LibJS: Access function arguments directly in AST interpreter

Instead of doing a generic scoped variable lookup, function arguments
now go directly to the call frame arguments list.

This is a huge speedup on everything that uses arguments. :^)
This commit is contained in:
Andreas Kling 2021-06-14 09:35:04 +02:00
parent a733a30373
commit 848944113c
Notes: sideshowbarker 2024-07-18 12:15:56 +09:00

View File

@ -1301,6 +1301,9 @@ Value Identifier::execute(Interpreter& interpreter, GlobalObject& global_object)
{
InterpreterNodeScope node_scope { interpreter, *this };
if (m_argument_index.has_value())
return interpreter.vm().argument(m_argument_index.value());
auto value = interpreter.vm().get_variable(string(), global_object);
if (value.is_empty()) {
if (!interpreter.exception())