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

Unified Diff: src/ast/ast.cc

Issue 1601023005: Remove a bit more dead code after array spread desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix is_simple Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.cc
diff --git a/src/ast/ast.cc b/src/ast/ast.cc
index 068b36c7438cb3430d1d90d25e2b7183f294f7b6..f87d7e8937221e2381d929678e06f6f3bc1939b9 100644
--- a/src/ast/ast.cc
+++ b/src/ast/ast.cc
@@ -497,10 +497,11 @@ void ObjectLiteral::BuildConstantProperties(Isolate* isolate) {
void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
+ DCHECK_LT(first_spread_index_, 0);
+
if (!constant_elements_.is_null()) return;
- int constants_length =
- first_spread_index_ >= 0 ? first_spread_index_ : values()->length();
+ int constants_length = values()->length();
// Allocate a fixed array to hold all the object literals.
Handle<JSArray> array = isolate->factory()->NewJSArray(
@@ -508,7 +509,7 @@ void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
Strength::WEAK, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
// Fill in the literals.
- bool is_simple = (first_spread_index_ < 0);
+ bool is_simple = true;
int depth_acc = 1;
bool is_holey = false;
int array_index = 0;
« 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