test/hotspot/jtreg/gc/shenandoah/compiler/CallMultipleCatchProjs.java
author roland
Thu, 26 Sep 2019 17:49:44 +0200
changeset 58366 222a91b9438a
permissions -rw-r--r--
8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info Reviewed-by: shade, rkennke
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58366
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     1
/*
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     2
 * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     4
 *
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     8
 *
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    13
 * accompanied this code).
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    14
 *
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    18
 *
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    21
 * questions.
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    22
 */
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    23
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    24
/**
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    25
 * @test
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    26
 * @bug 8231405
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    27
 * @summary barrier expansion breaks if barrier is right after call to rethrow stub
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    28
 * @key gc
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    29
 * @requires vm.gc.Shenandoah & !vm.graal.enabled
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    30
 *
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    31
 * @run main/othervm -XX:CompileOnly=CallMultipleCatchProjs::test -Xcomp -Xverify:none -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC CallMultipleCatchProjs
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    32
 *
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    33
 */
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    34
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    35
public class CallMultipleCatchProjs {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    36
    private static A field = new A();
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    37
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    38
    public static void main(String[] args) throws Exception {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    39
        Exception3 exception3 = new Exception3();
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    40
        test(new Exception2());
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    41
    }
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    42
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    43
    static int test(Exception exception) throws Exception {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    44
        try {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    45
            throw exception;
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    46
        } catch (Exception1 e1) {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    47
            return 1;
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    48
        } catch (Exception2 e2) {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    49
            return field.i + 2;
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    50
        } catch (Exception3 e3) {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    51
            return field.i + 3;
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    52
        }
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    53
    }
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    54
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    55
    private static class Exception1 extends Exception {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    56
    }
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    57
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    58
    private static class Exception2 extends Exception {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    59
    }
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    60
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    61
    private static class Exception3 extends Exception {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    62
    }
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    63
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    64
    private static class A {
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    65
        public int i;
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    66
    }
222a91b9438a 8231405: [Shenandoah] guarantee(d != NULL) failed: Null dominator info
roland
parents:
diff changeset
    67
}