case _CALL_METHOD_DESCRIPTOR_FAST:
return 2 + oparg;
case _MAYBE_EXPAND_METHOD_KW:
- return 1;
+ return 0;
case _PY_FRAME_KW:
return 3 + oparg;
case _CHECK_FUNCTION_VERSION_KW:
}
pure inst(END_SEND, (receiver, value -- val)) {
- (void)receiver;
val = value;
DEAD(value);
PyStackRef_CLOSE(receiver);
CALL_NON_PY_GENERAL,
};
- specializing op(_SPECIALIZE_CALL, (counter/1, callable[1], self_or_null[1], args[oparg] -- callable[1], self_or_null[1], args[oparg])) {
+ specializing op(_SPECIALIZE_CALL, (counter/1, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
#if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
- _Py_Specialize_Call(callable[0], next_instr, oparg + !PyStackRef_IsNull(self_or_null[0]));
+ _Py_Specialize_Call(callable, next_instr, oparg + !PyStackRef_IsNull(self_or_null));
DISPATCH_SAME_OPARG();
}
OPCODE_DEFERRED_INC(CALL);
#endif /* ENABLE_SPECIALIZATION_FT */
}
- op(_MAYBE_EXPAND_METHOD, (callable[1], self_or_null[1], args[oparg] -- callable[1], self_or_null[1], args[oparg])) {
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_MAYBE_EXPAND_METHOD, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
PyStackRef_CLOSE(temp);
}
}
// When calling Python, inline the call using DISPATCH_INLINED().
- op(_DO_CALL, (callable[1], self_or_null[1], args[oparg] -- res)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_DO_CALL, (callable, self_or_null, args[oparg] -- res)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, total_args, NULL, frame
);
DEAD(args);
res = PyStackRef_FromPyObjectSteal(res_o);
}
- op(_MONITOR_CALL, (func[1], maybe_self[1], args[oparg] -- func[1], maybe_self[1], args[oparg])) {
- int is_meth = !PyStackRef_IsNull(maybe_self[0]);
- PyObject *function = PyStackRef_AsPyObjectBorrow(func[0]);
+ op(_MONITOR_CALL, (func, maybe_self, args[oparg] -- func, maybe_self, args[oparg])) {
+ int is_meth = !PyStackRef_IsNull(maybe_self);
+ PyObject *function = PyStackRef_AsPyObjectBorrow(func);
PyObject *arg0;
if (is_meth) {
- arg0 = PyStackRef_AsPyObjectBorrow(maybe_self[0]);
+ arg0 = PyStackRef_AsPyObjectBorrow(maybe_self);
}
else if (oparg) {
arg0 = PyStackRef_AsPyObjectBorrow(args[0]);
macro(CALL) = _SPECIALIZE_CALL + unused/2 + _MAYBE_EXPAND_METHOD + _DO_CALL + _CHECK_PERIODIC;
macro(INSTRUMENTED_CALL) = unused/3 + _MAYBE_EXPAND_METHOD + _MONITOR_CALL + _DO_CALL + _CHECK_PERIODIC;
- op(_PY_FRAME_GENERAL, (callable[1], self_or_null[1], args[oparg] -- new_frame: _PyInterpreterFrame*)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_PY_FRAME_GENERAL, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
args, total_args, NULL, frame
);
// The frame has stolen all the arguments from the stack.
new_frame = temp;
}
- op(_CHECK_FUNCTION_VERSION, (func_version/2, callable[1], self_or_null[1], unused[oparg] -- callable[1], self_or_null[1], unused[oparg])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_FUNCTION_VERSION, (func_version/2, callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
EXIT_IF(!PyFunction_Check(callable_o));
PyFunctionObject *func = (PyFunctionObject *)callable_o;
EXIT_IF(func->func_version != func_version);
_SAVE_RETURN_OFFSET +
_PUSH_FRAME;
- op(_CHECK_METHOD_VERSION, (func_version/2, callable[1], null[1], unused[oparg] -- callable[1], null[1], unused[oparg])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_METHOD_VERSION, (func_version/2, callable, null, unused[oparg] -- callable, null, unused[oparg])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
EXIT_IF(Py_TYPE(callable_o) != &PyMethod_Type);
PyObject *func = ((PyMethodObject *)callable_o)->im_func;
EXIT_IF(!PyFunction_Check(func));
EXIT_IF(((PyFunctionObject *)func)->func_version != func_version);
- EXIT_IF(!PyStackRef_IsNull(null[0]));
+ EXIT_IF(!PyStackRef_IsNull(null));
}
- op(_EXPAND_METHOD, (callable[1], self_or_null[1], unused[oparg] -- callable[1], self_or_null[1], unused[oparg])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
- assert(PyStackRef_IsNull(self_or_null[0]));
+ op(_EXPAND_METHOD, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ assert(PyStackRef_IsNull(self_or_null));
assert(Py_TYPE(callable_o) == &PyMethod_Type);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
- assert(PyStackRef_FunctionCheck(callable[0]));
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ assert(PyStackRef_FunctionCheck(callable));
PyStackRef_CLOSE(temp);
}
_SAVE_RETURN_OFFSET +
_PUSH_FRAME;
- op(_CHECK_IS_NOT_PY_CALLABLE, (callable[1], unused[1], unused[oparg] -- callable[1], unused[1], unused[oparg])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_IS_NOT_PY_CALLABLE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
EXIT_IF(PyFunction_Check(callable_o));
EXIT_IF(Py_TYPE(callable_o) == &PyMethod_Type);
}
- op(_CALL_NON_PY_GENERAL, (callable[1], self_or_null[1], args[oparg] -- res)) {
+ op(_CALL_NON_PY_GENERAL, (callable, self_or_null, args[oparg] -- res)) {
#if TIER_ONE
assert(opcode != INSTRUMENTED_CALL);
#endif
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
_CALL_NON_PY_GENERAL +
_CHECK_PERIODIC;
- op(_CHECK_CALL_BOUND_METHOD_EXACT_ARGS, (callable[1], null[1], unused[oparg] -- callable[1], null[1], unused[oparg])) {
- EXIT_IF(!PyStackRef_IsNull(null[0]));
- EXIT_IF(Py_TYPE(PyStackRef_AsPyObjectBorrow(callable[0])) != &PyMethod_Type);
+ op(_CHECK_CALL_BOUND_METHOD_EXACT_ARGS, (callable, null, unused[oparg] -- callable, null, unused[oparg])) {
+ EXIT_IF(!PyStackRef_IsNull(null));
+ EXIT_IF(Py_TYPE(PyStackRef_AsPyObjectBorrow(callable)) != &PyMethod_Type);
}
- op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable[1], self_or_null[1], unused[oparg] -- callable[1], self_or_null[1], unused[oparg])) {
- assert(PyStackRef_IsNull(self_or_null[0]));
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
+ assert(PyStackRef_IsNull(self_or_null));
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
STAT_INC(CALL, hit);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
PyStackRef_CLOSE(temp);
}
DEOPT_IF(tstate->interp->eval_frame);
}
- op(_CHECK_FUNCTION_EXACT_ARGS, (callable[1], self_or_null[1], unused[oparg] -- callable[1], self_or_null[1], unused[oparg])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_FUNCTION_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
assert(PyFunction_Check(callable_o));
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
- EXIT_IF(code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null[0])));
+ EXIT_IF(code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null)));
}
- op(_CHECK_STACK_SPACE, (callable[1], self_or_null[1], unused[oparg] -- callable[1], self_or_null[1], unused[oparg])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_STACK_SPACE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize));
DEOPT_IF(tstate->py_recursion_remaining <= 1);
}
- replicate(5) pure op(_INIT_CALL_PY_EXACT_ARGS, (callable[1], self_or_null[1], args[oparg] -- new_frame: _PyInterpreterFrame*)) {
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ replicate(5) pure op(_INIT_CALL_PY_EXACT_ARGS, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) {
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
_CALL_TUPLE_1 +
_CHECK_PERIODIC;
- op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable[1], self_or_null[1], args[oparg] -- callable[1], self_or_null[1], args[oparg])) {
- (void)args;
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
- DEOPT_IF(!PyStackRef_IsNull(self_or_null[0]));
+ op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ DEOPT_IF(!PyStackRef_IsNull(self_or_null));
DEOPT_IF(!PyType_Check(callable_o));
PyTypeObject *tp = (PyTypeObject *)callable_o;
DEOPT_IF(FT_ATOMIC_LOAD_UINT32_RELAXED(tp->tp_version_tag) != type_version);
if (self_o == NULL) {
ERROR_NO_POP();
}
- self_or_null[0] = PyStackRef_FromPyObjectSteal(self_o);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(init_func);
+ self_or_null = PyStackRef_FromPyObjectSteal(self_o);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(init_func);
PyStackRef_CLOSE(temp);
}
- op(_CREATE_INIT_FRAME, (init[1], self[1], args[oparg] -- init_frame: _PyInterpreterFrame *)) {
+ op(_CREATE_INIT_FRAME, (init, self, args[oparg] -- init_frame: _PyInterpreterFrame *)) {
_PyInterpreterFrame *shim = _PyFrame_PushTrampolineUnchecked(
tstate, (PyCodeObject *)&_Py_InitCleanup, 1, frame);
assert(_PyFrame_GetBytecode(shim)[0].op.code == EXIT_INIT_CHECK);
assert(_PyFrame_GetBytecode(shim)[1].op.code == RETURN_VALUE);
/* Push self onto stack of shim */
- shim->localsplus[0] = PyStackRef_DUP(self[0]);
+ shim->localsplus[0] = PyStackRef_DUP(self);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, init[0], NULL, args-1, oparg+1, NULL, shim);
+ tstate, init, NULL, args-1, oparg+1, NULL, shim);
DEAD(init);
DEAD(self);
DEAD(args);
DEAD(should_be_none);
}
- op(_CALL_BUILTIN_CLASS, (callable[1], self_or_null[1], args[oparg] -- res)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CALL_BUILTIN_CLASS, (callable, self_or_null, args[oparg] -- res)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
DEOPT_IF(!PyType_Check(callable_o));
PyTypeObject *tp = (PyTypeObject *)callable_o;
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
_CALL_BUILTIN_CLASS +
_CHECK_PERIODIC;
- op(_CALL_BUILTIN_O, (callable[1], self_or_null[1], args[oparg] -- res)) {
+ op(_CALL_BUILTIN_O, (callable, self_or_null, args[oparg] -- res)) {
/* Builtin METH_O functions */
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
PyStackRef_CLOSE(arg);
DEAD(args);
DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
_CALL_BUILTIN_O +
_CHECK_PERIODIC;
- op(_CALL_BUILTIN_FAST, (callable[1], self_or_null[1], args[oparg] -- res)) {
+ op(_CALL_BUILTIN_FAST, (callable, self_or_null, args[oparg] -- res)) {
/* Builtin METH_FASTCALL functions, without keywords */
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
_CALL_BUILTIN_FAST +
_CHECK_PERIODIC;
- op(_CALL_BUILTIN_FAST_WITH_KEYWORDS, (callable[1], self_or_null[1], args[oparg] -- res)) {
+ op(_CALL_BUILTIN_FAST_WITH_KEYWORDS, (callable, self_or_null, args[oparg] -- res)) {
/* Builtin METH_FASTCALL | METH_KEYWORDS functions */
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
_CALL_BUILTIN_FAST_WITH_KEYWORDS +
_CHECK_PERIODIC;
- inst(CALL_LEN, (unused/1, unused/2, callable[1], self_or_null[1], args[oparg] -- res)) {
+ inst(CALL_LEN, (unused/1, unused/2, callable, self_or_null, args[oparg] -- res)) {
/* len(o) */
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
PyStackRef_CLOSE(arg_stackref);
DEAD(args);
DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
res = PyStackRef_FromPyObjectSteal(res_o);
}
- inst(CALL_ISINSTANCE, (unused/1, unused/2, callable, self_or_null[1], args[oparg] -- res)) {
+ inst(CALL_ISINSTANCE, (unused/1, unused/2, callable, self_or_null, args[oparg] -- res)) {
/* isinstance(o, o2) */
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
#endif
}
- op(_CALL_METHOD_DESCRIPTOR_O, (callable[1], self_or_null[1], args[oparg] -- res)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CALL_METHOD_DESCRIPTOR_O, (callable, self_or_null, args[oparg] -- res)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
_CALL_METHOD_DESCRIPTOR_O +
_CHECK_PERIODIC;
- op(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (callable[1], self_or_null[1], args[oparg] -- res)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (callable, self_or_null, args[oparg] -- res)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS +
_CHECK_PERIODIC;
- op(_CALL_METHOD_DESCRIPTOR_NOARGS, (callable[1], self_or_null[1], args[oparg] -- res)) {
+ op(_CALL_METHOD_DESCRIPTOR_NOARGS, (callable, self_or_null, args[oparg] -- res)) {
assert(oparg == 0 || oparg == 1);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
PyStackRef_CLOSE(self_stackref);
DEAD(args);
DEAD(self_or_null);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
ERROR_IF(res_o == NULL, error);
res = PyStackRef_FromPyObjectSteal(res_o);
}
_CALL_METHOD_DESCRIPTOR_NOARGS +
_CHECK_PERIODIC;
- op(_CALL_METHOD_DESCRIPTOR_FAST, (callable[1], self_or_null[1], args[oparg] -- res)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CALL_METHOD_DESCRIPTOR_FAST, (callable, self_or_null, args[oparg] -- res)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
CALL_KW_NON_PY,
};
- op(_MONITOR_CALL_KW, (callable[1], self_or_null[1], args[oparg], kwnames -- callable[1], self_or_null[1], args[oparg], kwnames)) {
- int is_meth = !PyStackRef_IsNull(self_or_null[0]);
+ op(_MONITOR_CALL_KW, (callable, self_or_null, args[oparg], unused -- callable, self_or_null, args[oparg], unused)) {
+ int is_meth = !PyStackRef_IsNull(self_or_null);
PyObject *arg;
if (is_meth) {
- arg = PyStackRef_AsPyObjectBorrow(self_or_null[0]);
+ arg = PyStackRef_AsPyObjectBorrow(self_or_null);
}
else if (args) {
arg = PyStackRef_AsPyObjectBorrow(args[0]);
else {
arg = &_PyInstrumentation_MISSING;
}
- PyObject *function = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *function = PyStackRef_AsPyObjectBorrow(callable);
int err = _Py_call_instrumentation_2args(
tstate, PY_MONITORING_EVENT_CALL,
frame, this_instr, function, arg);
ERROR_IF(err, error);
}
- op(_MAYBE_EXPAND_METHOD_KW, (callable[1], self_or_null[1], args[oparg], kwnames_in -- callable[1], self_or_null[1], args[oparg], kwnames_out)) {
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_MAYBE_EXPAND_METHOD_KW, (callable, self_or_null, unused[oparg], unused -- callable, self_or_null, unused[oparg], unused)) {
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
PyStackRef_CLOSE(temp);
}
- kwnames_out = kwnames_in;
- DEAD(kwnames_in);
}
- op(_DO_CALL_KW, (callable[1], self_or_null[1], args[oparg], kwnames -- res)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_DO_CALL_KW, (callable, self_or_null, args[oparg], kwnames -- res)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, positional_args, kwnames_o, frame
);
DEAD(args);
res = PyStackRef_FromPyObjectSteal(res_o);
}
- op(_PY_FRAME_KW, (callable[1], self_or_null[1], args[oparg], kwnames -- new_frame: _PyInterpreterFrame*)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_PY_FRAME_KW, (callable, self_or_null, args[oparg], kwnames -- new_frame: _PyInterpreterFrame*)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
// oparg counts all of the args, but *not* self:
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, positional_args, kwnames_o, frame
);
PyStackRef_CLOSE(kwnames);
new_frame = temp;
}
- op(_CHECK_FUNCTION_VERSION_KW, (func_version/2, callable[1], self_or_null[1], unused[oparg], kwnames -- callable[1], self_or_null[1], unused[oparg], kwnames)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_FUNCTION_VERSION_KW, (func_version/2, callable, unused, unused[oparg], unused -- callable, unused, unused[oparg], unused)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
EXIT_IF(!PyFunction_Check(callable_o));
PyFunctionObject *func = (PyFunctionObject *)callable_o;
EXIT_IF(func->func_version != func_version);
_SAVE_RETURN_OFFSET +
_PUSH_FRAME;
- op(_CHECK_METHOD_VERSION_KW, (func_version/2, callable[1], null[1], unused[oparg], kwnames -- callable[1], null[1], unused[oparg], kwnames)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_METHOD_VERSION_KW, (func_version/2, callable, null, unused[oparg], unused -- callable, null, unused[oparg], unused)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
EXIT_IF(Py_TYPE(callable_o) != &PyMethod_Type);
PyObject *func = ((PyMethodObject *)callable_o)->im_func;
EXIT_IF(!PyFunction_Check(func));
EXIT_IF(((PyFunctionObject *)func)->func_version != func_version);
- EXIT_IF(!PyStackRef_IsNull(null[0]));
+ EXIT_IF(!PyStackRef_IsNull(null));
}
- op(_EXPAND_METHOD_KW, (callable[1], self_or_null[1], unused[oparg], unused -- callable[1], self_or_null[1], unused[oparg], unused)) {
- assert(PyStackRef_IsNull(self_or_null[0]));
- _PyStackRef callable_s = callable[0];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable_s);
+ op(_EXPAND_METHOD_KW, (callable, self_or_null, unused[oparg], unused -- callable, self_or_null, unused[oparg], unused)) {
+ assert(PyStackRef_IsNull(self_or_null));
+ _PyStackRef callable_s = callable;
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
assert(Py_TYPE(callable_o) == &PyMethod_Type);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
- assert(PyStackRef_FunctionCheck(callable[0]));
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ assert(PyStackRef_FunctionCheck(callable));
PyStackRef_CLOSE(callable_s);
}
_SAVE_RETURN_OFFSET +
_PUSH_FRAME;
- specializing op(_SPECIALIZE_CALL_KW, (counter/1, callable[1], self_or_null[1], args[oparg], kwnames -- callable[1], self_or_null[1], args[oparg], kwnames)) {
+ specializing op(_SPECIALIZE_CALL_KW, (counter/1, callable, self_or_null, unused[oparg], unused -- callable, self_or_null, unused[oparg], unused)) {
#if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
- _Py_Specialize_CallKw(callable[0], next_instr, oparg + !PyStackRef_IsNull(self_or_null[0]));
+ _Py_Specialize_CallKw(callable, next_instr, oparg + !PyStackRef_IsNull(self_or_null));
DISPATCH_SAME_OPARG();
}
OPCODE_DEFERRED_INC(CALL_KW);
_MONITOR_CALL_KW +
_DO_CALL_KW;
- op(_CHECK_IS_NOT_PY_CALLABLE_KW, (callable[1], unused[1], unused[oparg], kwnames -- callable[1], unused[1], unused[oparg], kwnames)) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ op(_CHECK_IS_NOT_PY_CALLABLE_KW, (callable, unused, unused[oparg], unused -- callable, unused, unused[oparg], unused)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
EXIT_IF(PyFunction_Check(callable_o));
EXIT_IF(Py_TYPE(callable_o) == &PyMethod_Type);
}
- op(_CALL_KW_NON_PY, (callable[1], self_or_null[1], args[oparg], kwnames -- res)) {
+ op(_CALL_KW_NON_PY, (callable, self_or_null, args[oparg], kwnames -- res)) {
#if TIER_ONE
assert(opcode != INSTRUMENTED_CALL);
#endif
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
_PyStackRef val;
value = stack_pointer[-1];
receiver = stack_pointer[-2];
- (void)receiver;
val = value;
stack_pointer[-2] = val;
stack_pointer += -1;
}
case _MAYBE_EXPAND_METHOD: {
- _PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
break;
}
case _PY_FRAME_GENERAL: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
args, total_args, NULL, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
case _CHECK_FUNCTION_VERSION: {
- _PyStackRef *callable;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- callable = &stack_pointer[-2 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint32_t func_version = (uint32_t)CURRENT_OPERAND0();
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyFunction_Check(callable_o)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
case _CHECK_METHOD_VERSION: {
- _PyStackRef *null;
- _PyStackRef *callable;
+ _PyStackRef null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint32_t func_version = (uint32_t)CURRENT_OPERAND0();
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (Py_TYPE(callable_o) != &PyMethod_Type) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
- if (!PyStackRef_IsNull(null[0])) {
+ if (!PyStackRef_IsNull(null)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
}
case _EXPAND_METHOD: {
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
- assert(PyStackRef_IsNull(self_or_null[0]));
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ assert(PyStackRef_IsNull(self_or_null));
assert(Py_TYPE(callable_o) == &PyMethod_Type);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
- assert(PyStackRef_FunctionCheck(callable[0]));
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ assert(PyStackRef_FunctionCheck(callable));
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
case _CHECK_IS_NOT_PY_CALLABLE: {
- _PyStackRef *callable;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (PyFunction_Check(callable_o)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
case _CALL_NON_PY_GENERAL: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
#if TIER_ONE
assert(opcode != INSTRUMENTED_CALL);
#endif
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
}
case _CHECK_CALL_BOUND_METHOD_EXACT_ARGS: {
- _PyStackRef *null;
- _PyStackRef *callable;
+ _PyStackRef null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- if (!PyStackRef_IsNull(null[0])) {
+ null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ if (!PyStackRef_IsNull(null)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
- if (Py_TYPE(PyStackRef_AsPyObjectBorrow(callable[0])) != &PyMethod_Type) {
+ if (Py_TYPE(PyStackRef_AsPyObjectBorrow(callable)) != &PyMethod_Type) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
}
case _INIT_CALL_BOUND_METHOD_EXACT_ARGS: {
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- assert(PyStackRef_IsNull(self_or_null[0]));
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ assert(PyStackRef_IsNull(self_or_null));
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
STAT_INC(CALL, hit);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
case _CHECK_FUNCTION_EXACT_ARGS: {
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
assert(PyFunction_Check(callable_o));
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
- if (code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null[0]))) {
+ if (code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null))) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
}
case _CHECK_STACK_SPACE: {
- _PyStackRef *callable;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) {
case _INIT_CALL_PY_EXACT_ARGS_0: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = 0;
assert(oparg == CURRENT_OPARG());
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
case _INIT_CALL_PY_EXACT_ARGS_1: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = 1;
assert(oparg == CURRENT_OPARG());
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
case _INIT_CALL_PY_EXACT_ARGS_2: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = 2;
assert(oparg == CURRENT_OPARG());
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
case _INIT_CALL_PY_EXACT_ARGS_3: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = 3;
assert(oparg == CURRENT_OPARG());
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
case _INIT_CALL_PY_EXACT_ARGS_4: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = 4;
assert(oparg == CURRENT_OPARG());
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
case _INIT_CALL_PY_EXACT_ARGS: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
}
case _CHECK_AND_ALLOCATE_OBJECT: {
- _PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint32_t type_version = (uint32_t)CURRENT_OPERAND0();
- (void)args;
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ if (!PyStackRef_IsNull(self_or_null)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
if (self_o == NULL) {
JUMP_TO_ERROR();
}
- self_or_null[0] = PyStackRef_FromPyObjectSteal(self_o);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(init_func);
+ self_or_null = PyStackRef_FromPyObjectSteal(self_o);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(init_func);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
case _CREATE_INIT_FRAME: {
_PyStackRef *args;
- _PyStackRef *self;
- _PyStackRef *init;
+ _PyStackRef self;
+ _PyStackRef init;
_PyInterpreterFrame *init_frame;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self = &stack_pointer[-1 - oparg];
- init = &stack_pointer[-2 - oparg];
+ self = stack_pointer[-1 - oparg];
+ init = stack_pointer[-2 - oparg];
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *shim = _PyFrame_PushTrampolineUnchecked(
tstate, (PyCodeObject *)&_Py_InitCleanup, 1, frame);
stack_pointer = _PyFrame_GetStackPointer(frame);
assert(_PyFrame_GetBytecode(shim)[0].op.code == EXIT_INIT_CHECK);
assert(_PyFrame_GetBytecode(shim)[1].op.code == RETURN_VALUE);
- shim->localsplus[0] = PyStackRef_DUP(self[0]);
+ shim->localsplus[0] = PyStackRef_DUP(self);
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, init[0], NULL, args-1, oparg+1, NULL, shim);
+ tstate, init, NULL, args-1, oparg+1, NULL, shim);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
case _CALL_BUILTIN_CLASS: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyType_Check(callable_o)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
PyTypeObject *tp = (PyTypeObject *)callable_o;
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
case _CALL_BUILTIN_O: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
stack_pointer = _PyFrame_GetStackPointer(frame);
if (res_o == NULL) {
JUMP_TO_ERROR();
case _CALL_BUILTIN_FAST: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
case _CALL_BUILTIN_FAST_WITH_KEYWORDS: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
case _CALL_LEN: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
stack_pointer = _PyFrame_GetStackPointer(frame);
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[0] = res;
case _CALL_ISINSTANCE: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
+ _PyStackRef self_or_null;
_PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
callable = stack_pointer[-2 - oparg];
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -1 - oparg;
case _CALL_METHOD_DESCRIPTOR_O: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
case _CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
case _CALL_METHOD_DESCRIPTOR_NOARGS: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
assert(oparg == 0 || oparg == 1);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
stack_pointer = _PyFrame_GetStackPointer(frame);
if (res_o == NULL) {
JUMP_TO_ERROR();
case _CALL_METHOD_DESCRIPTOR_FAST: {
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
/* _MONITOR_CALL_KW is not a viable micro-op for tier 2 because it uses the 'this_instr' variable */
case _MAYBE_EXPAND_METHOD_KW: {
- _PyStackRef kwnames_in;
- _PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
- _PyStackRef kwnames_out;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- kwnames_in = stack_pointer[-1];
- args = &stack_pointer[-1 - oparg];
- self_or_null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
- kwnames_out = kwnames_in;
- stack_pointer[-1] = kwnames_out;
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
break;
}
case _PY_FRAME_KW: {
_PyStackRef kwnames;
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyInterpreterFrame *new_frame;
oparg = CURRENT_OPARG();
kwnames = stack_pointer[-1];
args = &stack_pointer[-1 - oparg];
- self_or_null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
case _CHECK_FUNCTION_VERSION_KW: {
- _PyStackRef *callable;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- callable = &stack_pointer[-3 - oparg];
+ callable = stack_pointer[-3 - oparg];
uint32_t func_version = (uint32_t)CURRENT_OPERAND0();
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyFunction_Check(callable_o)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
case _CHECK_METHOD_VERSION_KW: {
- _PyStackRef *null;
- _PyStackRef *callable;
+ _PyStackRef null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
+ null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
uint32_t func_version = (uint32_t)CURRENT_OPERAND0();
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (Py_TYPE(callable_o) != &PyMethod_Type) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
- if (!PyStackRef_IsNull(null[0])) {
+ if (!PyStackRef_IsNull(null)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
}
case _EXPAND_METHOD_KW: {
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- self_or_null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
- assert(PyStackRef_IsNull(self_or_null[0]));
- _PyStackRef callable_s = callable[0];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable_s);
+ self_or_null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
+ assert(PyStackRef_IsNull(self_or_null));
+ _PyStackRef callable_s = callable;
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
assert(Py_TYPE(callable_o) == &PyMethod_Type);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
- assert(PyStackRef_FunctionCheck(callable[0]));
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ assert(PyStackRef_FunctionCheck(callable));
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(callable_s);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
case _CHECK_IS_NOT_PY_CALLABLE_KW: {
- _PyStackRef *callable;
+ _PyStackRef callable;
oparg = CURRENT_OPARG();
- callable = &stack_pointer[-3 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ callable = stack_pointer[-3 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (PyFunction_Check(callable_o)) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
case _CALL_KW_NON_PY: {
_PyStackRef kwnames;
_PyStackRef *args;
- _PyStackRef *self_or_null;
- _PyStackRef *callable;
+ _PyStackRef self_or_null;
+ _PyStackRef callable;
_PyStackRef res;
oparg = CURRENT_OPARG();
kwnames = stack_pointer[-1];
args = &stack_pointer[-1 - oparg];
- self_or_null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
+ self_or_null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
#if TIER_ONE
assert(opcode != INSTRUMENTED_CALL);
#endif
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-3 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -3 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
_Py_CODEUNIT* const this_instr = next_instr - 4;
(void)this_instr;
opcode = CALL;
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
// _SPECIALIZE_CALL
{
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint16_t counter = read_u16(&this_instr[1].cache);
(void)counter;
#if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
_PyFrame_SetStackPointer(frame, stack_pointer);
- _Py_Specialize_Call(callable[0], next_instr, oparg + !PyStackRef_IsNull(self_or_null[0]));
+ _Py_Specialize_Call(callable, next_instr, oparg + !PyStackRef_IsNull(self_or_null));
stack_pointer = _PyFrame_GetStackPointer(frame);
DISPATCH_SAME_OPARG();
}
/* Skip 2 cache entries */
// _MAYBE_EXPAND_METHOD
{
- args = &stack_pointer[-oparg];
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
// _DO_CALL
{
args = &stack_pointer[-oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, total_args, NULL, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
for (int _i = oparg; --_i >= 0;) {
tmp = args[_i];
args[_i] = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
JUMP_TO_LABEL(error);
}
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyObject *res_o = PyObject_Vectorcall(
callable_o, args_o,
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_ALLOC_AND_ENTER_INIT);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
+ _PyStackRef init;
+ _PyStackRef self;
_PyStackRef *args;
- _PyStackRef *init;
- _PyStackRef *self;
_PyInterpreterFrame *init_frame;
_PyInterpreterFrame *new_frame;
/* Skip 1 cache entry */
}
// _CHECK_AND_ALLOCATE_OBJECT
{
- args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint32_t type_version = read_u32(&this_instr[2].cache);
- (void)args;
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ if (!PyStackRef_IsNull(self_or_null)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
if (self_o == NULL) {
JUMP_TO_LABEL(error);
}
- self_or_null[0] = PyStackRef_FromPyObjectSteal(self_o);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(init_func);
+ self_or_null = PyStackRef_FromPyObjectSteal(self_o);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(init_func);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
// _CREATE_INIT_FRAME
{
+ args = &stack_pointer[-oparg];
self = self_or_null;
init = callable;
_PyFrame_SetStackPointer(frame, stack_pointer);
stack_pointer = _PyFrame_GetStackPointer(frame);
assert(_PyFrame_GetBytecode(shim)[0].op.code == EXIT_INIT_CHECK);
assert(_PyFrame_GetBytecode(shim)[1].op.code == RETURN_VALUE);
- shim->localsplus[0] = PyStackRef_DUP(self[0]);
+ shim->localsplus[0] = PyStackRef_DUP(self);
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, init[0], NULL, args-1, oparg+1, NULL, shim);
+ tstate, init, NULL, args-1, oparg+1, NULL, shim);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
next_instr += 4;
INSTRUCTION_STATS(CALL_BOUND_METHOD_EXACT_ARGS);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *null;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef null;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyInterpreterFrame *new_frame;
/* Skip 1 cache entry */
}
// _CHECK_CALL_BOUND_METHOD_EXACT_ARGS
{
- null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- if (!PyStackRef_IsNull(null[0])) {
+ null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ if (!PyStackRef_IsNull(null)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
- if (Py_TYPE(PyStackRef_AsPyObjectBorrow(callable[0])) != &PyMethod_Type) {
+ if (Py_TYPE(PyStackRef_AsPyObjectBorrow(callable)) != &PyMethod_Type) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
// _INIT_CALL_BOUND_METHOD_EXACT_ARGS
{
self_or_null = null;
- assert(PyStackRef_IsNull(self_or_null[0]));
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ assert(PyStackRef_IsNull(self_or_null));
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
STAT_INC(CALL, hit);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
// _CHECK_FUNCTION_VERSION
{
uint32_t func_version = read_u32(&this_instr[2].cache);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyFunction_Check(callable_o)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
}
// _CHECK_FUNCTION_EXACT_ARGS
{
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
assert(PyFunction_Check(callable_o));
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
- if (code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null[0]))) {
+ if (code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null))) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
// _CHECK_STACK_SPACE
{
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) {
// _INIT_CALL_PY_EXACT_ARGS
{
args = &stack_pointer[-oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
next_instr += 4;
INSTRUCTION_STATS(CALL_BOUND_METHOD_GENERAL);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *null;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef null;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyInterpreterFrame *new_frame;
/* Skip 1 cache entry */
}
// _CHECK_METHOD_VERSION
{
- null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint32_t func_version = read_u32(&this_instr[2].cache);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (Py_TYPE(callable_o) != &PyMethod_Type) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
- if (!PyStackRef_IsNull(null[0])) {
+ if (!PyStackRef_IsNull(null)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
// _EXPAND_METHOD
{
self_or_null = null;
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
- assert(PyStackRef_IsNull(self_or_null[0]));
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
+ assert(PyStackRef_IsNull(self_or_null));
assert(Py_TYPE(callable_o) == &PyMethod_Type);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
- assert(PyStackRef_FunctionCheck(callable[0]));
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ assert(PyStackRef_FunctionCheck(callable));
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
// _PY_FRAME_GENERAL
{
args = &stack_pointer[-oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
args, total_args, NULL, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
next_instr += 4;
INSTRUCTION_STATS(CALL_BUILTIN_CLASS);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_BUILTIN_CLASS
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyType_Check(callable_o)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
PyTypeObject *tp = (PyTypeObject *)callable_o;
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_BUILTIN_FAST);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_BUILTIN_FAST
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_BUILTIN_FAST_WITH_KEYWORDS);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_BUILTIN_FAST_WITH_KEYWORDS
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_BUILTIN_O);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_BUILTIN_O
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
stack_pointer = _PyFrame_GetStackPointer(frame);
if (res_o == NULL) {
JUMP_TO_LABEL(error);
INSTRUCTION_STATS(CALL_ISINSTANCE);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
_PyStackRef callable;
- _PyStackRef *self_or_null;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
/* Skip 2 cache entries */
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
callable = stack_pointer[-2 - oparg];
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -1 - oparg;
_Py_CODEUNIT* const this_instr = next_instr - 4;
(void)this_instr;
opcode = CALL_KW;
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
- _PyStackRef kwnames_in;
- _PyStackRef kwnames_out;
_PyStackRef kwnames;
_PyStackRef res;
// _SPECIALIZE_CALL_KW
{
- self_or_null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
+ self_or_null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
uint16_t counter = read_u16(&this_instr[1].cache);
(void)counter;
#if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
_PyFrame_SetStackPointer(frame, stack_pointer);
- _Py_Specialize_CallKw(callable[0], next_instr, oparg + !PyStackRef_IsNull(self_or_null[0]));
+ _Py_Specialize_CallKw(callable, next_instr, oparg + !PyStackRef_IsNull(self_or_null));
stack_pointer = _PyFrame_GetStackPointer(frame);
DISPATCH_SAME_OPARG();
}
/* Skip 2 cache entries */
// _MAYBE_EXPAND_METHOD_KW
{
- kwnames_in = stack_pointer[-1];
- args = &stack_pointer[-1 - oparg];
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
- kwnames_out = kwnames_in;
}
// _DO_CALL_KW
{
- kwnames = kwnames_out;
+ kwnames = stack_pointer[-1];
args = &stack_pointer[-1 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
- stack_pointer[-1] = kwnames;
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyStackRef tmp = kwnames;
kwnames = PyStackRef_NULL;
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
stack_pointer[-1] = kwnames;
PyStackRef_CLOSE(tmp);
for (int _i = oparg; --_i >= 0;) {
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-3 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -3 - oparg;
assert(WITHIN_STACK_BOUNDS());
JUMP_TO_LABEL(error);
}
- stack_pointer[-1] = kwnames;
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyObject *res_o = PyObject_Vectorcall(
callable_o, args_o,
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-3 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -3 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_KW_BOUND_METHOD);
static_assert(INLINE_CACHE_ENTRIES_CALL_KW == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *null;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef null;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef kwnames;
_PyInterpreterFrame *new_frame;
}
// _CHECK_METHOD_VERSION_KW
{
- null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
+ null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
uint32_t func_version = read_u32(&this_instr[2].cache);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (Py_TYPE(callable_o) != &PyMethod_Type) {
UPDATE_MISS_STATS(CALL_KW);
assert(_PyOpcode_Deopt[opcode] == (CALL_KW));
assert(_PyOpcode_Deopt[opcode] == (CALL_KW));
JUMP_TO_PREDICTED(CALL_KW);
}
- if (!PyStackRef_IsNull(null[0])) {
+ if (!PyStackRef_IsNull(null)) {
UPDATE_MISS_STATS(CALL_KW);
assert(_PyOpcode_Deopt[opcode] == (CALL_KW));
JUMP_TO_PREDICTED(CALL_KW);
// _EXPAND_METHOD_KW
{
self_or_null = null;
- assert(PyStackRef_IsNull(self_or_null[0]));
- _PyStackRef callable_s = callable[0];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable_s);
+ assert(PyStackRef_IsNull(self_or_null));
+ _PyStackRef callable_s = callable;
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
assert(Py_TYPE(callable_o) == &PyMethod_Type);
- self_or_null[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
- callable[0] = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
- assert(PyStackRef_FunctionCheck(callable[0]));
+ self_or_null = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_self);
+ callable = PyStackRef_FromPyObjectNew(((PyMethodObject *)callable_o)->im_func);
+ assert(PyStackRef_FunctionCheck(callable));
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(callable_s);
stack_pointer = _PyFrame_GetStackPointer(frame);
{
kwnames = stack_pointer[-1];
args = &stack_pointer[-1 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
INSTRUCTION_STATS(CALL_KW_NON_PY);
opcode = CALL_KW_NON_PY;
static_assert(INLINE_CACHE_ENTRIES_CALL_KW == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef kwnames;
_PyStackRef res;
/* Skip 2 cache entries */
// _CHECK_IS_NOT_PY_CALLABLE_KW
{
- callable = &stack_pointer[-3 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ callable = stack_pointer[-3 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (PyFunction_Check(callable_o)) {
UPDATE_MISS_STATS(CALL_KW);
assert(_PyOpcode_Deopt[opcode] == (CALL_KW));
{
kwnames = stack_pointer[-1];
args = &stack_pointer[-1 - oparg];
- self_or_null = &stack_pointer[-2 - oparg];
+ self_or_null = stack_pointer[-2 - oparg];
#if TIER_ONE
assert(opcode != INSTRUMENTED_CALL);
#endif
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-3 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -3 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_KW_PY);
static_assert(INLINE_CACHE_ENTRIES_CALL_KW == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef kwnames;
_PyInterpreterFrame *new_frame;
}
// _CHECK_FUNCTION_VERSION_KW
{
- callable = &stack_pointer[-3 - oparg];
+ callable = stack_pointer[-3 - oparg];
uint32_t func_version = read_u32(&this_instr[2].cache);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyFunction_Check(callable_o)) {
UPDATE_MISS_STATS(CALL_KW);
assert(_PyOpcode_Deopt[opcode] == (CALL_KW));
{
kwnames = stack_pointer[-1];
args = &stack_pointer[-1 - oparg];
- self_or_null = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
next_instr += 4;
INSTRUCTION_STATS(CALL_LEN);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
/* Skip 2 cache entries */
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
stack_pointer = _PyFrame_GetStackPointer(frame);
res = PyStackRef_FromPyObjectSteal(res_o);
stack_pointer[0] = res;
next_instr += 4;
INSTRUCTION_STATS(CALL_METHOD_DESCRIPTOR_FAST);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_METHOD_DESCRIPTOR_FAST
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_METHOD_DESCRIPTOR_NOARGS);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_METHOD_DESCRIPTOR_NOARGS
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
assert(oparg == 0 || oparg == 1);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
- PyStackRef_CLOSE(callable[0]);
+ PyStackRef_CLOSE(callable);
stack_pointer = _PyFrame_GetStackPointer(frame);
if (res_o == NULL) {
JUMP_TO_LABEL(error);
next_instr += 4;
INSTRUCTION_STATS(CALL_METHOD_DESCRIPTOR_O);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
// _CALL_METHOD_DESCRIPTOR_O
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
INSTRUCTION_STATS(CALL_NON_PY_GENERAL);
opcode = CALL_NON_PY_GENERAL;
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyStackRef res;
/* Skip 1 cache entry */
/* Skip 2 cache entries */
// _CHECK_IS_NOT_PY_CALLABLE
{
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (PyFunction_Check(callable_o)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
// _CALL_NON_PY_GENERAL
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
+ self_or_null = stack_pointer[-1 - oparg];
#if TIER_ONE
assert(opcode != INSTRUMENTED_CALL);
#endif
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(CALL_PY_EXACT_ARGS);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyInterpreterFrame *new_frame;
/* Skip 1 cache entry */
}
// _CHECK_FUNCTION_VERSION
{
- callable = &stack_pointer[-2 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint32_t func_version = read_u32(&this_instr[2].cache);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyFunction_Check(callable_o)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
}
// _CHECK_FUNCTION_EXACT_ARGS
{
- self_or_null = &stack_pointer[-1 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
assert(PyFunction_Check(callable_o));
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
- if (code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null[0]))) {
+ if (code->co_argcount != oparg + (!PyStackRef_IsNull(self_or_null))) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
// _CHECK_STACK_SPACE
{
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyFunctionObject *func = (PyFunctionObject *)callable_o;
PyCodeObject *code = (PyCodeObject *)func->func_code;
if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) {
// _INIT_CALL_PY_EXACT_ARGS
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- int has_self = !PyStackRef_IsNull(self_or_null[0]);
+ int has_self = !PyStackRef_IsNull(self_or_null);
STAT_INC(CALL, hit);
- new_frame = _PyFrame_PushUnchecked(tstate, callable[0], oparg + has_self, frame);
+ new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
_PyStackRef *first_non_self_local = new_frame->localsplus + has_self;
- new_frame->localsplus[0] = self_or_null[0];
+ new_frame->localsplus[0] = self_or_null;
for (int i = 0; i < oparg; i++) {
first_non_self_local[i] = args[i];
}
next_instr += 4;
INSTRUCTION_STATS(CALL_PY_GENERAL);
static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size");
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
_PyInterpreterFrame *new_frame;
/* Skip 1 cache entry */
}
// _CHECK_FUNCTION_VERSION
{
- callable = &stack_pointer[-2 - oparg];
+ callable = stack_pointer[-2 - oparg];
uint32_t func_version = read_u32(&this_instr[2].cache);
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
if (!PyFunction_Check(callable_o)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
// _PY_FRAME_GENERAL
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
args--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *temp = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
args, total_args, NULL, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
_PyStackRef val;
value = stack_pointer[-1];
receiver = stack_pointer[-2];
- (void)receiver;
val = value;
stack_pointer[-2] = val;
stack_pointer += -1;
next_instr += 4;
INSTRUCTION_STATS(INSTRUMENTED_CALL);
opcode = INSTRUMENTED_CALL;
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
+ _PyStackRef func;
+ _PyStackRef maybe_self;
_PyStackRef *args;
- _PyStackRef *func;
- _PyStackRef *maybe_self;
_PyStackRef res;
/* Skip 3 cache entries */
// _MAYBE_EXPAND_METHOD
{
- args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
// _MONITOR_CALL
{
+ args = &stack_pointer[-oparg];
maybe_self = self_or_null;
func = callable;
- int is_meth = !PyStackRef_IsNull(maybe_self[0]);
- PyObject *function = PyStackRef_AsPyObjectBorrow(func[0]);
+ int is_meth = !PyStackRef_IsNull(maybe_self);
+ PyObject *function = PyStackRef_AsPyObjectBorrow(func);
PyObject *arg0;
if (is_meth) {
- arg0 = PyStackRef_AsPyObjectBorrow(maybe_self[0]);
+ arg0 = PyStackRef_AsPyObjectBorrow(maybe_self);
}
else if (oparg) {
arg0 = PyStackRef_AsPyObjectBorrow(args[0]);
else {
arg0 = &_PyInstrumentation_MISSING;
}
+ stack_pointer[-2 - oparg] = func;
+ stack_pointer[-1 - oparg] = maybe_self;
_PyFrame_SetStackPointer(frame, stack_pointer);
int err = _Py_call_instrumentation_2args(
tstate, PY_MONITORING_EVENT_CALL,
// _DO_CALL
{
args = &stack_pointer[-oparg];
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, total_args, NULL, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-1 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -2 - oparg;
next_instr += 4;
INSTRUCTION_STATS(INSTRUMENTED_CALL_KW);
opcode = INSTRUMENTED_CALL_KW;
- _PyStackRef *callable;
- _PyStackRef *self_or_null;
+ _PyStackRef callable;
+ _PyStackRef self_or_null;
_PyStackRef *args;
- _PyStackRef kwnames_in;
- _PyStackRef kwnames_out;
_PyStackRef kwnames;
_PyStackRef res;
/* Skip 1 cache entry */
/* Skip 2 cache entries */
// _MAYBE_EXPAND_METHOD_KW
{
- kwnames_in = stack_pointer[-1];
- args = &stack_pointer[-1 - oparg];
- self_or_null = &stack_pointer[-2 - oparg];
- callable = &stack_pointer[-3 - oparg];
- (void)args;
- if (PyStackRef_TYPE(callable[0]) == &PyMethod_Type && PyStackRef_IsNull(self_or_null[0])) {
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ self_or_null = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3 - oparg];
+ if (PyStackRef_TYPE(callable) == &PyMethod_Type && PyStackRef_IsNull(self_or_null)) {
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *self = ((PyMethodObject *)callable_o)->im_self;
- self_or_null[0] = PyStackRef_FromPyObjectNew(self);
+ self_or_null = PyStackRef_FromPyObjectNew(self);
PyObject *method = ((PyMethodObject *)callable_o)->im_func;
- _PyStackRef temp = callable[0];
- callable[0] = PyStackRef_FromPyObjectNew(method);
+ _PyStackRef temp = callable;
+ callable = PyStackRef_FromPyObjectNew(method);
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(temp);
stack_pointer = _PyFrame_GetStackPointer(frame);
}
- kwnames_out = kwnames_in;
}
// _MONITOR_CALL_KW
{
- int is_meth = !PyStackRef_IsNull(self_or_null[0]);
+ args = &stack_pointer[-1 - oparg];
+ int is_meth = !PyStackRef_IsNull(self_or_null);
PyObject *arg;
if (is_meth) {
- arg = PyStackRef_AsPyObjectBorrow(self_or_null[0]);
+ arg = PyStackRef_AsPyObjectBorrow(self_or_null);
}
else if (args) {
arg = PyStackRef_AsPyObjectBorrow(args[0]);
else {
arg = &_PyInstrumentation_MISSING;
}
- PyObject *function = PyStackRef_AsPyObjectBorrow(callable[0]);
- stack_pointer[-1] = kwnames_out;
+ PyObject *function = PyStackRef_AsPyObjectBorrow(callable);
+ stack_pointer[-3 - oparg] = callable;
+ stack_pointer[-2 - oparg] = self_or_null;
_PyFrame_SetStackPointer(frame, stack_pointer);
int err = _Py_call_instrumentation_2args(
tstate, PY_MONITORING_EVENT_CALL,
}
// _DO_CALL_KW
{
- kwnames = kwnames_out;
- PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable[0]);
+ kwnames = stack_pointer[-1];
+ args = &stack_pointer[-1 - oparg];
+ PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
PyObject *kwnames_o = PyStackRef_AsPyObjectBorrow(kwnames);
int total_args = oparg;
_PyStackRef *arguments = args;
- if (!PyStackRef_IsNull(self_or_null[0])) {
+ if (!PyStackRef_IsNull(self_or_null)) {
arguments--;
total_args++;
}
PyObject *locals = code_flags & CO_OPTIMIZED ? NULL : Py_NewRef(PyFunction_GET_GLOBALS(callable_o));
_PyFrame_SetStackPointer(frame, stack_pointer);
_PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
- tstate, callable[0], locals,
+ tstate, callable, locals,
arguments, positional_args, kwnames_o, frame
);
stack_pointer = _PyFrame_GetStackPointer(frame);
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-3 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -3 - oparg;
args[_i] = PyStackRef_NULL;
PyStackRef_CLOSE(tmp);
}
- tmp = self_or_null[0];
- self_or_null[0] = PyStackRef_NULL;
+ tmp = self_or_null;
+ self_or_null = PyStackRef_NULL;
+ stack_pointer[-2 - oparg] = self_or_null;
PyStackRef_XCLOSE(tmp);
- tmp = callable[0];
- callable[0] = PyStackRef_NULL;
+ tmp = callable;
+ callable = PyStackRef_NULL;
+ stack_pointer[-3 - oparg] = callable;
PyStackRef_CLOSE(tmp);
stack_pointer = _PyFrame_GetStackPointer(frame);
stack_pointer += -3 - oparg;
top = bottom;
}
- op(_SWAP, (bottom[1], unused[oparg-2], top[1] -- bottom[1], unused[oparg-2], top[1])) {
- JitOptSymbol *temp = bottom[0];
- bottom[0] = top[0];
- top[0] = temp;
+ op(_SWAP, (bottom, unused[oparg-2], top -- bottom, unused[oparg-2], top)) {
+ JitOptSymbol *temp = bottom;
+ bottom = top;
+ top = temp;
assert(oparg >= 2);
}
(void)offset;
}
- op(_LOAD_ATTR_MODULE, (dict_version/2, owner, index/1 -- attr)) {
+ op(_LOAD_ATTR_MODULE, (dict_version/2, index/1, owner -- attr)) {
(void)dict_version;
(void)index;
attr = NULL;
ctx->done = true;
}
- op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable[1], self_or_null[1], unused[oparg] -- callable[1], self_or_null[1], unused[oparg])) {
- callable[0] = sym_new_not_null(ctx);
- self_or_null[0] = sym_new_not_null(ctx);
+ op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
+ callable = sym_new_not_null(ctx);
+ self_or_null = sym_new_not_null(ctx);
}
op(_CHECK_FUNCTION_VERSION, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
}
case _INIT_CALL_BOUND_METHOD_EXACT_ARGS: {
- JitOptSymbol **self_or_null;
- JitOptSymbol **callable;
- self_or_null = &stack_pointer[-1 - oparg];
- callable = &stack_pointer[-2 - oparg];
- callable[0] = sym_new_not_null(ctx);
- self_or_null[0] = sym_new_not_null(ctx);
+ JitOptSymbol *self_or_null;
+ JitOptSymbol *callable;
+ self_or_null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ callable = sym_new_not_null(ctx);
+ self_or_null = sym_new_not_null(ctx);
+ stack_pointer[-2 - oparg] = callable;
+ stack_pointer[-1 - oparg] = self_or_null;
break;
}
/* _MONITOR_CALL_KW is not a viable micro-op for tier 2 */
case _MAYBE_EXPAND_METHOD_KW: {
- JitOptSymbol *kwnames_out;
- kwnames_out = sym_new_not_null(ctx);
- stack_pointer[-1] = kwnames_out;
break;
}
}
case _SWAP: {
- JitOptSymbol **top;
- JitOptSymbol **bottom;
- top = &stack_pointer[-1];
- bottom = &stack_pointer[-2 - (oparg-2)];
- JitOptSymbol *temp = bottom[0];
- bottom[0] = top[0];
- top[0] = temp;
+ JitOptSymbol *top;
+ JitOptSymbol *bottom;
+ top = stack_pointer[-1];
+ bottom = stack_pointer[-2 - (oparg-2)];
+ JitOptSymbol *temp = bottom;
+ bottom = top;
+ top = temp;
assert(oparg >= 2);
+ stack_pointer[-2 - (oparg-2)] = bottom;
+ stack_pointer[-1] = top;
break;
}
self.check_liveness, self.spilled
)
- def sanity_check(self) -> None:
+ @staticmethod
+ def check_names(locals: list[Local]) -> None:
names: set[str] = set()
- for var in self.inputs:
- if var.name in names:
- raise StackError(f"Duplicate name {var.name}")
- names.add(var.name)
- names = set()
- for var in self.outputs:
- if var.name in names:
- raise StackError(f"Duplicate name {var.name}")
- names.add(var.name)
- names = set()
- for var in self.stack.variables:
+ for var in locals:
+ if var.name == "unused":
+ continue
if var.name in names:
raise StackError(f"Duplicate name {var.name}")
names.add(var.name)
+ def sanity_check(self) -> None:
+ self.check_names(self.inputs)
+ self.check_names(self.outputs)
+ self.check_names(self.stack.variables)
+
def is_flushed(self) -> bool:
for var in self.outputs:
if var.in_local and not var.memory_offset: