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

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

Issue 2051073004: Remove more dead code now that legacy const is gone (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/ast-loop-assignment-analyzer.h" 9 #include "src/compiler/ast-loop-assignment-analyzer.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 environment()->Bind(variable, value); 1124 environment()->Bind(variable, value);
1125 } 1125 }
1126 break; 1126 break;
1127 case VariableLocation::CONTEXT: 1127 case VariableLocation::CONTEXT:
1128 if (hole_init) { 1128 if (hole_init) {
1129 Node* value = jsgraph()->TheHoleConstant(); 1129 Node* value = jsgraph()->TheHoleConstant();
1130 const Operator* op = javascript()->StoreContext(0, variable->index()); 1130 const Operator* op = javascript()->StoreContext(0, variable->index());
1131 NewNode(op, current_context(), value); 1131 NewNode(op, current_context(), value);
1132 } 1132 }
1133 break; 1133 break;
1134 case VariableLocation::LOOKUP: { 1134 case VariableLocation::LOOKUP: {
Michael Starzinger 2016/06/09 16:10:33 nit: Can we CHECK(!hole_init) here?
adamk 2016/06/09 16:12:36 Shall I add that in all the full-codegens too?
Michael Starzinger 2016/06/09 16:15:40 Hmm, yeah, good idea. Better err on the safe side.
1135 Node* name = jsgraph()->Constant(variable->name()); 1135 Node* name = jsgraph()->Constant(variable->name());
1136 // For variables we must not push an initial value (such as 'undefined') 1136 Node* value = jsgraph()->ZeroConstant(); // Indicates no initial value.
1137 // because we may have a (legal) redeclaration and we must not destroy
1138 // the current value.
1139 Node* value =
1140 hole_init ? jsgraph()->TheHoleConstant()
1141 : jsgraph()->ZeroConstant(); // Indicates no initial value.
1142 Node* attr = 1137 Node* attr =
1143 jsgraph()->Constant(variable->DeclarationPropertyAttributes()); 1138 jsgraph()->Constant(variable->DeclarationPropertyAttributes());
1144 const Operator* op = 1139 const Operator* op =
1145 javascript()->CallRuntime(Runtime::kDeclareLookupSlot); 1140 javascript()->CallRuntime(Runtime::kDeclareLookupSlot);
1146 Node* store = NewNode(op, name, value, attr); 1141 Node* store = NewNode(op, name, value, attr);
1147 PrepareFrameState(store, decl->proxy()->id()); 1142 PrepareFrameState(store, decl->proxy()->id());
1148 break; 1143 break;
1149 } 1144 }
1150 } 1145 }
1151 } 1146 }
(...skipping 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after
4369 // Phi does not exist yet, introduce one. 4364 // Phi does not exist yet, introduce one.
4370 value = NewPhi(inputs, value, control); 4365 value = NewPhi(inputs, value, control);
4371 value->ReplaceInput(inputs - 1, other); 4366 value->ReplaceInput(inputs - 1, other);
4372 } 4367 }
4373 return value; 4368 return value;
4374 } 4369 }
4375 4370
4376 } // namespace compiler 4371 } // namespace compiler
4377 } // namespace internal 4372 } // namespace internal
4378 } // namespace v8 4373 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698