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 void Finalize() final; | 30 void Finalize() final; |
31 | 31 |
32 private: | 32 private: |
33 // This limit currently matches what Crankshaft does. We may want to | 33 // This limit currently matches what Crankshaft does. We may want to |
34 // re-evaluate and come up with a proper limit for TurboFan. | 34 // re-evaluate and come up with a proper limit for TurboFan. |
35 static const int kMaxCallPolymorphism = 4; | 35 static const int kMaxCallPolymorphism = 4; |
36 | 36 |
37 struct Candidate { | 37 struct Candidate { |
38 Handle<JSFunction> functions[kMaxCallPolymorphism]; | 38 Handle<JSFunction> functions[kMaxCallPolymorphism]; |
39 int num_functions; | 39 int num_functions; |
40 Node* node = nullptr; // The call site at which to inline. | 40 Node* node = nullptr; // The call site at which to inline. |
41 int calls = -1; // Number of times the call site was hit. | 41 float frequency = 0.0f; // Relative frequency of this call site. |
42 }; | 42 }; |
43 | 43 |
44 // Comparator for candidates. | 44 // Comparator for candidates. |
45 struct CandidateCompare { | 45 struct CandidateCompare { |
46 bool operator()(const Candidate& left, const Candidate& right) const; | 46 bool operator()(const Candidate& left, const Candidate& right) const; |
47 }; | 47 }; |
48 | 48 |
49 // Candidates are kept in a sorted set of unique candidates. | 49 // Candidates are kept in a sorted set of unique candidates. |
50 typedef ZoneSet<Candidate, CandidateCompare> Candidates; | 50 typedef ZoneSet<Candidate, CandidateCompare> Candidates; |
51 | 51 |
(...skipping 12 matching lines...) Expand all Loading... |
64 ZoneSet<NodeId> seen_; | 64 ZoneSet<NodeId> seen_; |
65 JSGraph* const jsgraph_; | 65 JSGraph* const jsgraph_; |
66 int cumulative_count_ = 0; | 66 int cumulative_count_ = 0; |
67 }; | 67 }; |
68 | 68 |
69 } // namespace compiler | 69 } // namespace compiler |
70 } // namespace internal | 70 } // namespace internal |
71 } // namespace v8 | 71 } // namespace v8 |
72 | 72 |
73 #endif // V8_COMPILER_JS_INLINING_HEURISTIC_H_ | 73 #endif // V8_COMPILER_JS_INLINING_HEURISTIC_H_ |
OLD | NEW |