superui_boa_engine 0.2.1

Fork of boa_engine (boa 0.21.1) vendored for superui so the boa_parser stack-growth patch is publishable; also carries a relaxed icu_normalizer pin. See docs/fork-patches.md. Upstream: https://github.com/boa-dev/boa
use crate::{
    Context,
    builtins::OrdinaryObject,
    vm::opcode::{Operation, VaryingOperand},
};

/// `PushEmptyObject` implements the Opcode Operation for `Opcode::PushEmptyObject`
///
/// Operation:
///  - Push empty object `{}` value on the stack.
#[derive(Debug, Clone, Copy)]
pub(crate) struct PushEmptyObject;

impl PushEmptyObject {
    #[inline(always)]
    pub(crate) fn operation(dst: VaryingOperand, context: &mut Context) {
        let o = context
            .intrinsics()
            .templates()
            .ordinary_object()
            .create(OrdinaryObject, Vec::default());
        context.vm.set_register(dst.into(), o.into());
    }
}

impl Operation for PushEmptyObject {
    const NAME: &'static str = "PushEmptyObject";
    const INSTRUCTION: &'static str = "INST - PushEmptyObject";
    const COST: u8 = 1;
}