| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/typed-optimization.h" | 5 #include "src/compiler/typed-optimization.h" |
| 6 | 6 |
| 7 #include "src/compilation-dependencies.h" | 7 #include "src/compilation-dependencies.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 ReplaceWithValue(node, replacement); | 71 ReplaceWithValue(node, replacement); |
| 72 return Changed(replacement); | 72 return Changed(replacement); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 switch (node->opcode()) { | 76 switch (node->opcode()) { |
| 77 case IrOpcode::kCheckHeapObject: | 77 case IrOpcode::kCheckHeapObject: |
| 78 return ReduceCheckHeapObject(node); | 78 return ReduceCheckHeapObject(node); |
| 79 case IrOpcode::kCheckMaps: | 79 case IrOpcode::kCheckMaps: |
| 80 return ReduceCheckMaps(node); | 80 return ReduceCheckMaps(node); |
| 81 case IrOpcode::kCheckNumber: |
| 82 return ReduceCheckNumber(node); |
| 81 case IrOpcode::kCheckString: | 83 case IrOpcode::kCheckString: |
| 82 return ReduceCheckString(node); | 84 return ReduceCheckString(node); |
| 83 case IrOpcode::kLoadField: | 85 case IrOpcode::kLoadField: |
| 84 return ReduceLoadField(node); | 86 return ReduceLoadField(node); |
| 85 case IrOpcode::kNumberCeil: | 87 case IrOpcode::kNumberCeil: |
| 86 case IrOpcode::kNumberRound: | 88 case IrOpcode::kNumberRound: |
| 87 case IrOpcode::kNumberTrunc: | 89 case IrOpcode::kNumberTrunc: |
| 88 return ReduceNumberRoundop(node); | 90 return ReduceNumberRoundop(node); |
| 89 case IrOpcode::kNumberFloor: | 91 case IrOpcode::kNumberFloor: |
| 90 return ReduceNumberFloor(node); | 92 return ReduceNumberFloor(node); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 if (object_map->CanTransition()) { | 145 if (object_map->CanTransition()) { |
| 144 dependencies()->AssumeMapStable(object_map); | 146 dependencies()->AssumeMapStable(object_map); |
| 145 } | 147 } |
| 146 return Replace(effect); | 148 return Replace(effect); |
| 147 } | 149 } |
| 148 } | 150 } |
| 149 } | 151 } |
| 150 return NoChange(); | 152 return NoChange(); |
| 151 } | 153 } |
| 152 | 154 |
| 155 Reduction TypedOptimization::ReduceCheckNumber(Node* node) { |
| 156 Node* const input = NodeProperties::GetValueInput(node, 0); |
| 157 Type* const input_type = NodeProperties::GetType(input); |
| 158 if (input_type->Is(Type::Number())) { |
| 159 ReplaceWithValue(node, input); |
| 160 return Replace(input); |
| 161 } |
| 162 return NoChange(); |
| 163 } |
| 164 |
| 153 Reduction TypedOptimization::ReduceCheckString(Node* node) { | 165 Reduction TypedOptimization::ReduceCheckString(Node* node) { |
| 154 Node* const input = NodeProperties::GetValueInput(node, 0); | 166 Node* const input = NodeProperties::GetValueInput(node, 0); |
| 155 Type* const input_type = NodeProperties::GetType(input); | 167 Type* const input_type = NodeProperties::GetType(input); |
| 156 if (input_type->Is(Type::String())) { | 168 if (input_type->Is(Type::String())) { |
| 157 ReplaceWithValue(node, input); | 169 ReplaceWithValue(node, input); |
| 158 return Replace(input); | 170 return Replace(input); |
| 159 } | 171 } |
| 160 return NoChange(); | 172 return NoChange(); |
| 161 } | 173 } |
| 162 | 174 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 328 |
| 317 Isolate* TypedOptimization::isolate() const { return jsgraph()->isolate(); } | 329 Isolate* TypedOptimization::isolate() const { return jsgraph()->isolate(); } |
| 318 | 330 |
| 319 SimplifiedOperatorBuilder* TypedOptimization::simplified() const { | 331 SimplifiedOperatorBuilder* TypedOptimization::simplified() const { |
| 320 return jsgraph()->simplified(); | 332 return jsgraph()->simplified(); |
| 321 } | 333 } |
| 322 | 334 |
| 323 } // namespace compiler | 335 } // namespace compiler |
| 324 } // namespace internal | 336 } // namespace internal |
| 325 } // namespace v8 | 337 } // namespace v8 |
| OLD | NEW |