OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/common-operator-reducer.h" | 5 #include "src/compiler/common-operator-reducer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 HeapObjectMatcher mcond(cond); | 29 HeapObjectMatcher mcond(cond); |
30 return mcond.Value()->BooleanValue() ? Decision::kTrue : Decision::kFalse; | 30 return mcond.Value()->BooleanValue() ? Decision::kTrue : Decision::kFalse; |
31 } | 31 } |
32 default: | 32 default: |
33 return Decision::kUnknown; | 33 return Decision::kUnknown; |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 | |
40 CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph, | 39 CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph, |
41 CommonOperatorBuilder* common, | 40 CommonOperatorBuilder* common, |
42 MachineOperatorBuilder* machine) | 41 MachineOperatorBuilder* machine) |
43 : AdvancedReducer(editor), | 42 : AdvancedReducer(editor), |
44 graph_(graph), | 43 graph_(graph), |
45 common_(common), | 44 common_(common), |
46 machine_(machine), | 45 machine_(machine), |
47 dead_(graph->NewNode(common->Dead())) {} | 46 dead_(graph->NewNode(common->Dead())) { |
48 | 47 NodeProperties::SetType(dead_, Type::None()); |
| 48 } |
49 | 49 |
50 Reduction CommonOperatorReducer::Reduce(Node* node) { | 50 Reduction CommonOperatorReducer::Reduce(Node* node) { |
51 switch (node->opcode()) { | 51 switch (node->opcode()) { |
52 case IrOpcode::kBranch: | 52 case IrOpcode::kBranch: |
53 return ReduceBranch(node); | 53 return ReduceBranch(node); |
54 case IrOpcode::kDeoptimizeIf: | 54 case IrOpcode::kDeoptimizeIf: |
55 case IrOpcode::kDeoptimizeUnless: | 55 case IrOpcode::kDeoptimizeUnless: |
56 return ReduceDeoptimizeConditional(node); | 56 return ReduceDeoptimizeConditional(node); |
57 case IrOpcode::kMerge: | 57 case IrOpcode::kMerge: |
58 return ReduceMerge(node); | 58 return ReduceMerge(node); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 node->ReplaceInput(0, a); | 382 node->ReplaceInput(0, a); |
383 node->ReplaceInput(1, b); | 383 node->ReplaceInput(1, b); |
384 node->TrimInputCount(2); | 384 node->TrimInputCount(2); |
385 NodeProperties::ChangeOp(node, op); | 385 NodeProperties::ChangeOp(node, op); |
386 return Changed(node); | 386 return Changed(node); |
387 } | 387 } |
388 | 388 |
389 } // namespace compiler | 389 } // namespace compiler |
390 } // namespace internal | 390 } // namespace internal |
391 } // namespace v8 | 391 } // namespace v8 |
OLD | NEW |