Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.

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
Contributor

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant