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

Unified Diff: runtime/vm/flow_graph_builder.h

Issue 9564006: Implement StaticCall and InstanceCall in the new code generator. (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 | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/flow_graph_builder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.h
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 33c89b9713f5029ec5be702fb3d176f0977683e0..5398dd5d60c6c40f7256324491cee212c8954dbb 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -91,6 +91,7 @@ class EffectGraphVisitor : public AstNodeVisitor {
protected:
// Helpers for translating parts of the AST.
void TranslateArgumentList(const ArgumentListNode& node,
+ intptr_t next_temp_index,
ZoneGrowableArray<Value*>* values);
void CloseFragment() { exit_ = NULL; }
@@ -131,9 +132,13 @@ class ValueGraphVisitor : public EffectGraphVisitor {
Value* value() const { return value_; }
+ protected:
+ // Output parameters.
+ Value* value_;
+
private:
// Helper to set the output state to return a Value.
- void ReturnValue(Value* value) { value_ = value; }
+ virtual void ReturnValue(Value* value) { value_ = value; }
// Specify a computation as the final result. Adds a Bind instruction to
// the graph and returns its temporary value (i.e., set the output
@@ -142,9 +147,22 @@ class ValueGraphVisitor : public EffectGraphVisitor {
AddInstruction(new BindInstr(temp_index(), computation));
value_ = new TempVal(AllocateTempIndex());
}
+};
- // Output parameters.
- Value* value_;
+
+// Translate an AstNode to a control-flow graph fragment for both its effects
+// and value as an outgoing argument. Implements a function from an AstNode
+// and next temporary index to a graph fragment (as in the
+// EffectGraphBuilder), an updated temporary index, and an intermediate
+// language Value.
srdjan 2012/03/01 17:50:12 Why do we need both ArgumentGraphVisitor and Value
+class ArgumentGraphVisitor : public ValueGraphVisitor {
+ public:
+ ArgumentGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index)
+ : ValueGraphVisitor(owner, temp_index) { }
+
+ private:
+ // Override the returning of constants to ensure they are materialized.
+ virtual void ReturnValue(Value* value);
};
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/flow_graph_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698