diff --git a/Userland/Libraries/LibJS/JIT/Compiler.cpp b/Userland/Libraries/LibJS/JIT/Compiler.cpp index 4ef2ad6776..5b168a9587 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.cpp +++ b/Userland/Libraries/LibJS/JIT/Compiler.cpp @@ -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 Compiler::compile(Bytecode::Executable& bytecode_executable) { if (getenv("LIBJS_NO_JIT")) @@ -469,6 +481,9 @@ OwnPtr Compiler::compile(Bytecode::Executable& bytecode_execut case Bytecode::Instruction::Type::ToNumeric: compiler.compile_to_numeric(static_cast(op)); break; + case Bytecode::Instruction::Type::ResolveThisBinding: + compiler.compile_resolve_this_binding(static_cast(op)); + break; #define DO_COMPILE_COMMON_BINARY_OP(TitleCaseName, snake_case_name) \ case Bytecode::Instruction::Type::TitleCaseName: \ diff --git a/Userland/Libraries/LibJS/JIT/Compiler.h b/Userland/Libraries/LibJS/JIT/Compiler.h index e68336c06f..59c043100b 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.h +++ b/Userland/Libraries/LibJS/JIT/Compiler.h @@ -42,6 +42,7 @@ private: void compile_leave_unwind_context(Bytecode::Op::LeaveUnwindContext const&); void compile_throw(Bytecode::Op::Throw const&); void compile_to_numeric(Bytecode::Op::ToNumeric const&); + void compile_resolve_this_binding(Bytecode::Op::ResolveThisBinding const&); #define DO_COMPILE_COMMON_BINARY_OP(OpTitleCase, op_snake_case) \ void compile_##op_snake_case(Bytecode::Op::OpTitleCase const&);