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_JS_BUILTIN_REDUCER_H_ | 5 #ifndef V8_COMPILER_JS_BUILTIN_REDUCER_H_ |
6 #define V8_COMPILER_JS_BUILTIN_REDUCER_H_ | 6 #define V8_COMPILER_JS_BUILTIN_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 CommonOperatorBuilder; | 15 class CommonOperatorBuilder; |
16 class JSGraph; | 16 class JSGraph; |
17 class JSOperatorBuilder; | |
18 class MachineOperatorBuilder; | 17 class MachineOperatorBuilder; |
19 class SimplifiedOperatorBuilder; | 18 class SimplifiedOperatorBuilder; |
20 | 19 |
21 | 20 |
22 class JSBuiltinReducer final : public AdvancedReducer { | 21 class JSBuiltinReducer final : public AdvancedReducer { |
23 public: | 22 public: |
24 explicit JSBuiltinReducer(Editor* editor, JSGraph* jsgraph); | 23 explicit JSBuiltinReducer(Editor* editor, JSGraph* jsgraph); |
25 ~JSBuiltinReducer() final {} | 24 ~JSBuiltinReducer() final {} |
26 | 25 |
27 Reduction Reduce(Node* node) final; | 26 Reduction Reduce(Node* node) final; |
28 | 27 |
29 private: | 28 private: |
30 Reduction ReduceFunctionCall(Node* node); | 29 Reduction ReduceFunctionCall(Node* node); |
31 Reduction ReduceMathMax(Node* node); | 30 Reduction ReduceMathMax(Node* node); |
32 Reduction ReduceMathImul(Node* node); | 31 Reduction ReduceMathImul(Node* node); |
33 Reduction ReduceMathFround(Node* node); | 32 Reduction ReduceMathFround(Node* node); |
34 | 33 |
35 Graph* graph() const; | 34 Graph* graph() const; |
36 JSGraph* jsgraph() const { return jsgraph_; } | 35 JSGraph* jsgraph() const { return jsgraph_; } |
37 Isolate* isolate() const; | 36 Isolate* isolate() const; |
38 CommonOperatorBuilder* common() const; | 37 CommonOperatorBuilder* common() const; |
39 MachineOperatorBuilder* machine() const; | 38 MachineOperatorBuilder* machine() const; |
40 SimplifiedOperatorBuilder* simplified() const; | 39 SimplifiedOperatorBuilder* simplified() const; |
41 JSOperatorBuilder* javascript() const; | |
42 | 40 |
43 JSGraph* jsgraph_; | 41 JSGraph* jsgraph_; |
44 }; | 42 }; |
45 | 43 |
46 } // namespace compiler | 44 } // namespace compiler |
47 } // namespace internal | 45 } // namespace internal |
48 } // namespace v8 | 46 } // namespace v8 |
49 | 47 |
50 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_ | 48 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_ |
OLD | NEW |