| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // Load from constant type cell can benefit from type feedback. | 106 // Load from constant type cell can benefit from type feedback. |
| 107 Type* property_cell_value_type = Type::Tagged(); | 107 Type* property_cell_value_type = Type::Tagged(); |
| 108 if (property_details.cell_type() == PropertyCellType::kConstantType) { | 108 if (property_details.cell_type() == PropertyCellType::kConstantType) { |
| 109 // Compute proper type based on the current value in the cell. | 109 // Compute proper type based on the current value in the cell. |
| 110 if (property_cell_value->IsSmi()) { | 110 if (property_cell_value->IsSmi()) { |
| 111 property_cell_value_type = type_cache_.kSmi; | 111 property_cell_value_type = type_cache_.kSmi; |
| 112 } else if (property_cell_value->IsNumber()) { | 112 } else if (property_cell_value->IsNumber()) { |
| 113 property_cell_value_type = type_cache_.kHeapNumber; | 113 property_cell_value_type = type_cache_.kHeapNumber; |
| 114 } else { | 114 } else { |
| 115 // TODO(turbofan): Track the property_cell_value_map on the FieldAccess |
| 116 // below and use it in LoadElimination to eliminate map checks. |
| 115 Handle<Map> property_cell_value_map( | 117 Handle<Map> property_cell_value_map( |
| 116 Handle<HeapObject>::cast(property_cell_value)->map(), isolate()); | 118 Handle<HeapObject>::cast(property_cell_value)->map(), isolate()); |
| 117 property_cell_value_type = | 119 property_cell_value_type = Type::For(property_cell_value_map); |
| 118 Type::Class(property_cell_value_map, graph()->zone()); | |
| 119 } | 120 } |
| 120 } | 121 } |
| 121 Node* value = effect = graph()->NewNode( | 122 Node* value = effect = graph()->NewNode( |
| 122 simplified()->LoadField( | 123 simplified()->LoadField( |
| 123 AccessBuilder::ForPropertyCellValue(property_cell_value_type)), | 124 AccessBuilder::ForPropertyCellValue(property_cell_value_type)), |
| 124 jsgraph()->HeapConstant(property_cell), effect, control); | 125 jsgraph()->HeapConstant(property_cell), effect, control); |
| 125 ReplaceWithValue(node, value, effect, control); | 126 ReplaceWithValue(node, value, effect, control); |
| 126 return Replace(value); | 127 return Replace(value); |
| 127 } | 128 } |
| 128 | 129 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 273 } |
| 273 | 274 |
| 274 | 275 |
| 275 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const { | 276 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const { |
| 276 return jsgraph()->simplified(); | 277 return jsgraph()->simplified(); |
| 277 } | 278 } |
| 278 | 279 |
| 279 } // namespace compiler | 280 } // namespace compiler |
| 280 } // namespace internal | 281 } // namespace internal |
| 281 } // namespace v8 | 282 } // namespace v8 |
| OLD | NEW |