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 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ | 5 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ |
6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ | 6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ |
7 | 7 |
8 #include "src/compiler/graph-reducer.h" | 8 #include "src/compiler/graph-reducer.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 // Forward declarations. | 14 // Forward declarations. |
15 class JSGraph; | 15 class JSGraph; |
16 class MachineOperatorBuilder; | 16 class MachineOperatorBuilder; |
17 class SimplifiedOperatorBuilder; | 17 class SimplifiedOperatorBuilder; |
18 | 18 |
19 | 19 |
20 class SimplifiedOperatorReducer final : public Reducer { | 20 class SimplifiedOperatorReducer final : public Reducer { |
21 public: | 21 public: |
22 explicit SimplifiedOperatorReducer(JSGraph* jsgraph); | 22 explicit SimplifiedOperatorReducer(JSGraph* jsgraph); |
23 ~SimplifiedOperatorReducer() final; | 23 ~SimplifiedOperatorReducer() final; |
24 | 24 |
25 Reduction Reduce(Node* node) final; | 25 Reduction Reduce(Node* node) final; |
26 | 26 |
27 private: | 27 private: |
| 28 Reduction ReduceReferenceEqual(Node* node); |
| 29 |
28 Reduction Change(Node* node, const Operator* op, Node* a); | 30 Reduction Change(Node* node, const Operator* op, Node* a); |
29 Reduction ReplaceFloat64(double value); | 31 Reduction ReplaceFloat64(double value); |
30 Reduction ReplaceInt32(int32_t value); | 32 Reduction ReplaceInt32(int32_t value); |
31 Reduction ReplaceUint32(uint32_t value) { | 33 Reduction ReplaceUint32(uint32_t value) { |
32 return ReplaceInt32(bit_cast<int32_t>(value)); | 34 return ReplaceInt32(bit_cast<int32_t>(value)); |
33 } | 35 } |
34 Reduction ReplaceNumber(double value); | 36 Reduction ReplaceNumber(double value); |
35 Reduction ReplaceNumber(int32_t value); | 37 Reduction ReplaceNumber(int32_t value); |
36 | 38 |
37 Graph* graph() const; | 39 Graph* graph() const; |
38 JSGraph* jsgraph() const { return jsgraph_; } | 40 JSGraph* jsgraph() const { return jsgraph_; } |
39 MachineOperatorBuilder* machine() const; | 41 MachineOperatorBuilder* machine() const; |
40 SimplifiedOperatorBuilder* simplified() const; | 42 SimplifiedOperatorBuilder* simplified() const; |
41 | 43 |
42 JSGraph* const jsgraph_; | 44 JSGraph* const jsgraph_; |
43 | 45 |
44 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorReducer); | 46 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorReducer); |
45 }; | 47 }; |
46 | 48 |
47 } // namespace compiler | 49 } // namespace compiler |
48 } // namespace internal | 50 } // namespace internal |
49 } // namespace v8 | 51 } // namespace v8 |
50 | 52 |
51 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ | 53 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_REDUCER_H_ |
OLD | NEW |