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