diff --git a/Userland/Libraries/LibJS/JIT/Compiler.cpp b/Userland/Libraries/LibJS/JIT/Compiler.cpp index bdd6385cc5..ec1ea8e8c5 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.cpp +++ b/Userland/Libraries/LibJS/JIT/Compiler.cpp @@ -2061,6 +2061,10 @@ OwnPtr Compiler::compile(Bytecode::Executable& bytecode_execut Assembler::Operand::Register(LOCALS_ARRAY_BASE), Assembler::Operand::Register(ARG2)); + compiler.m_assembler.mov( + Assembler::Operand::Register(RUNNING_EXECUTION_CONTEXT_BASE), + Assembler::Operand::Register(ARG4)); + compiler.reload_cached_accumulator(); Assembler::Label normal_entry {}; diff --git a/Userland/Libraries/LibJS/JIT/Compiler.h b/Userland/Libraries/LibJS/JIT/Compiler.h index dec5ff0545..c84b58c9ae 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.h +++ b/Userland/Libraries/LibJS/JIT/Compiler.h @@ -38,6 +38,7 @@ private: static constexpr auto REGISTER_ARRAY_BASE = Assembler::Reg::RBX; static constexpr auto LOCALS_ARRAY_BASE = Assembler::Reg::R14; static constexpr auto CACHED_ACCUMULATOR = Assembler::Reg::R13; + static constexpr auto RUNNING_EXECUTION_CONTEXT_BASE = Assembler::Reg::R15; # endif # define JS_ENUMERATE_COMMON_BINARY_OPS_WITHOUT_FAST_PATH(O) \ diff --git a/Userland/Libraries/LibJS/JIT/NativeExecutable.cpp b/Userland/Libraries/LibJS/JIT/NativeExecutable.cpp index 9981be13e4..d6fe7c23cc 100644 --- a/Userland/Libraries/LibJS/JIT/NativeExecutable.cpp +++ b/Userland/Libraries/LibJS/JIT/NativeExecutable.cpp @@ -43,11 +43,12 @@ void NativeExecutable::run(VM& vm, size_t entry_point) const VERIFY(entry_point_address != 0); } - typedef void (*JITCode)(VM&, Value* registers, Value* locals, FlatPtr entry_point_address); + typedef void (*JITCode)(VM&, Value* registers, Value* locals, FlatPtr entry_point_address, ExecutionContext&); ((JITCode)m_code)(vm, vm.bytecode_interpreter().registers().data(), vm.running_execution_context().local_variables.data(), - entry_point_address); + entry_point_address, + vm.running_execution_context()); } #if ARCH(X86_64)