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

Unified Diff: src/compiler/js-inlining-heuristic.cc

Issue 1430553003: [turbofan] Use sorted set in JSInliningHeuristic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo of doom. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-inlining-heuristic.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining-heuristic.cc
diff --git a/src/compiler/js-inlining-heuristic.cc b/src/compiler/js-inlining-heuristic.cc
index f0968218763deb420acf840b59534df801d8be4d..4b7fb8d567ecab532e5477adcd6f41bdf3b902a5 100644
--- a/src/compiler/js-inlining-heuristic.cc
+++ b/src/compiler/js-inlining-heuristic.cc
@@ -72,14 +72,13 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
// ---------------------------------------------------------------------------
// In the general case we remember the candidate for later.
- candidates_.push_back({function, node, calls});
+ candidates_.insert({function, node, calls});
return NoChange();
}
void JSInliningHeuristic::ProcessCandidates() {
if (candidates_.empty()) return; // Nothing to do without candidates.
- std::sort(candidates_.begin(), candidates_.end(), Compare);
if (FLAG_trace_turbo_inlining) PrintCandidates();
int cumulative_count = 0;
@@ -99,10 +98,9 @@ void JSInliningHeuristic::ProcessCandidates() {
}
-// static
-bool JSInliningHeuristic::Compare(const Candidate& left,
- const Candidate& right) {
- return left.calls > right.calls;
+bool JSInliningHeuristic::CandidateCompare::operator()(
+ const Candidate& left, const Candidate& right) const {
+ return left.node != right.node && left.calls >= right.calls;
}
« no previous file with comments | « src/compiler/js-inlining-heuristic.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698