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

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

Issue 2833423004: [turbofan] Make sure an inlined call is not resurrected and inlined again. (Closed)
Patch Set: Created 3 years, 8 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 | « src/compiler/js-inlining.cc ('k') | test/mjsunit/compiler/regress-714483.js » ('j') | 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, num_calls), 263 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, num_calls),
264 num_calls + 1, calls); 264 num_calls + 1, calls);
265 ReplaceWithValue(node, value, effect, control); 265 ReplaceWithValue(node, value, effect, control);
266 266
267 // Inline the individual, cloned call sites. 267 // Inline the individual, cloned call sites.
268 for (int i = 0; i < num_calls; ++i) { 268 for (int i = 0; i < num_calls; ++i) {
269 Handle<JSFunction> function = candidate.functions[i]; 269 Handle<JSFunction> function = candidate.functions[i];
270 Node* node = calls[i]; 270 Node* node = calls[i];
271 Reduction const reduction = inliner_.ReduceJSCall(node); 271 Reduction const reduction = inliner_.ReduceJSCall(node);
272 if (reduction.Changed()) { 272 if (reduction.Changed()) {
273 // Killing the call node is not strictly necessary, but it is safer to
274 // make sure we do not resurrect the node.
275 node->Kill();
273 cumulative_count_ += function->shared()->ast_node_count(); 276 cumulative_count_ += function->shared()->ast_node_count();
274 } 277 }
275 } 278 }
276 279
277 return Replace(value); 280 return Replace(value);
278 } 281 }
279 282
280 bool JSInliningHeuristic::CandidateCompare::operator()( 283 bool JSInliningHeuristic::CandidateCompare::operator()(
281 const Candidate& left, const Candidate& right) const { 284 const Candidate& left, const Candidate& right) const {
282 if (left.frequency > right.frequency) { 285 if (left.frequency > right.frequency) {
(...skipping 27 matching lines...) Expand all
310 return jsgraph()->common(); 313 return jsgraph()->common();
311 } 314 }
312 315
313 SimplifiedOperatorBuilder* JSInliningHeuristic::simplified() const { 316 SimplifiedOperatorBuilder* JSInliningHeuristic::simplified() const {
314 return jsgraph()->simplified(); 317 return jsgraph()->simplified();
315 } 318 }
316 319
317 } // namespace compiler 320 } // namespace compiler
318 } // namespace internal 321 } // namespace internal
319 } // namespace v8 322 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | test/mjsunit/compiler/regress-714483.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698