| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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_INLINING_HEURISTIC_H_ | 5 #ifndef V8_COMPILER_JS_INLINING_HEURISTIC_H_ |
| 6 #define V8_COMPILER_JS_INLINING_HEURISTIC_H_ | 6 #define V8_COMPILER_JS_INLINING_HEURISTIC_H_ |
| 7 | 7 |
| 8 #include "src/compiler/js-inlining.h" | 8 #include "src/compiler/js-inlining.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // and inlines call sites that the heuristic determines to be important. | 30 // and inlines call sites that the heuristic determines to be important. |
| 31 void Finalize() final; | 31 void Finalize() final; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // This limit currently matches what Crankshaft does. We may want to | 34 // This limit currently matches what Crankshaft does. We may want to |
| 35 // re-evaluate and come up with a proper limit for TurboFan. | 35 // re-evaluate and come up with a proper limit for TurboFan. |
| 36 static const int kMaxCallPolymorphism = 4; | 36 static const int kMaxCallPolymorphism = 4; |
| 37 | 37 |
| 38 struct Candidate { | 38 struct Candidate { |
| 39 Handle<JSFunction> functions[kMaxCallPolymorphism]; | 39 Handle<JSFunction> functions[kMaxCallPolymorphism]; |
| 40 // TODO(2206): For now polymorphic inlining is treated orthogonally to |
| 41 // inlining based on SharedFunctionInfo. This should be unified and the |
| 42 // above array should be switched to SharedFunctionInfo instead. Currently |
| 43 // we use {num_functions == 1 && functions[0].is_null()} as an indicator. |
| 44 Handle<SharedFunctionInfo> shared_info; |
| 40 int num_functions; | 45 int num_functions; |
| 41 Node* node = nullptr; // The call site at which to inline. | 46 Node* node = nullptr; // The call site at which to inline. |
| 42 float frequency = 0.0f; // Relative frequency of this call site. | 47 float frequency = 0.0f; // Relative frequency of this call site. |
| 43 }; | 48 }; |
| 44 | 49 |
| 45 // Comparator for candidates. | 50 // Comparator for candidates. |
| 46 struct CandidateCompare { | 51 struct CandidateCompare { |
| 47 bool operator()(const Candidate& left, const Candidate& right) const; | 52 bool operator()(const Candidate& left, const Candidate& right) const; |
| 48 }; | 53 }; |
| 49 | 54 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 ZoneSet<NodeId> seen_; | 70 ZoneSet<NodeId> seen_; |
| 66 JSGraph* const jsgraph_; | 71 JSGraph* const jsgraph_; |
| 67 int cumulative_count_ = 0; | 72 int cumulative_count_ = 0; |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 } // namespace compiler | 75 } // namespace compiler |
| 71 } // namespace internal | 76 } // namespace internal |
| 72 } // namespace v8 | 77 } // namespace v8 |
| 73 | 78 |
| 74 #endif // V8_COMPILER_JS_INLINING_HEURISTIC_H_ | 79 #endif // V8_COMPILER_JS_INLINING_HEURISTIC_H_ |
| OLD | NEW |