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

Unified Diff: vm/flow_graph_builder.cc

Issue 10825035: Add an explicit push-argument instruction to the IL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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: vm/flow_graph_builder.cc
===================================================================
--- vm/flow_graph_builder.cc (revision 9930)
+++ vm/flow_graph_builder.cc (working copy)
@@ -1375,6 +1375,7 @@
} else {
receiver = BuildNullValue();
}
+ AddInstruction(new PushArgumentInstr(receiver));
ASSERT(function.context_scope() != ContextScope::null());
// The function type of a closure may have type arguments. In that case, pass
@@ -1389,10 +1390,8 @@
} else {
type_arguments = BuildNullValue();
}
-
- CreateClosureComp* create = new CreateClosureComp(
- node, owner()->try_index(), type_arguments, receiver);
- ReturnComputation(create);
+ AddInstruction(new PushArgumentInstr(type_arguments));
+ ReturnComputation(new CreateClosureComp(node, owner()->try_index()));
Kevin Millikin (Google) 2012/07/26 13:03:18 I imagine we'll also want a list of the push argum
Florian Schneider 2012/07/26 13:45:24 Done.
}
@@ -1407,6 +1406,21 @@
}
}
+
+void EffectGraphVisitor::BuildPushArguments(
+ const ArgumentListNode& node,
+ ZoneGrowableArray<PushArgumentInstr*>* values) {
+ for (intptr_t i = 0; i < node.length(); ++i) {
+ ValueGraphVisitor for_argument(owner(), temp_index());
+ node.NodeAt(i)->Visit(&for_argument);
+ Append(for_argument);
+ PushArgumentInstr* push_arg = new PushArgumentInstr(for_argument.value());
+ AddInstruction(push_arg);
+ values->Add(push_arg);
+ }
+}
+
+
void EffectGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) {
ArgumentListNode* arguments = node->arguments();
int length = arguments->length();
@@ -1447,11 +1461,13 @@
ValueGraphVisitor for_closure(owner(), temp_index());
node->closure()->Visit(&for_closure);
Append(for_closure);
+ PushArgumentInstr* push_closure = new PushArgumentInstr(for_closure.value());
+ AddInstruction(push_closure);
- ZoneGrowableArray<Value*>* arguments =
- new ZoneGrowableArray<Value*>(node->arguments()->length());
- arguments->Add(for_closure.value());
- TranslateArgumentList(*node->arguments(), arguments);
+ ZoneGrowableArray<PushArgumentInstr*>* arguments =
+ new ZoneGrowableArray<PushArgumentInstr*>(node->arguments()->length());
+ arguments->Add(push_closure);
+ BuildPushArguments(*node->arguments(), arguments);
// Save context around the call.
BuildStoreContext(*owner()->parsed_function().expression_temp_var());
« no previous file with comments | « vm/flow_graph_builder.h ('k') | vm/flow_graph_compiler.cc » ('j') | vm/flow_graph_compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698