mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +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
Notes:
sideshowbarker
2024-07-18 12:15:56 +09:00
Author: https://github.com/awesomekling
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