mirror of
https://github.com/python/cpython.git
synced 2026-04-20 10:51:00 +00:00
gh-148211: decompose [_POP_CALL_X/_SHUFFLE_2]_LOAD_CONST_INLINE_BORROW in JIT (GH-148313)
This commit is contained in:
parent
d3b7b93cbb
commit
aea0b91d65
8 changed files with 1040 additions and 1411 deletions
|
|
@ -763,19 +763,6 @@ dummy_func(void) {
|
|||
value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
|
||||
}
|
||||
|
||||
op(_POP_CALL_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused -- value)) {
|
||||
value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
|
||||
}
|
||||
|
||||
op(_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused, unused, unused -- value)) {
|
||||
value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
|
||||
}
|
||||
|
||||
op(_SHUFFLE_2_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused, arg -- res, a)) {
|
||||
res = PyJitRef_Borrow(sym_new_const(ctx, ptr));
|
||||
a = arg;
|
||||
}
|
||||
|
||||
op(_POP_TOP, (value -- )) {
|
||||
PyTypeObject *typ = sym_get_type(value);
|
||||
if (PyJitRef_IsBorrowed(value) ||
|
||||
|
|
@ -1252,8 +1239,11 @@ dummy_func(void) {
|
|||
PyObject* type = (PyObject *)sym_get_type(arg);
|
||||
if (type) {
|
||||
res = sym_new_const(ctx, type);
|
||||
ADD_OP(_SHUFFLE_2_LOAD_CONST_INLINE_BORROW, 0,
|
||||
(uintptr_t)type);
|
||||
ADD_OP(_SWAP, 3, 0);
|
||||
ADD_OP(_POP_TOP, 0, 0);
|
||||
ADD_OP(_POP_TOP, 0, 0);
|
||||
ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)type);
|
||||
ADD_OP(_SWAP, 2, 0);
|
||||
}
|
||||
else {
|
||||
res = sym_new_not_null(ctx);
|
||||
|
|
@ -1290,7 +1280,8 @@ dummy_func(void) {
|
|||
out = Py_True;
|
||||
}
|
||||
sym_set_const(res, out);
|
||||
ADD_OP(_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)out);
|
||||
ADD_OP(_POP_CALL_TWO, 0, 0);
|
||||
ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)out);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue