< prev index next >

test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java

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


  30  * @library ../common/patches
  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.CanInlineMethodTest
  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  *                   compiler.jvmci.compilerToVM.CanInlineMethodTest
  45  */
  46 
  47 package compiler.jvmci.compilerToVM;
  48 
  49 import compiler.jvmci.common.CTVMUtilities;





  50 import java.lang.reflect.Executable;
  51 import java.util.ArrayList;
  52 import java.util.Arrays;
  53 import java.util.List;
  54 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  55 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  56 import jdk.test.lib.Asserts;
  57 import sun.hotspot.WhiteBox;
  58 
  59 public class CanInlineMethodTest {
  60 
  61     private static final WhiteBox WB = WhiteBox.getWhiteBox();
  62 
  63     public static void main(String[] args) {
  64         List<Executable> testCases = createTestCases();
  65         testCases.forEach(CanInlineMethodTest::runSanityTest);
  66     }
  67 
  68     private static void runSanityTest(Executable aMethod) {
  69         HotSpotResolvedJavaMethod method = CTVMUtilities
  70                 .getResolvedMethod(aMethod);
  71         boolean canInline = CompilerToVMHelper.canInlineMethod(method);
  72         boolean expectedCanInline = !WB.testSetDontInlineMethod(aMethod,
  73                 true);
  74         Asserts.assertEQ(canInline, expectedCanInline, "Unexpected initial " +
  75                 "value of property 'can inline'");
  76 
  77         canInline = CompilerToVMHelper.canInlineMethod(method);


  30  * @library ../common/patches
  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.CanInlineMethodTest
  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  *                   compiler.jvmci.compilerToVM.CanInlineMethodTest
  45  */
  46 
  47 package compiler.jvmci.compilerToVM;
  48 
  49 import compiler.jvmci.common.CTVMUtilities;
  50 import jdk.test.lib.Asserts;
  51 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  52 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  53 import sun.hotspot.WhiteBox;
  54 
  55 import java.lang.reflect.Executable;
  56 import java.util.ArrayList;
  57 import java.util.Arrays;
  58 import java.util.List;




  59 
  60 public class CanInlineMethodTest {
  61 
  62     private static final WhiteBox WB = WhiteBox.getWhiteBox();
  63 
  64     public static void main(String[] args) {
  65         List<Executable> testCases = createTestCases();
  66         testCases.forEach(CanInlineMethodTest::runSanityTest);
  67     }
  68 
  69     private static void runSanityTest(Executable aMethod) {
  70         HotSpotResolvedJavaMethod method = CTVMUtilities
  71                 .getResolvedMethod(aMethod);
  72         boolean canInline = CompilerToVMHelper.canInlineMethod(method);
  73         boolean expectedCanInline = !WB.testSetDontInlineMethod(aMethod,
  74                 true);
  75         Asserts.assertEQ(canInline, expectedCanInline, "Unexpected initial " +
  76                 "value of property 'can inline'");
  77 
  78         canInline = CompilerToVMHelper.canInlineMethod(method);
< prev index next >