diff --git a/src/libAtomVM/opcodesswitch.h b/src/libAtomVM/opcodesswitch.h index 3c7b8dae96..97f57eb1e8 100644 --- a/src/libAtomVM/opcodesswitch.h +++ b/src/libAtomVM/opcodesswitch.h @@ -2551,14 +2551,11 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb) } if (needs_to_wait) { - ctx->saved_ip = saved_pc; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" ctx->restore_trap_handler = &&wait_timeout_trap_handler; #pragma GCC diagnostic pop - ctx->saved_module = mod; - ctx = scheduler_wait(ctx); - goto schedule_in; + SCHEDULE_WAIT(mod, saved_pc); } #endif @@ -2592,6 +2589,7 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb) if (UNLIKELY(!mailbox_has_next(&ctx->mailbox))) { // No message is here. // We were signaled for another reason. +printf("%s:%d -- ctx->process_id = %d\n", __FILE__, __LINE__, ctx->process_id); ctx = scheduler_wait(ctx); goto schedule_in; } else { @@ -3182,10 +3180,7 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb) if (LIKELY(remaining_reductions)) { JUMP_TO_ADDRESS(mod->labels[label]); } else { - ctx->saved_ip = mod->labels[label]; - ctx->saved_module = mod; - ctx = scheduler_next(ctx->global, ctx); - goto schedule_in; + SCHEDULE_NEXT(mod, mod->labels[label]); } #endif break; @@ -6383,7 +6378,7 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb) case OP_RECV_MARKER_CLEAR: { DEST_REGISTER(reg_a); DECODE_DEST_REGISTER(reg_a, pc); - TRACE("recv_marker_clean/1: reg1=%c%i\n", T_DEST_REG(reg_a)); + TRACE("recv_marker_clear/1: reg1=%c%i\n", T_DEST_REG(reg_a)); break; }