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:
parent
b5a0baf1c0
commit
0ca04e2dd4
1 changed files with 8 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue