1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibJS/JIT: Resolve the EnvironmentVariableCache pointers at JIT time

This commit is contained in:
Andreas Kling 2023-11-05 15:14:54 +01:00
parent a616a682fe
commit 536b9c29e4
5 changed files with 17 additions and 13 deletions

View file

@ -970,9 +970,9 @@ void Compiler::compile_get_global(Bytecode::Op::GetGlobal const& op)
check_exception();
}
static Value cxx_get_variable(VM& vm, DeprecatedFlyString const& name, u32 cache_index)
static Value cxx_get_variable(VM& vm, DeprecatedFlyString const& name, Bytecode::EnvironmentVariableCache& cache)
{
return TRY_OR_SET_EXCEPTION(Bytecode::get_variable(vm.bytecode_interpreter(), name, cache_index));
return TRY_OR_SET_EXCEPTION(Bytecode::get_variable(vm.bytecode_interpreter(), name, cache));
}
void Compiler::compile_get_variable(Bytecode::Op::GetVariable const& op)
@ -982,7 +982,7 @@ void Compiler::compile_get_variable(Bytecode::Op::GetVariable const& op)
Assembler::Operand::Imm(bit_cast<u64>(&m_bytecode_executable.get_identifier(op.identifier()))));
m_assembler.mov(
Assembler::Operand::Register(ARG2),
Assembler::Operand::Imm(op.cache_index()));
Assembler::Operand::Imm(bit_cast<u64>(&m_bytecode_executable.environment_variable_caches[op.cache_index()])));
native_call((void*)cxx_get_variable);
store_accumulator(RET);
check_exception();