Skip to content
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

gh-91625: Don't ignore extended args of adaptive opcodes #91626

Merged
merged 12 commits into from Apr 17, 2022

Conversation

Copy link
Member

@sweeneyde sweeneyde commented Apr 17, 2022

@sweeneyde sweeneyde added type-bug interpreter-core 3.11 labels Apr 17, 2022
Python/ceval.c Outdated
assert(cframe.use_tracing == 0 || cframe.use_tracing == 255); \
opcode |= cframe.use_tracing OR_DTRACE_LINE; \
Copy link
Member Author

@sweeneyde sweeneyde Apr 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tracing checks here should be removed. We should be able to finish executing the logical opcode (family) we started to execute before trying to respect cframe.use_tracing.

Do reviewers agree?

Copy link
Member Author

@sweeneyde sweeneyde Apr 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only time it could make a difference is if one of the _Py_Specialize_XxxXxxxx() calls somehow managed to set the flag.

Copy link
Member

@markshannon markshannon left a comment

Thanks for catching this.

The tests could be tidied up with a bit of code generation. Other than that, looks good.

def __getattr__(self, attr):
return int(attr.lstrip("_"))
def number_attrs(Z):
return [
Copy link
Member

@markshannon markshannon Apr 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ideal for generating. Maybe something like

attrs = ", ".join(f"Z._{n:03d}" for n in range(280))
code = f"def number_attrs(Z):\n    return [ {attrs} ]"
exec(code...

@@ -150,6 +150,45 @@ def load_tests(loader, tests, pattern):
tests.addTest(doctest.DocTestSuite())
return tests

def unpack_400(x):
Copy link
Member

@markshannon markshannon Apr 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate this as well?

@sweeneyde sweeneyde merged commit cec5d85 into python:main Apr 17, 2022
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 interpreter-core release-blocker type-bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants