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 15 matching lines...) Expand all Loading... |
26 case IrOpcode::kInt32Constant: { | 26 case IrOpcode::kInt32Constant: { |
27 Int32Matcher mcond(cond); | 27 Int32Matcher mcond(cond); |
28 return mcond.Value() ? Decision::kTrue : Decision::kFalse; | 28 return mcond.Value() ? Decision::kTrue : Decision::kFalse; |
29 } | 29 } |
30 case IrOpcode::kInt64Constant: { | 30 case IrOpcode::kInt64Constant: { |
31 Int64Matcher mcond(cond); | 31 Int64Matcher mcond(cond); |
32 return mcond.Value() ? Decision::kTrue : Decision::kFalse; | 32 return mcond.Value() ? Decision::kTrue : Decision::kFalse; |
33 } | 33 } |
34 case IrOpcode::kHeapConstant: { | 34 case IrOpcode::kHeapConstant: { |
35 HeapObjectMatcher mcond(cond); | 35 HeapObjectMatcher mcond(cond); |
36 return mcond.Value().handle()->BooleanValue() ? Decision::kTrue | 36 return mcond.Value()->BooleanValue() ? Decision::kTrue : Decision::kFalse; |
37 : Decision::kFalse; | |
38 } | 37 } |
39 default: | 38 default: |
40 return Decision::kUnknown; | 39 return Decision::kUnknown; |
41 } | 40 } |
42 } | 41 } |
43 | 42 |
44 } // namespace | 43 } // namespace |
45 | 44 |
46 | 45 |
47 CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph, | 46 CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph, |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 node->set_op(op); | 373 node->set_op(op); |
375 node->ReplaceInput(0, a); | 374 node->ReplaceInput(0, a); |
376 node->ReplaceInput(1, b); | 375 node->ReplaceInput(1, b); |
377 node->TrimInputCount(2); | 376 node->TrimInputCount(2); |
378 return Changed(node); | 377 return Changed(node); |
379 } | 378 } |
380 | 379 |
381 } // namespace compiler | 380 } // namespace compiler |
382 } // namespace internal | 381 } // namespace internal |
383 } // namespace v8 | 382 } // namespace v8 |
OLD | NEW |