From 68289a531484d26214e09f1eadd9833531a3bc3c Mon Sep 17 00:00:00 2001 From: Alex Light Date: Tue, 15 Dec 2015 17:30:30 -0800 Subject: Revert "ART: Refactor SsaBuilder for more precise typing info" This reverts commit d9510dfc32349eeb4f2145c801f7ba1d5bccfb12. Bug: 26208284 Bug: 24252151 Bug: 24252100 Bug: 22538329 Bug: 25786318 Change-Id: I5f491becdf076ff51d437d490405ec4e1586c010 --- compiler/optimizing/ssa_builder.h | 42 ++++++++++----------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) (limited to 'compiler/optimizing/ssa_builder.h') diff --git a/compiler/optimizing/ssa_builder.h b/compiler/optimizing/ssa_builder.h index ed6f5cab51..dcce5e4c2c 100644 --- a/compiler/optimizing/ssa_builder.h +++ b/compiler/optimizing/ssa_builder.h @@ -49,20 +49,17 @@ static constexpr int kDefaultNumberOfLoops = 2; */ class SsaBuilder : public HGraphVisitor { public: - explicit SsaBuilder(HGraph* graph, StackHandleScopeCollection* handles) + explicit SsaBuilder(HGraph* graph) : HGraphVisitor(graph), - handles_(handles), - agets_fixed_(false), current_locals_(nullptr), loop_headers_(graph->GetArena()->Adapter(kArenaAllocSsaBuilder)), - ambiguous_agets_(graph->GetArena()->Adapter(kArenaAllocSsaBuilder)), locals_for_(graph->GetBlocks().size(), ArenaVector(graph->GetArena()->Adapter(kArenaAllocSsaBuilder)), graph->GetArena()->Adapter(kArenaAllocSsaBuilder)) { loop_headers_.reserve(kDefaultNumberOfLoops); } - BuildSsaResult BuildSsa(); + void BuildSsa(); // Returns locals vector for `block`. If it is a catch block, the vector will be // prepopulated with catch phis for vregs which are defined in `current_locals_`. @@ -74,38 +71,23 @@ class SsaBuilder : public HGraphVisitor { void VisitStoreLocal(HStoreLocal* store); void VisitInstruction(HInstruction* instruction); void VisitTemporary(HTemporary* instruction); - void VisitArrayGet(HArrayGet* aget); + + static HInstruction* GetFloatOrDoubleEquivalent(HInstruction* user, + HInstruction* instruction, + Primitive::Type type); + + static HInstruction* GetReferenceTypeEquivalent(HInstruction* instruction); static constexpr const char* kSsaBuilderPassName = "ssa_builder"; private: void SetLoopHeaderPhiInputs(); - void FixEnvironmentPhis(); void FixNullConstantType(); void EquivalentPhisCleanup(); - void RunPrimitiveTypePropagation(); - - // Attempts to resolve types of aget and aget-wide instructions from reference - // type information on the input array. Returns false if the type of the array - // is unknown. - bool FixAmbiguousArrayGets(); - - bool TypeInputsOfPhi(HPhi* phi, ArenaVector* worklist); - bool UpdatePrimitiveType(HPhi* phi, ArenaVector* worklist); - void ProcessPrimitiveTypePropagationWorklist(ArenaVector* worklist); - HInstruction* GetFloatOrDoubleEquivalent(HInstruction* instruction, Primitive::Type type); - HInstruction* GetReferenceTypeEquivalent(HInstruction* instruction); - - HFloatConstant* GetFloatEquivalent(HIntConstant* constant); - HDoubleConstant* GetDoubleEquivalent(HLongConstant* constant); - HPhi* GetFloatDoubleOrReferenceEquivalentOfPhi(HPhi* phi, Primitive::Type type); - HArrayGet* GetFloatOrDoubleEquivalentOfArrayGet(HArrayGet* aget); - - StackHandleScopeCollection* const handles_; - - // True if types of ambiguous ArrayGets have been resolved. - bool agets_fixed_; + static HFloatConstant* GetFloatEquivalent(HIntConstant* constant); + static HDoubleConstant* GetDoubleEquivalent(HLongConstant* constant); + static HPhi* GetFloatDoubleOrReferenceEquivalentOfPhi(HPhi* phi, Primitive::Type type); // Locals for the current block being visited. ArenaVector* current_locals_; @@ -114,8 +96,6 @@ class SsaBuilder : public HGraphVisitor { // over these blocks to set the inputs of their phis. ArenaVector loop_headers_; - ArenaVector ambiguous_agets_; - // HEnvironment for each block. ArenaVector> locals_for_; -- cgit v1.2.3-59-g8ed1b