Lua.Compiler.Instruction (Lua v1.0.0-rc.1)

View Source

Constructor functions for Lua VM instructions.

Our register-based instruction set. Each instruction is a tagged tuple. Operands are either register indices (integers) or {:constant, value} for inline literals.

Summary

Functions

Creates a constant operand for use in instructions.

Functions

add(dest, a, b, hint_a \\ nil, hint_b \\ nil)

bitwise_and(dest, a, b, hint_a \\ nil, hint_b \\ nil)

bitwise_not(dest, source, hint \\ nil)

bitwise_or(dest, a, b, hint_a \\ nil, hint_b \\ nil)

bitwise_xor(dest, a, b, hint_a \\ nil, hint_b \\ nil)

break_instr()

call(base, arg_count, result_count, name_hint \\ nil)

close_upvalues(threshold)

closure(dest, proto_index)

concatenate(dest, a, b)

constant(value)

Creates a constant operand for use in instructions.

divide(dest, a, b, hint_a \\ nil, hint_b \\ nil)

equal(dest, a, b)

floor_divide(dest, a, b, hint_a \\ nil, hint_b \\ nil)

generic_for(base, var_count, body)

get_field(dest, table, name, name_hint \\ nil)

get_global(dest, name)

get_open_upvalue(dest, reg)

get_table(dest, table, key, name_hint \\ nil)

get_upvalue(dest, index)

length(dest, source)

less_equal(dest, a, b)

less_than(dest, a, b)

load_boolean(dest, value)

load_constant(dest, value)

load_env(dest)

load_nil(dest, count)

logical_not(dest, source)

modulo(dest, a, b, hint_a \\ nil, hint_b \\ nil)

move(dest, source)

multiply(dest, a, b, hint_a \\ nil, hint_b \\ nil)

negate(dest, source, hint \\ nil)

new_table(dest, array_hint \\ 0, hash_hint \\ 0)

numeric_for(base, loop_var, body)

power(dest, a, b, hint_a \\ nil, hint_b \\ nil)

repeat_loop(loop_body, condition_body, test_reg)

return_instr(base, count)

return_vararg()

scope(register_count, body)

self_instr(base, object, method_name, name_hint \\ nil)

set_field(table, name, value, name_hint \\ nil)

set_global(name, source)

set_list(table, start, count, offset)

set_open_upvalue(reg, source)

set_table(table, key, value, name_hint \\ nil)

set_upvalue(index, source)

shift_left(dest, a, b, hint_a \\ nil, hint_b \\ nil)

shift_right(dest, a, b, hint_a \\ nil, hint_b \\ nil)

source_line(line, file)

subtract(dest, a, b, hint_a \\ nil, hint_b \\ nil)

tail_call(base, arg_count, name_hint \\ nil)

test(register, then_body, else_body)

test_and(dest, source, rest_body)

test_or(dest, source, rest_body)

vararg(base, count)

while_loop(condition_body, test_reg, loop_body)