pub enum HelperCall {
Show 32 variants
LoadConstant {
const_id: u32,
},
Unary {
op: u32,
operand: Value,
},
Binary {
op: u32,
left: Value,
right: Value,
},
CreateObject,
CreateArray,
CreateCell,
CreateClosure {
function_id: u32,
captures: Value,
},
GetProperty {
object: Value,
key: Value,
},
SetProperty {
object: Value,
key: Value,
value: Value,
},
DeleteProperty {
object: Value,
key: Value,
},
Call {
callee: Value,
this_value: Value,
arguments: Value,
},
Construct {
callee: Value,
arguments: Value,
},
Import {
specifier: u32,
},
Truthy {
value: Value,
},
ResumeValue,
DefineAccessor {
object: Value,
key: Value,
accessor: Value,
kind: u32,
},
LoadGlobal {
name: u32,
},
StoreGlobal {
name: u32,
value: Value,
},
TypeOfGlobal {
name: u32,
},
LoadThis,
LoadArguments,
LoadNewTarget,
ArrayPush {
array: Value,
value: Value,
},
ArrayExtend {
array: Value,
iterable: Value,
},
ObjectSpread {
target: Value,
source: Value,
},
SetPrototype {
object: Value,
prototype: Value,
},
CreatePrivateName {
description: u32,
},
CreateRegExp {
pattern: u32,
flags: u32,
},
GetIterator {
src: Value,
kind: u32,
},
IteratorNext {
iterator: Value,
done_reg: u32,
value_reg: u32,
},
Export {
name: u32,
src: Value,
},
ConsumeFuel {
amount: u32,
},
}Expand description
A typed helper invocation. Runtime Values carry their Value type;
operator selectors, string-constant ids, function/register indices, and
protocol kinds are the raw ABI u32 selectors codegen passes (never
§Safety
The caller must provide a live, uniquely owned frame whose nonempty handle
range is disjoint from its header, and a live, aligned, writable out when
this helper has one. Both remain valid and unaliased for the full call.
bamts_bytecode enums — this crate does not depend on the bytecode). The
implicit frame and completion out are supplied by NativeOps::dispatch
and the wrapper, not by the operands here.
Variants§
LoadConstant
Materialize module constant const_id.
Unary
Apply unary operator selector op to operand.
Binary
Apply binary operator selector op to left and right.
CreateObject
A fresh empty object.
CreateArray
A fresh empty array.
CreateCell
A compiler-private array cell seeded with the uninitialized sentinel.
CreateClosure
A closure over function_id binding the captures array value.
GetProperty
object[key].
SetProperty
object[key] = value.
DeleteProperty
delete object[key].
Call
Call callee with receiver this_value over the arguments array.
Construct
Construct with callee over the arguments array.
Import
Import the module named by string constant specifier.
Truthy
ToBoolean on value. Routed to NativeOps::truthy; present here for a
complete algebra but never delivered to NativeOps::dispatch in normal
operation.
ResumeValue
The verified resumed value for the current frame.
DefineAccessor
Install a getter/setter (kind selector) under key.
LoadGlobal
globalThis[name].
StoreGlobal
globalThis[name] = value.
TypeOfGlobal
typeof globalThis[name].
LoadThis
The this binding.
LoadArguments
The arguments object.
LoadNewTarget
new.target.
ArrayPush
Append value to array.
ArrayExtend
Spread iterable onto the end of array.
ObjectSpread
Copy own enumerable properties of source onto target.
SetPrototype
Set the [[Prototype]] of object.
CreatePrivateName
A fresh private name described by string constant description.
CreateRegExp
A RegExp from string constants pattern and flags.
GetIterator
Acquire an iterator over src using protocol kind.
IteratorNext
Advance iterator, writing the done flag into register done_reg and
the produced value into register value_reg (both via the frame). On
Throw, the thrown handle is the result value and neither register is
written.
Export
Export local value src under string constant name.
ConsumeFuel
Consume amount units from the shared instruction budget.
Implementations§
Source§impl HelperCall
impl HelperCall
Sourcepub const fn helper(&self) -> NativeHelper
pub const fn helper(&self) -> NativeHelper
The helper this call selects.
Trait Implementations§
Source§impl Clone for HelperCall
impl Clone for HelperCall
Source§fn clone(&self) -> HelperCall
fn clone(&self) -> HelperCall
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more