Skip to content

Commit edb4004

Browse files
committed
gh-148211: decompose _INSERT_1_LOAD_CONST_INLINE(_BORROW) in JIT
1 parent 35e789c commit edb4004

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Python/optimizer_analysis.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ static JitOptRef
410410
lookup_super_attr(JitOptContext *ctx, _PyBloomFilter *dependencies,
411411
_PyUOpInstruction *this_instr,
412412
PyTypeObject *su_type, PyTypeObject *obj_type,
413-
PyObject *name, uint16_t immortal, uint16_t mortal)
413+
PyObject *name,
414+
uint16_t immortal, uint16_t mortal, uint16_t suffix)
414415
{
415416
if (su_type == NULL || obj_type == NULL) {
416417
return sym_new_not_null(ctx);
@@ -438,6 +439,9 @@ lookup_super_attr(JitOptContext *ctx, _PyBloomFilter *dependencies,
438439
ADD_OP(_POP_TOP, 0, 0);
439440
ADD_OP(_POP_TOP, 0, 0);
440441
ADD_OP(opcode, 0, (uintptr_t)lookup);
442+
if (suffix != _NOP) {
443+
ADD_OP(suffix, 2, 0);
444+
}
441445
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)su_type);
442446
_Py_BloomFilter_Add(dependencies, su_type);
443447
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)obj_type);

Python/optimizer_bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,8 @@ dummy_func(void) {
970970
PyObject *name = get_co_name(ctx, oparg >> 2);
971971
attr = lookup_super_attr(ctx, dependencies, this_instr,
972972
su_type, obj_type, name,
973-
_INSERT_1_LOAD_CONST_INLINE_BORROW,
974-
_INSERT_1_LOAD_CONST_INLINE);
973+
_LOAD_CONST_INLINE_BORROW,
974+
_LOAD_CONST_INLINE, _SWAP);
975975
}
976976

977977
op(_LOAD_ATTR_PROPERTY_FRAME, (fget/4, owner -- new_frame)) {

Python/optimizer_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)