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

Unified Diff: runtime/vm/flow_graph_builder.h

Issue 12518009: Remove virtual functions on class InliningContext. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
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 92f5174ba6c849925a1df5665eb290bd16f456c4..bdfe133dbb8b888317fd6de48053facd859492f9 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -16,14 +16,13 @@ class FlowGraph;
class Instruction;
class ParsedFunction;
-// An abstraction of the graph context in which an inlined call occurs.
-class InliningContext: public ZoneAllocated {
+// An InliningContext collects the exits from an inlined function during
+// graph construction so they can be plugged into the caller's flow graph.
+class InliningContext: public ValueObject {
public:
- // Create the appropriate inlining context for the flow graph context of a
- // call.
- static InliningContext* Create(Definition* call);
+ InliningContext() : exits_(4) { }
- virtual void AddExit(ReturnInstr* exit) = 0;
+ void AddExit(ReturnInstr* exit);
// Inline a flow graph at a call site.
//
@@ -33,29 +32,9 @@ class InliningContext: public ZoneAllocated {
//
// After inlining the caller graph will correctly have adjusted the
// pre/post orders, the dominator tree and the use lists.
- virtual void ReplaceCall(FlowGraph* caller_graph,
- Definition* call,
- FlowGraph* callee_graph) = 0;
-
- protected:
- static void PrepareGraphs(FlowGraph* caller_graph,
- Definition* call,
- FlowGraph* callee_graph);
-};
-
-
-// The context of a call inlined for its value (including calls inlined for
-// their effects, i.e., when the value is ignored). Collects normal exit
-// blocks and return values.
-class ValueInliningContext: public InliningContext {
- public:
- ValueInliningContext() : exits_(4) { }
-
- virtual void AddExit(ReturnInstr* exit);
-
- virtual void ReplaceCall(FlowGraph* caller_graph,
- Definition* call,
- FlowGraph* callee_graph);
+ void ReplaceCall(FlowGraph* caller_graph,
+ Definition* call,
+ FlowGraph* callee_graph);
private:
struct Data {
@@ -63,6 +42,10 @@ class ValueInliningContext: public InliningContext {
ReturnInstr* exit_return;
};
+ static void PrepareGraphs(FlowGraph* caller_graph,
+ Definition* call,
+ FlowGraph* callee_graph);
+
BlockEntryInstr* ExitBlockAt(intptr_t i) const {
ASSERT(exits_[i].exit_block != NULL);
return exits_[i].exit_block;
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698