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

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

Issue 2299973002: Remove unused VariableLocation::GLOBAL. (Closed)
Patch Set: Created 4 years, 3 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 | « src/compiler/ast-graph-builder.cc ('k') | 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 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 <memory> 7 #include <memory>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 5614 matching lines...) Expand 10 before | Expand all | Expand 10 after
5625 return context; 5625 return context;
5626 } 5626 }
5627 5627
5628 5628
5629 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { 5629 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
5630 DCHECK(!HasStackOverflow()); 5630 DCHECK(!HasStackOverflow());
5631 DCHECK(current_block() != NULL); 5631 DCHECK(current_block() != NULL);
5632 DCHECK(current_block()->HasPredecessor()); 5632 DCHECK(current_block()->HasPredecessor());
5633 Variable* variable = expr->var(); 5633 Variable* variable = expr->var();
5634 switch (variable->location()) { 5634 switch (variable->location()) {
5635 case VariableLocation::GLOBAL:
5636 case VariableLocation::UNALLOCATED: { 5635 case VariableLocation::UNALLOCATED: {
5637 if (IsLexicalVariableMode(variable->mode())) { 5636 if (IsLexicalVariableMode(variable->mode())) {
5638 // TODO(rossberg): should this be an DCHECK? 5637 // TODO(rossberg): should this be an DCHECK?
5639 return Bailout(kReferenceToGlobalLexicalVariable); 5638 return Bailout(kReferenceToGlobalLexicalVariable);
5640 } 5639 }
5641 // Handle known global constants like 'undefined' specially to avoid a 5640 // Handle known global constants like 'undefined' specially to avoid a
5642 // load from a global cell for them. 5641 // load from a global cell for them.
5643 Handle<Object> constant_value = 5642 Handle<Object> constant_value =
5644 isolate()->factory()->GlobalConstantFor(variable->name()); 5643 isolate()->factory()->GlobalConstantFor(variable->name());
5645 if (!constant_value.is_null()) { 5644 if (!constant_value.is_null()) {
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
6941 6940
6942 if (proxy != NULL) { 6941 if (proxy != NULL) {
6943 Variable* var = proxy->var(); 6942 Variable* var = proxy->var();
6944 if (var->mode() == LET) { 6943 if (var->mode() == LET) {
6945 return Bailout(kUnsupportedLetCompoundAssignment); 6944 return Bailout(kUnsupportedLetCompoundAssignment);
6946 } 6945 }
6947 6946
6948 CHECK_ALIVE(VisitForValue(operation)); 6947 CHECK_ALIVE(VisitForValue(operation));
6949 6948
6950 switch (var->location()) { 6949 switch (var->location()) {
6951 case VariableLocation::GLOBAL:
6952 case VariableLocation::UNALLOCATED: 6950 case VariableLocation::UNALLOCATED:
6953 HandleGlobalVariableAssignment(var, Top(), expr->AssignmentSlot(), 6951 HandleGlobalVariableAssignment(var, Top(), expr->AssignmentSlot(),
6954 expr->AssignmentId()); 6952 expr->AssignmentId());
6955 break; 6953 break;
6956 6954
6957 case VariableLocation::PARAMETER: 6955 case VariableLocation::PARAMETER:
6958 case VariableLocation::LOCAL: 6956 case VariableLocation::LOCAL:
6959 if (var->mode() == CONST) { 6957 if (var->mode() == CONST) {
6960 return Bailout(kNonInitializerAssignmentToConst); 6958 return Bailout(kNonInitializerAssignmentToConst);
6961 } 6959 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
7063 CHECK_ALIVE(VisitForValue(expr->value())); 7061 CHECK_ALIVE(VisitForValue(expr->value()));
7064 return ast_context()->ReturnValue(Pop()); 7062 return ast_context()->ReturnValue(Pop());
7065 } 7063 }
7066 } 7064 }
7067 } 7065 }
7068 7066
7069 if (var->is_arguments()) return Bailout(kAssignmentToArguments); 7067 if (var->is_arguments()) return Bailout(kAssignmentToArguments);
7070 7068
7071 // Handle the assignment. 7069 // Handle the assignment.
7072 switch (var->location()) { 7070 switch (var->location()) {
7073 case VariableLocation::GLOBAL:
7074 case VariableLocation::UNALLOCATED: 7071 case VariableLocation::UNALLOCATED:
7075 CHECK_ALIVE(VisitForValue(expr->value())); 7072 CHECK_ALIVE(VisitForValue(expr->value()));
7076 HandleGlobalVariableAssignment(var, Top(), expr->AssignmentSlot(), 7073 HandleGlobalVariableAssignment(var, Top(), expr->AssignmentSlot(),
7077 expr->AssignmentId()); 7074 expr->AssignmentId());
7078 return ast_context()->ReturnValue(Pop()); 7075 return ast_context()->ReturnValue(Pop());
7079 7076
7080 case VariableLocation::PARAMETER: 7077 case VariableLocation::PARAMETER:
7081 case VariableLocation::LOCAL: { 7078 case VariableLocation::LOCAL: {
7082 // Perform an initialization check for let declared variables 7079 // Perform an initialization check for let declared variables
7083 // or parameters. 7080 // or parameters.
(...skipping 3654 matching lines...) Expand 10 before | Expand all | Expand 10 after
10738 } 10735 }
10739 // Argument of the count operation is a variable, not a property. 10736 // Argument of the count operation is a variable, not a property.
10740 DCHECK(prop == NULL); 10737 DCHECK(prop == NULL);
10741 CHECK_ALIVE(VisitForValue(target)); 10738 CHECK_ALIVE(VisitForValue(target));
10742 10739
10743 after = BuildIncrement(returns_original_input, expr); 10740 after = BuildIncrement(returns_original_input, expr);
10744 input = returns_original_input ? Top() : Pop(); 10741 input = returns_original_input ? Top() : Pop();
10745 Push(after); 10742 Push(after);
10746 10743
10747 switch (var->location()) { 10744 switch (var->location()) {
10748 case VariableLocation::GLOBAL:
10749 case VariableLocation::UNALLOCATED: 10745 case VariableLocation::UNALLOCATED:
10750 HandleGlobalVariableAssignment(var, after, expr->CountSlot(), 10746 HandleGlobalVariableAssignment(var, after, expr->CountSlot(),
10751 expr->AssignmentId()); 10747 expr->AssignmentId());
10752 break; 10748 break;
10753 10749
10754 case VariableLocation::PARAMETER: 10750 case VariableLocation::PARAMETER:
10755 case VariableLocation::LOCAL: 10751 case VariableLocation::LOCAL:
10756 BindIfLive(var, after); 10752 BindIfLive(var, after);
10757 break; 10753 break;
10758 10754
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
12143 globals_.Rewind(0); 12139 globals_.Rewind(0);
12144 } 12140 }
12145 } 12141 }
12146 12142
12147 12143
12148 void HOptimizedGraphBuilder::VisitVariableDeclaration( 12144 void HOptimizedGraphBuilder::VisitVariableDeclaration(
12149 VariableDeclaration* declaration) { 12145 VariableDeclaration* declaration) {
12150 VariableProxy* proxy = declaration->proxy(); 12146 VariableProxy* proxy = declaration->proxy();
12151 Variable* variable = proxy->var(); 12147 Variable* variable = proxy->var();
12152 switch (variable->location()) { 12148 switch (variable->location()) {
12153 case VariableLocation::GLOBAL:
12154 case VariableLocation::UNALLOCATED: { 12149 case VariableLocation::UNALLOCATED: {
12155 DCHECK(!variable->binding_needs_init()); 12150 DCHECK(!variable->binding_needs_init());
12156 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); 12151 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
12157 DCHECK(!slot.IsInvalid()); 12152 DCHECK(!slot.IsInvalid());
12158 globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); 12153 globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
12159 globals_.Add(isolate()->factory()->undefined_value(), zone()); 12154 globals_.Add(isolate()->factory()->undefined_value(), zone());
12160 return; 12155 return;
12161 } 12156 }
12162 case VariableLocation::PARAMETER: 12157 case VariableLocation::PARAMETER:
12163 case VariableLocation::LOCAL: 12158 case VariableLocation::LOCAL:
(...skipping 19 matching lines...) Expand all
12183 UNREACHABLE(); 12178 UNREACHABLE();
12184 } 12179 }
12185 } 12180 }
12186 12181
12187 12182
12188 void HOptimizedGraphBuilder::VisitFunctionDeclaration( 12183 void HOptimizedGraphBuilder::VisitFunctionDeclaration(
12189 FunctionDeclaration* declaration) { 12184 FunctionDeclaration* declaration) {
12190 VariableProxy* proxy = declaration->proxy(); 12185 VariableProxy* proxy = declaration->proxy();
12191 Variable* variable = proxy->var(); 12186 Variable* variable = proxy->var();
12192 switch (variable->location()) { 12187 switch (variable->location()) {
12193 case VariableLocation::GLOBAL:
12194 case VariableLocation::UNALLOCATED: { 12188 case VariableLocation::UNALLOCATED: {
12195 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); 12189 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
12196 DCHECK(!slot.IsInvalid()); 12190 DCHECK(!slot.IsInvalid());
12197 globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); 12191 globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
12198 Handle<SharedFunctionInfo> function = Compiler::GetSharedFunctionInfo( 12192 Handle<SharedFunctionInfo> function = Compiler::GetSharedFunctionInfo(
12199 declaration->fun(), current_info()->script(), top_info()); 12193 declaration->fun(), current_info()->script(), top_info());
12200 // Check for stack-overflow exception. 12194 // Check for stack-overflow exception.
12201 if (function.is_null()) return SetStackOverflow(); 12195 if (function.is_null()) return SetStackOverflow();
12202 globals_.Add(function, zone()); 12196 globals_.Add(function, zone());
12203 return; 12197 return;
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
13408 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13402 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13409 } 13403 }
13410 13404
13411 #ifdef DEBUG 13405 #ifdef DEBUG
13412 graph_->Verify(false); // No full verify. 13406 graph_->Verify(false); // No full verify.
13413 #endif 13407 #endif
13414 } 13408 }
13415 13409
13416 } // namespace internal 13410 } // namespace internal
13417 } // namespace v8 13411 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698