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

Parse wordcodes in Python 3.6 #621

Merged
merged 6 commits into from Aug 22, 2017

Conversation

Projects
None yet
4 participants
@abonie
Copy link
Contributor

commented Aug 8, 2017

Python 3.6 uses 2 bytes for each instruction (instead of varying number of bytes as in previous versions). This PR will introduce changes to VM that check for Python version to parse bytecode appropriately.

Single wordcode is 2 bytes wide and consists of an opcode and its
argument (or 0 if no argument is used)

TODO opcodes:
EXTENDED_ARG
???

@abonie abonie changed the title [WIP] Parse wordcodes instead of bytecodes [WIP] Parse wordcodes in Python 3.6 Aug 8, 2017

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from fc762b9 to 89269f3 Aug 9, 2017

@cjrh

This comment has been minimized.

Copy link

commented Aug 10, 2017

Just a heads-up I've been tinkering with this in #536. I didn't get very far, but I did get the new dict opcode change done. (It's most other things that are still broken in my PR).

@cjrh

This comment has been minimized.

Copy link

commented Aug 10, 2017

By all means please feel free to take anything that might be useful from my PR. I have very little time available to work on this.

@abonie

This comment has been minimized.

Copy link
Contributor Author

commented Aug 11, 2017

Thanks cjrh, I have not touched the dict changes yet, so it works out.
For now I got sidetracked by the fact, that argument unpacking operators * and ** do not work under any Python version, but I will definitely checkout your PR when I get to dicts.

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from 89269f3 to 80c9d7b Aug 13, 2017

@abonie

This comment has been minimized.

Copy link
Contributor Author

commented Aug 13, 2017

@cjrh if I were to use some of your code from #536 what is the proper way to give you credit? Should I just mention it in commit message?

abonie added some commits Aug 8, 2017

Parse wordcodes instead of bytecodes
Single wordcode is 2 bytes wide and consists of an opcode and its
argument (or 0 if no argument is used)
Implement CALL_FUNCTION_EX opcode
Prior to 3.6 it was called CALL_FUNCTION_VAR_KW and operated in a
slightly different manner

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from 80c9d7b to 046b97c Aug 15, 2017

@cjrh

This comment has been minimized.

Copy link

commented Aug 16, 2017

@abonie Sorry for the delay! No credit necessary, just go for it 👍

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from 42ab2ef to a65bac8 Aug 20, 2017

@abonie abonie changed the title [WIP] Parse wordcodes in Python 3.6 Parse wordcodes in Python 3.6 Aug 20, 2017

this.push(dict)
return
}

VirtualMachine.prototype.byte_STORE_MAP = function() {
switch (constants.BATAVIA_MAGIC) {
case constants.BATAVIA_MAGIC_35:

This comment has been minimized.

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from 1dcc649 to 31a441e Aug 20, 2017

this.push(dict)
return
}

VirtualMachine.prototype.byte_STORE_MAP = function() {
switch (constants.BATAVIA_MAGIC) {
case constants.BATAVIA_MAGIC_35:

This comment has been minimized.

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from 31a441e to 7807adc Aug 20, 2017

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from 7807adc to be5024d Aug 20, 2017

@abonie abonie force-pushed the abonie:wordcode_parsing_for_python_36 branch from b90385b to 42ab063 Aug 21, 2017

@freakboy3742 freakboy3742 merged commit 3908058 into beeware:master Aug 22, 2017

5 checks passed

beekeeper:0/beefore:eslint JavaScript lint checks passed.
Details
beekeeper:0/beefore:pycodestyle Python lint checks passed.
Details
beekeeper:1/smoke-test Smoke build (Python 3.4) passed.
Details
beekeeper:2/full-test:py3.5 Python 3.5 tests: non-critical problem found. Click for details.
Details
beekeeper:2/full-test:py3.6 Python 3.6 tests: non-critical problem found. Click for details.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.