Skip to content

Comments

Flow control and conditional branching opcodes#229

Merged
jeff5 merged 5 commits intojython:mainfrom
jeff5:flow-control-opcodes-3.8
Feb 4, 2023
Merged

Flow control and conditional branching opcodes#229
jeff5 merged 5 commits intojython:mainfrom
jeff5:flow-control-opcodes-3.8

Conversation

@jeff5
Copy link
Member

@jeff5 jeff5 commented Jan 6, 2023

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.)

jeff5 added 4 commits January 6, 2023 12:33
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.
@jeff5 jeff5 marked this pull request as ready for review January 7, 2023 08:38
@jeff5
Copy link
Member Author

jeff5 commented Jan 7, 2023

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.
@jeff5 jeff5 merged commit 8be597d into jython:main Feb 4, 2023
@jeff5 jeff5 deleted the flow-control-opcodes-3.8 branch February 4, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant