| Index: runtime/vm/flow_graph_optimizer.h
|
| diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
|
| index 3aecb910f784ab23227db1ab22ab68d93eddbc17..519452e51cdcd39655c3ea711f11a8c70e305ff5 100644
|
| --- a/runtime/vm/flow_graph_optimizer.h
|
| +++ b/runtime/vm/flow_graph_optimizer.h
|
| @@ -429,13 +429,27 @@ class AllocationSinking : public ZoneAllocated {
|
| public:
|
| explicit AllocationSinking(FlowGraph* flow_graph)
|
| : flow_graph_(flow_graph),
|
| + candidates_(5),
|
| materializations_(5) { }
|
|
|
| + const GrowableArray<AllocateObjectInstr*>& candidates() const {
|
| + return candidates_;
|
| + }
|
| +
|
| + // Find the materialization insterted for the given allocation
|
| + // at the given exit.
|
| + MaterializeObjectInstr* MaterializationFor(Definition* alloc,
|
| + Instruction* exit);
|
| +
|
| void Optimize();
|
|
|
| void DetachMaterializations();
|
|
|
| private:
|
| + void CollectCandidates();
|
| +
|
| + void DiscoverFailedCandidates();
|
| +
|
| void InsertMaterializations(AllocateObjectInstr* alloc);
|
|
|
| void CreateMaterializationAt(
|
| @@ -444,10 +458,13 @@ class AllocationSinking : public ZoneAllocated {
|
| const Class& cls,
|
| const ZoneGrowableArray<const Object*>& fields);
|
|
|
| + void EliminateAllocation(AllocateObjectInstr* alloc);
|
| +
|
| Isolate* isolate() const { return flow_graph_->isolate(); }
|
|
|
| FlowGraph* flow_graph_;
|
|
|
| + GrowableArray<AllocateObjectInstr*> candidates_;
|
| GrowableArray<MaterializeObjectInstr*> materializations_;
|
| };
|
|
|
|
|