Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created July 9, 2014 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/f2538f88a794a1ca4516 to your computer and use it in GitHub Desktop.
Save jnthn/f2538f88a794a1ca4516 to your computer and use it in GitHub Desktop.
diff --git a/src/core/interp.c b/src/core/interp.c
index 9a84b61..7cea172 100644
--- a/src/core/interp.c
+++ b/src/core/interp.c
@@ -4383,8 +4383,8 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
OP(sp_osrfinalize): {
MVMSpeshCandidate *cand = tc->cur_frame->spesh_cand;
if (cand) {
- cand->log_enter_idx++;
tc->cur_frame->spesh_log_idx = cand->log_enter_idx;
+ cand->log_enter_idx++;
if (--(cand->log_exits_remaining) == 0)
MVM_spesh_osr_finalize(tc);
}
diff --git a/src/spesh/osr.c b/src/spesh/osr.c
index 2b03a7d..b58f477 100644
--- a/src/spesh/osr.c
+++ b/src/spesh/osr.c
@@ -57,6 +57,7 @@ void MVM_spesh_osr(MVMThreadContext *tc) {
tc->cur_frame->spesh_log_slots = specialized->log_slots;
tc->cur_frame->spesh_cand = specialized;
tc->cur_frame->spesh_log_idx = 0;
+ specialized->log_enter_idx = 1;
/* Work out deopt index that applies, and move interpreter into the
* logging version of the code. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment