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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1309813007: [es6] implement destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cache te right scope in DeclareAndInitializeVariables() 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 Node* store = BuildKeyedSuperStore(receiver, home_object, key, value); 2058 Node* store = BuildKeyedSuperStore(receiver, home_object, key, value);
2059 states.AddToNode(store, bailout_id_after, 2059 states.AddToNode(store, bailout_id_after,
2060 OutputFrameStateCombine::Ignore()); 2060 OutputFrameStateCombine::Ignore());
2061 break; 2061 break;
2062 } 2062 }
2063 } 2063 }
2064 } 2064 }
2065 2065
2066 2066
2067 void AstGraphBuilder::VisitAssignment(Assignment* expr) { 2067 void AstGraphBuilder::VisitAssignment(Assignment* expr) {
2068 RETURN_IF_VISIT_NODE(expr->destructuring_assignment());
2068 DCHECK(expr->target()->IsValidReferenceExpressionOrThis()); 2069 DCHECK(expr->target()->IsValidReferenceExpressionOrThis());
2069 2070
2070 // Left-hand side can only be a property, a global or a variable slot. 2071 // Left-hand side can only be a property, a global or a variable slot.
2071 Property* property = expr->target()->AsProperty(); 2072 Property* property = expr->target()->AsProperty();
2072 LhsKind assign_type = Property::GetAssignType(property); 2073 LhsKind assign_type = Property::GetAssignType(property);
2073 bool needs_frame_state_before = true; 2074 bool needs_frame_state_before = true;
2074 2075
2075 // Evaluate LHS expression. 2076 // Evaluate LHS expression.
2076 switch (assign_type) { 2077 switch (assign_type) {
2077 case VARIABLE: { 2078 case VARIABLE: {
(...skipping 2232 matching lines...) Expand 10 before | Expand all | Expand 10 after
4310 // Phi does not exist yet, introduce one. 4311 // Phi does not exist yet, introduce one.
4311 value = NewPhi(inputs, value, control); 4312 value = NewPhi(inputs, value, control);
4312 value->ReplaceInput(inputs - 1, other); 4313 value->ReplaceInput(inputs - 1, other);
4313 } 4314 }
4314 return value; 4315 return value;
4315 } 4316 }
4316 4317
4317 } // namespace compiler 4318 } // namespace compiler
4318 } // namespace internal 4319 } // namespace internal
4319 } // namespace v8 4320 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698