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 коммит произвёл Alan Wu
Родитель b5a0baf1c0
Коммит 0ca04e2dd4
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -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: