mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
gh-144888: Replace bloom filter linked lists with continuous arrays to optimize executor invalidating performance (GH-145873)
This commit is contained in:
+18
-1
@@ -62,6 +62,23 @@ jit_error(const char *message)
|
||||
|
||||
static size_t _Py_jit_shim_size = 0;
|
||||
|
||||
static int
|
||||
address_in_executor_array(_PyExecutorObject **ptrs, size_t count, uintptr_t addr)
|
||||
{
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
_PyExecutorObject *exec = ptrs[i];
|
||||
if (exec->jit_code == NULL || exec->jit_size == 0) {
|
||||
continue;
|
||||
}
|
||||
uintptr_t start = (uintptr_t)exec->jit_code;
|
||||
uintptr_t end = start + exec->jit_size;
|
||||
if (addr >= start && addr < end) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
address_in_executor_list(_PyExecutorObject *head, uintptr_t addr)
|
||||
{
|
||||
@@ -94,7 +111,7 @@ _PyJIT_AddressInJitCode(PyInterpreterState *interp, uintptr_t addr)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (address_in_executor_list(interp->executor_list_head, addr)) {
|
||||
if (address_in_executor_array(interp->executor_ptrs, interp->executor_count, addr)) {
|
||||
return 1;
|
||||
}
|
||||
if (address_in_executor_list(interp->executor_deletion_list_head, addr)) {
|
||||
|
||||
Reference in New Issue
Block a user