LibJS/Bytecode: Defer GetGlobal identifier lookup until cache misses

This way we avoid looking up the identifier when the cache hits.
This commit is contained in:
Andreas Kling
2024-05-11 19:32:33 +02:00
parent 6ec4d6f668
commit a06441c88c
2 changed files with 4 additions and 2 deletions

View File

@@ -1264,7 +1264,7 @@ ThrowCompletionOr<void> GetCalleeAndThisFromEnvironment::execute_impl(Bytecode::
ThrowCompletionOr<void> GetGlobal::execute_impl(Bytecode::Interpreter& interpreter) const
{
interpreter.set(dst(), TRY(get_global(interpreter, interpreter.current_executable().get_identifier(m_identifier), interpreter.current_executable().global_variable_caches[m_cache_index])));
interpreter.set(dst(), TRY(get_global(interpreter, m_identifier, interpreter.current_executable().global_variable_caches[m_cache_index])));
return {};
}