< prev index next >

test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.base/jdk.internal.org.objectweb.asm
  33  *          java.base/jdk.internal.org.objectweb.asm.tree
  34  *          jdk.vm.ci/jdk.vm.ci.hotspot
  35  *          jdk.vm.ci/jdk.vm.ci.code
  36  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  37  * @build compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest
  38  * @build sun.hotspot.WhiteBox
  39  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  40  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  41  * @run main/othervm -Xbootclasspath/a:.
  42  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  43  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  44  *                   -XX:-BackgroundCompilation
  45  *                   compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest
  46  */
  47 
  48 package compiler.jvmci.compilerToVM;
  49 
  50 import compiler.jvmci.common.CTVMUtilities;
  51 
  52 import java.lang.reflect.Executable;
  53 import java.util.ArrayList;
  54 import java.util.List;
  55 
  56 import compiler.testlibrary.CompilerUtils;
  57 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  58 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  59 import jdk.test.lib.Asserts;
  60 import jdk.test.lib.Utils;


  61 import sun.hotspot.code.NMethod;
  62 




  63 public class HasCompiledCodeForOSRTest {
  64     public static void main(String[] args) {
  65         List<CompileCodeTestCase> testCases = createTestCases();
  66         testCases.forEach(HasCompiledCodeForOSRTest::runSanityTest);
  67     }
  68 
  69     public static List<CompileCodeTestCase> createTestCases() {
  70         List<CompileCodeTestCase> testCases = new ArrayList<>();
  71 
  72         try {
  73             Class<?> aClass = DummyClass.class;
  74             Object receiver = new DummyClass();
  75             testCases.add(new CompileCodeTestCase(receiver,
  76                     aClass.getMethod("withLoop"), 17));
  77         } catch (NoSuchMethodException e) {
  78             throw new Error("TEST BUG : " + e.getMessage(), e);
  79         }
  80         return testCases;
  81     }
  82 




  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.base/jdk.internal.org.objectweb.asm
  33  *          java.base/jdk.internal.org.objectweb.asm.tree
  34  *          jdk.vm.ci/jdk.vm.ci.hotspot
  35  *          jdk.vm.ci/jdk.vm.ci.code
  36  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  37  * @build compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest
  38  * @build sun.hotspot.WhiteBox
  39  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  40  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  41  * @run main/othervm -Xbootclasspath/a:.
  42  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  43  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  44  *                   -XX:-BackgroundCompilation
  45  *                   compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest
  46  */
  47 
  48 package compiler.jvmci.compilerToVM;
  49 
  50 import compiler.jvmci.common.CTVMUtilities;





  51 import compiler.testlibrary.CompilerUtils;


  52 import jdk.test.lib.Asserts;
  53 import jdk.test.lib.Utils;
  54 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  55 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  56 import sun.hotspot.code.NMethod;
  57 
  58 import java.lang.reflect.Executable;
  59 import java.util.ArrayList;
  60 import java.util.List;
  61 
  62 public class HasCompiledCodeForOSRTest {
  63     public static void main(String[] args) {
  64         List<CompileCodeTestCase> testCases = createTestCases();
  65         testCases.forEach(HasCompiledCodeForOSRTest::runSanityTest);
  66     }
  67 
  68     public static List<CompileCodeTestCase> createTestCases() {
  69         List<CompileCodeTestCase> testCases = new ArrayList<>();
  70 
  71         try {
  72             Class<?> aClass = DummyClass.class;
  73             Object receiver = new DummyClass();
  74             testCases.add(new CompileCodeTestCase(receiver,
  75                     aClass.getMethod("withLoop"), 17));
  76         } catch (NoSuchMethodException e) {
  77             throw new Error("TEST BUG : " + e.getMessage(), e);
  78         }
  79         return testCases;
  80     }
  81 


< prev index next >