4 inline static cell callstack_size(cell size)
6 return sizeof(callstack) + size;
9 /* This is a little tricky. The iterator may allocate memory, so we
10 keep the callstack in a GC root and use relative offsets */
11 template<typename Iterator> void factor_vm::iterate_callstack_object(callstack *stack_, Iterator &iterator)
13 data_root<callstack> stack(stack_,this);
14 fixnum frame_offset = untag_fixnum(stack->length) - sizeof(stack_frame);
16 while(frame_offset >= 0)
18 stack_frame *frame = stack->frame_at(frame_offset);
19 frame_offset -= frame->size;
24 template<typename Iterator> void factor_vm::iterate_callstack(context *ctx, Iterator &iterator)
26 stack_frame *frame = ctx->callstack_bottom - 1;
28 while(frame >= ctx->callstack_top)
31 frame = frame_successor(frame);