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_MACHINE_OPERATOR_REDUCER_H_ | 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ |
6 #define V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ | 6 #define V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ |
7 | 7 |
8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
11 #include "src/globals.h" | 11 #include "src/globals.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 namespace compiler { | 15 namespace compiler { |
16 | 16 |
17 // Forward declarations. | 17 // Forward declarations. |
18 class CommonOperatorBuilder; | 18 class CommonOperatorBuilder; |
19 class JSGraph; | 19 class JSGraph; |
20 | 20 |
21 | 21 |
22 // Performs constant folding and strength reduction on nodes that have | 22 // Performs constant folding and strength reduction on nodes that have |
23 // machine operators. | 23 // machine operators. |
24 class V8_EXPORT_PRIVATE MachineOperatorReducer final | 24 class V8_EXPORT_PRIVATE MachineOperatorReducer final |
25 : public NON_EXPORTED_BASE(Reducer) { | 25 : public NON_EXPORTED_BASE(Reducer) { |
26 public: | 26 public: |
27 explicit MachineOperatorReducer(JSGraph* jsgraph); | 27 explicit MachineOperatorReducer(JSGraph* jsgraph, |
| 28 bool allow_signalling_nan = true); |
28 ~MachineOperatorReducer(); | 29 ~MachineOperatorReducer(); |
29 | 30 |
30 Reduction Reduce(Node* node) override; | 31 Reduction Reduce(Node* node) override; |
31 | 32 |
32 private: | 33 private: |
33 Node* Float32Constant(volatile float value); | 34 Node* Float32Constant(volatile float value); |
34 Node* Float64Constant(volatile double value); | 35 Node* Float64Constant(volatile double value); |
35 Node* Int32Constant(int32_t value); | 36 Node* Int32Constant(int32_t value); |
36 Node* Int64Constant(int64_t value); | 37 Node* Int64Constant(int64_t value); |
37 Node* Uint32Constant(uint32_t value) { | 38 Node* Uint32Constant(uint32_t value) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 Reduction ReduceFloat64InsertHighWord32(Node* node); | 98 Reduction ReduceFloat64InsertHighWord32(Node* node); |
98 Reduction ReduceFloat64Compare(Node* node); | 99 Reduction ReduceFloat64Compare(Node* node); |
99 Reduction ReduceFloat64RoundDown(Node* node); | 100 Reduction ReduceFloat64RoundDown(Node* node); |
100 | 101 |
101 Graph* graph() const; | 102 Graph* graph() const; |
102 JSGraph* jsgraph() const { return jsgraph_; } | 103 JSGraph* jsgraph() const { return jsgraph_; } |
103 CommonOperatorBuilder* common() const; | 104 CommonOperatorBuilder* common() const; |
104 MachineOperatorBuilder* machine() const; | 105 MachineOperatorBuilder* machine() const; |
105 | 106 |
106 JSGraph* jsgraph_; | 107 JSGraph* jsgraph_; |
| 108 bool allow_signalling_nan_; |
107 }; | 109 }; |
108 | 110 |
109 } // namespace compiler | 111 } // namespace compiler |
110 } // namespace internal | 112 } // namespace internal |
111 } // namespace v8 | 113 } // namespace v8 |
112 | 114 |
113 #endif // V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ | 115 #endif // V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ |
OLD | NEW |