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

Side by Side Diff: runtime/vm/flow_graph_inliner.cc

Issue 659793003: Fix issue 21159: prevent endless inlining of field dispatchers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/isssue_21159.dart » ('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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_inliner.h" 5 #include "vm/flow_graph_inliner.h"
6 6
7 #include "vm/block_scheduler.h" 7 #include "vm/block_scheduler.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/flow_graph.h" 10 #include "vm/flow_graph.h"
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 "code size: %" Pd ", " 757 "code size: %" Pd ", "
758 "call sites: %" Pd ", " 758 "call sites: %" Pd ", "
759 "const args: %" Pd "\n", 759 "const args: %" Pd "\n",
760 size, 760 size,
761 call_site_count, 761 call_site_count,
762 constants_count)); 762 constants_count));
763 PRINT_INLINING_TREE("Heuristic fail", 763 PRINT_INLINING_TREE("Heuristic fail",
764 &call_data->caller, &function, call_data->call); 764 &call_data->caller, &function, call_data->call);
765 return false; 765 return false;
766 } 766 }
767 767 if ((GrowthFactor() < 10.0) &&
Florian Schneider 2014/10/16 10:34:33 We need to avoid infinite recursion, but not sure
768 if (function.IsInvokeFieldDispatcher() || 768 (function.IsInvokeFieldDispatcher() ||
769 function.IsNoSuchMethodDispatcher()) { 769 function.IsNoSuchMethodDispatcher())) {
770 // Append call sites to the currently processed list so that dispatcher 770 // Append call sites to the currently processed list so that dispatcher
771 // methods get inlined regardless of the current depth. 771 // methods get inlined regardless of the current depth.
772 // Use GrowthFactor to prevent endless recursive inlining.
772 inlining_call_sites_->FindCallSites(callee_graph, 773 inlining_call_sites_->FindCallSites(callee_graph,
773 0, 774 0,
774 &inlined_info_); 775 &inlined_info_);
775 } else { 776 } else {
776 collected_call_sites_->FindCallSites(callee_graph, 777 collected_call_sites_->FindCallSites(callee_graph,
777 inlining_depth_, 778 inlining_depth_,
778 &inlined_info_); 779 &inlined_info_);
779 } 780 }
780 781
781 // Add the function to the cache. 782 // Add the function to the cache.
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 OS::Print("After Inlining of %s\n", flow_graph_-> 1704 OS::Print("After Inlining of %s\n", flow_graph_->
1704 parsed_function().function().ToFullyQualifiedCString()); 1705 parsed_function().function().ToFullyQualifiedCString());
1705 FlowGraphPrinter printer(*flow_graph_); 1706 FlowGraphPrinter printer(*flow_graph_);
1706 printer.PrintBlocks(); 1707 printer.PrintBlocks();
1707 } 1708 }
1708 } 1709 }
1709 } 1710 }
1710 } 1711 }
1711 1712
1712 } // namespace dart 1713 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/isssue_21159.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698