Skip to main content

compile_reg

Function compile_reg 

Source
pub fn compile_reg(program: &ProgramData) -> RegChunk
Expand description

Compile an AST program into register-based bytecode.

Register-based bytecode is more suitable for JIT compilation compared to stack-based bytecode.

ยงExamples

use just::parser::JsParser;
use just::runner::jit;

let code = "var x = 5 + 3;";
let ast = JsParser::parse_to_ast_from_str(code).unwrap();
let chunk = jit::compile_reg(&ast);