Skip to main content

InstructionValue

Enum InstructionValue 

Source
pub enum InstructionValue {
Show 43 variants LoadLocal { place: Place, loc: Option<SourceLocation>, }, LoadContext { place: Place, loc: Option<SourceLocation>, }, DeclareLocal { lvalue: LValue, type_annotation: Option<String>, loc: Option<SourceLocation>, }, DeclareContext { lvalue: LValue, loc: Option<SourceLocation>, }, StoreLocal { lvalue: LValue, value: Place, type_annotation: Option<String>, loc: Option<SourceLocation>, }, StoreContext { lvalue: LValue, value: Place, loc: Option<SourceLocation>, }, Destructure { lvalue: LValuePattern, value: Place, loc: Option<SourceLocation>, }, Primitive { value: PrimitiveValue, loc: Option<SourceLocation>, }, JSXText { value: String, loc: Option<SourceLocation>, }, BinaryExpression { operator: BinaryOperator, left: Place, right: Place, loc: Option<SourceLocation>, }, NewExpression { callee: Place, args: Vec<PlaceOrSpread>, loc: Option<SourceLocation>, }, CallExpression { callee: Place, args: Vec<PlaceOrSpread>, loc: Option<SourceLocation>, }, MethodCall { receiver: Place, property: Place, args: Vec<PlaceOrSpread>, loc: Option<SourceLocation>, }, UnaryExpression { operator: UnaryOperator, value: Place, loc: Option<SourceLocation>, }, TypeCastExpression { value: Place, type_: Type, type_annotation_name: Option<String>, type_annotation_kind: Option<String>, type_annotation: Option<Box<Value>>, loc: Option<SourceLocation>, }, JsxExpression { tag: JsxTag, props: Vec<JsxAttribute>, children: Option<Vec<Place>>, loc: Option<SourceLocation>, opening_loc: Option<SourceLocation>, closing_loc: Option<SourceLocation>, }, ObjectExpression { properties: Vec<ObjectPropertyOrSpread>, loc: Option<SourceLocation>, }, ObjectMethod { loc: Option<SourceLocation>, lowered_func: LoweredFunction, }, ArrayExpression { elements: Vec<ArrayElement>, loc: Option<SourceLocation>, }, JsxFragment { children: Vec<Place>, loc: Option<SourceLocation>, }, RegExpLiteral { pattern: String, flags: String, loc: Option<SourceLocation>, }, MetaProperty { meta: String, property: String, loc: Option<SourceLocation>, }, PropertyStore { object: Place, property: PropertyLiteral, value: Place, loc: Option<SourceLocation>, }, PropertyLoad { object: Place, property: PropertyLiteral, loc: Option<SourceLocation>, }, PropertyDelete { object: Place, property: PropertyLiteral, loc: Option<SourceLocation>, }, ComputedStore { object: Place, property: Place, value: Place, loc: Option<SourceLocation>, }, ComputedLoad { object: Place, property: Place, loc: Option<SourceLocation>, }, ComputedDelete { object: Place, property: Place, loc: Option<SourceLocation>, }, LoadGlobal { binding: NonLocalBinding, loc: Option<SourceLocation>, }, StoreGlobal { name: String, value: Place, loc: Option<SourceLocation>, }, FunctionExpression { name: Option<String>, name_hint: Option<String>, lowered_func: LoweredFunction, expr_type: FunctionExpressionType, loc: Option<SourceLocation>, }, TaggedTemplateExpression { tag: Place, value: TemplateQuasi, loc: Option<SourceLocation>, }, TemplateLiteral { subexprs: Vec<Place>, quasis: Vec<TemplateQuasi>, loc: Option<SourceLocation>, }, Await { value: Place, loc: Option<SourceLocation>, }, GetIterator { collection: Place, loc: Option<SourceLocation>, }, IteratorNext { iterator: Place, collection: Place, loc: Option<SourceLocation>, }, NextPropertyOf { value: Place, loc: Option<SourceLocation>, }, PrefixUpdate { lvalue: Place, operation: UpdateOperator, value: Place, loc: Option<SourceLocation>, }, PostfixUpdate { lvalue: Place, operation: UpdateOperator, value: Place, loc: Option<SourceLocation>, }, Debugger { loc: Option<SourceLocation>, }, StartMemoize { manual_memo_id: u32, deps: Option<Vec<ManualMemoDependency>>, deps_loc: Option<Option<SourceLocation>>, has_invalid_deps: bool, loc: Option<SourceLocation>, }, FinishMemoize { manual_memo_id: u32, decl: Place, pruned: bool, loc: Option<SourceLocation>, }, UnsupportedNode { node_type: Option<String>, original_node: Option<Value>, loc: Option<SourceLocation>, },
}

