diff options
author | 2017-11-08 03:26:30 +0000 | |
---|---|---|
committer | 2017-11-08 03:26:30 +0000 | |
commit | cefd676fb79d225fcd7e8e8c0ef141d70a2f45b8 (patch) | |
tree | be625fa0bc1255cbea5c5066dd878fb0b2a1c454 /runtime/mirror/class.cc | |
parent | dbc26ad5e8ded15688d20a39344c677077311279 (diff) | |
parent | 86083f7cd118f3d6c757191e83b4e4abaabdc5d7 (diff) |
Merge "runtime: Bitstring implementation for subtype checking (4/4)."
Diffstat (limited to 'runtime/mirror/class.cc')
-rw-r--r-- | runtime/mirror/class.cc | 14 |
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 |