summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Interpreter.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-08-09 17:09:48 -0400
committerAndreas Kling <kling@serenityos.org>2021-08-10 23:07:50 +0200
commit66264f7c2a823a9be09e91abe9b75041005d7045 (patch)
tree2753f75456538ab9f985a6de0d66cdcd60b335bb /Userland/Libraries/LibJS/Interpreter.cpp
parent34bd25f6c280070581661bd7708830c772bfa604 (diff)
downloadserenity-66264f7c2a823a9be09e91abe9b75041005d7045.zip
LibJS: Change ExecutionContext's arguments list to a MarkedValueList
The test262 tests under RegExp/property-escapes/generated will invoke Reflect.apply with up to 10,000 arguments at a time. In LibJS, when the call stack reached VM::call_internal, we transfer those arguments from a MarkedValueList to the execution context's arguments Vector. Because these types differ (MarkedValueList is a Vector<Value, 32>), the arguments are copied rather than moved. By changing the arguments vector to a MarkedValueList, we can properly move the passed arguments over. This shaves about 2 seconds off the following test262 test (from 15sec): RegExp/property-escapes/generated/General_Category_-_Decimal_Number.js
Diffstat (limited to 'Userland/Libraries/LibJS/Interpreter.cpp')
-rw-r--r--Userland/Libraries/LibJS/Interpreter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Interpreter.cpp b/Userland/Libraries/LibJS/Interpreter.cpp
index e5d800042f..41db16c75d 100644
--- a/Userland/Libraries/LibJS/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Interpreter.cpp
@@ -45,7 +45,7 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
vm.set_last_value(Badge<Interpreter> {}, {});
- ExecutionContext execution_context;
+ ExecutionContext execution_context(heap());
execution_context.current_node = &program;
execution_context.this_value = &global_object;
static FlyString global_execution_context_name = "(global execution context)";