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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10540040: Inline setters, getters, various cleanups & restructuring. (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
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler_ia32.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
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 8404)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1751,23 +1751,52 @@
}
-void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
+void EffectGraphVisitor::BuildInstanceSetterValues(
+ InstanceSetterNode* node, Value** receiver, Value** value) {
ValueGraphVisitor for_receiver(owner(), temp_index());
node->receiver()->Visit(&for_receiver);
Append(for_receiver);
ValueGraphVisitor for_value(owner(), for_receiver.temp_index());
node->value()->Visit(&for_value);
Append(for_value);
+ *receiver = for_receiver.value();
+ *value = for_value.value();
+}
+
+
+void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
+ Value *receiver, *value;
+ BuildInstanceSetterValues(node, &receiver, &value);
InstanceSetterComp* setter =
new InstanceSetterComp(node->token_index(),
owner()->try_index(),
node->field_name(),
- for_receiver.value(),
- for_value.value());
+ receiver,
+ value);
ReturnComputation(setter);
}
+void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
+ Value *receiver, *value;
+ BuildInstanceSetterValues(node, &receiver, &value);
+ BindInstr* store_local_instr = new BindInstr(
+ BuildStoreLocal(*owner()->parsed_function().expression_temp_var(),
+ value));
+ AddInstruction(store_local_instr);
+ UseVal* saved_value = new UseVal(store_local_instr);
+ InstanceSetterComp* setter =
+ new InstanceSetterComp(node->token_index(),
+ owner()->try_index(),
+ node->field_name(),
+ receiver,
+ saved_value);
+ AddInstruction(new DoInstr(setter));
+ ReturnComputation(
+ BuildLoadLocal(*owner()->parsed_function().expression_temp_var()));
+}
+
+
void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) {
const String& getter_name =
String::Handle(Field::GetterName(node->field_name()));
@@ -1854,8 +1883,8 @@
ValueGraphVisitor for_instance(owner(), temp_index());
node->instance()->Visit(&for_instance);
Append(for_instance);
- LoadInstanceFieldComp* load =
- new LoadInstanceFieldComp(node, for_instance.value());
+ LoadInstanceFieldComp* load = new LoadInstanceFieldComp(
+ node->field(), for_instance.value(), NULL, NULL);
ReturnComputation(load);
}
@@ -1877,12 +1906,19 @@
type,
dst_name);
}
- StoreInstanceFieldComp* store =
- new StoreInstanceFieldComp(node, for_instance.value(), store_value);
+ StoreInstanceFieldComp* store = new StoreInstanceFieldComp(
+ node->field(), for_instance.value(), store_value, NULL, NULL);
ReturnComputation(store);
}
+// StoreInstanceFieldNode does not return result.
+void ValueGraphVisitor::VisitStoreInstanceFieldNode(
+ StoreInstanceFieldNode* node) {
+ UNIMPLEMENTED();
+}
+
+
void EffectGraphVisitor::VisitLoadStaticFieldNode(LoadStaticFieldNode* node) {
LoadStaticFieldComp* load = new LoadStaticFieldComp(node->field());
ReturnComputation(load);
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698