diff options
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/graph_visualizer.cc | 5 | ||||
-rw-r--r-- | compiler/optimizing/locations.h | 4 | ||||
-rw-r--r-- | compiler/optimizing/nodes.cc | 94 | ||||
-rw-r--r-- | compiler/optimizing/nodes.h | 14 | ||||
-rw-r--r-- | compiler/optimizing/optimizing_compiler_stats.h | 2 |
5 files changed, 17 insertions, 102 deletions
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index d94c1fa2fb..23b93fc373 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -449,10 +449,7 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { } void VisitCompare(HCompare* compare) override { - ComparisonBias bias = compare->GetBias(); - StartAttributeStream("bias") << (bias == ComparisonBias::kGtBias - ? "gt" - : (bias == ComparisonBias::kLtBias ? "lt" : "none")); + StartAttributeStream("bias") << compare->GetBias(); } void VisitInvoke(HInvoke* invoke) override { diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h index 5e7e74b948..8f5eed7afd 100644 --- a/compiler/optimizing/locations.h +++ b/compiler/optimizing/locations.h @@ -440,8 +440,8 @@ class Location : public ValueObject { // way that none of them can be interpreted as a kConstant tag. uintptr_t value_; }; -std::ostream& operator<<(std::ostream& os, const Location::Kind& rhs); -std::ostream& operator<<(std::ostream& os, const Location::Policy& rhs); +std::ostream& operator<<(std::ostream& os, Location::Kind rhs); +std::ostream& operator<<(std::ostream& os, Location::Policy rhs); class RegisterSet : public ValueObject { public: diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 3ea13b66f7..ec4b79e175 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -1702,14 +1702,15 @@ HInstruction* HBinaryOperation::GetLeastConstantLeft() const { } } -std::ostream& operator<<(std::ostream& os, const ComparisonBias& rhs) { +std::ostream& operator<<(std::ostream& os, ComparisonBias rhs) { + // TODO: Replace with auto-generated operator<<. switch (rhs) { case ComparisonBias::kNoBias: - return os << "no_bias"; + return os << "none"; case ComparisonBias::kGtBias: - return os << "gt_bias"; + return os << "gt"; case ComparisonBias::kLtBias: - return os << "lt_bias"; + return os << "lt"; default: LOG(FATAL) << "Unknown ComparisonBias: " << static_cast<int>(rhs); UNREACHABLE(); @@ -1735,7 +1736,7 @@ bool HInstruction::Equals(const HInstruction* other) const { return true; } -std::ostream& operator<<(std::ostream& os, const HInstruction::InstructionKind& rhs) { +std::ostream& operator<<(std::ostream& os, HInstruction::InstructionKind rhs) { #define DECLARE_CASE(type, super) case HInstruction::k##type: os << #type; break; switch (rhs) { FOR_EACH_CONCRETE_INSTRUCTION(DECLARE_CASE) @@ -2933,28 +2934,6 @@ bool HInvokeStaticOrDirect::NeedsDexCacheOfDeclaringClass() const { return !opt.GetDoesNotNeedDexCache(); } -std::ostream& operator<<(std::ostream& os, HInvokeStaticOrDirect::MethodLoadKind rhs) { - switch (rhs) { - case HInvokeStaticOrDirect::MethodLoadKind::kStringInit: - return os << "StringInit"; - case HInvokeStaticOrDirect::MethodLoadKind::kRecursive: - return os << "Recursive"; - case HInvokeStaticOrDirect::MethodLoadKind::kBootImageLinkTimePcRelative: - return os << "BootImageLinkTimePcRelative"; - case HInvokeStaticOrDirect::MethodLoadKind::kBootImageRelRo: - return os << "BootImageRelRo"; - case HInvokeStaticOrDirect::MethodLoadKind::kBssEntry: - return os << "BssEntry"; - case HInvokeStaticOrDirect::MethodLoadKind::kJitDirectAddress: - return os << "JitDirectAddress"; - case HInvokeStaticOrDirect::MethodLoadKind::kRuntimeCall: - return os << "RuntimeCall"; - default: - LOG(FATAL) << "Unknown MethodLoadKind: " << static_cast<int>(rhs); - UNREACHABLE(); - } -} - std::ostream& operator<<(std::ostream& os, HInvokeStaticOrDirect::ClinitCheckRequirement rhs) { switch (rhs) { case HInvokeStaticOrDirect::ClinitCheckRequirement::kExplicit: @@ -2990,28 +2969,6 @@ bool HLoadClass::InstructionDataEquals(const HInstruction* other) const { } } -std::ostream& operator<<(std::ostream& os, HLoadClass::LoadKind rhs) { - switch (rhs) { - case HLoadClass::LoadKind::kReferrersClass: - return os << "ReferrersClass"; - case HLoadClass::LoadKind::kBootImageLinkTimePcRelative: - return os << "BootImageLinkTimePcRelative"; - case HLoadClass::LoadKind::kBootImageRelRo: - return os << "BootImageRelRo"; - case HLoadClass::LoadKind::kBssEntry: - return os << "BssEntry"; - case HLoadClass::LoadKind::kJitBootImageAddress: - return os << "JitBootImageAddress"; - case HLoadClass::LoadKind::kJitTableAddress: - return os << "JitTableAddress"; - case HLoadClass::LoadKind::kRuntimeCall: - return os << "RuntimeCall"; - default: - LOG(FATAL) << "Unknown HLoadClass::LoadKind: " << static_cast<int>(rhs); - UNREACHABLE(); - } -} - bool HLoadString::InstructionDataEquals(const HInstruction* other) const { const HLoadString* other_load_string = other->AsLoadString(); // TODO: To allow GVN for HLoadString from different dex files, we should compare the strings @@ -3032,26 +2989,6 @@ bool HLoadString::InstructionDataEquals(const HInstruction* other) const { } } -std::ostream& operator<<(std::ostream& os, HLoadString::LoadKind rhs) { - switch (rhs) { - case HLoadString::LoadKind::kBootImageLinkTimePcRelative: - return os << "BootImageLinkTimePcRelative"; - case HLoadString::LoadKind::kBootImageRelRo: - return os << "BootImageRelRo"; - case HLoadString::LoadKind::kBssEntry: - return os << "BssEntry"; - case HLoadString::LoadKind::kJitBootImageAddress: - return os << "JitBootImageAddress"; - case HLoadString::LoadKind::kJitTableAddress: - return os << "JitTableAddress"; - case HLoadString::LoadKind::kRuntimeCall: - return os << "RuntimeCall"; - default: - LOG(FATAL) << "Unknown HLoadString::LoadKind: " << static_cast<int>(rhs); - UNREACHABLE(); - } -} - void HInstruction::RemoveEnvironmentUsers() { for (const HUseListNode<HEnvironment*>& use : GetEnvUses()) { HEnvironment* user = use.GetUser(); @@ -3163,25 +3100,6 @@ std::ostream& operator<<(std::ostream& os, TypeCheckKind rhs) { } } -std::ostream& operator<<(std::ostream& os, const MemBarrierKind& kind) { - switch (kind) { - case MemBarrierKind::kAnyStore: - return os << "AnyStore"; - case MemBarrierKind::kLoadAny: - return os << "LoadAny"; - case MemBarrierKind::kStoreStore: - return os << "StoreStore"; - case MemBarrierKind::kAnyAny: - return os << "AnyAny"; - case MemBarrierKind::kNTStoreStore: - return os << "NTStoreStore"; - - default: - LOG(FATAL) << "Unknown MemBarrierKind: " << static_cast<int>(kind); - UNREACHABLE(); - } -} - // Check that intrinsic enum values fit within space set aside in ArtMethod modifier flags. #define CHECK_INTRINSICS_ENUM_VALUES(Name, InvokeType, _, SideEffects, Exceptions, ...) \ static_assert( \ diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 00dc50c24e..a7ea371ace 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2090,7 +2090,7 @@ class HEnvironment : public ArenaObject<kArenaAllocEnvironment> { class HInstruction : public ArenaObject<kArenaAllocInstruction> { public: #define DECLARE_KIND(type, super) k##type, - enum InstructionKind { + enum InstructionKind { // private marker to avoid generate-operator-out.py from processing. FOR_EACH_CONCRETE_INSTRUCTION(DECLARE_KIND) kLastInstructionKind }; @@ -2648,7 +2648,7 @@ class HInstruction : public ArenaObject<kArenaAllocInstruction> { friend class HGraph; friend class HInstructionList; }; -std::ostream& operator<<(std::ostream& os, const HInstruction::InstructionKind& rhs); +std::ostream& operator<<(std::ostream& os, HInstruction::InstructionKind rhs); // Iterates over the instructions, while preserving the next instruction // in case the current instruction gets removed from the list by the user @@ -3673,14 +3673,14 @@ class HBinaryOperation : public HExpression<2> { // The comparison bias applies for floating point operations and indicates how NaN // comparisons are treated: -enum class ComparisonBias { +enum class ComparisonBias { // private marker to avoid generate-operator-out.py from processing. kNoBias, // bias is not applicable (i.e. for long operation) kGtBias, // return 1 for NaN comparisons kLtBias, // return -1 for NaN comparisons kLast = kLtBias }; -std::ostream& operator<<(std::ostream& os, const ComparisonBias& rhs); +std::ostream& operator<<(std::ostream& os, ComparisonBias rhs); class HCondition : public HBinaryOperation { public: @@ -4565,7 +4565,7 @@ class HInvokeStaticOrDirect final : public HInvoke { public: // Requirements of this method call regarding the class // initialization (clinit) check of its declaring class. - enum class ClinitCheckRequirement { + enum class ClinitCheckRequirement { // private marker to avoid generate-operator-out.py from processing. kNone, // Class already initialized. kExplicit, // Static call having explicit clinit check as last input. kImplicit, // Static call implicitly requiring a clinit check. @@ -7200,7 +7200,7 @@ class HThrow final : public HExpression<1> { * Implementation strategies for the code generator of a HInstanceOf * or `HCheckCast`. */ -enum class TypeCheckKind { +enum class TypeCheckKind { // private marker to avoid generate-operator-out.py from processing. kUnresolvedCheck, // Check against an unresolved type. kExactCheck, // Can do a single class compare. kClassHierarchyCheck, // Can just walk the super class chain. @@ -7474,7 +7474,7 @@ enum MemBarrierKind { kNTStoreStore, kLastBarrierKind = kNTStoreStore }; -std::ostream& operator<<(std::ostream& os, const MemBarrierKind& kind); +std::ostream& operator<<(std::ostream& os, MemBarrierKind kind); class HMemoryBarrier final : public HExpression<0> { public: diff --git a/compiler/optimizing/optimizing_compiler_stats.h b/compiler/optimizing/optimizing_compiler_stats.h index 621e86380e..475c53205f 100644 --- a/compiler/optimizing/optimizing_compiler_stats.h +++ b/compiler/optimizing/optimizing_compiler_stats.h @@ -110,7 +110,7 @@ enum class MethodCompilationStat { kJitOutOfMemoryForCommit, kLastStat }; -std::ostream& operator<<(std::ostream& os, const MethodCompilationStat& rhs); +std::ostream& operator<<(std::ostream& os, MethodCompilationStat rhs); class OptimizingCompilerStats { public: |