X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FApply.h;h=14031c26bf011d9d4cf5626600bb6cfec4004acb;hb=423d477bfecd490de1449c59325c8776f91d7aac;hp=fe4134181e4b7250fae0f6eaa5c9e8cdecf1d903;hpb=553e90d9a32ee1b1809430f260c401cc4169c6c7;p=ghc-hetmet.git diff --git a/ghc/rts/Apply.h b/ghc/rts/Apply.h index fe41341..14031c2 100644 --- a/ghc/rts/Apply.h +++ b/ghc/rts/Apply.h @@ -1,72 +1,29 @@ -// ----------------------------------------------------------------------------- -// Apply.h -// -// (c) The University of Glasgow 2002 -// -// Helper bits for the generic apply code (AutoApply.hc) -// ----------------------------------------------------------------------------- +/* ----------------------------------------------------------------------------- + * + * (c) The University of Glasgow 2002-2004 + * + * Declarations for things defined in AutoApply.cmm + * + * -------------------------------------------------------------------------- */ #ifndef APPLY_H #define APPLY_H -// Build a new PAP: function is in R1,p -// ret addr and m arguments taking up n words are on the stack. -#define BUILD_PAP(m,n,f) \ - { \ - StgPAP *pap; \ - nat size, i; \ - TICK_SLOW_CALL_BUILT_PAP(); \ - size = PAP_sizeW(n); \ - HP_CHK_NP(size, Sp[0] = f;); \ - TICK_ALLOC_PAP(n, 0); \ - pap = (StgPAP *) (Hp + 1 - size); \ - SET_HDR(pap, &stg_PAP_info, CCCS); \ - pap->arity = arity - m; \ - pap->fun = R1.cl; \ - pap->n_args = n; \ - for (i = 0; i < n; i++) { \ - pap->payload[i] = (StgClosure *)Sp[1+i]; \ - } \ - R1.p = (P_)pap; \ - Sp += 1 + n; \ - JMP_(ENTRY_CODE(Sp[0])); \ - } - -// Copy the old PAP, build a new one with the extra arg(s) -// ret addr and m arguments taking up n words are on the stack. -#define NEW_PAP(m,n,f) \ - { \ - StgPAP *pap, *new_pap; \ - nat size, i; \ - TICK_SLOW_CALL_NEW_PAP(); \ - pap = (StgPAP *)R1.p; \ - size = PAP_sizeW(pap->n_args + n); \ - HP_CHK_NP(size, Sp[0] = f;); \ - TICK_ALLOC_PAP(n, 0); \ - new_pap = (StgPAP *) (Hp + 1 - size); \ - SET_HDR(new_pap, &stg_PAP_info, CCCS); \ - new_pap->arity = arity - m; \ - new_pap->n_args = pap->n_args + n; \ - new_pap->fun = pap->fun; \ - for (i = 0; i < pap->n_args; i++) { \ - new_pap->payload[i] = pap->payload[i]; \ - } \ - for (i = 0; i < n; i++) { \ - new_pap->payload[pap->n_args+i] = (StgClosure *)Sp[1+i]; \ - } \ - R1.p = (P_)new_pap; \ - Sp += n+1; \ - JMP_(ENTRY_CODE(Sp[0])); \ - } - // canned slow entry points, indexed by arg type (ARG_P, ARG_PP, etc.) -extern StgFun * stg_ap_stack_entries[]; +#ifdef IN_STG_CODE +extern StgWord stg_ap_stack_entries[]; +#else +extern StgFun *stg_ap_stack_entries[]; +#endif // canned register save code for heap check failure in a function -extern StgFun * stg_stack_save_entries[]; +#ifdef IN_STG_CODE +extern StgWord stg_stack_save_entries[]; +#else +extern StgFun *stg_stack_save_entries[]; +#endif // canned bitmap for each arg type extern StgWord stg_arg_bitmaps[]; #endif // APPLY_H -