OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef V8_COMPILER_JS_BUILTIN_REDUCER_H_ | |
6 #define V8_COMPILER_JS_BUILTIN_REDUCER_H_ | |
7 | |
8 #include "src/compiler/graph-reducer.h" | |
9 #include "src/compiler/js-graph.h" | |
10 #include "src/compiler/machine-operator.h" | |
11 #include "src/compiler/node.h" | |
12 #include "src/compiler/simplified-operator.h" | |
13 | |
14 namespace v8 { | |
15 namespace internal { | |
16 namespace compiler { | |
17 | |
18 class JSBuiltinReducer FINAL : public Reducer { | |
19 public: | |
20 explicit JSBuiltinReducer(JSGraph* jsgraph) | |
21 : jsgraph_(jsgraph), simplified_(jsgraph->zone()) {} | |
22 virtual ~JSBuiltinReducer() {} | |
23 | |
24 virtual Reduction Reduce(Node* node) OVERRIDE; | |
25 | |
26 private: | |
27 Graph* graph() { return jsgraph_->graph(); } | |
28 CommonOperatorBuilder* common() { return jsgraph_->common(); } | |
29 MachineOperatorBuilder* machine() { return jsgraph_->machine(); } | |
30 SimplifiedOperatorBuilder* simplified() { return &simplified_; } | |
31 | |
32 #define DECLARE_REDUCE(ignored1, ignore2, name) \ | |
33 Reduction Reduce##name(Node* node); | |
34 FUNCTIONS_WITH_ID_LIST(DECLARE_REDUCE) | |
titzer
2014/09/19 11:06:15
Where does this (higher order) macro come from? Ca
Michael Starzinger
2014/09/19 11:18:30
Done.
| |
35 #undef DECLARE_REDUCE | |
36 | |
37 JSGraph* jsgraph_; | |
38 SimplifiedOperatorBuilder simplified_; | |
39 }; | |
40 | |
41 } // namespace compiler | |
42 } // namespace internal | |
43 } // namespace v8 | |
44 | |
45 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_ | |
OLD | NEW |