Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java @ 16041:f0efdd541094
less dependency between jtt tests and GraalCompilerTest constructors
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Thu, 05 Jun 2014 18:14:14 +0200 |
parents | 7b09605b29c5 |
children | 006d99164743 |
rev | line source |
---|---|
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:
diff
changeset
|
1 /* |
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:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
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:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
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:
diff
changeset
|
4 * |
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:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
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:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
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:
diff
changeset
|
7 * published by the Free Software Foundation. |
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:
diff
changeset
|
8 * |
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:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
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:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
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:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
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:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
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:
diff
changeset
|
13 * accompanied this code). |
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:
diff
changeset
|
14 * |
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:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
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:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
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:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
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:
diff
changeset
|
18 * |
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:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
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:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
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:
diff
changeset
|
21 * questions. |
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:
diff
changeset
|
22 */ |
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:
diff
changeset
|
23 package com.oracle.graal.jtt; |
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:
diff
changeset
|
24 |
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:
diff
changeset
|
25 import static com.oracle.graal.api.meta.MetaUtil.*; |
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:
diff
changeset
|
26 import static java.lang.reflect.Modifier.*; |
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:
diff
changeset
|
27 |
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:
diff
changeset
|
28 import java.lang.reflect.*; |
9682
86d24f120b78
Allow tests to check for deoptimizations, provide Method object in before hook.
Roland Schatz <roland.schatz@oracle.com>
parents:
9438
diff
changeset
|
29 import java.util.*; |
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:
diff
changeset
|
30 |
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:
diff
changeset
|
31 import org.junit.*; |
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:
diff
changeset
|
32 |
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:
diff
changeset
|
33 import com.oracle.graal.api.code.*; |
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:
diff
changeset
|
34 import com.oracle.graal.api.meta.*; |
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:
diff
changeset
|
35 import com.oracle.graal.compiler.test.*; |
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:
diff
changeset
|
36 import com.oracle.graal.nodes.*; |
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:
diff
changeset
|
37 |
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:
diff
changeset
|
38 /** |
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:
diff
changeset
|
39 * Base class for the JTT tests. |
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:
diff
changeset
|
40 * <p> |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
41 * These tests are executed twice: once with arguments passed to the execution and once with the |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
42 * arguments bound to the test's parameters during compilation. The latter is a good test of |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
43 * canonicalization. |
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:
diff
changeset
|
44 */ |
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:
diff
changeset
|
45 public class JTTTest extends GraalCompilerTest { |
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:
diff
changeset
|
46 |
16041
f0efdd541094
less dependency between jtt tests and GraalCompilerTest constructors
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15622
diff
changeset
|
47 public static final class DummyTestClass { |
f0efdd541094
less dependency between jtt tests and GraalCompilerTest constructors
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15622
diff
changeset
|
48 } |
f0efdd541094
less dependency between jtt tests and GraalCompilerTest constructors
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15622
diff
changeset
|
49 |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
50 protected static final Set<DeoptimizationReason> EMPTY = Collections.<DeoptimizationReason> emptySet(); |
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:
diff
changeset
|
51 /** |
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:
diff
changeset
|
52 * The arguments which, if non-null, will replace the Locals in the test method's graph. |
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:
diff
changeset
|
53 */ |
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:
diff
changeset
|
54 Object[] argsToBind; |
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:
diff
changeset
|
55 |
8232
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
56 public JTTTest() { |
11959
23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11405
diff
changeset
|
57 Assert.assertNotNull(getCodeCache()); |
8232
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
58 } |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
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:
diff
changeset
|
60 @Override |
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:
diff
changeset
|
61 protected StructuredGraph parse(Method m) { |
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:
diff
changeset
|
62 StructuredGraph graph = super.parse(m); |
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:
diff
changeset
|
63 if (argsToBind != null) { |
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:
diff
changeset
|
64 Object receiver = isStatic(m.getModifiers()) ? null : this; |
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:
diff
changeset
|
65 Object[] args = argsWithReceiver(receiver, argsToBind); |
11959
23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11405
diff
changeset
|
66 JavaType[] parameterTypes = signatureToTypes(getMetaAccess().lookupJavaMethod(m)); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7282
diff
changeset
|
67 assert parameterTypes.length == args.length; |
9438
3e884486cc8a
Fix non-static args binding in JTT
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8233
diff
changeset
|
68 for (int i = 0; i < args.length; i++) { |
13614
0774f3303c2e
rename LocalNode to ParameterNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
11959
diff
changeset
|
69 ParameterNode param = graph.getParameter(i); |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
13674
diff
changeset
|
70 Constant c = getSnippetReflection().forBoxed(parameterTypes[i].getKind(), args[i]); |
11959
23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11405
diff
changeset
|
71 ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph); |
13614
0774f3303c2e
rename LocalNode to ParameterNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
11959
diff
changeset
|
72 param.replaceAtUsages(replacement); |
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:
diff
changeset
|
73 } |
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:
diff
changeset
|
74 } |
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:
diff
changeset
|
75 return graph; |
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:
diff
changeset
|
76 } |
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:
diff
changeset
|
77 |
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:
diff
changeset
|
78 @Override |
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:
diff
changeset
|
79 protected InstalledCode getCode(ResolvedJavaMethod method, StructuredGraph graph) { |
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:
diff
changeset
|
80 return super.getCode(method, graph, argsToBind != null); |
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:
diff
changeset
|
81 } |
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:
diff
changeset
|
82 |
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:
diff
changeset
|
83 Double delta; |
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:
diff
changeset
|
84 |
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:
diff
changeset
|
85 @Override |
15622
7b09605b29c5
renamed GraalTest.assertEquals* to assertDeepEquals to avoid confusion with JUnit API methods
Doug Simon <doug.simon@oracle.com>
parents:
15018
diff
changeset
|
86 protected void assertDeepEquals(Object expected, Object actual) { |
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:
diff
changeset
|
87 if (delta != null) { |
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:
diff
changeset
|
88 Assert.assertEquals(((Number) expected).doubleValue(), ((Number) actual).doubleValue(), delta); |
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:
diff
changeset
|
89 } else { |
15622
7b09605b29c5
renamed GraalTest.assertEquals* to assertDeepEquals to avoid confusion with JUnit API methods
Doug Simon <doug.simon@oracle.com>
parents:
15018
diff
changeset
|
90 super.assertDeepEquals(expected, actual); |
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:
diff
changeset
|
91 } |
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:
diff
changeset
|
92 } |
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:
diff
changeset
|
93 |
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:
diff
changeset
|
94 @SuppressWarnings("hiding") |
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:
diff
changeset
|
95 protected void runTestWithDelta(double delta, String name, Object... args) { |
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:
diff
changeset
|
96 this.delta = Double.valueOf(delta); |
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:
diff
changeset
|
97 runTest(name, args); |
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:
diff
changeset
|
98 } |
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:
diff
changeset
|
99 |
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:
diff
changeset
|
100 protected void runTest(String name, Object... args) { |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
101 runTest(EMPTY, name, args); |
9682
86d24f120b78
Allow tests to check for deoptimizations, provide Method object in before hook.
Roland Schatz <roland.schatz@oracle.com>
parents:
9438
diff
changeset
|
102 } |
86d24f120b78
Allow tests to check for deoptimizations, provide Method object in before hook.
Roland Schatz <roland.schatz@oracle.com>
parents:
9438
diff
changeset
|
103 |
10887 | 104 protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, String name, Object... args) { |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
105 runTest(shouldNotDeopt, true, false, name, args); |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
106 } |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
107 |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
108 protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, boolean bind, boolean noProfile, String name, Object... args) { |
8232
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
109 Method method = getMethod(name); |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
110 Object receiver = Modifier.isStatic(method.getModifiers()) ? null : this; |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
111 |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
112 Result expect = executeExpected(method, receiver, args); |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
113 |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
114 if (noProfile) { |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
115 getMetaAccess().lookupJavaMethod(method).reprofile(); |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
116 } |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
117 |
11405
25161615539b
method rename to avoid ambiguous overloading
Doug Simon <doug.simon@oracle.com>
parents:
10887
diff
changeset
|
118 testAgainstExpected(method, expect, shouldNotDeopt, receiver, args); |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
119 if (args.length > 0 && bind) { |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
120 if (noProfile) { |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
121 getMetaAccess().lookupJavaMethod(method).reprofile(); |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
122 } |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
123 |
9438
3e884486cc8a
Fix non-static args binding in JTT
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8233
diff
changeset
|
124 this.argsToBind = args; |
11405
25161615539b
method rename to avoid ambiguous overloading
Doug Simon <doug.simon@oracle.com>
parents:
10887
diff
changeset
|
125 testAgainstExpected(method, expect, shouldNotDeopt, receiver, args); |
9438
3e884486cc8a
Fix non-static args binding in JTT
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8233
diff
changeset
|
126 this.argsToBind = null; |
3e884486cc8a
Fix non-static args binding in JTT
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8233
diff
changeset
|
127 } |
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:
diff
changeset
|
128 } |
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:
diff
changeset
|
129 } |