vm: remove _reversed from callstack iterator names
Now that they're the only game in town we can give them the short namesdb4
parent
f6a5f48da0
commit
d74f194b07
|
@ -132,7 +132,7 @@ void factor_vm::primitive_callstack_to_array()
|
||||||
data_root<callstack> callstack(ctx->pop(),this);
|
data_root<callstack> callstack(ctx->pop(),this);
|
||||||
|
|
||||||
stack_frame_accumulator accum(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) */
|
/* The callstack iterator visits frames in reverse order (top to bottom) */
|
||||||
std::reverse(
|
std::reverse(
|
||||||
|
|
|
@ -9,7 +9,7 @@ inline static cell callstack_object_size(cell size)
|
||||||
/* This is a little tricky. The iterator may allocate memory, so we
|
/* This is a little tricky. The iterator may allocate memory, so we
|
||||||
keep the callstack in a GC root and use relative offsets */
|
keep the callstack in a GC root and use relative offsets */
|
||||||
template<typename Iterator, typename Fixup>
|
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)
|
Iterator &iterator, Fixup &fixup)
|
||||||
{
|
{
|
||||||
data_root<callstack> stack(stack_,this);
|
data_root<callstack> stack(stack_,this);
|
||||||
|
@ -43,14 +43,14 @@ inline void factor_vm::iterate_callstack_object_reversed(callstack *stack_,
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Iterator>
|
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;
|
no_fixup none;
|
||||||
iterate_callstack_object_reversed(stack_, iterator, none);
|
iterate_callstack_object(stack_, iterator, none);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Iterator, typename Fixup>
|
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)
|
if (ctx->callstack_top == ctx->callstack_bottom)
|
||||||
return;
|
return;
|
||||||
|
@ -92,10 +92,10 @@ inline void factor_vm::iterate_callstack_reversed(context *ctx, Iterator &iterat
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Iterator>
|
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;
|
no_fixup none;
|
||||||
iterate_callstack_reversed(ctx, iterator, none);
|
iterate_callstack(ctx, iterator, none);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ void code_block_visitor<Fixup>::visit_object_code_block(object *obj)
|
||||||
{
|
{
|
||||||
callstack *stack = (callstack *)obj;
|
callstack *stack = (callstack *)obj;
|
||||||
call_frame_code_block_visitor<Fixup> call_frame_visitor(parent,fixup);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ template<typename Fixup>
|
||||||
void code_block_visitor<Fixup>::visit_context_code_blocks()
|
void code_block_visitor<Fixup>::visit_context_code_blocks()
|
||||||
{
|
{
|
||||||
call_frame_code_block_visitor<Fixup> call_frame_visitor(parent,fixup);
|
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>
|
template<typename Fixup>
|
||||||
|
|
|
@ -248,7 +248,7 @@ void factor_vm::print_callstack()
|
||||||
if (ctx)
|
if (ctx)
|
||||||
{
|
{
|
||||||
stack_frame_printer printer(this);
|
stack_frame_printer printer(this);
|
||||||
iterate_callstack_reversed(ctx,printer);
|
iterate_callstack(ctx,printer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cout << "*** Context not initialized" << std::endl;
|
std::cout << "*** Context not initialized" << std::endl;
|
||||||
|
|
|
@ -253,7 +253,7 @@ struct call_frame_scrubber {
|
||||||
void factor_vm::scrub_context(context *ctx)
|
void factor_vm::scrub_context(context *ctx)
|
||||||
{
|
{
|
||||||
call_frame_scrubber scrubber(this,ctx);
|
call_frame_scrubber scrubber(this,ctx);
|
||||||
iterate_callstack_reversed(ctx,scrubber);
|
iterate_callstack(ctx,scrubber);
|
||||||
}
|
}
|
||||||
|
|
||||||
void factor_vm::scrub_contexts()
|
void factor_vm::scrub_contexts()
|
||||||
|
|
|
@ -369,14 +369,14 @@ template<typename Fixup>
|
||||||
void slot_visitor<Fixup>::visit_callstack_object(callstack *stack)
|
void slot_visitor<Fixup>::visit_callstack_object(callstack *stack)
|
||||||
{
|
{
|
||||||
call_frame_slot_visitor<Fixup> call_frame_visitor(parent,this);
|
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>
|
template<typename Fixup>
|
||||||
void slot_visitor<Fixup>::visit_callstack(context *ctx)
|
void slot_visitor<Fixup>::visit_callstack(context *ctx)
|
||||||
{
|
{
|
||||||
call_frame_slot_visitor<Fixup> call_frame_visitor(parent,this);
|
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>
|
template<typename Fixup>
|
||||||
|
|
12
vm/vm.hpp
12
vm/vm.hpp
|
@ -179,13 +179,13 @@ struct factor_vm
|
||||||
void primitive_load_locals();
|
void primitive_load_locals();
|
||||||
|
|
||||||
template<typename Iterator, typename Fixup>
|
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 begin = active_contexts.begin();
|
||||||
std::set<context *>::const_iterator end = active_contexts.end();
|
std::set<context *>::const_iterator end = active_contexts.end();
|
||||||
while(begin != end)
|
while(begin != end)
|
||||||
{
|
{
|
||||||
iterate_callstack_reversed(*begin++,iter,fixup);
|
iterate_callstack(*begin++,iter,fixup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,10 +622,10 @@ struct factor_vm
|
||||||
bool embedded_image_p();
|
bool embedded_image_p();
|
||||||
|
|
||||||
template<typename Iterator, typename Fixup>
|
template<typename Iterator, typename Fixup>
|
||||||
void iterate_callstack_object_reversed(callstack *stack_, Iterator &iterator,
|
void iterate_callstack_object(callstack *stack_, Iterator &iterator,
|
||||||
Fixup &fixup);
|
Fixup &fixup);
|
||||||
template<typename Iterator>
|
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);
|
void check_frame(stack_frame *frame);
|
||||||
callstack *allot_callstack(cell size);
|
callstack *allot_callstack(cell size);
|
||||||
|
@ -649,9 +649,9 @@ struct factor_vm
|
||||||
void primitive_callstack_bounds();
|
void primitive_callstack_bounds();
|
||||||
|
|
||||||
template<typename Iterator, typename Fixup>
|
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>
|
template<typename Iterator>
|
||||||
void iterate_callstack_reversed(context *ctx, Iterator &iterator);
|
void iterate_callstack(context *ctx, Iterator &iterator);
|
||||||
|
|
||||||
// cpu-*
|
// cpu-*
|
||||||
void dispatch_signal_handler(cell *sp, cell *pc, cell newpc);
|
void dispatch_signal_handler(cell *sp, cell *pc, cell newpc);
|
||||||
|
|
Loading…
Reference in New Issue