ART: Make InstructionSet an enum class and add kLast.
Adding InstructionSet::kLast shall make it easier to encode
the InstructionSet in fewer bits using BitField<>. However,
introducing `kLast` into the `art` namespace is not a good
idea, so we change the InstructionSet to an enum class.
This also uncovered a case of InstructionSet::kNone being
erroneously used instead of vixl32::Condition::None(), so
it's good to remove `kNone` from the `art` namespace.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I6fa6168dfba4ed6da86d021a69c80224f09997a6
diff --git a/runtime/oat_quick_method_header.h b/runtime/oat_quick_method_header.h
index 3625b9e..4443255 100644
--- a/runtime/oat_quick_method_header.h
+++ b/runtime/oat_quick_method_header.h
@@ -136,8 +136,8 @@
bool Contains(uintptr_t pc) const {
uintptr_t code_start = reinterpret_cast<uintptr_t>(code_);
- static_assert(kRuntimeISA != kThumb2, "kThumb2 cannot be a runtime ISA");
- if (kRuntimeISA == kArm) {
+ static_assert(kRuntimeISA != InstructionSet::kThumb2, "kThumb2 cannot be a runtime ISA");
+ if (kRuntimeISA == InstructionSet::kArm) {
// On Thumb-2, the pc is offset by one.
code_start++;
}
@@ -149,8 +149,8 @@
// (not `kThumb2`), *but* we always generate code for the Thumb-2
// instruction set anyway. Thumb-2 requires the entrypoint to be of
// offset 1.
- static_assert(kRuntimeISA != kThumb2, "kThumb2 cannot be a runtime ISA");
- return (kRuntimeISA == kArm)
+ static_assert(kRuntimeISA != InstructionSet::kThumb2, "kThumb2 cannot be a runtime ISA");
+ return (kRuntimeISA == InstructionSet::kArm)
? reinterpret_cast<uint8_t*>(reinterpret_cast<uintptr_t>(code_) | 1)
: code_;
}