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

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

Issue 1818043004: Fix JSInliningHeuristic::CandidateCompare predicate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Correct fix Created 4 years, 9 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 | « no previous file | no next file » | 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 #include "src/compiler/js-inlining-heuristic.h" 5 #include "src/compiler/js-inlining-heuristic.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/objects-inl.h" 9 #include "src/objects-inl.h"
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 cumulative_count_ += candidate.function->shared()->ast_node_count(); 114 cumulative_count_ += candidate.function->shared()->ast_node_count();
115 return; 115 return;
116 } 116 }
117 } 117 }
118 } 118 }
119 } 119 }
120 120
121 121
122 bool JSInliningHeuristic::CandidateCompare::operator()( 122 bool JSInliningHeuristic::CandidateCompare::operator()(
123 const Candidate& left, const Candidate& right) const { 123 const Candidate& left, const Candidate& right) const {
124 return left.node != right.node && left.calls >= right.calls; 124 if (left.calls != right.calls) {
125 return left.calls > right.calls;
126 }
127 return left.node < right.node;
125 } 128 }
126 129
127 130
128 void JSInliningHeuristic::PrintCandidates() { 131 void JSInliningHeuristic::PrintCandidates() {
129 PrintF("Candidates for inlining (size=%zu):\n", candidates_.size()); 132 PrintF("Candidates for inlining (size=%zu):\n", candidates_.size());
130 for (const Candidate& candidate : candidates_) { 133 for (const Candidate& candidate : candidates_) {
131 PrintF(" id:%d, calls:%d, size[source]:%d, size[ast]:%d / %s\n", 134 PrintF(" id:%d, calls:%d, size[source]:%d, size[ast]:%d / %s\n",
132 candidate.node->id(), candidate.calls, 135 candidate.node->id(), candidate.calls,
133 candidate.function->shared()->SourceSize(), 136 candidate.function->shared()->SourceSize(),
134 candidate.function->shared()->ast_node_count(), 137 candidate.function->shared()->ast_node_count(),
135 candidate.function->shared()->DebugName()->ToCString().get()); 138 candidate.function->shared()->DebugName()->ToCString().get());
136 } 139 }
137 } 140 }
138 141
139 } // namespace compiler 142 } // namespace compiler
140 } // namespace internal 143 } // namespace internal
141 } // namespace v8 144 } // namespace v8
OLDNEW
« 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