25 /**
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.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.GetStackTraceElementTest
38 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
39 * compiler.jvmci.compilerToVM.GetStackTraceElementTest
40 */
41
42 package compiler.jvmci.compilerToVM;
43
44 import compiler.jvmci.common.CTVMUtilities;
45 import java.lang.reflect.Executable;
46 import java.lang.reflect.Method;
47 import java.lang.reflect.Modifier;
48 import java.util.HashMap;
49 import java.util.Map;
50
51 import compiler.jvmci.common.testcases.TestCase;
52 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
53 import jdk.vm.ci.hotspot.CompilerToVMHelper;
54 import jdk.test.lib.Asserts;
55
56 public class GetStackTraceElementTest {
57
58 public static void main(String[] args) {
59 Map<Executable, int[]> testCases = createTestCases();
60 testCases.forEach(GetStackTraceElementTest::runSanityTest);
61 }
62
63 private static void runSanityTest(Executable aMethod, int[] bcis) {
64 HotSpotResolvedJavaMethod method = CTVMUtilities
65 .getResolvedMethod(aMethod);
66 String className = aMethod.getDeclaringClass().getName();
67 String methodName = aMethod.getName().equals(className)
68 ? "<init>"
69 : aMethod.getName();
70 String fileName = getFileName(className);
71 Map<Integer, Integer> bciWithLineNumber = CTVMUtilities
72 .getBciToLineNumber(aMethod);
73 boolean isNative = Modifier.isNative(aMethod.getModifiers());
74 int lineNumber = -1;
75 for (int bci : bcis) {
|
25 /**
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.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.GetStackTraceElementTest
38 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
39 * compiler.jvmci.compilerToVM.GetStackTraceElementTest
40 */
41
42 package compiler.jvmci.compilerToVM;
43
44 import compiler.jvmci.common.CTVMUtilities;
45 import compiler.jvmci.common.testcases.TestCase;
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.lang.reflect.Modifier;
53 import java.util.HashMap;
54 import java.util.Map;
55
56 public class GetStackTraceElementTest {
57
58 public static void main(String[] args) {
59 Map<Executable, int[]> testCases = createTestCases();
60 testCases.forEach(GetStackTraceElementTest::runSanityTest);
61 }
62
63 private static void runSanityTest(Executable aMethod, int[] bcis) {
64 HotSpotResolvedJavaMethod method = CTVMUtilities
65 .getResolvedMethod(aMethod);
66 String className = aMethod.getDeclaringClass().getName();
67 String methodName = aMethod.getName().equals(className)
68 ? "<init>"
69 : aMethod.getName();
70 String fileName = getFileName(className);
71 Map<Integer, Integer> bciWithLineNumber = CTVMUtilities
72 .getBciToLineNumber(aMethod);
73 boolean isNative = Modifier.isNative(aMethod.getModifiers());
74 int lineNumber = -1;
75 for (int bci : bcis) {
|