1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:15:09 +00:00

LibJS/JIT: Resolve the GetById property name at JIT time

We can resolve the IdentifierTableIndex to a DeprecatedFlyString& once
when jitting the code, instead of every time GetById executes.
This commit is contained in:
Andreas Kling 2023-11-05 14:16:41 +01:00
parent 673e3ec57d
commit c92954db36
4 changed files with 10 additions and 11 deletions

View file

@ -760,7 +760,7 @@ 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, m_property, base_value, base_value, m_cache_index));
interpreter.accumulator() = TRY(get_by_id(interpreter, interpreter.current_executable().get_identifier(m_property), base_value, base_value, m_cache_index));
return {};
}
@ -768,7 +768,7 @@ 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, m_property, base_value, this_value, m_cache_index));
interpreter.accumulator() = TRY(get_by_id(interpreter, interpreter.current_executable().get_identifier(m_property), base_value, this_value, m_cache_index));
return {};
}