-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Generate Bytecode #167
Comments
Has any work been done on this? |
@IovoslavIovchev Nope not yet |
This will require a fundamental change on how the interpreter works, but it would be very useful to cache bytecode in the future, and to implement an optimization pass (or multiple optimization passes). Some overview on how V8 does this can be found here: https://v8.dev/blog/ignition-interpreter |
My guess is a new interpreter would be created along side the current one which reads the AST and generates bytecode, there would most likely be a switch for a while ‘—bytecode’ Design doc for ignition |
Do we want to come up with a set of instructions that would work for us, that would get the ball rolling |
@jasonwilliams are there any ideas for the VM design/any work done? Are we aiming for a register-based VM? I reckon we need to have some idea what the VM is going to be like before we come up with the instruction set. |
Yes i would imagine it being similar to the V8 VM with registers and an accumulator |
Will attempt to base of Jason’s example here: There is an issue here though. For now we will need to do the former, but in future we may have to refactor Values again, so that they’re not so coupled with the Gc. Similar to the Executable trait we will need a CodeGen trait that each node implements |
#461 POC from @IovoslavIovchev
|
Is this really closed? |
Issue here to keep track of.
At some point generating bytecode would be needed.
Example from Rapidus:
https://github.com/maekawatoshiki/rapidus/blob/new-gen/src/bytecode_gen.rs#L474-L558
Spidermonkey:
https://dxr.mozilla.org/mozilla-central/source/js/src/vm/Opcodes.h
V8:
https://github.com/v8/v8/blob/master/src/compiler/opcodes.h
The text was updated successfully, but these errors were encountered: