sl_compiler::compile::compile_let

Function compile_let_value

Source
fn compile_let_value(
    env: &mut SloshVm,
    state: &mut CompileState,
    val: Value,
    reg: u16,
) -> VMResult<()>
Expand description

Compile a value “out of the way” of the let bindings and then set the target register. For calls that use multiple regs and destructuring lets in use registers can get walked over without this. Use SET not MOV, we don’t want to replace a value that has been captured and SET honors this, MOV does not.