summaryrefslogtreecommitdiff
path: root/runtime/mirror/class.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/class.cc')
-rw-r--r--runtime/mirror/class.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 40157c4808..4d810dbce0 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -29,6 +29,7 @@
#include "dex_file_annotations.h"
#include "gc/accounting/card_table-inl.h"
#include "handle_scope-inl.h"
+#include "subtype_check.h"
#include "method.h"
#include "object-inl.h"
#include "object-refvisitor-inl.h"
@@ -41,6 +42,11 @@
#include "well_known_classes.h"
namespace art {
+
+// TODO: move to own CC file?
+constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity];
+constexpr size_t BitString::kCapacity;
+
namespace mirror {
using android::base::StringPrintf;
@@ -166,11 +172,9 @@ void Class::SetStatus(Handle<Class> h_this, Status new_status, Thread* self) {
self->AssertPendingException();
}
- static_assert(sizeof(Status) == sizeof(uint32_t), "Size of status not equal to uint32");
- if (Runtime::Current()->IsActiveTransaction()) {
- h_this->SetField32Volatile<true>(StatusOffset(), new_status);
- } else {
- h_this->SetField32Volatile<false>(StatusOffset(), new_status);
+ {
+ ObjPtr<mirror::Class> h_this_ptr = h_this.Get();
+ SubtypeCheck<ObjPtr<mirror::Class>>::WriteStatus(h_this_ptr, new_status);
}
// Setting the object size alloc fast path needs to be after the status write so that if the