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 25 matching lines...) Expand all Loading... |
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 | 40 // TODO(2206): For now polymorphic inlining is treated orthogonally to |
41 // inlining based on SharedFunctionInfo. This should be unified and the | 41 // inlining based on SharedFunctionInfo. This should be unified and the |
42 // above array should be switched to SharedFunctionInfo instead. Currently | 42 // above array should be switched to SharedFunctionInfo instead. Currently |
43 // we use {num_functions == 1 && functions[0].is_null()} as an indicator. | 43 // we use {num_functions == 1 && functions[0].is_null()} as an indicator. |
44 Handle<SharedFunctionInfo> shared_info; | 44 Handle<SharedFunctionInfo> shared_info; |
45 int num_functions; | 45 int num_functions; |
46 Node* node = nullptr; // The call site at which to inline. | 46 Node* node = nullptr; // The call site at which to inline. |
47 float frequency = 0.0f; // Relative frequency of this call site. | 47 CallFrequency frequency; // Relative frequency of this call site. |
48 }; | 48 }; |
49 | 49 |
50 // Comparator for candidates. | 50 // Comparator for candidates. |
51 struct CandidateCompare { | 51 struct CandidateCompare { |
52 bool operator()(const Candidate& left, const Candidate& right) const; | 52 bool operator()(const Candidate& left, const Candidate& right) const; |
53 }; | 53 }; |
54 | 54 |
55 // Candidates are kept in a sorted set of unique candidates. | 55 // Candidates are kept in a sorted set of unique candidates. |
56 typedef ZoneSet<Candidate, CandidateCompare> Candidates; | 56 typedef ZoneSet<Candidate, CandidateCompare> Candidates; |
57 | 57 |
(...skipping 12 matching lines...) Expand all Loading... |
70 ZoneSet<NodeId> seen_; | 70 ZoneSet<NodeId> seen_; |
71 JSGraph* const jsgraph_; | 71 JSGraph* const jsgraph_; |
72 int cumulative_count_ = 0; | 72 int cumulative_count_ = 0; |
73 }; | 73 }; |
74 | 74 |
75 } // namespace compiler | 75 } // namespace compiler |
76 } // namespace internal | 76 } // namespace internal |
77 } // namespace v8 | 77 } // namespace v8 |
78 | 78 |
79 #endif // V8_COMPILER_JS_INLINING_HEURISTIC_H_ | 79 #endif // V8_COMPILER_JS_INLINING_HEURISTIC_H_ |
OLD | NEW |