diff options
author | Christopher Ferris <cferris@google.com> | 2014-07-11 04:18:58 +0000 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-07-11 04:18:58 +0000 |
commit | a9b870b73a155ce70c867d5b3f9758fab0b45f07 (patch) | |
tree | b2d65f4668793fab5652dfe41dcf13c913fee3a8 /runtime/mirror | |
parent | 460503b13bc894828a2d2d47d09e5534b3e91aa1 (diff) | |
download | art-a9b870b73a155ce70c867d5b3f9758fab0b45f07.zip art-a9b870b73a155ce70c867d5b3f9758fab0b45f07.tar.gz art-a9b870b73a155ce70c867d5b3f9758fab0b45f07.tar.bz2 |
Revert "Add intrinsic for Reference.get()"
This reverts commit 460503b13bc894828a2d2d47d09e5534b3e91aa1.
Change-Id: Ie63f43049307e02e3b90f4e034abc9ea54ca4e24
Diffstat (limited to 'runtime/mirror')
-rw-r--r-- | runtime/mirror/reference.cc | 43 | ||||
-rw-r--r-- | runtime/mirror/reference.h | 48 |
2 files changed, 0 insertions, 91 deletions
diff --git a/runtime/mirror/reference.cc b/runtime/mirror/reference.cc deleted file mode 100644 index 533aaca..0000000 --- a/runtime/mirror/reference.cc +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "reference.h" - -namespace art { -namespace mirror { - -ReferenceClass* Reference::java_lang_ref_Reference_ = nullptr; - -void Reference::SetClass(ReferenceClass* java_lang_ref_Reference) { - CHECK(java_lang_ref_Reference_ == nullptr); - CHECK(java_lang_ref_Reference != nullptr); - java_lang_ref_Reference_ = java_lang_ref_Reference; -} - -void Reference::ResetClass() { - CHECK(java_lang_ref_Reference_ != nullptr); - java_lang_ref_Reference_ = nullptr; -} - -void Reference::VisitRoots(RootCallback* callback, void* arg) { - if (java_lang_ref_Reference_ != nullptr) { - callback(reinterpret_cast<mirror::Object**>(&java_lang_ref_Reference_), - arg, 0, kRootStickyClass); - } -} - -} // namespace mirror -} // namespace art diff --git a/runtime/mirror/reference.h b/runtime/mirror/reference.h index 15e0145..9c9d87b 100644 --- a/runtime/mirror/reference.h +++ b/runtime/mirror/reference.h @@ -17,10 +17,7 @@ #ifndef ART_RUNTIME_MIRROR_REFERENCE_H_ #define ART_RUNTIME_MIRROR_REFERENCE_H_ -#include "class.h" #include "object.h" -#include "object_callbacks.h" -#include "thread.h" namespace art { @@ -32,11 +29,9 @@ class ReferenceQueue; } // namespace gc struct ReferenceOffsets; -struct ReferenceClassOffsets; struct FinalizerReferenceOffsets; namespace mirror { -class ReferenceClass; // C++ mirror of java.lang.ref.Reference class MANAGED Reference : public Object { @@ -85,15 +80,6 @@ class MANAGED Reference : public Object { bool IsEnqueuable() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - static ReferenceClass* GetJavaLangRefReference() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - CHECK(java_lang_ref_Reference_ != nullptr); - return ReadBarrier::BarrierForRoot<mirror::ReferenceClass, kWithReadBarrier>( - &java_lang_ref_Reference_); - } - static void SetClass(ReferenceClass* klass); - static void ResetClass(void); - static void VisitRoots(RootCallback* callback, void* arg); - private: // Note: This avoids a read barrier, it should only be used by the GC. HeapReference<Object>* GetReferentReferenceAddr() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { @@ -106,46 +92,12 @@ class MANAGED Reference : public Object { HeapReference<Reference> queue_next_; // Note this is Java volatile: HeapReference<Object> referent_; // Note this is Java volatile: - static ReferenceClass* java_lang_ref_Reference_; - friend struct art::ReferenceOffsets; // for verifying offset information friend class gc::ReferenceProcessor; friend class gc::ReferenceQueue; DISALLOW_IMPLICIT_CONSTRUCTORS(Reference); }; -// Tightly coupled with the ReferenceProcessor to provide switch for slow/fast path. Consistency -// is maintained by ReferenceProcessor. -class MANAGED ReferenceClass : public Class { - public: - static MemberOffset DisableIntrinsicOffset() { - return OFFSET_OF_OBJECT_MEMBER(ReferenceClass, disable_intrinsic_); - } - static MemberOffset SlowPathEnabledOffset() { - return OFFSET_OF_OBJECT_MEMBER(ReferenceClass, slow_path_enabled_); - } - - void Init() { - disable_intrinsic_ = false; - slow_path_enabled_ = false; - } - - bool GetSlowPathEnabled() const { - return slow_path_enabled_; - } - void SetSlowPathEnabled(bool enabled) { - slow_path_enabled_ = enabled; - } - - private: - int32_t disable_intrinsic_; - int32_t slow_path_enabled_; - // allows runtime to safely enable/disable intrinsics fast path for benchmarking - - friend struct art::ReferenceClassOffsets; // for verifying offset information - DISALLOW_IMPLICIT_CONSTRUCTORS(ReferenceClass); -}; - // C++ mirror of java.lang.ref.FinalizerReference class MANAGED FinalizerReference : public Reference { public: |