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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 9463007: Ensure that outgoing constant arguments will be materialized. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 01ad7fde8940ebd34d7b186bd028e7dd576ed9f2..439e549214092934424717804d29cd102209774d 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -561,22 +561,32 @@ void TestGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) {
}
-// <Expression> ::= StaticCall { function: Function
-// arguments: <ArgumentList> }
-StaticCallComp* EffectGraphVisitor::TranslateStaticCall(
- const StaticCallNode& node) {
- ArgumentListNode* arguments = node.arguments();
- int length = arguments->length();
- ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length);
+void EffectGraphVisitor::TranslateArgumentList(
+ const ArgumentListNode& node, ZoneGrowableArray<Value*>* values) {
int index = temp_index();
- for (intptr_t i = 0; i < length; ++i) {
+ for (intptr_t i = 0; i < node.length(); ++i) {
ValueGraphVisitor for_value(owner(), index);
- arguments->NodeAt(i)->Visit(&for_value);
+ node.NodeAt(i)->Visit(&for_value);
Append(for_value);
- CHECK_ALIVE(return NULL);
- values->Add(for_value.value());
+ CHECK_ALIVE(return);
+ Value* argument_value = for_value.value();
index = for_value.temp_index();
+ if (argument_value->IsConstant()) {
+ AddInstruction(new BindInstr(index, argument_value));
+ argument_value = new TempValue(index++);
+ }
+ values->Add(argument_value);
}
+}
+
+// <Expression> ::= StaticCall { function: Function
+// arguments: <ArgumentList> }
+StaticCallComp* EffectGraphVisitor::TranslateStaticCall(
+ const StaticCallNode& node) {
+ int length = node.arguments()->length();
+ ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>(length);
+ TranslateArgumentList(*node.arguments(), values);
+ CHECK_ALIVE(return NULL);
return new StaticCallComp(node.function(), values);
}
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698