mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 03:27:15 +02:00
LibJS/JIT: Resolve the GlobalVariableCache pointers at JIT time
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a616a682fe Pull-request: https://github.com/SerenityOS/serenity/pull/21817
@@ -952,9 +952,9 @@ void Compiler::compile_get_by_value(Bytecode::Op::GetByValue const& op)
|
||||
check_exception();
|
||||
}
|
||||
|
||||
static Value cxx_get_global(VM& vm, DeprecatedFlyString const& identifier, u32 cache_index)
|
||||
static Value cxx_get_global(VM& vm, DeprecatedFlyString const& identifier, Bytecode::GlobalVariableCache& cache)
|
||||
{
|
||||
return TRY_OR_SET_EXCEPTION(Bytecode::get_global(vm.bytecode_interpreter(), identifier, cache_index));
|
||||
return TRY_OR_SET_EXCEPTION(Bytecode::get_global(vm.bytecode_interpreter(), identifier, cache));
|
||||
}
|
||||
|
||||
void Compiler::compile_get_global(Bytecode::Op::GetGlobal const& op)
|
||||
@@ -964,7 +964,7 @@ void Compiler::compile_get_global(Bytecode::Op::GetGlobal 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.global_variable_caches[op.cache_index()])));
|
||||
native_call((void*)cxx_get_global);
|
||||
store_accumulator(RET);
|
||||
check_exception();
|
||||
|
||||
Reference in New Issue
Block a user