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

core/vm: optimize interpreter by wrapping instructions #476

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Francesco4203
Copy link
Collaborator

@Francesco4203 Francesco4203 commented Jun 19, 2024

For each instruction, the interpreter has to check for many details to make proper actions, using some instruction's constants, before executing it. Wrapping the actions and constants needed for each specific instruction reduce the checking time and memory accessing time.
To generate wrappers for a specific version of an instruction set, run the following (version-name is the desired version, if it is not given, all versions will be generated):

go run ./WrapperCodeGenerator/main.go version-name

@Francesco4203 Francesco4203 force-pushed the optimize-interpreter-by-wrapping-opcodes branch 5 times, most recently from a88a629 to e05d1b9 Compare June 21, 2024 07:06
- for each opcode and each version, assign corresponding wrapper based on the version and opcodeName
- vm/jump_table/ExportInstructionSet: export instruction set attributes based on input version for generating codes, including unsupported instructions of different versions for dummy wrappers
- vm/interpreter: if not debug mode, call wrapper instead of execute opcodes directly
- ExportInstructionSet: export instruction set based on input version to json
- ImportInstructionSet: import instruction set from json
- OpCodeWrapperGenerator: generate wrappers for an instruction set
@Francesco4203 Francesco4203 force-pushed the optimize-interpreter-by-wrapping-opcodes branch from e05d1b9 to ec0f76f Compare July 8, 2024 11:09
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