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

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 1309813007: [es6] implement destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove facilities for rewriting the expression multiple ways Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/hydrogen.h" 5 #include "src/crankshaft/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast/ast-numbering.h" 10 #include "src/ast/ast-numbering.h"
(...skipping 7021 matching lines...) Expand 10 before | Expand all | Expand 10 after
7032 } else { 7032 } else {
7033 return Bailout(kInvalidLhsInCompoundAssignment); 7033 return Bailout(kInvalidLhsInCompoundAssignment);
7034 } 7034 }
7035 } 7035 }
7036 7036
7037 7037
7038 void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) { 7038 void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
7039 DCHECK(!HasStackOverflow()); 7039 DCHECK(!HasStackOverflow());
7040 DCHECK(current_block() != NULL); 7040 DCHECK(current_block() != NULL);
7041 DCHECK(current_block()->HasPredecessor()); 7041 DCHECK(current_block()->HasPredecessor());
7042
7042 VariableProxy* proxy = expr->target()->AsVariableProxy(); 7043 VariableProxy* proxy = expr->target()->AsVariableProxy();
7043 Property* prop = expr->target()->AsProperty(); 7044 Property* prop = expr->target()->AsProperty();
7044 DCHECK(proxy == NULL || prop == NULL); 7045 DCHECK(proxy == NULL || prop == NULL);
7045 7046
7046 if (expr->is_compound()) { 7047 if (expr->is_compound()) {
7047 HandleCompoundAssignment(expr); 7048 HandleCompoundAssignment(expr);
7048 return; 7049 return;
7049 } 7050 }
7050 7051
7051 if (prop != NULL) { 7052 if (prop != NULL) {
(...skipping 5075 matching lines...) Expand 10 before | Expand all | Expand 10 after
12127 UNREACHABLE(); 12128 UNREACHABLE();
12128 } 12129 }
12129 12130
12130 12131
12131 void HOptimizedGraphBuilder::VisitExportDeclaration( 12132 void HOptimizedGraphBuilder::VisitExportDeclaration(
12132 ExportDeclaration* declaration) { 12133 ExportDeclaration* declaration) {
12133 UNREACHABLE(); 12134 UNREACHABLE();
12134 } 12135 }
12135 12136
12136 12137
12138 void HOptimizedGraphBuilder::VisitRewritableExpression(
12139 RewritableExpression* node) {
12140 CHECK_ALIVE(Visit(node->expression()));
12141 }
12142
12143
12137 // Generators for inline runtime functions. 12144 // Generators for inline runtime functions.
12138 // Support for types. 12145 // Support for types.
12139 void HOptimizedGraphBuilder::GenerateIsSmi(CallRuntime* call) { 12146 void HOptimizedGraphBuilder::GenerateIsSmi(CallRuntime* call) {
12140 DCHECK(call->arguments()->length() == 1); 12147 DCHECK(call->arguments()->length() == 1);
12141 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 12148 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
12142 HValue* value = Pop(); 12149 HValue* value = Pop();
12143 HIsSmiAndBranch* result = New<HIsSmiAndBranch>(value); 12150 HIsSmiAndBranch* result = New<HIsSmiAndBranch>(value);
12144 return ast_context()->ReturnControl(result, call->id()); 12151 return ast_context()->ReturnControl(result, call->id());
12145 } 12152 }
12146 12153
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
13611 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13618 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13612 } 13619 }
13613 13620
13614 #ifdef DEBUG 13621 #ifdef DEBUG
13615 graph_->Verify(false); // No full verify. 13622 graph_->Verify(false); // No full verify.
13616 #endif 13623 #endif
13617 } 13624 }
13618 13625
13619 } // namespace internal 13626 } // namespace internal
13620 } // namespace v8 13627 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698