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

Side by Side Diff: src/compiler/js-global-object-specialization.cc

Issue 2488183002: [turbofan] Address a couple of Type-related TODOs. (Closed)
Patch Set: Now with green bots. Created 4 years, 1 month 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/access-info.cc ('k') | src/compiler/js-native-context-specialization.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/js-global-object-specialization.h" 5 #include "src/compiler/js-global-object-specialization.h"
6 6
7 #include "src/compilation-dependencies.h" 7 #include "src/compilation-dependencies.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 ReplaceWithValue(node, value); 113 ReplaceWithValue(node, value);
114 return Replace(value); 114 return Replace(value);
115 } 115 }
116 116
117 // Load from constant type cell can benefit from type feedback. 117 // Load from constant type cell can benefit from type feedback.
118 Type* property_cell_value_type = Type::NonInternal(); 118 Type* property_cell_value_type = Type::NonInternal();
119 MachineRepresentation representation = MachineRepresentation::kTagged; 119 MachineRepresentation representation = MachineRepresentation::kTagged;
120 if (property_details.cell_type() == PropertyCellType::kConstantType) { 120 if (property_details.cell_type() == PropertyCellType::kConstantType) {
121 // Compute proper type based on the current value in the cell. 121 // Compute proper type based on the current value in the cell.
122 if (property_cell_value->IsSmi()) { 122 if (property_cell_value->IsSmi()) {
123 property_cell_value_type = type_cache_.kSmi; 123 property_cell_value_type = Type::SignedSmall();
124 representation = MachineRepresentation::kTaggedSigned; 124 representation = MachineRepresentation::kTaggedSigned;
125 } else if (property_cell_value->IsNumber()) { 125 } else if (property_cell_value->IsNumber()) {
126 // TODO(mvstanton): Remove kHeapNumber from type cache, it's just 126 property_cell_value_type = Type::Number();
127 // Type::Number().
128 property_cell_value_type = type_cache_.kHeapNumber;
129 representation = MachineRepresentation::kTaggedPointer; 127 representation = MachineRepresentation::kTaggedPointer;
130 } else { 128 } else {
131 // TODO(turbofan): Track the property_cell_value_map on the FieldAccess 129 // TODO(turbofan): Track the property_cell_value_map on the FieldAccess
132 // below and use it in LoadElimination to eliminate map checks. 130 // below and use it in LoadElimination to eliminate map checks.
133 Handle<Map> property_cell_value_map( 131 Handle<Map> property_cell_value_map(
134 Handle<HeapObject>::cast(property_cell_value)->map(), isolate()); 132 Handle<HeapObject>::cast(property_cell_value)->map(), isolate());
135 property_cell_value_type = Type::For(property_cell_value_map); 133 property_cell_value_type = Type::For(property_cell_value_map);
136 representation = MachineRepresentation::kTaggedPointer; 134 representation = MachineRepresentation::kTaggedPointer;
137 } 135 }
138 } 136 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 return jsgraph()->javascript(); 278 return jsgraph()->javascript();
281 } 279 }
282 280
283 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const { 281 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const {
284 return jsgraph()->simplified(); 282 return jsgraph()->simplified();
285 } 283 }
286 284
287 } // namespace compiler 285 } // namespace compiler
288 } // namespace internal 286 } // namespace internal
289 } // namespace v8 287 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-info.cc ('k') | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698