GH-105848: Simplify the arrangement of CALL's stack#107788
Conversation
gvanrossum
left a comment
There was a problem hiding this comment.
I think this can go in just like this.
Sorry, something went wrong.
|
How about some buildbot runs? |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @brandtbucher for commit fd6607f 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @brandtbucher for commit fd6607f 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @brandtbucher for commit a5a2d8f 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @brandtbucher for commit a5a2d8f 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
|
No new buildbot failures. |
Sorry, something went wrong.
markshannon
left a comment
There was a problem hiding this comment.
A bunch of minor style issues, but nothing blocking.
Sorry, something went wrong.
Summary: This reflects the changes in python/cpython#107788. The changes to the relevant `LOAD_` instructions are mostly covered by updating `LoadMethodResult` to have a non-default constructor in 3.14+ which normalizes the content. Reviewed By: alexmalyshev Differential Revision: D80667929 fbshipit-source-id: 2d62f1850056792695faf8d9ceea61a0b4b31253
Instead of supporting both
[callable, self, args...]and[NULL, callable, args...], changeCALL's stack to be[callable, self_or_null, args...]. This always puts the desired callable at the same location on the stack, simplifying (or removing) the resulting shuffles and adjustments necessary for the shared code paths that follow.This also changes
CALL_FUNCTION_EX,DICT_MERGE,LOAD_ATTR,LOAD_GLOBAL,LOAD_SUPER_ATTRto support the new stack layout. In some cases, I've also changed the names of the stack items for consistency within a family.As a side-effect of the new layout,
LOAD_ATTR_PROPERTYandLOAD_ATTR_GETATTRIBUTE_OVERRIDDEN(which are both implemented as inlined calls) don't support pushing an additional item to the stack for a followingCALL(oparg & 1) anymore. I think this is fine, since it seems rare to call a "method" that's looked up in this manner.CALLsequence #105848