mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 09:18:05 +03:00
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:
parent
a733a30373
commit
848944113c
Notes:
sideshowbarker
2024-07-18 12:15:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/848944113cf
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user