Mercurial > hg > truffle
changeset 4424:fe11e8522eb3
Fix array copy snippet's write barrier
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 01 Feb 2012 17:23:23 +0100 |
parents | e8ce691d7923 |
children | f75f0cdf0ccc |
files | graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/ArrayCopySnippets.java |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/ArrayCopySnippets.java Wed Feb 01 16:54:44 2012 +0100 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/ArrayCopySnippets.java Wed Feb 01 17:23:23 2012 +0100 @@ -334,14 +334,14 @@ UnsafeStoreNode.store(dest, i + (destOffset + header), a, CiKind.Object); } if (length > 0) { - long cardShift = CardTableShiftNode.get(); + int cardShift = CardTableShiftNode.get(); long cardStart = CardTableStartNode.get(); long dstAddr = GetObjectAddressNode.get(dest); - long count = (8 * (length - 1)) >>> cardShift; - long start = ((dstAddr + header + destOffset) >>> cardShift) + cardStart; - - while (count-- > 0) { - DirectStoreNode.store(start + count, false); + long start = (dstAddr + header + destOffset) >>> cardShift; + long end = (dstAddr + header + destOffset + 8L * (length - 1)) >>> cardShift; + long count = end - start; + while (count-- >= 0) { + DirectStoreNode.store((start + cardStart) + count, false); } }