Commit 6051e896 authored by petermarshall's avatar petermarshall Committed by Commit bot

[Runtime] Use ElementsAccessor in NewWithSpread.

Speeds up some benchmarks that make heavy use of derived constructors.

BUG=chromium:672075

Review-Url: https://codereview.chromium.org/2557963004
Cr-Commit-Position: refs/heads/master@{#41580}
parent 7854e649
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "src/accessors.h" #include "src/accessors.h"
#include "src/arguments.h" #include "src/arguments.h"
#include "src/debug/debug.h" #include "src/debug/debug.h"
#include "src/elements.h"
#include "src/frames-inl.h" #include "src/frames-inl.h"
#include "src/isolate-inl.h" #include "src/isolate-inl.h"
#include "src/messages.h" #include "src/messages.h"
...@@ -455,10 +456,10 @@ RUNTIME_FUNCTION(Runtime_NewWithSpread) { ...@@ -455,10 +456,10 @@ RUNTIME_FUNCTION(Runtime_NewWithSpread) {
} }
// Append element of the spread to the result. // Append element of the spread to the result.
ElementsAccessor* accessor = spread_array->GetElementsAccessor();
for (uint32_t i = 0; i < spread_length; i++) { for (uint32_t i = 0; i < spread_length; i++) {
// TODO(petermarshall): Use ElementAccessors here. DCHECK(accessor->HasElement(spread_array, i));
LookupIterator it(isolate, spread, i); Handle<Object> element = accessor->Get(spread_array, i);
Handle<Object> element = spread_array->GetDataProperty(&it);
construct_args[constructor_argc - 1 + i] = element; construct_args[constructor_argc - 1 + i] = element;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment