Skip to content

Commit 6825711

Browse files
emit oparg for inline variants
1 parent 30024a0 commit 6825711

4 files changed

Lines changed: 30 additions & 28 deletions

File tree

Python/bytecodes.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4936,17 +4936,16 @@ dummy_func(
49364936
PyStackRef_CLOSE(temp);
49374937
}
49384938

4939-
tier2 op(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS_INLINE, (callable, args[oparg], cfunc/4 -- callable, args[oparg])) {
4940-
PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
4941-
assert(self != NULL);
4939+
tier2 op(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS_INLINE, (callable, self_st, args[oparg], cfunc/4 -- callable, self_st, args[oparg])) {
4940+
PyObject *self = PyStackRef_AsPyObjectBorrow(self_st);
49424941
STAT_INC(CALL, hit);
49434942
volatile PyCFunctionFastWithKeywords cfunc_v = _PyCFunctionFastWithKeywords_CAST(cfunc);
49444943
PyObject *res_o = _PyCallMethodDescriptorFastWithKeywords_StackRef(
49454944
callable,
49464945
cfunc_v,
49474946
self,
4948-
args,
4949-
oparg
4947+
&self_st,
4948+
oparg + 1
49504949
);
49514950
if (res_o == NULL) {
49524951
ERROR_NO_POP();
@@ -5079,17 +5078,17 @@ dummy_func(
50795078
PyStackRef_CLOSE(temp);
50805079
}
50815080

5082-
tier2 op(_CALL_METHOD_DESCRIPTOR_FAST_INLINE, (callable, args[oparg], cfunc/4 -- callable, args[oparg])) {
5083-
PyObject *self = PyStackRef_AsPyObjectBorrow(args[0]);
5081+
tier2 op(_CALL_METHOD_DESCRIPTOR_FAST_INLINE, (callable, self_st, args[oparg], cfunc/4 -- callable, self_st, args[oparg])) {
5082+
PyObject *self = PyStackRef_AsPyObjectBorrow(self_st);
50845083
assert(self != NULL);
50855084
STAT_INC(CALL, hit);
50865085
volatile PyCFunctionFast cfunc_v = _PyCFunctionFast_CAST(cfunc);
50875086
PyObject *res_o = _PyCallMethodDescriptorFast_StackRef(
50885087
callable,
50895088
cfunc_v,
50905089
self,
5091-
args,
5092-
oparg
5090+
&self_st,
5091+
oparg + 1
50935092
);
50945093
if (res_o == NULL) {
50955094
ERROR_NO_POP();

Python/executor_cases.c.h

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

Python/optimizer_bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ dummy_func(void) {
14731473
&& sym_is_not_null(self_or_null)) {
14741474
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
14751475
PyCFunction cfunc = method->d_method->ml_meth;
1476-
ADD_OP(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS_INLINE, oparg + 1, (uintptr_t)cfunc);
1476+
ADD_OP(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS_INLINE, oparg, (uintptr_t)cfunc);
14771477
}
14781478
callable = sym_new_not_null(ctx);
14791479
}
@@ -1484,7 +1484,7 @@ dummy_func(void) {
14841484
&& sym_is_not_null(self_or_null)) {
14851485
PyMethodDescrObject *method = (PyMethodDescrObject *)callable_o;
14861486
PyCFunction cfunc = method->d_method->ml_meth;
1487-
ADD_OP(_CALL_METHOD_DESCRIPTOR_FAST_INLINE, oparg + 1, (uintptr_t)cfunc);
1487+
ADD_OP(_CALL_METHOD_DESCRIPTOR_FAST_INLINE, oparg, (uintptr_t)cfunc);
14881488
}
14891489
callable = sym_new_not_null(ctx);
14901490
}

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)