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 | 12 |
13 // Forward declarations. | 13 // Forward declarations. |
14 class TypeCache; | 14 class TypeCache; |
15 | 15 |
16 namespace compiler { | 16 namespace compiler { |
17 | 17 |
18 // Forward declarations. | 18 // Forward declarations. |
19 class CommonOperatorBuilder; | 19 class CommonOperatorBuilder; |
20 class JSGraph; | 20 class JSGraph; |
21 class MachineOperatorBuilder; | |
22 class SimplifiedOperatorBuilder; | 21 class SimplifiedOperatorBuilder; |
23 | 22 |
24 | 23 |
25 class JSBuiltinReducer final : public AdvancedReducer { | 24 class JSBuiltinReducer final : public AdvancedReducer { |
26 public: | 25 public: |
27 explicit JSBuiltinReducer(Editor* editor, JSGraph* jsgraph); | 26 explicit JSBuiltinReducer(Editor* editor, JSGraph* jsgraph); |
28 ~JSBuiltinReducer() final {} | 27 ~JSBuiltinReducer() final {} |
29 | 28 |
30 Reduction Reduce(Node* node) final; | 29 Reduction Reduce(Node* node) final; |
31 | 30 |
32 private: | 31 private: |
33 Reduction ReduceFunctionCall(Node* node); | 32 Reduction ReduceMathAtan(Node* node); |
34 Reduction ReduceMathMax(Node* node); | 33 Reduction ReduceMathAtan2(Node* node); |
35 Reduction ReduceMathImul(Node* node); | |
36 Reduction ReduceMathCeil(Node* node); | 34 Reduction ReduceMathCeil(Node* node); |
37 Reduction ReduceMathClz32(Node* node); | 35 Reduction ReduceMathClz32(Node* node); |
38 Reduction ReduceMathFloor(Node* node); | 36 Reduction ReduceMathFloor(Node* node); |
39 Reduction ReduceMathFround(Node* node); | 37 Reduction ReduceMathFround(Node* node); |
40 Reduction ReduceMathAtan(Node* node); | 38 Reduction ReduceMathImul(Node* node); |
41 Reduction ReduceMathAtan2(Node* node); | |
42 Reduction ReduceMathLog(Node* node); | 39 Reduction ReduceMathLog(Node* node); |
43 Reduction ReduceMathLog1p(Node* node); | 40 Reduction ReduceMathLog1p(Node* node); |
| 41 Reduction ReduceMathMax(Node* node); |
| 42 Reduction ReduceMathMin(Node* node); |
44 Reduction ReduceMathRound(Node* node); | 43 Reduction ReduceMathRound(Node* node); |
45 Reduction ReduceMathSqrt(Node* node); | 44 Reduction ReduceMathSqrt(Node* node); |
46 Reduction ReduceMathTrunc(Node* node); | 45 Reduction ReduceMathTrunc(Node* node); |
47 Reduction ReduceStringFromCharCode(Node* node); | 46 Reduction ReduceStringFromCharCode(Node* node); |
48 | 47 |
| 48 Node* ToNumber(Node* value); |
| 49 Node* ToUint32(Node* value); |
| 50 |
49 Graph* graph() const; | 51 Graph* graph() const; |
50 JSGraph* jsgraph() const { return jsgraph_; } | 52 JSGraph* jsgraph() const { return jsgraph_; } |
51 Isolate* isolate() const; | 53 Isolate* isolate() const; |
52 CommonOperatorBuilder* common() const; | 54 CommonOperatorBuilder* common() const; |
53 MachineOperatorBuilder* machine() const; | |
54 SimplifiedOperatorBuilder* simplified() const; | 55 SimplifiedOperatorBuilder* simplified() const; |
55 | 56 |
56 JSGraph* const jsgraph_; | 57 JSGraph* const jsgraph_; |
57 TypeCache const& type_cache_; | 58 TypeCache const& type_cache_; |
58 }; | 59 }; |
59 | 60 |
60 } // namespace compiler | 61 } // namespace compiler |
61 } // namespace internal | 62 } // namespace internal |
62 } // namespace v8 | 63 } // namespace v8 |
63 | 64 |
64 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_ | 65 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_ |
OLD | NEW |