summaryrefslogtreecommitdiff
path: root/runtime/gc/reference_processor.h
diff options
context:
space:
mode:
author Fred Shih <ffred@google.com> 2014-07-11 09:59:27 -0700
committer Fred Shih <ffred@google.com> 2014-07-15 15:45:21 -0700
commit4ee7a665e7f9cd2c5ace2d6304e33f64067b209f (patch)
treee8e6867c71fde6e37ec5597e8677ab807084f734 /runtime/gc/reference_processor.h
parent76e6773dfed9e9bf382bbb8d6c8654525fa44b0c (diff)
Revert "Revert "Revert "Revert "Add intrinsic for Reference.get()""""
Fixed TargetReg issue causing build failure for x86. This reverts commit 9e82bd3f0ce9e5f5777bea2f752ff3e251d32f9f. Change-Id: I7e6a526954467aaf68deeed999880dfe9aa5f06e
Diffstat (limited to 'runtime/gc/reference_processor.h')
-rw-r--r--runtime/gc/reference_processor.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/gc/reference_processor.h b/runtime/gc/reference_processor.h
index 2771ea809b..7274457a5d 100644
--- a/runtime/gc/reference_processor.h
+++ b/runtime/gc/reference_processor.h
@@ -49,6 +49,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 +61,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 +76,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 +87,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_);