|
23 | 23 |
|
24 | 24 | /**
|
25 | 25 | * @test
|
26 |
| - * @bug 8275638 |
| 26 | + * @bug 8275638 8278966 |
27 | 27 | * @summary GraphKit::combine_exception_states fails with "matching stack sizes" assert
|
28 | 28 | *
|
29 | 29 | * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestLateMHInlineExceptions::m
|
@@ -55,18 +55,37 @@ public static void main(String[] args) throws Throwable {
|
55 | 55 | }
|
56 | 56 | test4(test);
|
57 | 57 | test4(null);
|
| 58 | + test5(test); |
| 59 | + try { |
| 60 | + test5(null); |
| 61 | + } catch (NullPointerException npe) { |
| 62 | + } |
| 63 | + test6(test); |
| 64 | + try { |
| 65 | + test6(null); |
| 66 | + } catch (NullPointerException npe) { |
| 67 | + } |
58 | 68 | }
|
59 | 69 | }
|
60 | 70 |
|
61 | 71 | void m() {
|
62 | 72 | }
|
63 | 73 |
|
| 74 | + static void nothing(Throwable t) { |
| 75 | + } |
| 76 | + |
64 | 77 | static final MethodHandle mh;
|
| 78 | + static final MethodHandle mh_nothing; |
| 79 | + static final MethodHandle mh2; |
| 80 | + static final MethodHandle mh3; |
65 | 81 |
|
66 | 82 | static {
|
67 | 83 | MethodHandles.Lookup lookup = MethodHandles.lookup();
|
68 | 84 | try {
|
69 | 85 | mh = lookup.findVirtual(TestLateMHInlineExceptions.class, "m", MethodType.methodType(void.class));
|
| 86 | + mh_nothing = lookup.findStatic(TestLateMHInlineExceptions.class, "nothing", MethodType.methodType(void.class, Throwable.class)); |
| 87 | + mh2 = MethodHandles.tryFinally(mh, mh_nothing); |
| 88 | + mh3 = MethodHandles.catchException(mh, Throwable.class, mh_nothing); |
70 | 89 | } catch (NoSuchMethodException e) {
|
71 | 90 | e.printStackTrace();
|
72 | 91 | throw new RuntimeException("Method handle lookup failed");
|
@@ -102,4 +121,12 @@ private static void test4(TestLateMHInlineExceptions test) throws Throwable {
|
102 | 121 | } catch (NullPointerException npe) {
|
103 | 122 | }
|
104 | 123 | }
|
| 124 | + |
| 125 | + private static void test5(TestLateMHInlineExceptions test) throws Throwable { |
| 126 | + mh2.invokeExact(test); |
| 127 | + } |
| 128 | + |
| 129 | + private static void test6(TestLateMHInlineExceptions test) throws Throwable { |
| 130 | + mh3.invokeExact(test); |
| 131 | + } |
105 | 132 | }
|
0 commit comments