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/redundancy-elimination.h" | 5 #include "src/compiler/redundancy-elimination.h" |
6 | 6 |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
11 namespace compiler { | 11 namespace compiler { |
12 | 12 |
13 RedundancyElimination::RedundancyElimination(Editor* editor, Zone* zone) | 13 RedundancyElimination::RedundancyElimination(Editor* editor, Zone* zone) |
14 : AdvancedReducer(editor), node_checks_(zone), zone_(zone) {} | 14 : AdvancedReducer(editor), node_checks_(zone), zone_(zone) {} |
15 | 15 |
16 RedundancyElimination::~RedundancyElimination() {} | 16 RedundancyElimination::~RedundancyElimination() {} |
17 | 17 |
18 Reduction RedundancyElimination::Reduce(Node* node) { | 18 Reduction RedundancyElimination::Reduce(Node* node) { |
| 19 if (node_checks_.Get(node)) return NoChange(); |
19 switch (node->opcode()) { | 20 switch (node->opcode()) { |
20 case IrOpcode::kCheckBounds: | 21 case IrOpcode::kCheckBounds: |
21 case IrOpcode::kCheckFloat64Hole: | 22 case IrOpcode::kCheckFloat64Hole: |
22 case IrOpcode::kCheckHeapObject: | 23 case IrOpcode::kCheckHeapObject: |
23 case IrOpcode::kCheckIf: | 24 case IrOpcode::kCheckIf: |
24 case IrOpcode::kCheckNumber: | 25 case IrOpcode::kCheckNumber: |
25 case IrOpcode::kCheckSmi: | 26 case IrOpcode::kCheckSmi: |
26 case IrOpcode::kCheckString: | 27 case IrOpcode::kCheckString: |
27 case IrOpcode::kCheckTaggedHole: | 28 case IrOpcode::kCheckTaggedHole: |
28 case IrOpcode::kCheckedFloat64ToInt32: | 29 case IrOpcode::kCheckedFloat64ToInt32: |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 node_checks_.Set(node, checks); | 278 node_checks_.Set(node, checks); |
278 return Changed(node); | 279 return Changed(node); |
279 } | 280 } |
280 } | 281 } |
281 return NoChange(); | 282 return NoChange(); |
282 } | 283 } |
283 | 284 |
284 } // namespace compiler | 285 } // namespace compiler |
285 } // namespace internal | 286 } // namespace internal |
286 } // namespace v8 | 287 } // namespace v8 |
OLD | NEW |