From: <ste...@us...> - 2010-06-17 05:02:41
|
Revision: 15859 http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=15859&view=rev Author: steveb-oss Date: 2010-06-17 05:02:34 +0000 (Thu, 17 Jun 2010) Log Message: ----------- Fix bug identified by Da Feng. This bug is only evident when ADDRESS_BASED_HASHING is true and DYNAMIC_HASH_OFFSET is false, and a collector moves objects (as in a compacting collector). Modified Paths: -------------- rvmroot/trunk/rvm/src/org/jikesrvm/objectmodel/JavaHeader.java Modified: rvmroot/trunk/rvm/src/org/jikesrvm/objectmodel/JavaHeader.java =================================================================== --- rvmroot/trunk/rvm/src/org/jikesrvm/objectmodel/JavaHeader.java 2010-06-17 04:43:34 UTC (rev 15858) +++ rvmroot/trunk/rvm/src/org/jikesrvm/objectmodel/JavaHeader.java 2010-06-17 05:02:34 UTC (rev 15859) @@ -456,7 +456,7 @@ } if (toObj != null) { - toAddress = Magic.objectAsAddress(toObj).minus(OBJECT_REF_OFFSET); + toAddress = Magic.objectAsAddress(toObj).minus(objRefOffset); } // Low memory word of source object @@ -464,13 +464,18 @@ // Do the copy Memory.aligned32Copy(toAddress, fromAddress, copyBytes); - toObj = Magic.addressAsObject(toAddress.plus(objRefOffset)); + if (toObj == null) { + toObj = Magic.addressAsObject(toAddress.plus(objRefOffset)); + } else { + if (VM.VerifyAssertions) VM._assert(toObj == Magic.addressAsObject(toAddress.plus(objRefOffset))); + } + // Do we need to copy the hash code? if (hashState.EQ(HASH_STATE_HASHED)) { int hashCode = Magic.objectAsAddress(fromObj).toWord().rshl(SizeConstants.LOG_BYTES_IN_ADDRESS).toInt(); if (DYNAMIC_HASH_OFFSET) { - Magic.setIntAtOffset(toObj, Offset.fromIntSignExtend(numBytes - objRefOffset - HASHCODE_BYTES), hashCode); + Magic.setIntAtOffset(toObj, Offset.fromIntSignExtend(numBytes - OBJECT_REF_OFFSET - HASHCODE_BYTES), hashCode); } else { Magic.setIntAtOffset(toObj, HASHCODE_OFFSET, (hashCode << 1) | ALIGNMENT_MASK); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |