diff options
Diffstat (limited to 'compiler/optimizing/nodes.h')
| -rw-r--r-- | compiler/optimizing/nodes.h | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index daec096f3e..18b256f48e 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -98,6 +98,7 @@ enum IfCondition { }; enum GraphAnalysisResult { + kAnalysisInvalidBytecode, kAnalysisFailThrowCatchLoop, kAnalysisFailAmbiguousArrayOp, kAnalysisSuccess, @@ -308,10 +309,14 @@ class HGraph : public ArenaObject<kArenaAllocGraph> { blocks_.reserve(kDefaultNumberOfBlocks); } + // Acquires and stores RTI of inexact Object to be used when creating HNullConstant. + void InitializeInexactObjectRTI(StackHandleScopeCollection* handles); + ArenaAllocator* GetArena() const { return arena_; } const ArenaVector<HBasicBlock*>& GetBlocks() const { return blocks_; } bool IsInSsaForm() const { return in_ssa_form_; } + void SetInSsaForm() { in_ssa_form_ = true; } HBasicBlock* GetEntryBlock() const { return entry_block_; } HBasicBlock* GetExitBlock() const { return exit_block_; } @@ -322,11 +327,6 @@ class HGraph : public ArenaObject<kArenaAllocGraph> { void AddBlock(HBasicBlock* block); - // Try building the SSA form of this graph, with dominance computation and - // loop recognition. Returns a code specifying that it was successful or the - // reason for failure. - GraphAnalysisResult TryBuildingSsa(StackHandleScopeCollection* handles); - void ComputeDominanceInformation(); void ClearDominanceInformation(); void ClearLoopInformation(); @@ -1235,7 +1235,6 @@ class HLoopInformationOutwardIterator : public ValueObject { M(StoreLocal, Instruction) \ M(Sub, BinaryOperation) \ M(SuspendCheck, Instruction) \ - M(Temporary, Instruction) \ M(Throw, Instruction) \ M(TryBoundary, Instruction) \ M(TypeConversion, Instruction) \ @@ -4941,33 +4940,6 @@ class HBoundsCheck : public HExpression<2> { DISALLOW_COPY_AND_ASSIGN(HBoundsCheck); }; -/** - * Some DEX instructions are folded into multiple HInstructions that need - * to stay live until the last HInstruction. This class - * is used as a marker for the baseline compiler to ensure its preceding - * HInstruction stays live. `index` represents the stack location index of the - * instruction (the actual offset is computed as index * vreg_size). - */ -class HTemporary : public HTemplateInstruction<0> { - public: - explicit HTemporary(size_t index, uint32_t dex_pc = kNoDexPc) - : HTemplateInstruction(SideEffects::None(), dex_pc), index_(index) {} - - size_t GetIndex() const { return index_; } - - Primitive::Type GetType() const OVERRIDE { - // The previous instruction is the one that will be stored in the temporary location. - DCHECK(GetPrevious() != nullptr); - return GetPrevious()->GetType(); - } - - DECLARE_INSTRUCTION(Temporary); - - private: - const size_t index_; - DISALLOW_COPY_AND_ASSIGN(HTemporary); -}; - class HSuspendCheck : public HTemplateInstruction<0> { public: explicit HSuspendCheck(uint32_t dex_pc) @@ -5451,6 +5423,8 @@ enum class TypeCheckKind { kArrayCheck // No optimization yet when checking against a generic array. }; +std::ostream& operator<<(std::ostream& os, TypeCheckKind rhs); + class HInstanceOf : public HExpression<2> { public: HInstanceOf(HInstruction* object, @@ -6023,9 +5997,14 @@ class HBlocksInLoopReversePostOrderIterator : public ValueObject { }; inline int64_t Int64FromConstant(HConstant* constant) { - DCHECK(constant->IsIntConstant() || constant->IsLongConstant()); - return constant->IsIntConstant() ? constant->AsIntConstant()->GetValue() - : constant->AsLongConstant()->GetValue(); + if (constant->IsIntConstant()) { + return constant->AsIntConstant()->GetValue(); + } else if (constant->IsLongConstant()) { + return constant->AsLongConstant()->GetValue(); + } else { + DCHECK(constant->IsNullConstant()); + return 0; + } } inline bool IsSameDexFile(const DexFile& lhs, const DexFile& rhs) { |