4 OBJECT
blokctx_s_under_context(STATE
, OBJECT ctx
);
5 OBJECT
blokenv_s_under_context2(STATE
, OBJECT cmethod
, OBJECT ctx
, OBJECT ctx_block
);
6 void blokenv_call(STATE
, cpu c
, OBJECT self
, int num_args
);
8 OBJECT
methctx_dup(STATE
, OBJECT self
);
9 OBJECT
methctx_dup_chain(STATE
, OBJECT ctx
, OBJECT
*also
);
11 #define context_p(st, ctx) (ctx->obj_type == MContextType || ctx->obj_type == BContextType)
12 #define block_context_p(state, ctx) (FASTCTX(ctx)->type == FASTCTX_BLOCK)
14 #define methctx_is_fast_p(st, ctx) (ctx->obj_type == MContextType)
16 #define blokctx_home(state, obj) (blokenv_get_home(FASTCTX(obj)->name))
17 #define blokctx_env(state, self) (FASTCTX(self)->name)
18 #define blokctx_locals(state, self) (FASTCTX(self)->locals)
20 void methctx_reference(STATE
, OBJECT ctx
);
24 static inline void methctx_reference(STATE
, OBJECT ctx
) {
25 struct fast_context
*fc
;
26 /* Don't do it again. */
27 if(!stack_context_p(ctx
)) return;
29 /* Has to be done first because this uses informated we're about
31 object_memory_context_referenced(state
->om
, ctx
);
34 ctx
->gc_zone
= YoungObjectZone
;
35 switch(FASTCTX(ctx
)->type
) {
37 ctx
->klass
= BASIC_CLASS(fastctx
);
38 ctx
->obj_type
= MContextType
;
42 ctx
->klass
= BASIC_CLASS(blokctx
);
43 ctx
->obj_type
= BContextType
;
46 ctx
->klass
= BASIC_CLASS(nmc
);
47 ctx
->obj_type
= MContextType
;
50 SET_NUM_FIELDS(ctx
, FASTCTX_FIELDS
);
51 ctx
->StoresBytes
= TRUE
;
52 ctx
->ForeverYoung
= TRUE
;
56 /* Fixup the locals tuple. */
57 if(!NIL_P(fc
->locals
)) {
58 CLEAR_FLAGS(fc
->locals
);
59 fc
->locals
->gc_zone
= YoungObjectZone
;
60 fc
->locals
->klass
= BASIC_CLASS(tuple
);