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

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

Issue 1410723004: [turbofan] Bring back early return in JSInliningHeuristic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // Everything above this line is part of the inlining heuristic. 82 // Everything above this line is part of the inlining heuristic.
83 // --------------------------------------------------------------------------- 83 // ---------------------------------------------------------------------------
84 84
85 // In the general case we remember the candidate for later. 85 // In the general case we remember the candidate for later.
86 candidates_.insert({function, node, calls}); 86 candidates_.insert({function, node, calls});
87 return NoChange(); 87 return NoChange();
88 } 88 }
89 89
90 90
91 void JSInliningHeuristic::Finalize() { 91 void JSInliningHeuristic::Finalize() {
92 if (candidates_.empty()) return; // Nothing to do without candidates.
92 if (FLAG_trace_turbo_inlining) PrintCandidates(); 93 if (FLAG_trace_turbo_inlining) PrintCandidates();
93 94
94 while (!candidates_.empty()) { 95 while (!candidates_.empty()) {
95 if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) break; 96 if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) break;
96 auto i = candidates_.begin(); 97 auto i = candidates_.begin();
97 Candidate const& candidate = *i; 98 Candidate const& candidate = *i;
98 inliner_.ReduceJSCallFunction(candidate.node, candidate.function); 99 inliner_.ReduceJSCallFunction(candidate.node, candidate.function);
99 cumulative_count_ += candidate.function->shared()->ast_node_count(); 100 cumulative_count_ += candidate.function->shared()->ast_node_count();
100 candidates_.erase(i); 101 candidates_.erase(i);
101 } 102 }
(...skipping 13 matching lines...) Expand all
115 candidate.node->id(), candidate.calls, 116 candidate.node->id(), candidate.calls,
116 candidate.function->shared()->SourceSize(), 117 candidate.function->shared()->SourceSize(),
117 candidate.function->shared()->ast_node_count(), 118 candidate.function->shared()->ast_node_count(),
118 candidate.function->shared()->DebugName()->ToCString().get()); 119 candidate.function->shared()->DebugName()->ToCString().get());
119 } 120 }
120 } 121 }
121 122
122 } // namespace compiler 123 } // namespace compiler
123 } // namespace internal 124 } // namespace internal
124 } // namespace v8 125 } // 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