diff options
author | Christopher Ferris <cferris@google.com> | 2014-07-11 06:44:39 +0000 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-07-11 06:44:39 +0000 |
commit | d4415e8bd04c4a9367744ff0149597b4f37a0e0a (patch) | |
tree | 97c42c08fd04034cf6cecadb39644bf9531be0f1 /runtime/gc/reference_processor.h | |
parent | a9b870b73a155ce70c867d5b3f9758fab0b45f07 (diff) | |
download | android_art-d4415e8bd04c4a9367744ff0149597b4f37a0e0a.tar.gz android_art-d4415e8bd04c4a9367744ff0149597b4f37a0e0a.tar.bz2 android_art-d4415e8bd04c4a9367744ff0149597b4f37a0e0a.zip |
Revert "Revert "Add intrinsic for Reference.get()""
This reverts commit a9b870b73a155ce70c867d5b3f9758fab0b45f07.
Change-Id: Ic2a9b47f2b911bef4b764d10bc33cf000e4b4211
Diffstat (limited to 'runtime/gc/reference_processor.h')
-rw-r--r-- | runtime/gc/reference_processor.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/gc/reference_processor.h b/runtime/gc/reference_processor.h index 2771ea809b..91328a385f 100644 --- a/runtime/gc/reference_processor.h +++ b/runtime/gc/reference_processor.h @@ -30,6 +30,7 @@ class TimingLogger; namespace mirror { class Object; class Reference; +class ReferenceClass; } // namespace mirror namespace gc { @@ -49,6 +50,7 @@ class ReferenceProcessor { SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_) LOCKS_EXCLUDED(lock_); + // The slow path bool is contained in the reference class object, can only be set once // Only allow setting this with mutators suspended so that we can avoid using a lock in the // GetReferent fast path as an optimization. void EnableSlowPath() EXCLUSIVE_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -60,7 +62,7 @@ class ReferenceProcessor { IsHeapReferenceMarkedCallback* is_marked_callback, void* arg) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); void UpdateRoots(IsMarkedCallback* callback, void* arg) - SHARED_LOCKS_REQUIRED(Locks::mutator_lock_, Locks::heap_bitmap_lock_); + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_, Locks::heap_bitmap_lock_); private: class ProcessReferencesArgs { @@ -75,8 +77,10 @@ class ReferenceProcessor { MarkObjectCallback* mark_callback_; void* arg_; }; + bool SlowPathEnabled() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); // Called by ProcessReferences. - void DisableSlowPath(Thread* self) EXCLUSIVE_LOCKS_REQUIRED(lock_); + void DisableSlowPath(Thread* self) EXCLUSIVE_LOCKS_REQUIRED(lock_) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); // If we are preserving references it means that some dead objects may become live, we use start // and stop preserving to block mutators using GetReferrent from getting access to these // referents. @@ -84,8 +88,6 @@ class ReferenceProcessor { void StopPreservingReferences(Thread* self) LOCKS_EXCLUDED(lock_); // Process args, used by the GetReferent to return referents which are already marked. ProcessReferencesArgs process_references_args_ GUARDED_BY(lock_); - // Boolean for whether or not we need to go slow path in GetReferent. - volatile bool slow_path_enabled_; // Boolean for whether or not we are preserving references (either soft references or finalizers). // If this is true, then we cannot return a referent (see comment in GetReferent). bool preserving_references_ GUARDED_BY(lock_); |