You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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’
@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.
There is an issue here though.
Operations on Values have been promoted to the Value level, so the stack needs to either use Values (which isn’t efficient because it will point to the heap for everything) or each instruction will need to box to a Value do the operation then come back down.
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
Activity
yovoslav commentedon Nov 4, 2019
Has any work been done on this?
jasonwilliams commentedon Nov 4, 2019
@IovoslavIovchev Nope not yet
Razican commentedon May 19, 2020
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
jasonwilliams commentedon May 20, 2020
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
https://docs.google.com/document/d/11T2CRex9hXxoJwbYqVQ32yIPMh0uouUZLdyrtmMoL44/mobilebasic#h.z0c1oogsbnnq
jasonwilliams commentedon Jun 3, 2020
Do we want to come up with a set of instructions that would work for us, that would get the ball rolling
yovoslav commentedon Jun 4, 2020
@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.
jasonwilliams commentedon Jun 4, 2020
Yes i would imagine it being similar to the V8 VM with registers and an accumulator
jasonwilliams commentedon Jun 6, 2020
Will attempt to base of Jason’s example here:
jorendorff@266319f#diff-8a4e02ddeeda9cccf194eab4892b1c1cR162-R167
There is an issue here though.
Operations on Values have been promoted to the Value level, so the stack needs to either use Values (which isn’t efficient because it will point to the heap for everything) or each instruction will need to box to a Value do the operation then come back down.
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
yovoslav commentedon Jun 7, 2020
There is currently a POC branch, with the aim to explore the different options we have.
The current implementation is based on the aforementioned example.
jasonwilliams commentedon Jun 7, 2020
#461 POC from @IovoslavIovchev
I've:
Realm(so that VM can implement Default)CodeGenfor NodeRazican commentedon Jan 2, 2021
Is this really closed?