Skip to content

Commit

Permalink
Optimize sp_jit_enter in interp.c a very small amount
Browse files Browse the repository at this point in the history
The compiler seems to generate better code by declaring it as a variable
due to the large number of pointer indirections involved.
  • Loading branch information
samcv committed Jun 3, 2018
1 parent 7ea1b5c commit fa13c6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/interp.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit fa13c6d

Please sign in to comment.