From ef7d42fca18c16fbaf103822ad16f23246e2905d Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 6 Jan 2014 12:55:46 -0800 Subject: Object model changes to support 64bit. Modify mirror objects so that references between them use an ObjectReference value type rather than an Object* so that functionality to compress larger references can be captured in the ObjectRefererence implementation. ObjectReferences are 32bit and all other aspects of object layout remain as they are currently. Expand fields in objects holding pointers so they can hold 64bit pointers. Its expected the size of these will come down by improving where we hold compiler meta-data. Stub out x86_64 architecture specific runtime implementation. Modify OutputStream so that reads and writes are of unsigned quantities. Make the use of portable or quick code more explicit. Templatize AtomicInteger to support more than just int32_t as a type. Add missing, and fix issues relating to, missing annotalysis information on the mutator lock. Refactor and share implementations for array copy between System and uses elsewhere in the runtime. Fix numerous 64bit build issues. Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822 --- runtime/lock_word-inl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/lock_word-inl.h') diff --git a/runtime/lock_word-inl.h b/runtime/lock_word-inl.h index 8b9a3cd954..414b3bb3e1 100644 --- a/runtime/lock_word-inl.h +++ b/runtime/lock_word-inl.h @@ -18,6 +18,7 @@ #define ART_RUNTIME_LOCK_WORD_INL_H_ #include "lock_word.h" +#include "monitor_pool.h" namespace art { @@ -33,7 +34,8 @@ inline uint32_t LockWord::ThinLockCount() const { inline Monitor* LockWord::FatLockMonitor() const { DCHECK_EQ(GetState(), kFatLocked); - return reinterpret_cast(value_ << kStateSize); + MonitorId mon_id = static_cast(value_ & ~(kStateMask << kStateShift)); + return MonitorPool::MonitorFromMonitorId(mon_id); } inline size_t LockWord::ForwardingAddress() const { @@ -46,8 +48,7 @@ inline LockWord::LockWord() : value_(0) { } inline LockWord::LockWord(Monitor* mon) - : value_(((reinterpret_cast(mon) >> kStateSize) | (kStateFat << kStateShift)) & - 0xFFFFFFFFU) { + : value_(mon->GetMonitorId() | (kStateFat << kStateShift)) { DCHECK_EQ(FatLockMonitor(), mon); } -- cgit v1.2.3