From a5a219575dc2133817b4e02764ab3a33a4e40a9c Mon Sep 17 00:00:00 2001 From: Paul Guyot Date: Wed, 23 Aug 2023 21:11:57 +0200 Subject: [PATCH] Optimize by registering labels to the instruction that follows the label Signed-off-by: Paul Guyot --- src/libAtomVM/opcodesswitch.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libAtomVM/opcodesswitch.h b/src/libAtomVM/opcodesswitch.h index 79c92d959..d7469d1e6 100644 --- a/src/libAtomVM/opcodesswitch.h +++ b/src/libAtomVM/opcodesswitch.h @@ -1594,9 +1594,6 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb) switch (*pc++) { case OP_LABEL: { - #ifdef IMPL_CODE_LOADER - const uint8_t* saved_pc = pc - 1; - #endif uint32_t label; DECODE_LITERAL(label, pc) @@ -1604,8 +1601,8 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb) USED_BY_TRACE(label); #ifdef IMPL_CODE_LOADER - TRACE("Mark label %i here at %" PRIuPTR "\n", label, saved_pc - code); - module_add_label(mod, label, saved_pc); + TRACE("Mark label %i here at %" PRIuPTR "\n", label, pc - code); + module_add_label(mod, label, pc); #endif break; }