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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10668034: Recognize leaf functions: skip stack check and populating the pc slot, store the pc slot lazily in … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 9089)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -614,4 +614,28 @@
}
+
+FlowGraphAnalyzer::FlowGraphAnalyzer(
+ const GrowableArray<BlockEntryInstr*>& blocks)
+ :blocks_(blocks), is_leaf_(false) {}
+
+
+void FlowGraphAnalyzer::Analyze() {
+ is_leaf_ = true;
+ for (intptr_t i = 0; i < blocks_.length(); ++i) {
+ BlockEntryInstr* block_entry = blocks_[i];
+ Instruction* instr = block_entry->StraightLineSuccessor();
+ while ((instr != NULL) && !instr->IsBlockEntry()) {
+ LocationSummary* locs = instr->locs();
+ if (locs != NULL) {
+ if (locs->is_call()) {
+ is_leaf_ = false;
+ return;
+ }
+ }
+ instr = instr->StraightLineSuccessor();
+ }
+ }
+}
+
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698