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

Unified Diff: runtime/vm/flow_graph_compiler.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_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 9089)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -31,7 +31,8 @@
Assembler* assembler,
const ParsedFunction& parsed_function,
const GrowableArray<BlockEntryInstr*>& block_order,
- bool is_optimizing)
+ bool is_optimizing,
+ bool is_leaf)
: assembler_(assembler),
parsed_function_(parsed_function),
block_order_(block_order),
@@ -42,6 +43,7 @@
block_info_(block_order.length()),
deopt_stubs_(),
is_optimizing_(is_optimizing),
+ is_dart_leaf_(is_leaf),
bool_true_(Bool::ZoneHandle(Bool::True())),
bool_false_(Bool::ZoneHandle(Bool::False())),
double_class_(Class::ZoneHandle(
@@ -61,6 +63,13 @@
}
+bool FlowGraphCompiler::IsLeaf() const {
+ return is_dart_leaf_ &&
+ !parsed_function_.function().IsClosureFunction() &&
+ (parsed_function().copied_parameter_count() == 0);
+}
+
+
void FlowGraphCompiler::InitCompiler() {
pc_descriptors_list_ = new DescriptorList();
exception_handlers_list_ = new ExceptionHandlerList();
@@ -278,6 +287,7 @@
intptr_t argument_count,
const Array& argument_names,
intptr_t checked_argument_count) {
+ ASSERT(!IsLeaf());
ASSERT(frame_register_allocator()->IsSpilled());
ICData& ic_data =
ICData::ZoneHandle(ICData::New(parsed_function().function(),

Powered by Google App Engine
This is Rietveld 408576698