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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 11031040: Don't inline functions above the deoptimization threshold. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Typo and added deopt increment Created 8 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/deopt_instructions.cc ('K') | « runtime/vm/deopt_instructions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index a4f17dc7e1fbc2a6743215d45e4af7a18edcc439..303f452b06a97388e8eb8c8280e1d12d758f060c 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -107,6 +107,14 @@ class CallSiteInliner : public FlowGraphVisitor {
// Assuming no optional parameters the actual/formal count should match.
ASSERT(arguments->length() == function.num_fixed_parameters());
+ // Abort if this function has deoptimized too much.
+ if (function.deoptimization_counter() >=
+ FLAG_deoptimization_counter_threshold) {
+ function.set_is_inlinable(false);
+ TRACE_INLINING(OS::Print(" Bailout: deoptimization threshold\n"));
+ return false;
+ }
+
// Abort if this is a recursive occurrence.
if (IsCallRecursive(function, call)) {
function.set_is_inlinable(false);
@@ -139,9 +147,7 @@ class CallSiteInliner : public FlowGraphVisitor {
parsed_function.AllocateVariables();
// Load IC data for the callee.
- if ((function.deoptimization_counter() <
- FLAG_deoptimization_counter_threshold) &&
- function.HasCode()) {
+ if (function.HasCode()) {
const Code& unoptimized_code =
Code::Handle(function.unoptimized_code());
isolate->set_ic_data_array(unoptimized_code.ExtractTypeFeedbackArray());
« runtime/vm/deopt_instructions.cc ('K') | « runtime/vm/deopt_instructions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698