Change ClassStatus to fit into 4 bits.
In preparation for extending the type check bit string from
24 to 28 bits, rewrite ClassStatus to fit into 4 bits. Also
perform a proper cleanup of the ClassStatus, i.e. change it
to an enum class, remove the "Status" word from enumerator
names, replace "Max" with "Last" in line with other
enumerations and remove aliases from mirror::Class.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: testrunner.py --target --optimizing
Bug: 64692057
Bug: 65318848
Change-Id: Iec1610ba5dac2c527b36c12819f132e1a77f2d45
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index f437db2..7a3014e 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -1654,9 +1654,8 @@
const uint8_t* status_pointer = oat_class_pointer;
CHECK_LT(status_pointer, oat_file_->End()) << oat_file_->GetLocation();
- mirror::Class::Status status =
- static_cast<mirror::Class::Status>(*reinterpret_cast<const int16_t*>(status_pointer));
- CHECK_LT(status, mirror::Class::kStatusMax);
+ ClassStatus status = enum_cast<ClassStatus>(*reinterpret_cast<const int16_t*>(status_pointer));
+ CHECK_LE(status, ClassStatus::kLast);
const uint8_t* type_pointer = status_pointer + sizeof(uint16_t);
CHECK_LT(type_pointer, oat_file_->End()) << oat_file_->GetLocation();
@@ -1737,7 +1736,7 @@
}
OatFile::OatClass::OatClass(const OatFile* oat_file,
- mirror::Class::Status status,
+ ClassStatus status,
OatClassType type,
uint32_t bitmap_size,
const uint32_t* bitmap_pointer,