1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Only clear the JIT function when we invalidate the entry block

We should only clear the JIT function when the entry point is
invalidated.  Right now we only support compiling functions with a PC
offset of zero (functions that take optional parameters can start at
non-zero PC), so this patch just checks that the index is 0 before
clearing the jit function
This commit is contained in:
Aaron Patterson 2021-08-26 11:41:47 -07:00 committed by Alan Wu
parent b5a0baf1c0
commit 0ca04e2dd4

View file

@ -1122,7 +1122,14 @@ invalidate_block_version(block_t *block)
// interpreter will run the iseq
#if JIT_ENABLED
iseq->body->jit_func = 0;
// Only clear the jit_func when we're invalidating the JIT entry block.
// We only support compiling iseqs from index 0 right now. So entry
// points will always have an instruction index of 0. We'll need to
// change this in the future when we support optional parameters because
// they enter the function with a non-zero PC
if (block->blockid.idx == 0) {
iseq->body->jit_func = 0;
}
#endif
// TODO: