-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-131798: JIT: replace _CHECK_METHOD_VERSION with _CHECK_FUNCTION_VERSION_INLINE #135022
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
base: main
Are you sure you want to change the base?
Conversation
…ION_VERSION_INLINE Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
…ka/method-version
Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, thanks! A few suggestions:
Misc/NEWS.d/next/Core_and_Builtins/2025-06-02-20-13-37.gh-issue-131798.JQRFvR.rst
Outdated
Show resolved
Hide resolved
Lib/test/test_capi/test_opt.py
Outdated
class TestObject: | ||
def test(self, *args, **kwargs): | ||
return args[0] | ||
|
||
test_object = TestObject() | ||
test_bound_method = TestObject.test.__get__(test_object) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this into test_method_guards_removed_or_reduced
? global_identity
needs to be at module scope for other reasons that don't apply here.
Also, I think it can be simplified to something like:
class TestObject:
def test(self, arg):
return arg
test_bound_method = TestObject().test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm correct, TestObject().test
will just generate _CHECK_FUNCTION_VERSION
code, It's a normal function.
Reference the test code here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this into
test_method_guards_removed_or_reduced
?global_identity
needs to be at module scope for other reasons that don't apply here.
BTW, if I push the test object into the test_method_guards_removed_or_reduced
. I think the method will not be treated by a const. So we the _CHECK_FUNCTION_VERSION_INLINE
is not exist in final opcode.
…e-131798.JQRFvR.rst Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
Uh oh!
There was an error while loading. Please reload this page.