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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 9726011: Implement StaticGetter and StaticSetter in new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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/code_generator_x64.cc ('k') | runtime/vm/flow_graph_compiler_x64.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 5662)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1110,12 +1110,33 @@
void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) {
- Bailout("EffectGraphVisitor::VisitStaticGetterNode");
+ const String& getter_name =
+ String::Handle(Field::GetterName(node->field_name()));
+ const Function& getter_function =
+ Function::ZoneHandle(node->cls().LookupStaticFunction(getter_name));
+ ASSERT(!getter_function.IsNull());
+ ZoneGrowableArray<Value*>* values = new ZoneGrowableArray<Value*>();
+ StaticCallComp* call = new StaticCallComp(node->token_index(),
+ getter_function,
+ Array::ZoneHandle(), // No names.
+ values);
+ ReturnComputation(call);
}
void EffectGraphVisitor::VisitStaticSetterNode(StaticSetterNode* node) {
- Bailout("EffectGraphVisitor::VisitStaticSetterNode");
+ const String& setter_name =
+ String::Handle(Field::SetterName(node->field_name()));
+ const Function& setter_function =
+ Function::ZoneHandle(node->cls().LookupStaticFunction(setter_name));
+ ASSERT(!setter_function.IsNull());
+ ArgumentGraphVisitor for_value(owner(), temp_index());
+ node->value()->Visit(&for_value);
+ Append(for_value);
+ StaticSetterComp* call = new StaticSetterComp(node->token_index(),
+ setter_function,
+ for_value.value());
+ ReturnComputation(call);
}
@@ -1521,6 +1542,13 @@
}
+void FlowGraphPrinter::VisitStaticSetter(StaticSetterComp* comp) {
+ OS::Print("StaticSetter(");
+ comp->value()->Accept(this);
+ OS::Print(")");
+}
+
+
void FlowGraphPrinter::VisitBooleanNegate(BooleanNegateComp* comp) {
OS::Print("! ");
comp->value()->Accept(this);
« no previous file with comments | « runtime/vm/code_generator_x64.cc ('k') | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698