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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 14308009: Detect leaf optimized methods and skip stack check overflow test in those, unless it is in a loop (… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 21574)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -160,6 +160,8 @@
pc_descriptors_list_ = new DescriptorList(64);
exception_handlers_list_ = new ExceptionHandlerList();
block_info_.Clear();
+ bool is_leaf = !parsed_function().function().IsClosureFunction() &&
+ is_optimizing();
for (int i = 0; i < block_order_.length(); ++i) {
block_info_.Add(new BlockInfo());
if (is_optimizing()) {
@@ -185,9 +187,24 @@
may_reoptimize_ = true;
break;
}
+ if (is_leaf && !current->IsCheckStackOverflow()) {
+ // Note that we do no care if the code contains instructions that
+ // can deoptimize.
+ LocationSummary* locs = current->locs();
+ if (locs != NULL && locs->can_call()) {
+ is_leaf = false;
+ }
+ }
}
}
}
+ if (is_leaf) {
+ BlockEntryInstr* entry = block_order_[1];
Kevin Millikin (Google) 2013/04/18 10:05:28 I don't think we should rely on properties of the
srdjan 2013/04/18 18:15:57 Yes, using: flow_graph_.graph_entry()->normal_entr
+ ASSERT(entry != NULL);
+ CheckStackOverflowInstr* check = entry->next()->AsCheckStackOverflow();
+ ASSERT(check != NULL);
+ check->RemoveFromGraph();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698