-
Notifications
You must be signed in to change notification settings - Fork 676
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
Rework VM dispatch #4967
Open
rerobika
wants to merge
1
commit into
jerryscript-project:master
Choose a base branch
from
rerobika:rework_vm_dispatch_2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rework VM dispatch #4967
Conversation
This file contains 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
rerobika
added
performance
Affects performance
interpreter
Related to the virtual machine
stack usage
Affects stack usage
labels
Jan 19, 2022
|
rerobika
force-pushed
the
rework_vm_dispatch_2
branch
2 times, most recently
from
January 19, 2022 11:28
a50bb28
to
03b8e31
Compare
ossy-szeged
reviewed
Jan 19, 2022
rerobika
force-pushed
the
rework_vm_dispatch_2
branch
2 times, most recently
from
January 19, 2022 12:25
12af4cc
to
b9e60a5
Compare
Overview: - `VM_OC_*` opcodes are removed, now the dispatch is based on the `CBC`/`CBC_EXT` opcode - The common argument decoding is removed, now each opcode resolves it's arguments individually using `VM_DECODE_{EXT}_...` macros. Whenever an argument is decoded the dispatcher continues with the same opcode increased by `VM_OPCODE_DECODED_ARG`. - E.g.: A opcode with 2 literal arguments dispatches as the following: - step_1: `case opcode: goto resolve_first_literal`, opcode increment by `VM_OPCODE_DECODED_ARG`, dispatch again (Hidden by macro) - step_2: `case VM_OPCODE_ONE_LITERAL(opcode): goto resolve_second_literal`, opcode increment by `VM_OPCODE_DECODED_ARG`, dispatch again (Hidden by macro) - step_3: `case VM_OPCODE_TWO_LITERALS (opcode):` Opcode handler implementation goes here. - The opcode handler implementation goes as the following: ```c case VM_OPCODE_TWO_LITERALS (opcode): { VM_DECODE_LITERAL_LITERAL (opcode); /* use left and right value as before */ } ``` - The put result block is optimized, each assignment knows whether an ident or property reference should be resolved - `free_left_value` and `free_both_values` labels are removed, due to the extra long jumps they caused to execute 1 or 2 simple calls. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
rerobika
force-pushed
the
rework_vm_dispatch_2
branch
from
January 20, 2022 13:55
b9e60a5
to
cc74bcc
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
abandoned
Abandoned by reviewers or author
interpreter
Related to the virtual machine
performance
Affects performance
stack usage
Affects stack usage
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.
Overview:
VM_OC_*
opcodes are removed, now the dispatch is based on theCBC
/CBC_EXT
opcodeVM_DECODE_{EXT}_...
macros. Whenever an argument is decoded the dispatcher continues with the same opcode increased byVM_OPCODE_DECODED_ARG
.case opcode: goto resolve_first_literal
, opcode increment byVM_OPCODE_DECODED_ARG
, dispatch again (Hidden by macro)case VM_OPCODE_ONE_LITERAL(opcode): goto resolve_second_literal
, opcode increment byVM_OPCODE_DECODED_ARG
, dispatch again (Hidden by macro)case VM_OPCODE_TWO_LITERALS (opcode):
Opcode handler implementation goes here.free_left_value
andfree_both_values
labels are removed, due to the extra long jumps they caused to execute 1 or 2 simple calls.JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]