From b476a29a2cda22b86fc1d96e4cc65ce36fb878af Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 27 Jun 2019 07:54:48 +0000 Subject: Revert "Support using opaque JNI ids" This reverts commit 21d5994583c679cd5d8573b5d35dbd659bdca2c7. Bug: 134162467 Reason for revert: Breaks debuggable Change-Id: I9510a6ac208d392ff25ee196a1a519fecd151445 --- runtime/mirror/class_ext-inl.h | 69 ------------------------------------------ 1 file changed, 69 deletions(-) (limited to 'runtime/mirror/class_ext-inl.h') diff --git a/runtime/mirror/class_ext-inl.h b/runtime/mirror/class_ext-inl.h index ead02eed3b..bf51654447 100644 --- a/runtime/mirror/class_ext-inl.h +++ b/runtime/mirror/class_ext-inl.h @@ -19,81 +19,12 @@ #include "class_ext.h" -#include "array-inl.h" #include "art_method-inl.h" -#include "handle_scope.h" #include "object-inl.h" namespace art { namespace mirror { -template -inline ObjPtr ClassExt::EnsureJniIdsArrayPresent(MemberOffset off, size_t count) { - ObjPtr existing( - GetFieldObject(off)); - if (!existing.IsNull()) { - return existing; - } - Thread* self = Thread::Current(); - StackHandleScope<2> hs(self); - Handle h_this(hs.NewHandle(this)); - Handle new_arr( - hs.NewHandle(Runtime::Current()->GetClassLinker()->AllocPointerArray(self, count))); - if (new_arr.IsNull()) { - // Fail. - self->AssertPendingOOMException(); - return nullptr; - } - bool set; - // Set the ext_data_ field using CAS semantics. - if (Runtime::Current()->IsActiveTransaction()) { - set = h_this->CasFieldObject( - off, nullptr, new_arr.Get(), CASMode::kStrong, std::memory_order_seq_cst); - } else { - set = h_this->CasFieldObject( - off, nullptr, new_arr.Get(), CASMode::kStrong, std::memory_order_seq_cst); - } - ObjPtr ret( - set ? new_arr.Get() - : h_this->GetFieldObject(off)); - CHECK(!ret.IsNull()); - return ret; -} - -template -inline ObjPtr ClassExt::EnsureJMethodIDsArrayPresent(size_t count) { - return EnsureJniIdsArrayPresent( - MemberOffset(OFFSET_OF_OBJECT_MEMBER(ClassExt, jmethod_ids_)), count); -} -template -inline ObjPtr ClassExt::EnsureStaticJFieldIDsArrayPresent(size_t count) { - return EnsureJniIdsArrayPresent( - MemberOffset(OFFSET_OF_OBJECT_MEMBER(ClassExt, static_jfield_ids_)), count); -} -template -inline ObjPtr ClassExt::EnsureInstanceJFieldIDsArrayPresent(size_t count) { - return EnsureJniIdsArrayPresent( - MemberOffset(OFFSET_OF_OBJECT_MEMBER(ClassExt, instance_jfield_ids_)), count); -} - -template -inline ObjPtr ClassExt::GetInstanceJFieldIDs() { - return GetFieldObject( - OFFSET_OF_OBJECT_MEMBER(ClassExt, instance_jfield_ids_)); -} - -template -inline ObjPtr ClassExt::GetStaticJFieldIDs() { - return GetFieldObject( - OFFSET_OF_OBJECT_MEMBER(ClassExt, static_jfield_ids_)); -} - -template -inline ObjPtr ClassExt::GetJMethodIDs() { - return GetFieldObject( - OFFSET_OF_OBJECT_MEMBER(ClassExt, jmethod_ids_)); -} - inline ObjPtr ClassExt::GetVerifyError() { return GetFieldObject(OFFSET_OF_OBJECT_MEMBER(ClassExt, verify_error_)); } -- cgit v1.2.3-59-g8ed1b