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

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: Add explicit placeholder RewritableExpression for rewriting 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 7020 matching lines...) Expand 10 before | Expand all | Expand 10 after
7031 } else { 7031 } else {
7032 return Bailout(kInvalidLhsInCompoundAssignment); 7032 return Bailout(kInvalidLhsInCompoundAssignment);
7033 } 7033 }
7034 } 7034 }
7035 7035
7036 7036
7037 void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) { 7037 void HOptimizedGraphBuilder::VisitAssignment(Assignment* expr) {
7038 DCHECK(!HasStackOverflow()); 7038 DCHECK(!HasStackOverflow());
7039 DCHECK(current_block() != NULL); 7039 DCHECK(current_block() != NULL);
7040 DCHECK(current_block()->HasPredecessor()); 7040 DCHECK(current_block()->HasPredecessor());
7041
7041 VariableProxy* proxy = expr->target()->AsVariableProxy(); 7042 VariableProxy* proxy = expr->target()->AsVariableProxy();
7042 Property* prop = expr->target()->AsProperty(); 7043 Property* prop = expr->target()->AsProperty();
7043 DCHECK(proxy == NULL || prop == NULL); 7044 DCHECK(proxy == NULL || prop == NULL);
7044 7045
7045 if (expr->is_compound()) { 7046 if (expr->is_compound()) {
7046 HandleCompoundAssignment(expr); 7047 HandleCompoundAssignment(expr);
7047 return; 7048 return;
7048 } 7049 }
7049 7050
7050 if (prop != NULL) { 7051 if (prop != NULL) {
(...skipping 5068 matching lines...) Expand 10 before | Expand all | Expand 10 after
12119 UNREACHABLE(); 12120 UNREACHABLE();
12120 } 12121 }
12121 12122
12122 12123
12123 void HOptimizedGraphBuilder::VisitExportDeclaration( 12124 void HOptimizedGraphBuilder::VisitExportDeclaration(
12124 ExportDeclaration* declaration) { 12125 ExportDeclaration* declaration) {
12125 UNREACHABLE(); 12126 UNREACHABLE();
12126 } 12127 }
12127 12128
12128 12129
12130 void HOptimizedGraphBuilder::VisitRewritableExpression(
12131 RewritableExpression* node) {
12132 CHECK_ALIVE(Visit(node->expression()));
12133 }
12134
12135
12129 // Generators for inline runtime functions. 12136 // Generators for inline runtime functions.
12130 // Support for types. 12137 // Support for types.
12131 void HOptimizedGraphBuilder::GenerateIsSmi(CallRuntime* call) { 12138 void HOptimizedGraphBuilder::GenerateIsSmi(CallRuntime* call) {
12132 DCHECK(call->arguments()->length() == 1); 12139 DCHECK(call->arguments()->length() == 1);
12133 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 12140 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
12134 HValue* value = Pop(); 12141 HValue* value = Pop();
12135 HIsSmiAndBranch* result = New<HIsSmiAndBranch>(value); 12142 HIsSmiAndBranch* result = New<HIsSmiAndBranch>(value);
12136 return ast_context()->ReturnControl(result, call->id()); 12143 return ast_context()->ReturnControl(result, call->id());
12137 } 12144 }
12138 12145
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
13619 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13626 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13620 } 13627 }
13621 13628
13622 #ifdef DEBUG 13629 #ifdef DEBUG
13623 graph_->Verify(false); // No full verify. 13630 graph_->Verify(false); // No full verify.
13624 #endif 13631 #endif
13625 } 13632 }
13626 13633
13627 } // namespace internal 13634 } // namespace internal
13628 } // namespace v8 13635 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698