Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: src/runtime/runtime-classes.cc

Issue 2557963004: [Runtime] Use ElementsAccessor in NewWithSpread. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-classes.cc
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc
index ca309f5fecd5a89e66e2287d116741620d3e97b2..357a0934d9d4c099ca8ab426e79be5703faed311 100644
--- a/src/runtime/runtime-classes.cc
+++ b/src/runtime/runtime-classes.cc
@@ -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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698