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

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

Issue 2894433004: Enforce strict weak ordering on NaN frequencies (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 942968aaa5c0fc2929f26eb9365684066a4fb808..fa9fd0b25c0aff426d595ef83604f2a6d306ade8 100644
--- a/src/compiler/js-inlining-heuristic.cc
+++ b/src/compiler/js-inlining-heuristic.cc
@@ -306,6 +306,12 @@ Reduction JSInliningHeuristic::InlineCandidate(Candidate const& candidate) {
bool JSInliningHeuristic::CandidateCompare::operator()(
const Candidate& left, const Candidate& right) const {
if (right.frequency.IsUnknown()) {
+ if (left.frequency.IsUnknown()) {
+ // If left and right are both unknown then the ordering is indeterminate,
+ // which breaks strict weak ordering requirements, so we fall back to the
+ // node id as a tie breaker.
+ return left.node->id() > right.node->id();
+ }
return true;
} else if (left.frequency.IsUnknown()) {
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698