diff options
author | 2014-07-11 04:18:58 +0000 | |
---|---|---|
committer | 2014-07-11 04:18:58 +0000 | |
commit | a9b870b73a155ce70c867d5b3f9758fab0b45f07 (patch) | |
tree | b2d65f4668793fab5652dfe41dcf13c913fee3a8 /runtime/gc/reference_processor.cc | |
parent | 460503b13bc894828a2d2d47d09e5534b3e91aa1 (diff) |
Revert "Add intrinsic for Reference.get()"
This reverts commit 460503b13bc894828a2d2d47d09e5534b3e91aa1.
Change-Id: Ie63f43049307e02e3b90f4e034abc9ea54ca4e24
Diffstat (limited to 'runtime/gc/reference_processor.cc')
-rw-r--r-- | runtime/gc/reference_processor.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc index 62d9e68273..e52bc1fd1e 100644 --- a/runtime/gc/reference_processor.cc +++ b/runtime/gc/reference_processor.cc @@ -17,9 +17,7 @@ #include "reference_processor.h" #include "mirror/object-inl.h" -#include "mirror/reference.h" #include "mirror/reference-inl.h" -#include "reference_processor-inl.h" #include "reflection.h" #include "ScopedLocalRef.h" #include "scoped_thread_state_change.h" @@ -29,17 +27,18 @@ namespace art { namespace gc { ReferenceProcessor::ReferenceProcessor() - : process_references_args_(nullptr, nullptr, nullptr), + : process_references_args_(nullptr, nullptr, nullptr), slow_path_enabled_(false), preserving_references_(false), lock_("reference processor lock", kReferenceProcessorLock), condition_("reference processor condition", lock_) { } void ReferenceProcessor::EnableSlowPath() { - mirror::Reference::GetJavaLangRefReference()->SetSlowPathEnabled(true); + Locks::mutator_lock_->AssertExclusiveHeld(Thread::Current()); + slow_path_enabled_ = true; } void ReferenceProcessor::DisableSlowPath(Thread* self) { - mirror::Reference::GetJavaLangRefReference()->SetSlowPathEnabled(false); + slow_path_enabled_ = false; condition_.Broadcast(self); } @@ -47,11 +46,11 @@ mirror::Object* ReferenceProcessor::GetReferent(Thread* self, mirror::Reference* mirror::Object* const referent = reference->GetReferent(); // If the referent is null then it is already cleared, we can just return null since there is no // scenario where it becomes non-null during the reference processing phase. - if (UNLIKELY(!SlowPathEnabled()) || referent == nullptr) { + if (LIKELY(!slow_path_enabled_) || referent == nullptr) { return referent; } MutexLock mu(self, lock_); - while (SlowPathEnabled()) { + while (slow_path_enabled_) { mirror::HeapReference<mirror::Object>* const referent_addr = reference->GetReferentReferenceAddr(); // If the referent became cleared, return it. Don't need barrier since thread roots can't get @@ -118,7 +117,7 @@ void ReferenceProcessor::ProcessReferences(bool concurrent, TimingLogger* timing process_references_args_.is_marked_callback_ = is_marked_callback; process_references_args_.mark_callback_ = mark_object_callback; process_references_args_.arg_ = arg; - CHECK_EQ(SlowPathEnabled(), concurrent) << "Slow path must be enabled iff concurrent"; + CHECK_EQ(slow_path_enabled_, concurrent) << "Slow path must be enabled iff concurrent"; } // Unless required to clear soft references with white references, preserve some white referents. if (!clear_soft_references) { |