std::cout << "*** Context not initialized" << std::endl;
}
+void factor_vm::print_callstack_object(callstack *obj)
+{
+ stack_frame_printer printer(this);
+ iterate_callstack_object(obj,printer);
+}
+
struct padded_address {
cell value;
data_root<array> methods(methods_,parent);
data_root<array> cache(cache_,parent);
- /* Load the object from the datastack. */
- emit_with_literal(parent->special_objects[PIC_LOAD],tag_fixnum(-index * sizeof(cell)));
+ /* The object must be on the top of the datastack at this point. */
/* Do a cache lookup. */
emit_with_literal(parent->special_objects[MEGA_LOOKUP],cache.value());
unwind_native_frames(special_objects[ERROR_HANDLER_QUOT],
ctx->callstack_top);
}
- /* Error was thrown in early startup before error handler is set, just
+ /* Error was thrown in early startup before error handler is set, so just
crash. */
else
{
/* Method dispatch */
if(mega_lookup_p(i,length))
{
+ fixnum index = untag_fixnum(array_nth(elements.untagged(),i + 1));
+ /* Load the object from the datastack, then remove our stack frame. */
+ emit_with_literal(parent->special_objects[PIC_LOAD],tag_fixnum(-index * sizeof(cell)));
emit_epilog(safepoint, stack_frame);
tail_call = true;
+
emit_mega_cache_lookup(
array_nth(elements.untagged(),i),
- untag_fixnum(array_nth(elements.untagged(),i + 1)),
+ index,
array_nth(elements.untagged(),i + 2));
i += 3;
}
void print_datastack();
void print_retainstack();
void print_callstack();
+ void print_callstack_object(callstack *obj);
void dump_cell(cell x);
void dump_memory(cell from, cell to);
template<typename Generation> void dump_generation(const char *name, Generation *gen);