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

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

Issue 2336113002: [turbofan] Make the inlining heuristic deterministic. (Closed)
Patch Set: Created 4 years, 3 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/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/simplified-operator.h" 10 #include "src/compiler/simplified-operator.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 279
280 return Replace(value); 280 return Replace(value);
281 } 281 }
282 282
283 bool JSInliningHeuristic::CandidateCompare::operator()( 283 bool JSInliningHeuristic::CandidateCompare::operator()(
284 const Candidate& left, const Candidate& right) const { 284 const Candidate& left, const Candidate& right) const {
285 if (left.calls != right.calls) { 285 if (left.calls != right.calls) {
286 return left.calls > right.calls; 286 return left.calls > right.calls;
287 } 287 }
288 return left.node < right.node; 288 return left.node->id() > right.node->id();
289 } 289 }
290 290
291 void JSInliningHeuristic::PrintCandidates() { 291 void JSInliningHeuristic::PrintCandidates() {
292 PrintF("Candidates for inlining (size=%zu):\n", candidates_.size()); 292 PrintF("Candidates for inlining (size=%zu):\n", candidates_.size());
293 for (const Candidate& candidate : candidates_) { 293 for (const Candidate& candidate : candidates_) {
294 PrintF(" #%d:%s, calls:%d\n", candidate.node->id(), 294 PrintF(" #%d:%s, calls:%d\n", candidate.node->id(),
295 candidate.node->op()->mnemonic(), candidate.calls); 295 candidate.node->op()->mnemonic(), candidate.calls);
296 for (int i = 0; i < candidate.num_functions; ++i) { 296 for (int i = 0; i < candidate.num_functions; ++i) {
297 Handle<JSFunction> function = candidate.functions[i]; 297 Handle<JSFunction> function = candidate.functions[i];
298 PrintF(" - size[source]:%d, size[ast]:%d, name: %s\n", 298 PrintF(" - size[source]:%d, size[ast]:%d, name: %s\n",
(...skipping 10 matching lines...) Expand all
309 return jsgraph()->common(); 309 return jsgraph()->common();
310 } 310 }
311 311
312 SimplifiedOperatorBuilder* JSInliningHeuristic::simplified() const { 312 SimplifiedOperatorBuilder* JSInliningHeuristic::simplified() const {
313 return jsgraph()->simplified(); 313 return jsgraph()->simplified();
314 } 314 }
315 315
316 } // namespace compiler 316 } // namespace compiler
317 } // namespace internal 317 } // namespace internal
318 } // namespace v8 318 } // 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