mirror of
https://github.com/python/cpython.git
synced 2026-05-09 03:50:56 +00:00
gh-149217: Avoid adding dependencies on immutable, immortal classes in the JIT (GH149256)
This commit is contained in:
parent
00c4a946f4
commit
8a7eddaa84
3 changed files with 24 additions and 40 deletions
|
|
@ -149,10 +149,7 @@ dummy_func(void) {
|
|||
// Promote the probable type version to a known one.
|
||||
sym_set_type(owner, probable_type);
|
||||
sym_set_type_version(owner, type_version);
|
||||
if ((probable_type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) == 0) {
|
||||
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)probable_type);
|
||||
_Py_BloomFilter_Add(dependencies, probable_type);
|
||||
}
|
||||
watch_type(probable_type, dependencies);
|
||||
}
|
||||
else {
|
||||
ctx->contradiction = true;
|
||||
|
|
@ -238,10 +235,7 @@ dummy_func(void) {
|
|||
}
|
||||
else {
|
||||
sym_set_const(owner, type);
|
||||
if ((((PyTypeObject *)type)->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) == 0) {
|
||||
PyType_Watch(TYPE_WATCHER_ID, type);
|
||||
_Py_BloomFilter_Add(dependencies, type);
|
||||
}
|
||||
watch_type((PyTypeObject *)type, dependencies);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -258,8 +252,7 @@ dummy_func(void) {
|
|||
probable_type->tp_version_tag == type_version) {
|
||||
sym_set_type(owner, probable_type);
|
||||
sym_set_type_version(owner, type_version);
|
||||
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)probable_type);
|
||||
_Py_BloomFilter_Add(dependencies, probable_type);
|
||||
watch_type(probable_type, dependencies);
|
||||
}
|
||||
else {
|
||||
ctx->contradiction = true;
|
||||
|
|
@ -1326,8 +1319,7 @@ dummy_func(void) {
|
|||
assert(init != NULL);
|
||||
assert(PyFunction_Check(init));
|
||||
callable = sym_new_const(ctx, init);
|
||||
PyType_Watch(TYPE_WATCHER_ID, callable_o);
|
||||
_Py_BloomFilter_Add(dependencies, callable_o);;
|
||||
watch_type((PyTypeObject *)callable_o, dependencies);
|
||||
}
|
||||
else {
|
||||
callable = sym_new_not_null(ctx);
|
||||
|
|
@ -2033,10 +2025,7 @@ dummy_func(void) {
|
|||
0, (uintptr_t)descr);
|
||||
ADD_OP(_SWAP, 3, 0);
|
||||
optimize_pop_top(ctx, this_instr, method_and_self[0]);
|
||||
if ((type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) == 0) {
|
||||
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type);
|
||||
_Py_BloomFilter_Add(dependencies, type);
|
||||
}
|
||||
watch_type(type, dependencies);
|
||||
method_and_self[0] = sym_new_const(ctx, descr);
|
||||
optimized = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue