diff options
Diffstat (limited to 'src/runtime/lmisc.r')
-rw-r--r-- | src/runtime/lmisc.r | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/runtime/lmisc.r b/src/runtime/lmisc.r index 11f29de..52f0a6d 100644 --- a/src/runtime/lmisc.r +++ b/src/runtime/lmisc.r @@ -6,86 +6,48 @@ /* * create - return an entry block for a co-expression. */ -#if COMPILER -struct b_coexpr *create(fnc, cproc, ntemps, wrk_size) -continuation fnc; -struct b_proc *cproc; -int ntemps; -int wrk_size; -#else /* COMPILER */ int Ocreate(entryp, cargp) word *entryp; register dptr cargp; -#endif /* COMPILER */ { - -#ifdef Coexpr tended struct b_coexpr *sblkp; register struct b_refresh *rblkp; register dptr dp, ndp; int na, nl, i; - -#if !COMPILER struct b_proc *cproc; /* cproc is the Icon procedure that create occurs in */ cproc = (struct b_proc *)BlkLoc(glbl_argp[0]); -#endif /* COMPILER */ /* * Calculate number of arguments and number of local variables. */ -#if COMPILER - na = abs((int)cproc->nparam); -#else /* COMPILER */ na = pfp->pf_nargs + 1; /* includes Arg0 */ -#endif /* COMPILER */ nl = (int)cproc->ndynam; /* * Get a new co-expression stack and initialize. */ - -#ifdef MultiThread - Protect(sblkp = alccoexp(0, 0), err_msg(0, NULL)); -#else /* MultiThread */ Protect(sblkp = alccoexp(), err_msg(0, NULL)); -#endif /* MultiThread */ - - if (!sblkp) -#if COMPILER - return NULL; -#else /* COMPILER */ Fail; -#endif /* COMPILER */ /* * Get a refresh block for the new co-expression. */ -#if COMPILER - Protect(rblkp = alcrefresh(na, nl, ntemps, wrk_size), err_msg(0,NULL)); -#else /* COMPILER */ Protect(rblkp = alcrefresh(entryp, na, nl),err_msg(0,NULL)); -#endif /* COMPILER */ if (!rblkp) -#if COMPILER - return NULL; -#else /* COMPILER */ Fail; -#endif /* COMPILER */ sblkp->freshblk.dword = D_Refresh; BlkLoc(sblkp->freshblk) = (union block *) rblkp; -#if !COMPILER /* * Copy current procedure frame marker into refresh block. */ rblkp->pfmkr = *pfp; rblkp->pfmkr.pf_pfp = 0; -#endif /* COMPILER */ /* * Copy arguments into refresh block. @@ -98,11 +60,7 @@ register dptr cargp; /* * Copy locals into the refresh block. */ -#if COMPILER - dp = pfp->tend.d; -#else /* COMPILER */ dp = &(pfp->pf_locals)[0]; -#endif /* COMPILER */ for (i = 1; i <= nl; i++) *ndp++ = *dp++; @@ -111,33 +69,12 @@ register dptr cargp; */ co_init(sblkp); -#if COMPILER - sblkp->fnc = fnc; - if (line_info) { - if (debug_info) - PFDebug(sblkp->pf)->proc = cproc; - PFDebug(sblkp->pf)->old_fname = ""; - PFDebug(sblkp->pf)->old_line = 0; - } - - return sblkp; -#else /* COMPILER */ /* * Return the new co-expression. */ Arg0.dword = D_Coexpr; BlkLoc(Arg0) = (union block *) sblkp; Return; -#endif /* COMPILER */ -#else /* Coexpr */ - err_msg(401, NULL); -#if COMPILER - return NULL; -#else /* COMPILER */ - Fail; -#endif /* COMPILER */ -#endif /* Coexpr */ - } /* @@ -148,8 +85,6 @@ dptr val; struct b_coexpr *ncp; dptr result; { -#ifdef Coexpr - int first; /* @@ -169,8 +104,4 @@ dptr result; return A_Resume; else return A_Continue; - -#else /* Coexpr */ - RunErr(401,NULL); -#endif /* Coexpr */ } |