pub enum JitProtoState {
Untried,
Failed,
Compiled {
entry: *const u8,
num_args: u8,
returns_one: bool,
arg_float_mask: u8,
arg_table_mask: u8,
ret_is_float: bool,
ret_is_table: bool,
},
}Expand description
P11-S2 / S2c — per-Proto JIT cache state. Copy so it fits a plain
Cell on the dispatch hot path (no RefCell borrow check); the
fn pointer’s mmap is kept alive by Vm.jit_handles.
Variants§
Untried
Compilation hasn’t been attempted yet.
Failed
Compilation was attempted and the body fell outside the whitelist; subsequent calls skip the attempt.
Compiled
Native code is installed and callable through the recorded entry.
Fields
entry: *const u8Raw mmap’d code address. Transmute to the
unsafe extern "C" fn(i64, …) -> i64 shape matching
num_args at the call site.
returns_one: boolTrue when the Lua chunk terminates with Return1 (single
observable return value). False means the chunk only
side-effects + Return0 — host gets an empty Vec<Value>
from Vm::call_value, an interpreter Op::Call gets
zero results pushed (PUC nresults handling).
arg_float_mask: u8P11-S3 — per-arg Float bit. Bit i = 1 ↔ arg slot i
is f64 (passed as i64 bit-pattern across the ABI, bitcast
inside the JIT). Bit i = 0 ↔ Int. Bits ≥ MAX_JIT_ARITY
are zero.
arg_table_mask: u8P11-S5d — per-arg Table bit. Bit i = 1 ↔ arg slot i
is Gc<Table> raw ptr (passed as the i64 pointer value
directly, since Gc<Table> is NonNull<Table> =
pointer-shaped). Mutually exclusive with arg_float_mask
for the same bit. Required so try_jit_call_op’s arg
marshalling can accept Value::Table(t) and pack
t.as_ptr() as i64; without it a Table arg would fall
into the dispatcher’s default-deny match arm and the
callee couldn’t be reached via JIT.
Trait Implementations§
Source§impl Clone for JitProtoState
impl Clone for JitProtoState
Source§fn clone(&self) -> JitProtoState
fn clone(&self) -> JitProtoState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more