Commit 5ff7901e authored by ulan's avatar ulan Committed by Commit bot

Fix JSInliningHeuristic::CandidateCompare predicate.

STL requires comparison to be a strict weak ordering.

In particular the predicate should be antisymmetric:
f(x, y) implies !f(y, x).

BUG=v8:4848
LOG=NO

Review URL: https://codereview.chromium.org/1818043004

Cr-Commit-Position: refs/heads/master@{#34960}
parent b6419fa2
......@@ -121,7 +121,10 @@ void JSInliningHeuristic::Finalize() {
bool JSInliningHeuristic::CandidateCompare::operator()(
const Candidate& left, const Candidate& right) const {
return left.node != right.node && left.calls >= right.calls;
if (left.calls != right.calls) {
return left.calls > right.calls;
}
return left.node < right.node;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment