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 @@
#include "src/accessors.h"
#include "src/arguments.h"
#include "src/debug/debug.h"
#include "src/elements.h"
#include "src/frames-inl.h"
#include "src/isolate-inl.h"
#include "src/messages.h"
......@@ -455,10 +456,10 @@ RUNTIME_FUNCTION(Runtime_NewWithSpread) {
}
// Append element of the spread to the result.
ElementsAccessor* accessor = spread_array->GetElementsAccessor();
for (uint32_t i = 0; i < spread_length; i++) {
// TODO(petermarshall): Use ElementAccessors here.
LookupIterator it(isolate, spread, i);
Handle<Object> element = spread_array->GetDataProperty(&it);
DCHECK(accessor->HasElement(spread_array, i));
Handle<Object> element = accessor->Get(spread_array, i);
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