data_root<callstack> callstack(ctx->pop(),this);
stack_frame_accumulator accum(this);
- iterate_callstack_object_reversed(callstack.untagged(),accum);
+ iterate_callstack_object(callstack.untagged(),accum);
/* The callstack iterator visits frames in reverse order (top to bottom) */
std::reverse(
/* This is a little tricky. The iterator may allocate memory, so we
keep the callstack in a GC root and use relative offsets */
template<typename Iterator, typename Fixup>
-inline void factor_vm::iterate_callstack_object_reversed(callstack *stack_,
+inline void factor_vm::iterate_callstack_object(callstack *stack_,
Iterator &iterator, Fixup &fixup)
{
data_root<callstack> stack(stack_,this);
}
template<typename Iterator>
-inline void factor_vm::iterate_callstack_object_reversed(callstack *stack_, Iterator &iterator)
+inline void factor_vm::iterate_callstack_object(callstack *stack_, Iterator &iterator)
{
no_fixup none;
- iterate_callstack_object_reversed(stack_, iterator, none);
+ iterate_callstack_object(stack_, iterator, none);
}
template<typename Iterator, typename Fixup>
-inline void factor_vm::iterate_callstack_reversed(context *ctx, Iterator &iterator, Fixup &fixup)
+inline void factor_vm::iterate_callstack(context *ctx, Iterator &iterator, Fixup &fixup)
{
if (ctx->callstack_top == ctx->callstack_bottom)
return;
}
template<typename Iterator>
-inline void factor_vm::iterate_callstack_reversed(context *ctx, Iterator &iterator)
+inline void factor_vm::iterate_callstack(context *ctx, Iterator &iterator)
{
no_fixup none;
- iterate_callstack_reversed(ctx, iterator, none);
+ iterate_callstack(ctx, iterator, none);
}
{
callstack *stack = (callstack *)obj;
call_frame_code_block_visitor<Fixup> call_frame_visitor(parent,fixup);
- parent->iterate_callstack_object_reversed(stack,call_frame_visitor,fixup);
+ parent->iterate_callstack_object(stack,call_frame_visitor,fixup);
break;
}
}
void code_block_visitor<Fixup>::visit_context_code_blocks()
{
call_frame_code_block_visitor<Fixup> call_frame_visitor(parent,fixup);
- parent->iterate_active_callstacks_reversed(call_frame_visitor,fixup);
+ parent->iterate_active_callstacks(call_frame_visitor,fixup);
}
template<typename Fixup>
if (ctx)
{
stack_frame_printer printer(this);
- iterate_callstack_reversed(ctx,printer);
+ iterate_callstack(ctx,printer);
}
else
std::cout << "*** Context not initialized" << std::endl;
void factor_vm::scrub_context(context *ctx)
{
call_frame_scrubber scrubber(this,ctx);
- iterate_callstack_reversed(ctx,scrubber);
+ iterate_callstack(ctx,scrubber);
}
void factor_vm::scrub_contexts()
void slot_visitor<Fixup>::visit_callstack_object(callstack *stack)
{
call_frame_slot_visitor<Fixup> call_frame_visitor(parent,this);
- parent->iterate_callstack_object_reversed(stack,call_frame_visitor,fixup);
+ parent->iterate_callstack_object(stack,call_frame_visitor,fixup);
}
template<typename Fixup>
void slot_visitor<Fixup>::visit_callstack(context *ctx)
{
call_frame_slot_visitor<Fixup> call_frame_visitor(parent,this);
- parent->iterate_callstack_reversed(ctx,call_frame_visitor,fixup);
+ parent->iterate_callstack(ctx,call_frame_visitor,fixup);
}
template<typename Fixup>
void primitive_load_locals();
template<typename Iterator, typename Fixup>
- void iterate_active_callstacks_reversed(Iterator &iter, Fixup &fixup)
+ void iterate_active_callstacks(Iterator &iter, Fixup &fixup)
{
std::set<context *>::const_iterator begin = active_contexts.begin();
std::set<context *>::const_iterator end = active_contexts.end();
while(begin != end)
{
- iterate_callstack_reversed(*begin++,iter,fixup);
+ iterate_callstack(*begin++,iter,fixup);
}
}
bool embedded_image_p();
template<typename Iterator, typename Fixup>
- void iterate_callstack_object_reversed(callstack *stack_, Iterator &iterator,
+ void iterate_callstack_object(callstack *stack_, Iterator &iterator,
Fixup &fixup);
template<typename Iterator>
- void iterate_callstack_object_reversed(callstack *stack_, Iterator &iterator);
+ void iterate_callstack_object(callstack *stack_, Iterator &iterator);
void check_frame(stack_frame *frame);
callstack *allot_callstack(cell size);
void primitive_callstack_bounds();
template<typename Iterator, typename Fixup>
- void iterate_callstack_reversed(context *ctx, Iterator &iterator, Fixup &fixup);
+ void iterate_callstack(context *ctx, Iterator &iterator, Fixup &fixup);
template<typename Iterator>
- void iterate_callstack_reversed(context *ctx, Iterator &iterator);
+ void iterate_callstack(context *ctx, Iterator &iterator);
// cpu-*
void dispatch_signal_handler(cell *sp, cell *pc, cell newpc);