Browse Source

Generate `Opcode` impl using macro (#2391)

This reduces a lot of the repetition from the `Opcode` functions and makes it easier to add a new Op.
pull/2396/head
José Julián Espina 2 years ago
parent
commit
18824baba8
  1. 172
      boa_engine/src/vm/mod.rs
  2. 415
      boa_engine/src/vm/opcode/mod.rs

172
boa_engine/src/vm/mod.rs

@ -15,9 +15,6 @@ mod call_frame;
mod code_block;
mod opcode;
#[allow(clippy::wildcard_imports)]
use opcode::*;
pub use {call_frame::CallFrame, code_block::CodeBlock, opcode::Opcode};
pub(crate) use {
@ -126,174 +123,7 @@ impl Context {
let _timer = Profiler::global().start_event(opcode.as_instruction_str(), "vm");
let result = match opcode {
Opcode::Nop => Nop::execute(self)?,
Opcode::Pop => Pop::execute(self)?,
Opcode::PopIfThrown => PopIfThrown::execute(self)?,
Opcode::Dup => Dup::execute(self)?,
Opcode::Swap => Swap::execute(self)?,
Opcode::RotateLeft => RotateLeft::execute(self)?,
Opcode::RotateRight => RotateRight::execute(self)?,
Opcode::PushUndefined => PushUndefined::execute(self)?,
Opcode::PushNull => PushNull::execute(self)?,
Opcode::PushTrue => PushTrue::execute(self)?,
Opcode::PushFalse => PushFalse::execute(self)?,
Opcode::PushZero => PushZero::execute(self)?,
Opcode::PushOne => PushOne::execute(self)?,
Opcode::PushInt8 => PushInt8::execute(self)?,
Opcode::PushInt16 => PushInt16::execute(self)?,
Opcode::PushInt32 => PushInt32::execute(self)?,
Opcode::PushRational => PushRational::execute(self)?,
Opcode::PushNaN => PushNaN::execute(self)?,
Opcode::PushPositiveInfinity => PushPositiveInfinity::execute(self)?,
Opcode::PushNegativeInfinity => PushNegativeInfinity::execute(self)?,
Opcode::PushLiteral => PushLiteral::execute(self)?,
Opcode::PushEmptyObject => PushEmptyObject::execute(self)?,
Opcode::PushClassPrototype => PushClassPrototype::execute(self)?,
Opcode::SetClassPrototype => SetClassPrototype::execute(self)?,
Opcode::SetHomeObject => SetHomeObject::execute(self)?,
Opcode::PushNewArray => PushNewArray::execute(self)?,
Opcode::PushValueToArray => PushValueToArray::execute(self)?,
Opcode::PushElisionToArray => PushElisionToArray::execute(self)?,
Opcode::PushIteratorToArray => PushIteratorToArray::execute(self)?,
Opcode::Add => Add::execute(self)?,
Opcode::Sub => Sub::execute(self)?,
Opcode::Mul => Mul::execute(self)?,
Opcode::Div => Div::execute(self)?,
Opcode::Pow => Pow::execute(self)?,
Opcode::Mod => Mod::execute(self)?,
Opcode::BitAnd => BitAnd::execute(self)?,
Opcode::BitOr => BitOr::execute(self)?,
Opcode::BitXor => BitXor::execute(self)?,
Opcode::ShiftLeft => ShiftLeft::execute(self)?,
Opcode::ShiftRight => ShiftRight::execute(self)?,
Opcode::UnsignedShiftRight => UnsignedShiftRight::execute(self)?,
Opcode::Eq => Eq::execute(self)?,
Opcode::NotEq => NotEq::execute(self)?,
Opcode::StrictEq => StrictEq::execute(self)?,
Opcode::StrictNotEq => StrictNotEq::execute(self)?,
Opcode::GreaterThan => GreaterThan::execute(self)?,
Opcode::GreaterThanOrEq => GreaterThanOrEq::execute(self)?,
Opcode::LessThan => LessThan::execute(self)?,
Opcode::LessThanOrEq => LessThanOrEq::execute(self)?,
Opcode::In => In::execute(self)?,
Opcode::InstanceOf => InstanceOf::execute(self)?,
Opcode::Void => Void::execute(self)?,
Opcode::TypeOf => TypeOf::execute(self)?,
Opcode::Pos => Pos::execute(self)?,
Opcode::Neg => Neg::execute(self)?,
Opcode::Inc => Inc::execute(self)?,
Opcode::IncPost => IncPost::execute(self)?,
Opcode::Dec => Dec::execute(self)?,
Opcode::DecPost => DecPost::execute(self)?,
Opcode::LogicalNot => LogicalNot::execute(self)?,
Opcode::BitNot => BitNot::execute(self)?,
Opcode::DefVar => DefVar::execute(self)?,
Opcode::DefInitVar => DefInitVar::execute(self)?,
Opcode::DefLet => DefLet::execute(self)?,
Opcode::DefInitLet => DefInitLet::execute(self)?,
Opcode::DefInitConst => DefInitConst::execute(self)?,
Opcode::DefInitArg => DefInitArg::execute(self)?,
Opcode::GetName => GetName::execute(self)?,
Opcode::GetNameOrUndefined => GetNameOrUndefined::execute(self)?,
Opcode::SetName => SetName::execute(self)?,
Opcode::Jump => Jump::execute(self)?,
Opcode::JumpIfFalse => JumpIfFalse::execute(self)?,
Opcode::JumpIfNotUndefined => JumpIfNotUndefined::execute(self)?,
Opcode::JumpIfNullOrUndefined => JumpIfNullOrUndefined::execute(self)?,
Opcode::LogicalAnd => LogicalAnd::execute(self)?,
Opcode::LogicalOr => LogicalOr::execute(self)?,
Opcode::Coalesce => Coalesce::execute(self)?,
Opcode::ToBoolean => ToBoolean::execute(self)?,
Opcode::GetPropertyByName => GetPropertyByName::execute(self)?,
Opcode::GetPropertyByValue => GetPropertyByValue::execute(self)?,
Opcode::GetPropertyByValuePush => GetPropertyByValuePush::execute(self)?,
Opcode::SetPropertyByName => SetPropertyByName::execute(self)?,
Opcode::DefineOwnPropertyByName => DefineOwnPropertyByName::execute(self)?,
Opcode::DefineClassMethodByName => DefineClassMethodByName::execute(self)?,
Opcode::SetPropertyByValue => SetPropertyByValue::execute(self)?,
Opcode::DefineOwnPropertyByValue => DefineOwnPropertyByValue::execute(self)?,
Opcode::DefineClassMethodByValue => DefineClassMethodByValue::execute(self)?,
Opcode::SetPropertyGetterByName => SetPropertyGetterByName::execute(self)?,
Opcode::DefineClassGetterByName => DefineClassGetterByName::execute(self)?,
Opcode::SetPropertyGetterByValue => SetPropertyGetterByValue::execute(self)?,
Opcode::DefineClassGetterByValue => DefineClassGetterByValue::execute(self)?,
Opcode::SetPropertySetterByName => SetPropertySetterByName::execute(self)?,
Opcode::DefineClassSetterByName => DefineClassSetterByName::execute(self)?,
Opcode::SetPropertySetterByValue => SetPropertySetterByValue::execute(self)?,
Opcode::DefineClassSetterByValue => DefineClassSetterByValue::execute(self)?,
Opcode::AssignPrivateField => AssignPrivateField::execute(self)?,
Opcode::SetPrivateField => SetPrivateField::execute(self)?,
Opcode::SetPrivateMethod => SetPrivateMethod::execute(self)?,
Opcode::SetPrivateSetter => SetPrivateSetter::execute(self)?,
Opcode::SetPrivateGetter => SetPrivateGetter::execute(self)?,
Opcode::GetPrivateField => GetPrivateField::execute(self)?,
Opcode::PushClassField => PushClassField::execute(self)?,
Opcode::PushClassFieldPrivate => PushClassFieldPrivate::execute(self)?,
Opcode::PushClassPrivateGetter => PushClassPrivateGetter::execute(self)?,
Opcode::PushClassPrivateSetter => PushClassPrivateSetter::execute(self)?,
Opcode::PushClassPrivateMethod => PushClassPrivateMethod::execute(self)?,
Opcode::DeletePropertyByName => DeletePropertyByName::execute(self)?,
Opcode::DeletePropertyByValue => DeletePropertyByValue::execute(self)?,
Opcode::CopyDataProperties => CopyDataProperties::execute(self)?,
Opcode::ToPropertyKey => ToPropertyKey::execute(self)?,
Opcode::Throw => Throw::execute(self)?,
Opcode::TryStart => TryStart::execute(self)?,
Opcode::TryEnd => TryEnd::execute(self)?,
Opcode::CatchEnd => CatchEnd::execute(self)?,
Opcode::CatchStart => CatchStart::execute(self)?,
Opcode::CatchEnd2 => CatchEnd2::execute(self)?,
Opcode::FinallyStart => FinallyStart::execute(self)?,
Opcode::FinallyEnd => FinallyEnd::execute(self)?,
Opcode::FinallySetJump => FinallySetJump::execute(self)?,
Opcode::This => This::execute(self)?,
Opcode::Super => Super::execute(self)?,
Opcode::SuperCall => SuperCall::execute(self)?,
Opcode::SuperCallSpread => SuperCallSpread::execute(self)?,
Opcode::SuperCallDerived => SuperCallDerived::execute(self)?,
Opcode::Case => Case::execute(self)?,
Opcode::Default => Default::execute(self)?,
Opcode::GetArrowFunction => GetArrowFunction::execute(self)?,
Opcode::GetFunction => GetFunction::execute(self)?,
Opcode::GetFunctionAsync => GetFunctionAsync::execute(self)?,
Opcode::GetGenerator => GetGenerator::execute(self)?,
Opcode::GetGeneratorAsync => GetGeneratorAsync::execute(self)?,
Opcode::CallEval => CallEval::execute(self)?,
Opcode::CallEvalSpread => CallEvalSpread::execute(self)?,
Opcode::Call => Call::execute(self)?,
Opcode::CallSpread => CallSpread::execute(self)?,
Opcode::New => New::execute(self)?,
Opcode::NewSpread => NewSpread::execute(self)?,
Opcode::Return => Return::execute(self)?,
Opcode::PushDeclarativeEnvironment => PushDeclarativeEnvironment::execute(self)?,
Opcode::PushFunctionEnvironment => PushFunctionEnvironment::execute(self)?,
Opcode::PopEnvironment => PopEnvironment::execute(self)?,
Opcode::LoopStart => LoopStart::execute(self)?,
Opcode::LoopContinue => LoopContinue::execute(self)?,
Opcode::LoopEnd => LoopEnd::execute(self)?,
Opcode::ForInLoopInitIterator => ForInLoopInitIterator::execute(self)?,
Opcode::InitIterator => InitIterator::execute(self)?,
Opcode::InitIteratorAsync => InitIteratorAsync::execute(self)?,
Opcode::IteratorNext => IteratorNext::execute(self)?,
Opcode::IteratorClose => IteratorClose::execute(self)?,
Opcode::IteratorToArray => IteratorToArray::execute(self)?,
Opcode::ForInLoopNext => ForInLoopNext::execute(self)?,
Opcode::ForAwaitOfLoopIterate => ForAwaitOfLoopIterate::execute(self)?,
Opcode::ForAwaitOfLoopNext => ForAwaitOfLoopNext::execute(self)?,
Opcode::ConcatToString => ConcatToString::execute(self)?,
Opcode::RequireObjectCoercible => RequireObjectCoercible::execute(self)?,
Opcode::ValueNotNullOrUndefined => ValueNotNullOrUndefined::execute(self)?,
Opcode::RestParameterInit => RestParameterInit::execute(self)?,
Opcode::RestParameterPop => RestParameterPop::execute(self)?,
Opcode::PopOnReturnAdd => PopOnReturnAdd::execute(self)?,
Opcode::PopOnReturnSub => PopOnReturnSub::execute(self)?,
Opcode::Yield => Yield::execute(self)?,
Opcode::GeneratorNext => GeneratorNext::execute(self)?,
Opcode::AsyncGeneratorNext => AsyncGeneratorNext::execute(self)?,
Opcode::GeneratorNextDelegate => GeneratorNextDelegate::execute(self)?,
Opcode::Await => Await::execute(self)?,
Opcode::PushNewTarget => PushNewTarget::execute(self)?,
};
let result = opcode.execute(self)?;
Ok(result)
}

415
boa_engine/src/vm/opcode/mod.rs

@ -92,9 +92,66 @@ pub(crate) use unary_ops::*;
#[doc(inline)]
pub(crate) use value::*;
/// The `Operation` trait implements the execution code along with the
/// identifying Name and Instruction value for an Boa Opcode
macro_rules! generate_impl {
(
$(#[$outer:meta])*
pub enum $Type:ident {
$(
$(#[$inner:ident $($args:tt)*])*
$Variant:ident
),*
$(,)?
}
) => {
$(#[$outer])*
pub enum $Type {
$(
$(#[$inner $($args)*])*
$Variant
),*
}
impl $Type {
/// Create opcode from `u8` byte.
///
/// # Safety
///
/// Does not check if `u8` type is a valid `Opcode`.
pub unsafe fn from_raw(value: u8) -> Self {
std::mem::transmute(value)
}
pub fn as_str(self) -> &'static str {
match self {
$(
Self::$Variant => $Variant::NAME
),*
}
}
/// Name of the profiler event for this opcode
pub fn as_instruction_str(self) -> &'static str {
match self {
$(
Self::$Variant => $Variant::INSTRUCTION
),*
}
}
pub(super) fn execute(self, context: &mut Context) -> JsResult<ShouldExit> {
match self {
$(
Self::$Variant => $Variant::execute(context)
),*
}
}
}
};
}
/// The `Operation` trait implements the execution code along with the
/// identifying Name and Instruction value for an Boa Opcode.
///
/// This trait should be implemented for a struct that corresponds with
/// any arm of the `OpCode` enum.
@ -106,6 +163,7 @@ pub(crate) trait Operation {
fn execute(context: &mut Context) -> JsResult<ShouldExit>;
}
generate_impl! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(u8)]
pub enum Opcode {
@ -1342,359 +1400,6 @@ pub enum Opcode {
// in TryFrom<u8> impl.
Nop,
}
impl Opcode {
/// Create opcode from `u8` byte.
///
/// # Safety
///
/// Does not check if `u8` type is a valid `Opcode`.
pub unsafe fn from_raw(value: u8) -> Self {
std::mem::transmute(value)
}
pub fn as_str(self) -> &'static str {
match self {
Self::Pop => Pop::NAME,
Self::PopIfThrown => PopIfThrown::NAME,
Self::Dup => Dup::NAME,
Self::Swap => Swap::NAME,
Self::RotateLeft => RotateLeft::NAME,
Self::RotateRight => RotateRight::NAME,
Self::PushZero => PushZero::NAME,
Self::PushOne => PushOne::NAME,
Self::PushInt8 => PushInt8::NAME,
Self::PushInt16 => PushInt16::NAME,
Self::PushInt32 => PushInt32::NAME,
Self::PushRational => PushRational::NAME,
Self::PushNaN => PushNaN::NAME,
Self::PushPositiveInfinity => PushPositiveInfinity::NAME,
Self::PushNegativeInfinity => PushNegativeInfinity::NAME,
Self::PushNull => PushNull::NAME,
Self::PushTrue => PushTrue::NAME,
Self::PushFalse => PushFalse::NAME,
Self::PushUndefined => PushUndefined::NAME,
Self::PushLiteral => PushLiteral::NAME,
Self::PushEmptyObject => PushEmptyObject::NAME,
Self::PushClassPrototype => PushClassPrototype::NAME,
Self::SetClassPrototype => SetClassPrototype::NAME,
Self::SetHomeObject => SetHomeObject::NAME,
Self::PushNewArray => PushNewArray::NAME,
Self::PushValueToArray => PushValueToArray::NAME,
Self::PushElisionToArray => PushElisionToArray::NAME,
Self::PushIteratorToArray => PushIteratorToArray::NAME,
Self::Add => Add::NAME,
Self::Sub => Sub::NAME,
Self::Div => Div::NAME,
Self::Mul => Mul::NAME,
Self::Mod => Mod::NAME,
Self::Pow => Pow::NAME,
Self::ShiftRight => ShiftRight::NAME,
Self::ShiftLeft => ShiftLeft::NAME,
Self::UnsignedShiftRight => UnsignedShiftRight::NAME,
Self::BitOr => BitOr::NAME,
Self::BitAnd => BitAnd::NAME,
Self::BitXor => BitXor::NAME,
Self::BitNot => BitNot::NAME,
Self::In => In::NAME,
Self::Eq => Eq::NAME,
Self::StrictEq => StrictEq::NAME,
Self::NotEq => NotEq::NAME,
Self::StrictNotEq => StrictNotEq::NAME,
Self::GreaterThan => GreaterThan::NAME,
Self::GreaterThanOrEq => GreaterThanOrEq::NAME,
Self::LessThan => LessThan::NAME,
Self::LessThanOrEq => LessThanOrEq::NAME,
Self::InstanceOf => InstanceOf::NAME,
Self::TypeOf => TypeOf::NAME,
Self::Void => Void::NAME,
Self::LogicalNot => LogicalNot::NAME,
Self::LogicalAnd => LogicalAnd::NAME,
Self::LogicalOr => LogicalOr::NAME,
Self::Coalesce => Coalesce::NAME,
Self::Pos => Pos::NAME,
Self::Neg => Neg::NAME,
Self::Inc => Inc::NAME,
Self::IncPost => IncPost::NAME,
Self::Dec => Dec::NAME,
Self::DecPost => DecPost::NAME,
Self::DefInitArg => DefInitArg::NAME,
Self::DefVar => DefVar::NAME,
Self::DefInitVar => DefInitVar::NAME,
Self::DefLet => DefLet::NAME,
Self::DefInitLet => DefInitLet::NAME,
Self::DefInitConst => DefInitConst::NAME,
Self::GetName => GetName::NAME,
Self::GetNameOrUndefined => GetNameOrUndefined::NAME,
Self::SetName => SetName::NAME,
Self::GetPropertyByName => GetPropertyByName::NAME,
Self::GetPropertyByValue => GetPropertyByValue::NAME,
Self::GetPropertyByValuePush => GetPropertyByValuePush::NAME,
Self::SetPropertyByName => SetPropertyByName::NAME,
Self::DefineOwnPropertyByName => DefineOwnPropertyByName::NAME,
Self::DefineClassMethodByName => DefineClassMethodByName::NAME,
Self::SetPropertyByValue => SetPropertyByValue::NAME,
Self::DefineOwnPropertyByValue => DefineOwnPropertyByValue::NAME,
Self::DefineClassMethodByValue => DefineClassMethodByValue::NAME,
Self::SetPropertyGetterByName => SetPropertyGetterByName::NAME,
Self::DefineClassGetterByName => DefineClassGetterByName::NAME,
Self::SetPropertyGetterByValue => SetPropertyGetterByValue::NAME,
Self::DefineClassGetterByValue => DefineClassGetterByValue::NAME,
Self::SetPropertySetterByName => SetPropertySetterByName::NAME,
Self::DefineClassSetterByName => DefineClassSetterByName::NAME,
Self::SetPropertySetterByValue => SetPropertySetterByValue::NAME,
Self::DefineClassSetterByValue => DefineClassSetterByValue::NAME,
Self::AssignPrivateField => AssignPrivateField::NAME,
Self::SetPrivateField => SetPrivateField::NAME,
Self::SetPrivateMethod => SetPrivateMethod::NAME,
Self::SetPrivateSetter => SetPrivateSetter::NAME,
Self::SetPrivateGetter => SetPrivateGetter::NAME,
Self::GetPrivateField => GetPrivateField::NAME,
Self::PushClassField => PushClassField::NAME,
Self::PushClassFieldPrivate => PushClassFieldPrivate::NAME,
Self::PushClassPrivateGetter => PushClassPrivateGetter::NAME,
Self::PushClassPrivateSetter => PushClassPrivateSetter::NAME,
Self::PushClassPrivateMethod => PushClassPrivateMethod::NAME,
Self::DeletePropertyByName => DeletePropertyByName::NAME,
Self::DeletePropertyByValue => DeletePropertyByValue::NAME,
Self::CopyDataProperties => CopyDataProperties::NAME,
Self::ToPropertyKey => ToPropertyKey::NAME,
Self::Jump => Jump::NAME,
Self::JumpIfFalse => JumpIfFalse::NAME,
Self::JumpIfNotUndefined => JumpIfNotUndefined::NAME,
Self::JumpIfNullOrUndefined => JumpIfNullOrUndefined::NAME,
Self::Throw => Throw::NAME,
Self::TryStart => TryStart::NAME,
Self::TryEnd => TryEnd::NAME,
Self::CatchStart => CatchStart::NAME,
Self::CatchEnd => CatchEnd::NAME,
Self::CatchEnd2 => CatchEnd2::NAME,
Self::FinallyStart => FinallyStart::NAME,
Self::FinallyEnd => FinallyEnd::NAME,
Self::FinallySetJump => FinallySetJump::NAME,
Self::ToBoolean => ToBoolean::NAME,
Self::This => This::NAME,
Self::Super => Super::NAME,
Self::SuperCall => SuperCall::NAME,
Self::SuperCallSpread => SuperCallSpread::NAME,
Self::SuperCallDerived => SuperCallDerived::NAME,
Self::Case => Case::NAME,
Self::Default => Default::NAME,
Self::GetArrowFunction => GetArrowFunction::NAME,
Self::GetFunction => GetFunction::NAME,
Self::GetFunctionAsync => GetFunctionAsync::NAME,
Self::GetGenerator => GetGenerator::NAME,
Self::GetGeneratorAsync => GetGeneratorAsync::NAME,
Self::CallEval => CallEval::NAME,
Self::CallEvalSpread => CallEvalSpread::NAME,
Self::Call => Call::NAME,
Self::CallSpread => CallSpread::NAME,
Self::New => New::NAME,
Self::NewSpread => NewSpread::NAME,
Self::Return => Return::NAME,
Self::PushDeclarativeEnvironment => PushDeclarativeEnvironment::NAME,
Self::PushFunctionEnvironment => PushFunctionEnvironment::NAME,
Self::PopEnvironment => PopEnvironment::NAME,
Self::LoopStart => LoopStart::NAME,
Self::LoopContinue => LoopContinue::NAME,
Self::LoopEnd => LoopEnd::NAME,
Self::ForInLoopInitIterator => ForInLoopInitIterator::NAME,
Self::InitIterator => InitIterator::NAME,
Self::InitIteratorAsync => InitIteratorAsync::NAME,
Self::IteratorNext => IteratorNext::NAME,
Self::IteratorClose => IteratorClose::NAME,
Self::IteratorToArray => IteratorToArray::NAME,
Self::ForInLoopNext => ForInLoopNext::NAME,
Self::ForAwaitOfLoopNext => ForAwaitOfLoopNext::NAME,
Self::ForAwaitOfLoopIterate => ForAwaitOfLoopIterate::NAME,
Self::ConcatToString => ConcatToString::NAME,
Self::RequireObjectCoercible => RequireObjectCoercible::NAME,
Self::ValueNotNullOrUndefined => ValueNotNullOrUndefined::NAME,
Self::RestParameterInit => RestParameterInit::NAME,
Self::RestParameterPop => RestParameterPop::NAME,
Self::PopOnReturnAdd => PopOnReturnAdd::NAME,
Self::PopOnReturnSub => PopOnReturnSub::NAME,
Self::Yield => Yield::NAME,
Self::GeneratorNext => GeneratorNext::NAME,
Self::AsyncGeneratorNext => AsyncGeneratorNext::NAME,
Self::Await => Await::NAME,
Self::PushNewTarget => PushNewTarget::NAME,
Self::GeneratorNextDelegate => GeneratorNextDelegate::NAME,
Self::Nop => Nop::NAME,
}
}
/// Name of the profiler event for this opcode
pub fn as_instruction_str(self) -> &'static str {
match self {
Self::Pop => Pop::INSTRUCTION,
Self::PopIfThrown => PopIfThrown::INSTRUCTION,
Self::Dup => Dup::INSTRUCTION,
Self::Swap => Swap::INSTRUCTION,
Self::RotateLeft => RotateLeft::INSTRUCTION,
Self::RotateRight => RotateRight::INSTRUCTION,
Self::PushZero => PushZero::INSTRUCTION,
Self::PushOne => PushOne::INSTRUCTION,
Self::PushInt8 => PushInt8::INSTRUCTION,
Self::PushInt16 => PushInt16::INSTRUCTION,
Self::PushInt32 => PushInt32::INSTRUCTION,
Self::PushRational => PushRational::INSTRUCTION,
Self::PushNaN => PushNaN::INSTRUCTION,
Self::PushPositiveInfinity => PushPositiveInfinity::INSTRUCTION,
Self::PushNegativeInfinity => PushNegativeInfinity::INSTRUCTION,
Self::PushNull => PushNull::INSTRUCTION,
Self::PushTrue => PushTrue::INSTRUCTION,
Self::PushFalse => PushFalse::INSTRUCTION,
Self::PushUndefined => PushUndefined::INSTRUCTION,
Self::PushLiteral => PushLiteral::INSTRUCTION,
Self::PushEmptyObject => PushEmptyObject::INSTRUCTION,
Self::PushNewArray => PushNewArray::INSTRUCTION,
Self::PushValueToArray => PushValueToArray::INSTRUCTION,
Self::PushElisionToArray => PushElisionToArray::INSTRUCTION,
Self::PushIteratorToArray => PushIteratorToArray::INSTRUCTION,
Self::Add => Add::INSTRUCTION,
Self::Sub => Sub::INSTRUCTION,
Self::Div => Div::INSTRUCTION,
Self::Mul => Mul::INSTRUCTION,
Self::Mod => Mod::INSTRUCTION,
Self::Pow => Pow::INSTRUCTION,
Self::ShiftRight => ShiftRight::INSTRUCTION,
Self::ShiftLeft => ShiftLeft::INSTRUCTION,
Self::UnsignedShiftRight => UnsignedShiftRight::INSTRUCTION,
Self::BitOr => BitOr::INSTRUCTION,
Self::BitAnd => BitAnd::INSTRUCTION,
Self::BitXor => BitXor::INSTRUCTION,
Self::BitNot => BitNot::INSTRUCTION,
Self::In => In::INSTRUCTION,
Self::Eq => Eq::INSTRUCTION,
Self::StrictEq => StrictEq::INSTRUCTION,
Self::NotEq => NotEq::INSTRUCTION,
Self::StrictNotEq => StrictNotEq::INSTRUCTION,
Self::GreaterThan => GreaterThan::INSTRUCTION,
Self::GreaterThanOrEq => GreaterThanOrEq::INSTRUCTION,
Self::LessThan => LessThan::INSTRUCTION,
Self::LessThanOrEq => LessThanOrEq::INSTRUCTION,
Self::InstanceOf => InstanceOf::INSTRUCTION,
Self::TypeOf => TypeOf::INSTRUCTION,
Self::Void => Void::INSTRUCTION,
Self::LogicalNot => LogicalNot::INSTRUCTION,
Self::LogicalAnd => LogicalAnd::INSTRUCTION,
Self::LogicalOr => LogicalOr::INSTRUCTION,
Self::Coalesce => Coalesce::INSTRUCTION,
Self::Pos => Pos::INSTRUCTION,
Self::Neg => Neg::INSTRUCTION,
Self::Inc => Inc::INSTRUCTION,
Self::IncPost => IncPost::INSTRUCTION,
Self::Dec => Dec::INSTRUCTION,
Self::DecPost => DecPost::INSTRUCTION,
Self::DefInitArg => DefInitArg::INSTRUCTION,
Self::DefVar => DefVar::INSTRUCTION,
Self::DefInitVar => DefInitVar::INSTRUCTION,
Self::DefLet => DefLet::INSTRUCTION,
Self::DefInitLet => DefInitLet::INSTRUCTION,
Self::DefInitConst => DefInitConst::INSTRUCTION,
Self::GetName => GetName::INSTRUCTION,
Self::GetNameOrUndefined => GetNameOrUndefined::INSTRUCTION,
Self::SetName => SetName::INSTRUCTION,
Self::GetPropertyByName => GetPropertyByName::INSTRUCTION,
Self::GetPropertyByValue => GetPropertyByValue::INSTRUCTION,
Self::GetPropertyByValuePush => GetPropertyByValuePush::INSTRUCTION,
Self::SetPropertyByName => SetPropertyByName::INSTRUCTION,
Self::DefineOwnPropertyByName => DefineOwnPropertyByName::INSTRUCTION,
Self::SetPropertyByValue => SetPropertyByValue::INSTRUCTION,
Self::DefineOwnPropertyByValue => DefineOwnPropertyByValue::INSTRUCTION,
Self::SetPropertyGetterByName => SetPropertyGetterByName::INSTRUCTION,
Self::SetPropertyGetterByValue => SetPropertyGetterByValue::INSTRUCTION,
Self::SetPropertySetterByName => SetPropertySetterByName::INSTRUCTION,
Self::SetPropertySetterByValue => SetPropertySetterByValue::INSTRUCTION,
Self::DeletePropertyByName => DeletePropertyByName::INSTRUCTION,
Self::DeletePropertyByValue => DeletePropertyByValue::INSTRUCTION,
Self::CopyDataProperties => CopyDataProperties::INSTRUCTION,
Self::Jump => Jump::INSTRUCTION,
Self::JumpIfFalse => JumpIfFalse::INSTRUCTION,
Self::JumpIfNotUndefined => JumpIfNotUndefined::INSTRUCTION,
Self::JumpIfNullOrUndefined => JumpIfNullOrUndefined::INSTRUCTION,
Self::Throw => Throw::INSTRUCTION,
Self::TryStart => TryStart::INSTRUCTION,
Self::TryEnd => TryEnd::INSTRUCTION,
Self::CatchStart => CatchStart::INSTRUCTION,
Self::CatchEnd => CatchEnd::INSTRUCTION,
Self::CatchEnd2 => CatchEnd2::INSTRUCTION,
Self::FinallyStart => FinallyStart::INSTRUCTION,
Self::FinallyEnd => FinallyEnd::INSTRUCTION,
Self::FinallySetJump => FinallySetJump::INSTRUCTION,
Self::ToBoolean => ToBoolean::INSTRUCTION,
Self::This => This::INSTRUCTION,
Self::Super => Super::INSTRUCTION,
Self::SuperCall => SuperCall::INSTRUCTION,
Self::SuperCallSpread => SuperCallSpread::INSTRUCTION,
Self::SuperCallDerived => SuperCallDerived::INSTRUCTION,
Self::Case => Case::INSTRUCTION,
Self::Default => Default::INSTRUCTION,
Self::GetArrowFunction => GetArrowFunction::INSTRUCTION,
Self::GetFunction => GetFunction::INSTRUCTION,
Self::GetFunctionAsync => GetFunctionAsync::INSTRUCTION,
Self::GetGenerator => GetGenerator::INSTRUCTION,
Self::GetGeneratorAsync => GetGeneratorAsync::INSTRUCTION,
Self::CallEval => CallEval::INSTRUCTION,
Self::CallEvalSpread => CallEvalSpread::INSTRUCTION,
Self::Call => Call::INSTRUCTION,
Self::CallSpread => CallSpread::INSTRUCTION,
Self::New => New::INSTRUCTION,
Self::NewSpread => NewSpread::INSTRUCTION,
Self::Return => Return::INSTRUCTION,
Self::PushDeclarativeEnvironment => PushDeclarativeEnvironment::INSTRUCTION,
Self::PushFunctionEnvironment => PushFunctionEnvironment::INSTRUCTION,
Self::PopEnvironment => PopEnvironment::INSTRUCTION,
Self::LoopStart => LoopStart::INSTRUCTION,
Self::LoopContinue => LoopContinue::INSTRUCTION,
Self::LoopEnd => LoopEnd::INSTRUCTION,
Self::ForInLoopInitIterator => ForInLoopInitIterator::INSTRUCTION,
Self::InitIterator => InitIterator::INSTRUCTION,
Self::InitIteratorAsync => InitIteratorAsync::INSTRUCTION,
Self::IteratorNext => IteratorNext::INSTRUCTION,
Self::IteratorClose => IteratorClose::INSTRUCTION,
Self::IteratorToArray => IteratorToArray::INSTRUCTION,
Self::ForInLoopNext => ForInLoopNext::INSTRUCTION,
Self::ForAwaitOfLoopIterate => ForAwaitOfLoopIterate::INSTRUCTION,
Self::ForAwaitOfLoopNext => ForAwaitOfLoopNext::INSTRUCTION,
Self::ConcatToString => ConcatToString::INSTRUCTION,
Self::RequireObjectCoercible => RequireObjectCoercible::INSTRUCTION,
Self::ValueNotNullOrUndefined => ValueNotNullOrUndefined::INSTRUCTION,
Self::RestParameterInit => RestParameterInit::INSTRUCTION,
Self::RestParameterPop => RestParameterPop::INSTRUCTION,
Self::PopOnReturnAdd => PopOnReturnAdd::INSTRUCTION,
Self::PopOnReturnSub => PopOnReturnSub::INSTRUCTION,
Self::Yield => Yield::INSTRUCTION,
Self::GeneratorNext => GeneratorNext::INSTRUCTION,
Self::AsyncGeneratorNext => AsyncGeneratorNext::INSTRUCTION,
Self::PushNewTarget => PushNewTarget::INSTRUCTION,
Self::Await => Await::INSTRUCTION,
Self::GeneratorNextDelegate => GeneratorNextDelegate::INSTRUCTION,
Self::Nop => Nop::INSTRUCTION,
Self::PushClassPrototype => PushClassPrototype::INSTRUCTION,
Self::SetClassPrototype => SetClassPrototype::INSTRUCTION,
Self::SetHomeObject => SetHomeObject::INSTRUCTION,
Self::DefineClassMethodByName => DefineClassMethodByName::INSTRUCTION,
Self::DefineClassMethodByValue => DefineClassMethodByValue::INSTRUCTION,
Self::DefineClassGetterByName => DefineClassGetterByName::INSTRUCTION,
Self::DefineClassGetterByValue => DefineClassGetterByValue::INSTRUCTION,
Self::DefineClassSetterByName => DefineClassSetterByName::INSTRUCTION,
Self::DefineClassSetterByValue => DefineClassSetterByValue::INSTRUCTION,
Self::AssignPrivateField => AssignPrivateField::INSTRUCTION,
Self::SetPrivateField => SetPrivateField::INSTRUCTION,
Self::SetPrivateMethod => SetPrivateMethod::INSTRUCTION,
Self::SetPrivateSetter => SetPrivateSetter::INSTRUCTION,
Self::SetPrivateGetter => SetPrivateGetter::INSTRUCTION,
Self::GetPrivateField => GetPrivateField::INSTRUCTION,
Self::PushClassField => PushClassField::INSTRUCTION,
Self::PushClassFieldPrivate => PushClassFieldPrivate::INSTRUCTION,
Self::PushClassPrivateGetter => PushClassPrivateGetter::INSTRUCTION,
Self::PushClassPrivateSetter => PushClassPrivateSetter::INSTRUCTION,
Self::PushClassPrivateMethod => PushClassPrivateMethod::INSTRUCTION,
Self::ToPropertyKey => ToPropertyKey::INSTRUCTION,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]

Loading…
Cancel
Save