Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java @ 19250:8ab925a6f724
made Assumptions be part of a StructuredGraph
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 11 Feb 2015 10:13:08 +0100 |
parents | 9619ba4daf4c |
children | a0a760b0fb5f |
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 /* |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18120
diff
changeset
|
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. |
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
|
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 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
|
26 |
9682
86d24f120b78
Allow tests to check for deoptimizations, provide Method object in before hook.
Roland Schatz <roland.schatz@oracle.com>
parents:
9438
diff
changeset
|
27 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
|
28 |
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
|
29 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
|
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 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
|
32 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
|
33 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
|
34 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
|
35 |
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 /** |
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 * 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
|
38 * <p> |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
39 * 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
|
40 * 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
|
41 * 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
|
42 */ |
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
|
43 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
|
44 |
16041
f0efdd541094
less dependency between jtt tests and GraalCompilerTest constructors
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15622
diff
changeset
|
45 public static final class DummyTestClass { |
f0efdd541094
less dependency between jtt tests and GraalCompilerTest constructors
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15622
diff
changeset
|
46 } |
f0efdd541094
less dependency between jtt tests and GraalCompilerTest constructors
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15622
diff
changeset
|
47 |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
48 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
|
49 /** |
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
|
50 * 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
|
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 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
|
53 |
8232
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
54 public JTTTest() { |
11959
23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11405
diff
changeset
|
55 Assert.assertNotNull(getCodeCache()); |
8232
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
56 } |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
57 |
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
|
58 @Override |
19250
8ab925a6f724
made Assumptions be part of a StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
59 protected StructuredGraph parseEager(ResolvedJavaMethod m, boolean allowOptimisticAssumptions) { |
8ab925a6f724
made Assumptions be part of a StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
60 StructuredGraph graph = super.parseEager(m, allowOptimisticAssumptions); |
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
|
61 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
|
62 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
|
63 Object[] args = argsWithReceiver(receiver, argsToBind); |
18120
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
64 JavaType[] parameterTypes = m.toParameterTypes(); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7282
diff
changeset
|
65 assert parameterTypes.length == args.length; |
9438
3e884486cc8a
Fix non-static args binding in JTT
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8233
diff
changeset
|
66 for (int i = 0; i < args.length; i++) { |
13614
0774f3303c2e
rename LocalNode to ParameterNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
11959
diff
changeset
|
67 ParameterNode param = graph.getParameter(i); |
16198
006d99164743
handle graphs in JTT tests where one or more parameter nodes have been dead code eliminated
Doug Simon <doug.simon@oracle.com>
parents:
16041
diff
changeset
|
68 if (param != null) { |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18120
diff
changeset
|
69 JavaConstant c = getSnippetReflection().forBoxed(parameterTypes[i].getKind(), args[i]); |
16198
006d99164743
handle graphs in JTT tests where one or more parameter nodes have been dead code eliminated
Doug Simon <doug.simon@oracle.com>
parents:
16041
diff
changeset
|
70 ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph); |
006d99164743
handle graphs in JTT tests where one or more parameter nodes have been dead code eliminated
Doug Simon <doug.simon@oracle.com>
parents:
16041
diff
changeset
|
71 param.replaceAtUsages(replacement); |
006d99164743
handle graphs in JTT tests where one or more parameter nodes have been dead code eliminated
Doug Simon <doug.simon@oracle.com>
parents:
16041
diff
changeset
|
72 } else { |
006d99164743
handle graphs in JTT tests where one or more parameter nodes have been dead code eliminated
Doug Simon <doug.simon@oracle.com>
parents:
16041
diff
changeset
|
73 // Parameter is not used and has been dead-code eliminated |
006d99164743
handle graphs in JTT tests where one or more parameter nodes have been dead code eliminated
Doug Simon <doug.simon@oracle.com>
parents:
16041
diff
changeset
|
74 } |
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
|
75 } |
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 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
|
78 } |
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 |
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 @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
|
81 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
|
82 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
|
83 } |
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 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
|
86 |
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 @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
|
88 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
|
89 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
|
90 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
|
91 } 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
|
92 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
|
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 } |
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 |
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 @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
|
97 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
|
98 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
|
99 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
|
100 } |
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
|
101 |
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
|
102 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
|
103 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
|
104 } |
86d24f120b78
Allow tests to check for deoptimizations, provide Method object in before hook.
Roland Schatz <roland.schatz@oracle.com>
parents:
9438
diff
changeset
|
105 |
10887 | 106 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
|
107 runTest(shouldNotDeopt, true, false, name, args); |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
108 } |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
109 |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
110 protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, boolean bind, boolean noProfile, String name, Object... args) { |
18120
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
111 ResolvedJavaMethod method = getResolvedJavaMethod(name); |
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
112 Object receiver = method.isStatic() ? null : this; |
8232
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
113 |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
114 Result expect = executeExpected(method, receiver, args); |
ab374f69e4e8
JTTTest gets the expeted result only once
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7530
diff
changeset
|
115 |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
116 if (noProfile) { |
18120
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
117 method.reprofile(); |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
118 } |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
119 |
11405
25161615539b
method rename to avoid ambiguous overloading
Doug Simon <doug.simon@oracle.com>
parents:
10887
diff
changeset
|
120 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
|
121 if (args.length > 0 && bind) { |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
122 if (noProfile) { |
18120
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
123 method.reprofile(); |
13674
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
124 } |
c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13614
diff
changeset
|
125 |
9438
3e884486cc8a
Fix non-static args binding in JTT
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8233
diff
changeset
|
126 this.argsToBind = args; |
11405
25161615539b
method rename to avoid ambiguous overloading
Doug Simon <doug.simon@oracle.com>
parents:
10887
diff
changeset
|
127 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
|
128 this.argsToBind = null; |
3e884486cc8a
Fix non-static args binding in JTT
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8233
diff
changeset
|
129 } |
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
|
130 } |
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
|
131 } |