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
LibJS: Start fleshing out a bytecode for the JavaScript engine :^)
This patch begins the work of implementing JavaScript execution in abytecode VM instead of an AST tree-walk interpreter.It's probably quite naive, but we have to start somewhere.The basic idea is that you call Bytecode::Generator::generate() on anAST node and it hands you back a Bytecode::Block filled withinstructions that can then be interpreted by a Bytecode::Interpreter.This first version only implements two instructions: Load and Add. :^)Each bytecode block has infinity registers, and the interpreter resizesits register file to fit the block being executed.Two new `js` options are added in this patch as well:`-d` will dump the generated bytecode`-b` will execute the generated bytecodeNote that unless `-d` and/or `-b` are specified, none of the bytecoderelated stuff in LibJS runs at all. This is implemented in parallelwith the existing AST interpreter. :^)