diff --git a/src/interpreter_run.cc b/src/interpreter_run.cc index 60f7cf09c..238e82688 100644 --- a/src/interpreter_run.cc +++ b/src/interpreter_run.cc @@ -527,6 +527,7 @@ Interpreter::Result Interpreter::run() { OPCODE_END(); OPCODE_BEGIN_WITH_WIDE(ALLOCATE, class_index); + process_->set_current_bcp(bcp); Object* result = process_->object_heap()->allocate_instance(Smi::from(class_index)); for (int attempts = 1; result == null && attempts < 4; attempts++) { #ifdef TOIT_GC_LOGGING @@ -540,6 +541,7 @@ Interpreter::Result Interpreter::run() { result = process_->object_heap()->allocate_instance(Smi::from(class_index)); } process_->object_heap()->leave_primitive(); + process_->set_current_bcp(null); if (result == null) { sp = push_error(sp, program->allocation_failed(), ""); diff --git a/src/scheduler.cc b/src/scheduler.cc index 1ddf0aba7..7b16a27fa 100644 --- a/src/scheduler.cc +++ b/src/scheduler.cc @@ -934,10 +934,15 @@ void Scheduler::tick(Locker& locker, int64 now) { int bci = program->absolute_bci_from_bcp(current_bcp); fprintf(stderr, " BCI: 0x%x\n", bci); - if (*current_bcp == Opcode::PRIMITIVE) { + Opcode opcode = static_cast(*current_bcp); + if (opcode == Opcode::PRIMITIVE) { int module = current_bcp[1]; int index = Utils::read_unaligned_uint16(current_bcp + 2); fprintf(stderr, " Primitive: %d:%d\n", module, index); + } else if (opcode == Opcode::ALLOCATE) { + fprintf(stderr, " Allocate: %d\n", current_bcp[1]); + } else if (opcode == Opcode::ALLOCATE_WIDE) { + fprintf(stderr, " Allocate: %d\n", Utils::read_unaligned_uint16(current_bcp + 1)); } } FATAL("Potential dead-lock");