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

Unified Diff: src/ast.cc

Issue 1172683003: Use the LookupIterator for SetElement and friends (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 6 months 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 | « src/array.js ('k') | src/elements.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 06846ffb8f5c431c938beb5ced8bb0f2ad55d0b2..c9e4c0f21974a8983024e4bc0b4f1415cccc87e1 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -541,17 +541,19 @@ void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
}
}
Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate);
+
if (boilerplate_value->IsTheHole()) {
is_holey = true;
- } else if (boilerplate_value->IsUninitialized()) {
+ continue;
+ }
+
+ if (boilerplate_value->IsUninitialized()) {
+ boilerplate_value = handle(Smi::FromInt(0), isolate);
is_simple = false;
- JSObject::SetOwnElement(array, array_index,
- handle(Smi::FromInt(0), isolate),
- SLOPPY).Assert();
- } else {
- JSObject::SetOwnElement(array, array_index, boilerplate_value, SLOPPY)
- .Assert();
}
+
+ JSObject::AddDataElement(array, array_index, boilerplate_value, NONE)
+ .Assert();
}
if (array_index != values()->length()) {
« no previous file with comments | « src/array.js ('k') | src/elements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698