From fa13c6d01fac0a45729803550a420b10d7e92c37 Mon Sep 17 00:00:00 2001 From: Samantha McVey Date: Sat, 2 Jun 2018 22:30:48 -0700 Subject: [PATCH] Optimize sp_jit_enter in interp.c a very small amount The compiler seems to generate better code by declaring it as a variable due to the large number of pointer indirections involved. --- src/core/interp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/interp.c b/src/core/interp.c index 34bc35446a..b70786fa42 100644 --- a/src/core/interp.c +++ b/src/core/interp.c @@ -5786,13 +5786,14 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex goto NEXT; } OP(sp_jit_enter): { - if (tc->cur_frame->spesh_cand->jitcode == NULL) { + MVMJitCode *jc = tc->cur_frame->spesh_cand->jitcode; + if (MVM_UNLIKELY(jc == NULL)) { MVM_exception_throw_adhoc(tc, "Try to enter NULL jitcode"); } /* trampoline back to this opcode */ cur_op -= 2; - MVM_jit_enter_code(tc, cu, tc->cur_frame->spesh_cand->jitcode); - if (!tc->cur_frame) { + MVM_jit_enter_code(tc, cu, jc); + if (MVM_UNLIKELY(!tc->cur_frame)) { /* somehow unwound our top frame */ goto return_label; }