OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_CALL_REDUCER_H_ |
| 6 #define V8_COMPILER_JS_CALL_REDUCER_H_ |
| 7 |
| 8 #include "src/compiler/graph-reducer.h" |
| 9 |
| 10 namespace v8 { |
| 11 namespace internal { |
| 12 namespace compiler { |
| 13 |
| 14 // Forward declarations. |
| 15 class JSGraph; |
| 16 class JSOperatorBuilder; |
| 17 |
| 18 |
| 19 // Performs strength reduction on {JSCallFunction} nodes, which might allow |
| 20 // inlining or other optimizations to be performed afterwards. |
| 21 class JSCallReducer final : public Reducer { |
| 22 public: |
| 23 explicit JSCallReducer(JSGraph* jsgraph) : jsgraph_(jsgraph) {} |
| 24 |
| 25 Reduction Reduce(Node* node) final; |
| 26 |
| 27 private: |
| 28 Reduction ReduceFunctionPrototypeApply(Node* node); |
| 29 Reduction ReduceFunctionPrototypeCall(Node* node); |
| 30 |
| 31 Graph* graph() const; |
| 32 JSGraph* jsgraph() const { return jsgraph_; } |
| 33 Isolate* isolate() const; |
| 34 JSOperatorBuilder* javascript() const; |
| 35 |
| 36 JSGraph* const jsgraph_; |
| 37 }; |
| 38 |
| 39 } // namespace compiler |
| 40 } // namespace internal |
| 41 } // namespace v8 |
| 42 |
| 43 #endif // V8_COMPILER_JS_CALL_REDUCER_H_ |
OLD | NEW |