8000 Merge pull request #185 from Shopify/fix-invalidation-clear · jhawthorn/ruby@0074c0a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0074c0a

Browse files
authored
Merge pull request ruby#185 from Shopify/fix-invalidation-clear
Only clear the JIT function when we invalidate the entry block
2 parents e7f8745 + 1bc5015 commit 0074c0a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

yjit_core.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,14 @@ invalidate_block_version(block_t* block)
11141114
// interpreter will run the iseq
11151115

11161116
#if JIT_ENABLED
1117-
iseq->body->jit_func = 0;
1117+
// Only clear the jit_func when we're invalidating the JIT entry block.
1118+
// We only support compiling iseqs from index 0 right now. So entry
1119+
// points will always have an instruction index of 0. We'll need to
1120+
// change this in the future when we support optional parameters because
1121+
// they enter the function with a non-zero PC
1122+
if (block->blockid.idx == 0) {
1123+
iseq->body->jit_func = 0;
1124+
}
11181125
#endif
11191126

11201127
// TODO:

0 commit comments

Comments
 (0)
0