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

Unified Diff: runtime/vm/flow_graph_optimizer.h

Issue 14935005: Implement a variation of scalar replacement for non-escaping allocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 7 years, 7 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_compiler.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.h
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index ea072a0121f0e19dd434b42b3f192c54975e75b6..46111e91835bdeb1c541730f850deef765a7bf53 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -44,6 +44,9 @@ class FlowGraphOptimizer : public FlowGraphVisitor {
void InferSmiRanges();
+ // Remove environments from the instructions which do not deoptimize.
+ void EliminateEnvironments();
+
virtual void VisitStaticCall(StaticCallInstr* instr);
virtual void VisitInstanceCall(InstanceCallInstr* instr);
virtual void VisitRelationalOp(RelationalOpInstr* instr);
@@ -318,6 +321,30 @@ class IfConverter : public AllStatic {
};
+class AllocationSinking : public ZoneAllocated {
+ public:
+ explicit AllocationSinking(FlowGraph* flow_graph)
+ : flow_graph_(flow_graph),
+ materializations_(5) { }
+
+ void Optimize();
+
+ void DetachMaterializations();
+
+ private:
+ void InsertMaterializations(AllocateObjectInstr* alloc);
+
+ void CreateMaterializationAt(
+ Instruction* exit,
+ AllocateObjectInstr* alloc,
+ const Class& cls,
+ const ZoneGrowableArray<const Field*>& fields);
+
+ FlowGraph* flow_graph_;
+
+ GrowableArray<MaterializeObjectInstr*> materializations_;
+};
+
} // namespace dart
#endif // VM_FLOW_GRAPH_OPTIMIZER_H_
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698