From 4d7f61d44a732cfbc8573e5d93364983fd746888 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 17 Apr 2014 14:43:39 -0700 Subject: Use non volatile lock words in semispace collector. GSS FormulaEvaluationActions.EvaluateAndApplyChanges: Before GC time: 9.1s After GC time: 7.98s Fixed timing logger errors. Change-Id: I4193c6ccbbbe7a7220dfaabbf3472a5dcebae616 --- runtime/mirror/object.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/mirror/object.h') diff --git a/runtime/mirror/object.h b/runtime/mirror/object.h index f652202999..fd31dfbbb5 100644 --- a/runtime/mirror/object.h +++ b/runtime/mirror/object.h @@ -100,8 +100,10 @@ class MANAGED LOCKABLE Object { return OFFSET_OF_OBJECT_MEMBER(Object, monitor_); } - LockWord GetLockWord(); - void SetLockWord(LockWord new_val); + // As volatile can be false if the mutators are suspended. This is an optimization since it + // avoids the barriers. + LockWord GetLockWord(bool as_volatile); + void SetLockWord(LockWord new_val, bool as_volatile); bool CasLockWord(LockWord old_val, LockWord new_val) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); uint32_t GetLockOwnerThreadId(); -- cgit v1.2.3-59-g8ed1b