Skip to content

Commit 0472290

Browse files
committed
Move call specializations from CALL to PRECALL.
1 parent 090e5c4 commit 0472290

File tree

6 files changed

+311
-206
lines changed

6 files changed

+311
-206
lines changed

‎Include/internal/pycore_code.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ int _Py_Specialize_LoadGlobal(PyObject *globals, PyObject *builtins, _Py_CODEUNI
271271
int _Py_Specialize_LoadMethod(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name, SpecializedCacheEntry *cache);
272272
int _Py_Specialize_BinarySubscr(PyObject *sub, PyObject *container, _Py_CODEUNIT *instr, SpecializedCacheEntry *cache);
273273
int _Py_Specialize_StoreSubscr(PyObject *container, PyObject *sub, _Py_CODEUNIT *instr);
274-
int _Py_Specialize_CallNoKw(PyObject *callable, _Py_CODEUNIT *instr, int nargs,
274+
int _Py_Specialize_Call(PyObject *callable, _Py_CODEUNIT *instr, int nargs,
275+
PyObject *kwnames, SpecializedCacheEntry *cache);
276+
int _Py_Specialize_Precall(PyObject *callable, _Py_CODEUNIT *instr, int nargs,
275277
PyObject *kwnames, SpecializedCacheEntry *cache, PyObject *builtins);
276278
void _Py_Specialize_BinaryOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
277279
SpecializedCacheEntry *cache);

‎Include/opcode.h‎

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

‎Lib/opcode.py‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,8 @@ def jabs_op(name, op):
248248
"STORE_SUBSCR_LIST_INT",
249249
"STORE_SUBSCR_DICT",
250250
"CALL_ADAPTIVE",
251-
"CALL_BUILTIN_CLASS",
252-
"CALL_NO_KW_BUILTIN_O",
253-
"CALL_NO_KW_BUILTIN_FAST",
254-
"CALL_BUILTIN_FAST_WITH_KEYWORDS",
255-
"CALL_NO_KW_LEN",
256-
"CALL_NO_KW_ISINSTANCE",
257251
"CALL_PY_EXACT_ARGS",
258252
"CALL_PY_WITH_DEFAULTS",
259-
"CALL_NO_KW_LIST_APPEND",
260-
"CALL_NO_KW_METHOD_DESCRIPTOR_O",
261-
"CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS",
262-
"CALL_NO_KW_STR_1",
263-
"CALL_NO_KW_TUPLE_1",
264-
"CALL_NO_KW_TYPE_1",
265-
"CALL_NO_KW_METHOD_DESCRIPTOR_FAST",
266253
"JUMP_ABSOLUTE_QUICK",
267254
"LOAD_ATTR_ADAPTIVE",
268255
"LOAD_ATTR_INSTANCE_VALUE",
@@ -277,6 +264,22 @@ def jabs_op(name, op):
277264
"LOAD_METHOD_CLASS",
278265
"LOAD_METHOD_MODULE",
279266
"LOAD_METHOD_NO_DICT",
267+
"PRECALL_ADAPTIVE",
268+
"PRECALL_BUILTIN_CLASS",
269+
"PRECALL_NO_KW_BUILTIN_O",
270+
"PRECALL_NO_KW_BUILTIN_FAST",
271+
"PRECALL_BUILTIN_FAST_WITH_KEYWORDS",
272+
"PRECALL_NO_KW_LEN",
273+
"PRECALL_NO_KW_ISINSTANCE",
274+
"PRECALL_NO_KW_LIST_APPEND",
275+
"PRECALL_NO_KW_METHOD_DESCRIPTOR_O",
276+
"PRECALL_NO_KW_METHOD_DESCRIPTOR_NOARGS",
277+
"PRECALL_NO_KW_STR_1",
278+
"PRECALL_NO_KW_TUPLE_1",
279+
"PRECALL_NO_KW_TYPE_1",
280+
"PRECALL_NO_KW_METHOD_DESCRIPTOR_FAST",
281+
"PRECALL_BOUND_METHOD",
282+
"PRECALL_PYFUNC",
280283
"RESUME_QUICK",
281284
"STORE_ATTR_ADAPTIVE",
282285
"STORE_ATTR_INSTANCE_VALUE",

0 commit comments

Comments
 (0)