OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |