# HG changeset patch # User Bernhard Urban # Date 1417544870 -3600 # Node ID 1f379e2a623f73d412cca0fdd48d98ae18bf84ee # Parent 58ea6b98cb0996825761e3f2a43e180df94141a5 checkcastArraycopy: sign extend super_check_offset diff -r 58ea6b98cb09 -r 1f379e2a623f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java Tue Dec 02 18:55:38 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java Tue Dec 02 19:27:50 2014 +0100 @@ -195,7 +195,7 @@ } private static void checkcastArraycopyHelper(int srcPos, int destPos, int length, Object nonNullSrc, Object nonNullDest, KlassPointer destElemKlass) { - int superCheckOffset = destElemKlass.readInt(superCheckOffsetOffset(), KLASS_SUPER_CHECK_OFFSET_LOCATION); + Word superCheckOffset = Word.signed(destElemKlass.readInt(superCheckOffsetOffset(), KLASS_SUPER_CHECK_OFFSET_LOCATION)); int copiedElements = CheckcastArrayCopyCallNode.checkcastArraycopy(nonNullSrc, srcPos, nonNullDest, destPos, length, superCheckOffset, destElemKlass, false); if (copiedElements != 0) { // the checkcast stub doesn't throw the ArrayStoreException, but returns the number of diff -r 58ea6b98cb09 -r 1f379e2a623f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckcastArrayCopyCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckcastArrayCopyCallNode.java Tue Dec 02 18:55:38 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckcastArrayCopyCallNode.java Tue Dec 02 19:27:50 2014 +0100 @@ -35,6 +35,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.runtime.*; +import com.oracle.graal.word.*; @NodeInfo(allowedUsageTypes = {InputType.Memory, InputType.Value}) public class CheckcastArrayCopyCallNode extends AbstractMemoryCheckpoint implements Lowerable, MemoryCheckpoint.Single { @@ -125,5 +126,5 @@ } @NodeIntrinsic - public static native int checkcastArraycopy(Object src, int srcPos, Object dest, int destPos, int length, int superCheckOffset, Object destElemKlass, @ConstantNodeParameter boolean uninit); + public static native int checkcastArraycopy(Object src, int srcPos, Object dest, int destPos, int length, Word superCheckOffset, Object destElemKlass, @ConstantNodeParameter boolean uninit); }