Skip to main content

HelperCall

Enum HelperCall 

Source
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.

Fields

§const_id: u32
§

Unary

Apply unary operator selector op to operand.

Fields

§op: u32
§operand: Value
§

Binary

Apply binary operator selector op to left and right.

Fields

§op: u32
§left: Value
§right: Value
§

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.

Fields

§function_id: u32
§captures: Value
§

GetProperty

object[key].

Fields

§object: Value
§key: Value
§

SetProperty

object[key] = value.

Fields

§object: Value
§key: Value
§value: Value
§

DeleteProperty

delete object[key].

Fields

§object: Value
§key: Value
§

Call

Call callee with receiver this_value over the arguments array.

Fields

§callee: Value
§this_value: Value
§arguments: Value
§

Construct

Construct with callee over the arguments array.

Fields

§callee: Value
§arguments: Value
§

Import

Import the module named by string constant specifier.

Fields

§specifier: u32
§

Truthy

ToBoolean on value. Routed to NativeOps::truthy; present here for a complete algebra but never delivered to NativeOps::dispatch in normal operation.

Fields

§value: Value
§

ResumeValue

The verified resumed value for the current frame.

§

DefineAccessor

Install a getter/setter (kind selector) under key.

Fields

§object: Value
§key: Value
§accessor: Value
§kind: u32
§

LoadGlobal

globalThis[name].

Fields

§name: u32
§

StoreGlobal

globalThis[name] = value.

Fields

§name: u32
§value: Value
§

TypeOfGlobal

typeof globalThis[name].

Fields

§name: u32
§

LoadThis

The this binding.

§

LoadArguments

The arguments object.

§

LoadNewTarget

new.target.

§

ArrayPush

Append value to array.

Fields

§array: Value
§value: Value
§

ArrayExtend

Spread iterable onto the end of array.

Fields

§array: Value
§iterable: Value
§

ObjectSpread

Copy own enumerable properties of source onto target.

Fields

§target: Value
§source: Value
§

SetPrototype

Set the [[Prototype]] of object.

Fields

§object: Value
§prototype: Value
§

CreatePrivateName

A fresh private name described by string constant description.

Fields

§description: u32
§

CreateRegExp

A RegExp from string constants pattern and flags.

Fields

§pattern: u32
§flags: u32
§

GetIterator

Acquire an iterator over src using protocol kind.

Fields

§src: Value
§kind: u32
§

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.

Fields

§iterator: Value
§done_reg: u32
§value_reg: u32
§

Export

Export local value src under string constant name.

Fields

§name: u32
§src: Value
§

ConsumeFuel

Consume amount units from the shared instruction budget.

Fields

§amount: u32

Implementations§

Source§

impl HelperCall

Source

pub const fn helper(&self) -> NativeHelper

The helper this call selects.

Trait Implementations§

Source§

impl Clone for HelperCall

Source§

fn clone(&self) -> HelperCall

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for HelperCall

Source§

impl Debug for HelperCall

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for HelperCall

Source§

fn eq(&self, other: &HelperCall) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HelperCall

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.