diff options
author | Andreas Gampe <agampe@google.com> | 2016-08-29 17:43:45 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2016-09-08 10:13:47 -0700 |
commit | bda1d606f2d31086874b68edd9254e3817d8049c (patch) | |
tree | db07417935fe72e99c3da60152e13f0620c7d8d7 /runtime/arch/instruction_set.h | |
parent | d14d515df39cd963179088b8721768f9645243aa (diff) |
ART: Detach libart-disassembler from libart
Some more intrusive changes than I would have liked, as long as
ART logging is different from libbase logging.
Fix up some includes.
Bug: 15436106
Bug: 31338270
Test: m test-art-host
Change-Id: I9fbe4b85b2d74e079a4981f3aec9af63b163a461
Diffstat (limited to 'runtime/arch/instruction_set.h')
-rw-r--r-- | runtime/arch/instruction_set.h | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/runtime/arch/instruction_set.h b/runtime/arch/instruction_set.h index 917acc9eec..4a8bea45e5 100644 --- a/runtime/arch/instruction_set.h +++ b/runtime/arch/instruction_set.h @@ -21,7 +21,7 @@ #include <string> #include "base/enums.h" -#include "base/logging.h" // Logging is required for FATAL in the helper functions. +#include "base/macros.h" namespace art { @@ -75,7 +75,6 @@ static constexpr size_t kMipsAlignment = 8; // X86 instruction alignment. This is the recommended alignment for maximum performance. static constexpr size_t kX86Alignment = 16; - const char* GetInstructionSetString(InstructionSet isa); // Note: Returns kNone when the string cannot be parsed to a known value. @@ -83,6 +82,9 @@ InstructionSet GetInstructionSetFromString(const char* instruction_set); InstructionSet GetInstructionSetFromELF(uint16_t e_machine, uint32_t e_flags); +// Fatal logging out of line to keep the header clean of logging.h. +NO_RETURN void InstructionSetAbort(InstructionSet isa); + static inline PointerSize GetInstructionSetPointerSize(InstructionSet isa) { switch (isa) { case kArm: @@ -99,12 +101,8 @@ static inline PointerSize GetInstructionSetPointerSize(InstructionSet isa) { return kMipsPointerSize; case kMips64: return kMips64PointerSize; - case kNone: - LOG(FATAL) << "ISA kNone does not have pointer size."; - UNREACHABLE(); default: - LOG(FATAL) << "Unknown ISA " << isa; - UNREACHABLE(); + InstructionSetAbort(isa); } } @@ -139,12 +137,8 @@ static inline bool Is64BitInstructionSet(InstructionSet isa) { case kMips64: return true; - case kNone: - LOG(FATAL) << "ISA kNone does not have bit width."; - UNREACHABLE(); default: - LOG(FATAL) << "Unknown ISA " << isa; - UNREACHABLE(); + InstructionSetAbort(isa); } } @@ -168,12 +162,9 @@ static inline size_t GetBytesPerGprSpillLocation(InstructionSet isa) { return 4; case kMips64: return 8; - case kNone: - LOG(FATAL) << "ISA kNone does not have spills."; - UNREACHABLE(); + default: - LOG(FATAL) << "Unknown ISA " << isa; - UNREACHABLE(); + InstructionSetAbort(isa); } } @@ -193,12 +184,9 @@ static inline size_t GetBytesPerFprSpillLocation(InstructionSet isa) { return 4; case kMips64: return 8; - case kNone: - LOG(FATAL) << "ISA kNone does not have spills."; - UNREACHABLE(); + default: - LOG(FATAL) << "Unknown ISA " << isa; - UNREACHABLE(); + InstructionSetAbort(isa); } } |