Mercurial > hg > truffle
changeset 10943:ed315765a43a
Add more unittests for ArrayCopy write barriers
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Fri, 02 Aug 2013 13:45:04 +0200 |
parents | 56a86b60c9d3 |
children | 3a9f3ec8efc6 |
files | graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Fri Aug 02 13:43:15 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Fri Aug 02 13:45:04 2013 +0200 @@ -207,6 +207,27 @@ test2("testUnsafeLoad", wr, new Long(16), new Integer(16)); } + static Object[] src = new Object[1]; + static Object[] dst = new Object[1]; + + static { + for (int i = 0; i < src.length; i++) { + src[i] = new Object(); + } + for (int i = 0; i < dst.length; i++) { + dst[i] = new Object(); + } + } + + public static void testArrayCopy(Object a, Object b, Object c) throws Exception { + System.arraycopy(a, 0, b, 0, (int) c); + } + + @Test + public void test11() throws Exception { + test2("testArrayCopy", src, dst, dst.length); + } + public static Object testUnsafeLoad(Object a, Object b, Object c) throws Exception { final int offset = (c == null ? 0 : ((Integer) c).intValue()); final long displacement = (b == null ? 0 : ((Long) b).longValue());