-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
gh-134584: Eliminate redundant refcounting from _CALL_TYPE_1
#135818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
85ab405
f927209
bbf1c9d
81f9b44
6934f63
e86897a
bd62d15
ca15e78
bcb805d
56fa30f
225d6db
bba9435
6ffffa6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Eliminate redundant refcounting from ``_CALL_TYPE_1``. Patch by Tomas Roun |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4030,25 +4030,23 @@ dummy_func( | |
| DEOPT_IF(callable_o != (PyObject *)&PyType_Type); | ||
| } | ||
|
|
||
| op(_CALL_TYPE_1, (callable, null, arg -- res)) { | ||
| op(_CALL_TYPE_1, (callable, null, arg -- res, a)) { | ||
| PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); | ||
|
|
||
| assert(oparg == 1); | ||
| DEAD(null); | ||
| DEAD(callable); | ||
| (void)callable; // Silence compiler warnings about unused variables | ||
| (void)null; | ||
| STAT_INC(CALL, hit); | ||
| INPUTS_DEAD(); | ||
| res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); | ||
| PyStackRef_CLOSE(arg); | ||
| a = arg; | ||
| } | ||
|
|
||
| macro(CALL_TYPE_1) = | ||
| unused/1 + | ||
| unused/2 + | ||
| _GUARD_NOS_NULL + | ||
| _GUARD_CALLABLE_TYPE_1 + | ||
| _CALL_TYPE_1; | ||
| _CALL_TYPE_1 + | ||
| POP_TOP; | ||
|
|
||
| op(_GUARD_CALLABLE_STR_1, (callable, unused, unused -- callable, unused, unused)) { | ||
| PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); | ||
|
|
@@ -5360,6 +5358,15 @@ dummy_func( | |
| value = PyStackRef_FromPyObjectBorrow(ptr); | ||
| } | ||
|
|
||
| tier2 op(_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- value, a)) { | ||
| PyStackRef_CLOSE(arg); | ||
|
||
| (void)null; // Silence compiler warnings about unused variables | ||
| DEAD(null); | ||
| PyStackRef_CLOSE(callable); | ||
Fidget-Spinner marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| value = PyStackRef_FromPyObjectBorrow(ptr); | ||
| a = arg; | ||
| } | ||
|
|
||
| tier2 op(_LOAD_CONST_UNDER_INLINE, (ptr/4, old -- value, new)) { | ||
| new = old; | ||
| DEAD(old); | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.