mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00: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
1 changed files with 3 additions and 0 deletions
|
@ -1301,6 +1301,9 @@ Value Identifier::execute(Interpreter& interpreter, GlobalObject& global_object)
|
||||||
{
|
{
|
||||||
InterpreterNodeScope node_scope { interpreter, *this };
|
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);
|
auto value = interpreter.vm().get_variable(string(), global_object);
|
||||||
if (value.is_empty()) {
|
if (value.is_empty()) {
|
||||||
if (!interpreter.exception())
|
if (!interpreter.exception())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue