1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:25:08 +00:00

LibJS/JIT: Resolve the PropertyLookupCache pointers at JIT time

We know where the lookup cache is by the time we're jitting code, so
let's put the pointer directly into the instruction stream.
This commit is contained in:
Andreas Kling 2023-11-05 14:33:54 +01:00
parent 3b6b9b9f25
commit f03d4a1ffe
4 changed files with 12 additions and 12 deletions

View file

@ -760,7 +760,8 @@ ThrowCompletionOr<void> SetLocal::execute_impl(Bytecode::Interpreter&) const
ThrowCompletionOr<void> GetById::execute_impl(Bytecode::Interpreter& interpreter) const
{
auto base_value = interpreter.accumulator();
interpreter.accumulator() = TRY(get_by_id(interpreter.vm(), interpreter.current_executable().get_identifier(m_property), base_value, base_value, m_cache_index));
auto& cache = interpreter.current_executable().property_lookup_caches[m_cache_index];
interpreter.accumulator() = TRY(get_by_id(interpreter.vm(), interpreter.current_executable().get_identifier(m_property), base_value, base_value, cache));
return {};
}
@ -768,7 +769,8 @@ ThrowCompletionOr<void> GetByIdWithThis::execute_impl(Bytecode::Interpreter& int
{
auto base_value = interpreter.accumulator();
auto this_value = interpreter.reg(m_this_value);
interpreter.accumulator() = TRY(get_by_id(interpreter.vm(), interpreter.current_executable().get_identifier(m_property), base_value, this_value, m_cache_index));
auto& cache = interpreter.current_executable().property_lookup_caches[m_cache_index];
interpreter.accumulator() = TRY(get_by_id(interpreter.vm(), interpreter.current_executable().get_identifier(m_property), base_value, this_value, cache));
return {};
}