Path: blob/master/test/hotspot/jtreg/compiler/lib/ir_framework/TestInfo.java
64507 views
/*1* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package compiler.lib.ir_framework;2425import compiler.lib.ir_framework.test.DeclaredTest;26import compiler.lib.ir_framework.test.TestVM;2728import java.lang.reflect.Method;2930/**31* Test info class which provides some useful utility methods and information about a <b>checked test</b>.32*33* @see Test34* @see Check35*/36public class TestInfo extends AbstractInfo {37private final Method testMethod;38private final boolean compilationSkipped;3940public TestInfo(Method testMethod, CompLevel testCmpLevel) {41super(testMethod.getDeclaringClass());42this.testMethod = testMethod;43this.compilationSkipped = testCmpLevel == CompLevel.SKIP;44}4546/**47* Get the associated test method object.48*49* @return the associated test method object.50*/51public Method getTest() {52return testMethod;53}5455/**56* Return a boolean indicating if the framework skipped a compilation after the warm-up due to VM flags not57* allowing a compilation on the requested level in {@link Test#compLevel()}.58*59* @return {@code true} if the framework skipped compilation of the test;60* {@code false} otherwise.61*/62public boolean isCompilationSkipped() {63return compilationSkipped;64}6566/**67* Returns a boolean indicating if the associated test method is C1 compiled.68*69* @return {@code true} if the test method is C1 compiled;70* {@code false} otherwise.71*/72public boolean isC1Compiled() {73return TestVM.isC1Compiled(testMethod);74}7576/**77* Returns a boolean indicating if the associated test method is C2 compiled.78*79* @return {@code true} if the test method is C2 compiled;80* {@code false} otherwise.81*/82public boolean isC2Compiled() {83return TestVM.isC2Compiled(testMethod);84}8586/**87* Returns a boolean indicating if the associated test method is compiled at {@code compLevel}.88*89* @param compLevel the compilation level.90* @return {@code true} if the test method is compiled at {@code compLevel};91* {@code false} otherwise.92*/93public boolean isCompiledAtLevel(CompLevel compLevel) {94return TestVM.isCompiledAtLevel(testMethod, compLevel);95}96}979899