Skip to main content

NativeHelper

Enum NativeHelper 

Source
#[repr(u32)]
pub enum NativeHelper {
Show 32 variants LoadConstant = 0, Unary = 1, Binary = 2, CreateObject = 3, CreateArray = 4, CreateClosure = 5, GetProperty = 6, SetProperty = 7, DeleteProperty = 8, Call = 9, Construct = 10, Import = 11, Truthy = 12, ResumeValue = 13, DefineAccessor = 14, LoadGlobal = 15, StoreGlobal = 16, TypeOfGlobal = 17, LoadThis = 18, LoadArguments = 19, LoadNewTarget = 20, ArrayPush = 21, ArrayExtend = 22, ObjectSpread = 23, SetPrototype = 24, CreatePrivateName = 25, CreateRegExp = 26, GetIterator = 27, IteratorNext = 28, Export = 29, ConsumeFuel = 30, CreateCell = 31,
}
Expand description

A runtime helper, identified by its stable ABI index. The variant order is the canonical external_index order (0..31) and is byte-identical to bamts_codegen::Helper; NativeHelper::symbol returns the exact linker symbol generated code resolves against.

Variants§

§

LoadConstant = 0

§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_load_constant — index 0.

§

Unary = 1

§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_unary — index 1.

§

Binary = 2

§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_binary — index 2.

§

CreateObject = 3

§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_create_object — index 3.

§

CreateArray = 4

§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_create_array — index 4.

§

CreateClosure = 5

§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_create_closure — index 5.

§

GetProperty = 6

§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_get_property — index 6.

§

SetProperty = 7

§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_set_property — index 7.

§

DeleteProperty = 8

§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_delete_property — index 8.

§

Call = 9

§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_call — index 9.

§

Construct = 10

§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_construct — index 10.

§

Import = 11

§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_import — index 11.

§

Truthy = 12

§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_truthy — index 12 (returns 0/1, never writes out).

§

ResumeValue = 13

§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_resume_value — index 13.

§

DefineAccessor = 14

§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_define_accessor — index 14.

§

LoadGlobal = 15

§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_load_global — index 15.

§

StoreGlobal = 16

§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_store_global — index 16.

§

TypeOfGlobal = 17

§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_typeof_global — index 17.

§

LoadThis = 18

§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_load_this — index 18.

§

LoadArguments = 19

§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_load_arguments — index 19.

§

LoadNewTarget = 20

§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_load_new_target — index 20.

§

ArrayPush = 21

§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_array_push — index 21.

§

ArrayExtend = 22

§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_array_extend — index 22.

§

ObjectSpread = 23

§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_object_spread — index 23.

§

SetPrototype = 24

§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_set_prototype — index 24.

§

CreatePrivateName = 25

§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_create_private_name — index 25.

§

CreateRegExp = 26

§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_create_regexp — index 26.

§

GetIterator = 27

§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_get_iterator — index 27.

§

IteratorNext = 28

§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_iterator_next — index 28 (writes two registers directly).

§

Export = 29

§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_export — index 29.

§

ConsumeFuel = 30

§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. Both remain valid and unaliased for the full call.

bamts_consume_fuel — index 30.

§

CreateCell = 31

bamts_create_cell — index 31.

§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. Both remain valid and unaliased for the full call.

Implementations§

Source§

impl NativeHelper

Source

pub const fn symbol(self) -> &'static str

The C symbol generated code links against. Byte-identical to

§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_codegen::Helper::symbol.

Source

pub const fn as_u32(self) -> u32

The stable ABI index, 0..HELPER_COUNT.

Source

pub const fn from_u32(index: u32) -> Option<NativeHelper>

Parses an ABI index, rejecting values outside 0..HELPER_COUNT.

Trait Implementations§

Source§

impl Clone for NativeHelper

Source§

fn clone(&self) -> NativeHelper

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 NativeHelper

Source§

impl Debug for NativeHelper

Source§

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

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

impl Eq for NativeHelper

Source§

impl Hash for NativeHelper

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for NativeHelper

Source§

fn cmp(&self, other: &NativeHelper) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for NativeHelper

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PartialOrd for NativeHelper

Source§

fn partial_cmp(&self, other: &NativeHelper) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for NativeHelper

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.