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

Unified Diff: vm/flow_graph_builder.cc

Issue 10826097: Use explicit push-argument for InstanceSetter instruction. (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
« no previous file with comments | « vm/flow_graph_builder.h ('k') | vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/flow_graph_builder.cc
===================================================================
--- vm/flow_graph_builder.cc (revision 10115)
+++ vm/flow_graph_builder.cc (working copy)
@@ -1788,43 +1788,52 @@
}
-void EffectGraphVisitor::BuildInstanceSetterValues(
- InstanceSetterNode* node, Value** receiver, Value** value) {
+void EffectGraphVisitor::BuildInstanceSetterArguments(
+ InstanceSetterNode* node,
+ ZoneGrowableArray<PushArgumentInstr*>* arguments,
+ bool result_is_needed) {
ValueGraphVisitor for_receiver(owner(), temp_index());
node->receiver()->Visit(&for_receiver);
Append(for_receiver);
- ValueGraphVisitor for_value(owner(), for_receiver.temp_index());
+ arguments->Add(PushArgument(for_receiver.value()));
+
+ ValueGraphVisitor for_value(owner(), temp_index());
node->value()->Visit(&for_value);
Append(for_value);
- *receiver = for_receiver.value();
- *value = for_value.value();
+
+ Value* value = NULL;
+ if (result_is_needed) {
+ value = Bind(
+ BuildStoreLocal(*owner()->parsed_function().expression_temp_var(),
+ for_value.value()));
+ } else {
+ value = for_value.value();
+ }
+ arguments->Add(PushArgument(value));
}
void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
- Value *receiver, *value;
- BuildInstanceSetterValues(node, &receiver, &value);
+ ZoneGrowableArray<PushArgumentInstr*>* arguments =
+ new ZoneGrowableArray<PushArgumentInstr*>(2);
+ BuildInstanceSetterArguments(node, arguments, false); // Value not used.
InstanceSetterComp* setter =
new InstanceSetterComp(node->token_pos(),
owner()->try_index(),
node->field_name(),
- receiver,
- value);
+ arguments);
ReturnComputation(setter);
}
void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
- Value *receiver, *value;
- BuildInstanceSetterValues(node, &receiver, &value);
- Value* saved_value = Bind(
- BuildStoreLocal(*owner()->parsed_function().expression_temp_var(),
- value));
+ ZoneGrowableArray<PushArgumentInstr*>* arguments =
+ new ZoneGrowableArray<PushArgumentInstr*>(2);
+ BuildInstanceSetterArguments(node, arguments, true); // Value used.
Do(new InstanceSetterComp(node->token_pos(),
owner()->try_index(),
node->field_name(),
- receiver,
- saved_value));
+ arguments));
ReturnComputation(
BuildLoadLocal(*owner()->parsed_function().expression_temp_var()));
}
« no previous file with comments | « vm/flow_graph_builder.h ('k') | vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698