Variants§

§

LoadLocal

Fields

§place: Place
§

LoadContext

Fields

§place: Place
§

DeclareLocal

Fields

§lvalue: LValue
§type_annotation: Option<String>
§

DeclareContext

Fields

§lvalue: LValue
§

StoreLocal

Fields

§lvalue: LValue
§value: Place
§type_annotation: Option<String>
§

StoreContext

Fields

§lvalue: LValue
§value: Place
§

Destructure

§

Primitive

§

JSXText

Fields

§value: String
§

BinaryExpression

Fields

§left: Place
§right: Place
§

NewExpression

§

CallExpression

§

MethodCall

Fields

§receiver: Place
§property: Place
§

UnaryExpression

Fields

§operator: UnaryOperator
§value: Place
§

TypeCastExpression

Fields

§value: Place
§type_: Type
§type_annotation_name: Option<String>
§type_annotation_kind: Option<String>
§type_annotation: Option<Box<Value>>

The original AST type annotation node, preserved for codegen. For Flow: the inner type from TypeAnnotation.typeAnnotation For TS: the TSType node from TSAsExpression/TSSatisfiesExpression

§

JsxExpression

§

ObjectExpression

§

ObjectMethod

Fields

§lowered_func: LoweredFunction
§

ArrayExpression

§

JsxFragment

Fields

§children: Vec<Place>
§

RegExpLiteral

Fields

§pattern: String
§flags: String
§

MetaProperty

Fields

§meta: String
§property: String
§

PropertyStore

Fields

§object: Place
§value: Place
§

PropertyLoad

Fields

§object: Place
§

PropertyDelete

Fields

§object: Place
§

ComputedStore

Fields

§object: Place
§property: Place
§value: Place
§

ComputedLoad

Fields

§object: Place
§property: Place
§

ComputedDelete

Fields

§object: Place
§property: Place
§

LoadGlobal

§

StoreGlobal

Fields

§name: String
§value: Place
§

FunctionExpression

§

TaggedTemplateExpression

§

TemplateLiteral

Fields

§subexprs: Vec<Place>
§

Await

Fields

§value: Place
§

GetIterator

Fields

§collection: Place
§

IteratorNext

Fields

§iterator: Place
§collection: Place
§

NextPropertyOf

Fields

§value: Place
§

PrefixUpdate

Fields

§lvalue: Place
§operation: UpdateOperator
§value: Place
§

PostfixUpdate

Fields

§lvalue: Place
§operation: UpdateOperator
§value: Place
§

Debugger

§

StartMemoize

Fields

§manual_memo_id: u32
§has_invalid_deps: bool
§

FinishMemoize

Fields

§manual_memo_id: u32
§decl: Place
§pruned: bool
§

UnsupportedNode

Fields

§node_type: Option<String>
§original_node: Option<Value>

The original AST node serialized as JSON, so codegen can emit it verbatim.

Implementations§

Trait Implementations§

Source§

impl Clone for InstructionValue

Source§

fn clone(&self) -> InstructionValue

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 Debug for InstructionValue

Source§

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

Formats the value using the given formatter. Read more

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.