< prev index next >

test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java

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


  26  * @test
  27  * @bug 8136421
  28  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  29  * @library /testlibrary /test/lib /
  30  * @library ../common/patches
  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.base/jdk.internal.reflect
  33  *          java.base/jdk.internal.org.objectweb.asm
  34  *          java.base/jdk.internal.org.objectweb.asm.tree
  35  *          jdk.vm.ci/jdk.vm.ci.hotspot
  36  *          jdk.vm.ci/jdk.vm.ci.code
  37  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  38  * @build compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest
  39  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  40  *                   compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest
  41  */
  42 
  43 package compiler.jvmci.compilerToVM;
  44 
  45 import compiler.jvmci.common.CTVMUtilities;
  46 import java.lang.reflect.Method;



  47 import java.lang.reflect.Executable;

  48 import java.util.HashMap;
  49 import java.util.Map;
  50 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  51 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  52 import jdk.test.lib.Asserts;
  53 
  54 public class MethodIsIgnoredBySecurityStackWalkTest {
  55 
  56     public static void main(String[] args) {
  57         Map<Executable, Boolean> testCases = createTestCases();
  58         testCases.forEach(
  59                 MethodIsIgnoredBySecurityStackWalkTest::runSanityTest);
  60     }
  61 
  62     private static void runSanityTest(Executable aMethod, Boolean expected) {
  63         HotSpotResolvedJavaMethod method
  64                 = CTVMUtilities.getResolvedMethod(aMethod);
  65         boolean isIgnored = CompilerToVMHelper
  66                 .methodIsIgnoredBySecurityStackWalk(method);
  67         String msg = String.format("%s is%s ignored but must%s", aMethod,
  68                 isIgnored ? "" : " not",
  69                 expected ? "" : " not");
  70         Asserts.assertEQ(isIgnored, expected, msg);
  71     }
  72 




  26  * @test
  27  * @bug 8136421
  28  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  29  * @library /testlibrary /test/lib /
  30  * @library ../common/patches
  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.base/jdk.internal.reflect
  33  *          java.base/jdk.internal.org.objectweb.asm
  34  *          java.base/jdk.internal.org.objectweb.asm.tree
  35  *          jdk.vm.ci/jdk.vm.ci.hotspot
  36  *          jdk.vm.ci/jdk.vm.ci.code
  37  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  38  * @build compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest
  39  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  40  *                   compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest
  41  */
  42 
  43 package compiler.jvmci.compilerToVM;
  44 
  45 import compiler.jvmci.common.CTVMUtilities;
  46 import jdk.test.lib.Asserts;
  47 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  48 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  49 
  50 import java.lang.reflect.Executable;
  51 import java.lang.reflect.Method;
  52 import java.util.HashMap;
  53 import java.util.Map;



  54 
  55 public class MethodIsIgnoredBySecurityStackWalkTest {
  56 
  57     public static void main(String[] args) {
  58         Map<Executable, Boolean> testCases = createTestCases();
  59         testCases.forEach(
  60                 MethodIsIgnoredBySecurityStackWalkTest::runSanityTest);
  61     }
  62 
  63     private static void runSanityTest(Executable aMethod, Boolean expected) {
  64         HotSpotResolvedJavaMethod method
  65                 = CTVMUtilities.getResolvedMethod(aMethod);
  66         boolean isIgnored = CompilerToVMHelper
  67                 .methodIsIgnoredBySecurityStackWalk(method);
  68         String msg = String.format("%s is%s ignored but must%s", aMethod,
  69                 isIgnored ? "" : " not",
  70                 expected ? "" : " not");
  71         Asserts.assertEQ(isIgnored, expected, msg);
  72     }
  73 


< prev index next >