mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +00:00
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
This commit is contained in:
parent
34bd25f6c2
commit
66264f7c2a
4 changed files with 25 additions and 17 deletions
|
@ -43,11 +43,16 @@ struct ScopeFrame {
|
|||
};
|
||||
|
||||
struct ExecutionContext {
|
||||
explicit ExecutionContext(Heap& heap)
|
||||
: arguments(heap)
|
||||
{
|
||||
}
|
||||
|
||||
const ASTNode* current_node { nullptr };
|
||||
FlyString function_name;
|
||||
FunctionObject* function { nullptr };
|
||||
Value this_value;
|
||||
Vector<Value> arguments;
|
||||
MarkedValueList arguments;
|
||||
Object* arguments_object { nullptr };
|
||||
Environment* lexical_environment { nullptr };
|
||||
Environment* variable_environment { nullptr };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue