Mercurial > hg > truffle
annotate graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ArrayCopy02.java @ 14991:64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 06 Apr 2014 17:46:24 +0200 |
parents | 390448a6b535 |
children |
rev | line source |
---|---|
5613 | 1 /* |
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package com.oracle.graal.jtt.optimize; | |
24 | |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7282
diff
changeset
|
25 import org.junit.*; |
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7282
diff
changeset
|
26 |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
27 import com.oracle.graal.jtt.*; |
5613 | 28 |
29 /* | |
30 * Tests calls to the array copy method. | |
31 */ | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
32 public class ArrayCopy02 extends JTTTest { |
5613 | 33 |
34 public static int[] src = new int[]{0, 1, 2, 3, 4, 5}; | |
35 public static int[] dest0 = new int[]{5, 4, 3, 2, 1, 0}; | |
36 public static int[] dest = new int[]{5, 4, 3, 2, 1, 0}; | |
5744
51cee50d1d11
ensure System.arrycopy is resolved in JTT tests that use it
Doug Simon <doug.simon@oracle.com>
parents:
5613
diff
changeset
|
37 static { |
5746
17d2c3b72762
Fix aliased case problem intoduced in last array copy snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5744
diff
changeset
|
38 // Ensure System is resolved |
5744
51cee50d1d11
ensure System.arrycopy is resolved in JTT tests that use it
Doug Simon <doug.simon@oracle.com>
parents:
5613
diff
changeset
|
39 System.arraycopy(src, 0, src, 0, src.length); |
51cee50d1d11
ensure System.arrycopy is resolved in JTT tests that use it
Doug Simon <doug.simon@oracle.com>
parents:
5613
diff
changeset
|
40 } |
5613 | 41 |
42 @Before | |
43 public void setUp() { | |
44 System.currentTimeMillis(); | |
45 for (int i = 0; i < dest.length; i++) { | |
46 dest[i] = dest0[i]; | |
47 } | |
48 } | |
49 | |
50 public static int[] test(int srcPos, int destPos, int length) { | |
51 System.arraycopy(src, srcPos, dest, destPos, length); | |
52 return dest; | |
53 } | |
54 | |
55 @Test | |
56 public void run0() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
57 runTest("test", 0, 0, 0); |
5613 | 58 } |
59 | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
60 @Test |
5613 | 61 public void run1() throws Throwable { |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
62 runTest("test", 0, 0, -1); |
5613 | 63 } |
64 | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
65 @Test |
5613 | 66 public void run2() throws Throwable { |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
67 runTest("test", -1, 0, 0); |
5613 | 68 } |
69 | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
70 @Test |
5613 | 71 public void run3() throws Throwable { |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
72 runTest("test", 0, -1, 0); |
5613 | 73 } |
74 | |
75 @Test | |
76 public void run4() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
77 runTest("test", 0, 0, 2); |
5613 | 78 } |
79 | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
80 @Test |
5613 | 81 public void run5() throws Throwable { |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
82 runTest("test", 0, 1, 6); |
5613 | 83 } |
84 | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
85 @Test |
5613 | 86 public void run6() throws Throwable { |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
87 runTest("test", 1, 0, 6); |
5613 | 88 } |
89 | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
90 @Test |
5613 | 91 public void run7() throws Throwable { |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
92 runTest("test", 1, 1, -1); |
5613 | 93 } |
94 | |
95 @Test | |
96 public void run8() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
97 runTest("test", 0, 1, 2); |
5613 | 98 } |
99 | |
100 @Test | |
101 public void run9() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
102 runTest("test", 1, 0, 2); |
5613 | 103 } |
104 | |
105 @Test | |
106 public void run10() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
107 runTest("test", 1, 1, 2); |
5613 | 108 } |
109 | |
110 @Test | |
111 public void run11() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
112 runTest("test", 0, 0, 6); |
5613 | 113 } |
114 | |
115 @Test | |
116 public void run12() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
117 runTest("test", 0, 1, 5); |
5613 | 118 } |
119 | |
120 @Test | |
121 public void run13() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
122 runTest("test", 1, 0, 5); |
5613 | 123 } |
124 | |
125 @Test | |
126 public void run14() throws Throwable { | |
7282
390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
Doug Simon <doug.simon@oracle.com>
parents:
5746
diff
changeset
|
127 runTest("test", 1, 1, 5); |
5613 | 128 } |
129 | |
130 } |