harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nina Rinskaya (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3216) [drlvm][jit][opt] OPT loses ArrayStoreException when optimizing java.lang.System.arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
Date Wed, 21 Feb 2007 14:08:05 GMT
[drlvm][jit][opt] OPT loses ArrayStoreException when optimizing java.lang.System.arraycopy(Object
src, int srcPos, Object dest, int destPos, int length)
--------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-3216
                 URL: https://issues.apache.org/jira/browse/HARMONY-3216
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Linux x86 (SLES9), Windows x86 (XP )
            Reporter: Nina Rinskaya
            Priority: Minor


Looks that OPT loses ArrayStoreException when optimizing java.lang.System.arraycopy(Object
src, int srcPos, Object dest, int destPos, int length), please see testcase and outputs below:

public class MyTest {
    Object[] oo1 = new String[3];
    public int test() {
        Integer[] oo2 = new Integer[oo1.length];
        for (int i=0; i<oo2.length; i++) {
            oo2[i] = new Integer(i);
        }
        try {
            System.arraycopy(oo2, 0, oo1, 0, oo1.length);
        } catch (ArrayStoreException ase) {
            return 0;
        }
        return 1;
    }
    public static void main(String[] args) {
        try {
            int res = new MyTest().test();
            if (res != 0 ) {
                System.out.println("Failed: ArrayStoreException not thrown!");
            } else
                System.out.println("Passed");
        } catch (Throwable t) {
            System.out.println("Error: ");
            t.printStackTrace();
        }
    }
}

Output on RI:

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)

java.lang.ArrayStoreException
        at java.lang.System.arraycopy(Native Method)
        at ac.test(ac.java:9)
        at ac.main(ac.java:18)
Passed: ArrayStoreException thrown

Output on Harmony (with default options):

java version "1.5.0"
pre-alpha : not complete or compatible
svn = r509548, (Feb 20 2007), Linux/ia32/gcc 3.3.3, debug build
http://incubator.apache.org/harmony
java.lang.ArrayStoreException: bad arrayCopy
        at java.lang.VMMemoryManager.arrayCopy(VMMemoryManager.java)
        at java.lang.System.arraycopy(System.java)
        at ac.test(ac.java:9)
        at ac.main(ac.java:18)
Passed: ArrayStoreException thrown

Output on Harmony with -Xem:opt:

Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r509548, (Feb 20 2007), Linux/ia32/gcc 3.3.3, debug build
http://incubator.apache.org/harmony
Failed: ArrayStoreException not thrown!

Output on Harmony with -Xem:opt -XDjit.arg.genArrayCopyRepMove=false:

java version "1.5.0"
pre-alpha : not complete or compatible
svn = r509548, (Feb 20 2007), Linux/ia32/gcc 3.3.3, debug build
http://incubator.apache.org/harmony
java.lang.ArrayStoreException: bad arrayCopy
        at java.lang.VMMemoryManager.arrayCopy(VMMemoryManager.java)
        at java.lang.System.arraycopy(System.java)
        at ac.test(ac.java:9)
        at ac.main(ac.java:18)
Passed: ArrayStoreException thrown


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message