Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(883)

Side by Side Diff: src/compiler/js-inlining-heuristic.h

Issue 2856103002: [turbofan] Introduce dedicated CallFrequency class. (Closed)
Patch Set: Address offline feedback from jarin@. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/js-inlining-heuristic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/js-inlining-heuristic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698