mirror of
https://github.com/python/cpython.git
synced 2026-01-02 21:43:49 +00:00
gh-142276: Watch attribute loads when promoting JIT constants (GH-142303)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Savannah Ostrowski <savannah@python.org>
This commit is contained in:
parent
e0451ceef8
commit
97f0a1f203
5 changed files with 38 additions and 13 deletions
|
|
@ -242,7 +242,7 @@ eliminate_pop_guard(_PyUOpInstruction *this_instr, bool exit)
|
|||
}
|
||||
|
||||
static JitOptRef
|
||||
lookup_attr(JitOptContext *ctx, _PyUOpInstruction *this_instr,
|
||||
lookup_attr(JitOptContext *ctx, _PyBloomFilter *dependencies, _PyUOpInstruction *this_instr,
|
||||
PyTypeObject *type, PyObject *name, uint16_t immortal,
|
||||
uint16_t mortal)
|
||||
{
|
||||
|
|
@ -252,6 +252,8 @@ lookup_attr(JitOptContext *ctx, _PyUOpInstruction *this_instr,
|
|||
if (lookup) {
|
||||
int opcode = _Py_IsImmortal(lookup) ? immortal : mortal;
|
||||
REPLACE_OP(this_instr, opcode, 0, (uintptr_t)lookup);
|
||||
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type);
|
||||
_Py_BloomFilter_Add(dependencies, type);
|
||||
return sym_new_const(ctx, lookup);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue