Skip to content

Instantly share code, notes, and snippets.

@niner
Created January 18, 2019 20:17
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 niner/7f146f55c52d43608952f6bf16867711 to your computer and use it in GitHub Desktop.
Save niner/7f146f55c52d43608952f6bf16867711 to your computer and use it in GitHub Desktop.
diff --git a/src/spesh/optimize.c b/src/spesh/optimize.c
index 9f55fa598..b7d4b82f4 100644
--- a/src/spesh/optimize.c
+++ b/src/spesh/optimize.c
@@ -2124,7 +2124,8 @@ static void optimize_plugin(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *
}
else {
/* Unstable guard indexes. */
- return;
+ agg_guard_index = -1;
+ goto specialize;
}
}
}
@@ -2141,6 +2142,7 @@ static void optimize_plugin(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *
}
}
+ specialize:
/* If we picked a guard index, insert the guards and rewrite the resolve
* instruction. If not, just rewrite the resolve instruction into the
* spesh version of itself including the index. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment