Flow control and conditional branching opcodes#229
Merged
jeff5 merged 5 commits intojython:mainfrom Feb 4, 2023
Merged
Conversation
Disassembled byte code sits alongside the compiled code so we can see what we're interpreting.
We add simple examples to exercise them. This discovers a bug in list.__setitem__ (actually PyList.Delegate.setItem) which we fix. We add a PyList constructor from stack slices. (Other PyList change is trivial.)
We access existing comparison implementations from CPython byte code. This allows us to provide examples of if-else and while loops. We fix a minor bug this revealed in PyUnicode.
Member
Author
|
These are fairly routine additions from the Very Slow Jython project although important for confirming that the plain object approach does not lead to dead ends in these basic operations. |
Merge in changes associated with adding a builtins module. The difference for the conditionals is in the tests, where we now create an interpreter explicitly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a opcodes for branching and comparison, and tests them with some common built-in types. We'll include any bug-fixes and enhancements to those types.
This will conflict with other open PRs but that ought to be resolvable. (Good test of process.)