be calling it at all, so we leave it as it is for now. */
stack_frame *factor_vm::second_from_top_stack_frame(context *ctx)
{
- stack_frame *frame = ctx->callstack_bottom - 1;
+ stack_frame *frame = ctx->bottom_frame();
while(frame >= ctx->callstack_top
&& frame_successor(frame) >= ctx->callstack_top
&& frame_successor(frame_successor(frame)) >= ctx->callstack_top)
datastack += sizeof(cell);
replace(tagged);
}
+
+ stack_frame *bottom_frame()
+ {
+ return callstack_bottom - 1;
+ }
};
VM_C_API context *new_context(factor_vm *parent);
the signal handler to do its thing, and launch the handler without going
through the resumable subprimitive. */
signal_resumable = false;
- stack_frame *frame = ctx->callstack_bottom - 1;
+ stack_frame *frame = ctx->bottom_frame();
while((cell)frame >= *sp
&& frame >= ctx->callstack_top
void factor_vm::record_callstack_sample(cell *begin, cell *end)
{
*begin = sample_callstacks.size();
- stack_frame *frame = ctx->callstack_bottom - 1;
+ stack_frame *frame = ctx->bottom_frame();
while (frame >= ctx->callstack_top) {
- sample_callstacks.push_back((code_block*)frame->entry_point - 1);
+ sample_callstacks.push_back(frame_code(frame));
frame = frame_successor(frame);
}