1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:37:34 +00:00

LibJS/JIT: Compile the ResolveThisBinding bytecode instruction

This commit is contained in:
Andreas Kling 2023-10-20 12:33:08 +02:00
parent b2602a4bae
commit 1c0efbec6b
2 changed files with 16 additions and 0 deletions

View file

@ -399,6 +399,18 @@ void Compiler::compile_to_numeric(Bytecode::Op::ToNumeric const&)
check_exception();
}
static Value cxx_resolve_this_binding(VM& vm)
{
return TRY_OR_SET_EXCEPTION(vm.resolve_this_binding());
}
void Compiler::compile_resolve_this_binding(Bytecode::Op::ResolveThisBinding const&)
{
m_assembler.native_call((void*)cxx_resolve_this_binding);
store_vm_register(Bytecode::Register::accumulator(), RET);
check_exception();
}
OwnPtr<NativeExecutable> Compiler::compile(Bytecode::Executable& bytecode_executable)
{
if (getenv("LIBJS_NO_JIT"))
@ -469,6 +481,9 @@ OwnPtr<NativeExecutable> Compiler::compile(Bytecode::Executable& bytecode_execut
case Bytecode::Instruction::Type::ToNumeric:
compiler.compile_to_numeric(static_cast<Bytecode::Op::ToNumeric const&>(op));
break;
case Bytecode::Instruction::Type::ResolveThisBinding:
compiler.compile_resolve_this_binding(static_cast<Bytecode::Op::ResolveThisBinding const&>(op));
break;
#define DO_COMPILE_COMMON_BINARY_OP(TitleCaseName, snake_case_name) \
case Bytecode::Instruction::Type::TitleCaseName: \