| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
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.
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 | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Expand Up | @@ -285,11 +285,25 @@ dummy_func( | |||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| family(LOAD_CONST, 0) = { | ||||||||||||||||||||||||||||||||||||||||||
| LOAD_CONST_MORTAL, | ||||||||||||||||||||||||||||||||||||||||||
| LOAD_CONST_IMMORTAL, | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| pure inst(LOAD_CONST, (-- value)) { | ||||||||||||||||||||||||||||||||||||||||||
| value = PyStackRef_FromPyObjectNew(GETITEM(FRAME_CO_CONSTS, oparg)); | ||||||||||||||||||||||||||||||||||||||||||
| inst(LOAD_CONST, (-- value)) { | ||||||||||||||||||||||||||||||||||||||||||
| /* We can't do this in the bytecode compiler as | ||||||||||||||||||||||||||||||||||||||||||
| * marshalling can intern strings and make them immortal. */ | ||||||||||||||||||||||||||||||||||||||||||
| PyObject *obj = GETITEM(FRAME_CO_CONSTS, oparg); | ||||||||||||||||||||||||||||||||||||||||||
| value = PyStackRef_FromPyObjectNew(obj); | ||||||||||||||||||||||||||||||||||||||||||
| #if ENABLE_SPECIALIZATION | ||||||||||||||||||||||||||||||||||||||||||
| if (this_instr->op.code == LOAD_CONST) { | ||||||||||||||||||||||||||||||||||||||||||
| this_instr->op.code = _Py_IsImmortal(obj) ? LOAD_CONST_IMMORTAL : LOAD_CONST_MORTAL; | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| #endif | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
Comment thread
Comment on lines
+292
to
+302
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWhy the check for this_instr->op.code == LOAD_CONST? Also, minor, but maybe a bit more idiomatic with the rest of the bytecode definitions to split the specializing part out and reuse the code for loading the const? I think this would also make LOAD_CONST a viable tier two instruction (which it currently isn't). Though actually tracing through one should be rare, I can think of cases where it might happen.
Suggested change
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Instrumentation. The opcode might be INSTRUMENTED_LINE for example.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
The specializing part needs to load the value to test it, so separating out the specialization just duplicates that.
Sorry, something went wrong.
All reactions
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| inst(LOAD_CONST_MORTAL, (-- value)) { | ||||||||||||||||||||||||||||||||||||||||||
| PyObject *obj = GETITEM(FRAME_CO_CONSTS, oparg); | ||||||||||||||||||||||||||||||||||||||||||
| value = PyStackRef_FromPyObjectNew(obj); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| inst(LOAD_CONST_IMMORTAL, (-- value)) { | ||||||||||||||||||||||||||||||||||||||||||
| Expand Down | ||||||||||||||||||||||||||||||||||||||||||
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis is a specialization, right? So we shouldn't need a magic bump (since the specialized variants don't occur in marshalled data).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAdding the extra instruction changes the allocated numbers for other instructions.
Even if it isn't absolutely necessary, it is harmless.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.