Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/test/hotspot/jtreg/compiler/lib/ir_framework/TestInfo.java
64507 views
1
/*
2
* Copyright (c) 2021, 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
24
package compiler.lib.ir_framework;
25
26
import compiler.lib.ir_framework.test.DeclaredTest;
27
import compiler.lib.ir_framework.test.TestVM;
28
29
import java.lang.reflect.Method;
30
31
/**
32
* Test info class which provides some useful utility methods and information about a <b>checked test</b>.
33
*
34
* @see Test
35
* @see Check
36
*/
37
public class TestInfo extends AbstractInfo {
38
private final Method testMethod;
39
private final boolean compilationSkipped;
40
41
public TestInfo(Method testMethod, CompLevel testCmpLevel) {
42
super(testMethod.getDeclaringClass());
43
this.testMethod = testMethod;
44
this.compilationSkipped = testCmpLevel == CompLevel.SKIP;
45
}
46
47
/**
48
* Get the associated test method object.
49
*
50
* @return the associated test method object.
51
*/
52
public Method getTest() {
53
return testMethod;
54
}
55
56
/**
57
* Return a boolean indicating if the framework skipped a compilation after the warm-up due to VM flags not
58
* allowing a compilation on the requested level in {@link Test#compLevel()}.
59
*
60
* @return {@code true} if the framework skipped compilation of the test;
61
* {@code false} otherwise.
62
*/
63
public boolean isCompilationSkipped() {
64
return compilationSkipped;
65
}
66
67
/**
68
* Returns a boolean indicating if the associated test method is C1 compiled.
69
*
70
* @return {@code true} if the test method is C1 compiled;
71
* {@code false} otherwise.
72
*/
73
public boolean isC1Compiled() {
74
return TestVM.isC1Compiled(testMethod);
75
}
76
77
/**
78
* Returns a boolean indicating if the associated test method is C2 compiled.
79
*
80
* @return {@code true} if the test method is C2 compiled;
81
* {@code false} otherwise.
82
*/
83
public boolean isC2Compiled() {
84
return TestVM.isC2Compiled(testMethod);
85
}
86
87
/**
88
* Returns a boolean indicating if the associated test method is compiled at {@code compLevel}.
89
*
90
* @param compLevel the compilation level.
91
* @return {@code true} if the test method is compiled at {@code compLevel};
92
* {@code false} otherwise.
93
*/
94
public boolean isCompiledAtLevel(CompLevel compLevel) {
95
return TestVM.isCompiledAtLevel(testMethod, compLevel);
96
}
97
}
98
99