hotspot/test/compiler/c1/CanonicalizeArrayLength.java
author shade
Wed, 02 Mar 2016 12:29:17 +0300
changeset 36348 f20b8728bad1
parent 36325 1330e79162ac
child 40059 c2304140ed64
permissions -rw-r--r--
8151017: [TESTBUG] test/compiler/c1/CanonicalizeArrayLength does not work on product builds Reviewed-by: thartmann, zmajo
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36317
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     1
/*
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     4
 *
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     7
 * published by the Free Software Foundation.
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     8
 *
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    13
 * accompanied this code).
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    14
 *
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    18
 *
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    21
 * questions.
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    22
 */
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    23
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    24
/*
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    25
 * @test
36325
1330e79162ac 8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents: 36317
diff changeset
    26
 * @bug 8150102 8150514 8150534
36317
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    27
 * @summary C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
36348
f20b8728bad1 8151017: [TESTBUG] test/compiler/c1/CanonicalizeArrayLength does not work on product builds
shade
parents: 36325
diff changeset
    28
 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation CanonicalizeArrayLength
f20b8728bad1 8151017: [TESTBUG] test/compiler/c1/CanonicalizeArrayLength does not work on product builds
shade
parents: 36325
diff changeset
    29
 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:+PatchALot CanonicalizeArrayLength
f20b8728bad1 8151017: [TESTBUG] test/compiler/c1/CanonicalizeArrayLength does not work on product builds
shade
parents: 36325
diff changeset
    30
 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=0 CanonicalizeArrayLength
f20b8728bad1 8151017: [TESTBUG] test/compiler/c1/CanonicalizeArrayLength does not work on product builds
shade
parents: 36325
diff changeset
    31
 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=1 CanonicalizeArrayLength
36317
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    32
 */
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    33
public class CanonicalizeArrayLength {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    34
    int[] arr = new int[42];
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    35
    int[] arrNull = null;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    36
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    37
    final int[] finalArr = new int[42];
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    38
    final int[] finalArrNull = null;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    39
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    40
    static int[] staticArr = new int[42];
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    41
    static int[] staticArrNull = null;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    42
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    43
    static final int[] staticFinalArr = new int[42];
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    44
    static final int[] staticFinalArrNull = null;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    45
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    46
    public static void main(String... args) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    47
        CanonicalizeArrayLength t = new CanonicalizeArrayLength();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    48
        for (int i = 0; i < 20000; i++) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    49
            if (t.testLocal() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    50
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    51
            if (t.testLocalNull() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    52
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    53
            if (t.testField() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    54
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    55
            if (t.testFieldNull() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    56
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    57
            if (t.testFinalField() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    58
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    59
            if (t.testFinalFieldNull() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    60
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    61
            if (t.testStaticField() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    62
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    63
            if (t.testStaticFieldNull() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    64
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    65
            if (t.testStaticFinalField() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    66
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    67
            if (t.testStaticFinalFieldNull() != 42)
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    68
                throw new IllegalStateException();
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    69
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    70
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    71
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    72
    int testField() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    73
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    74
            return arr.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    75
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    76
            return -1;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    77
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    78
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    79
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    80
    int testFieldNull() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    81
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    82
            return arrNull.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    83
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    84
            return 42;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    85
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    86
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    87
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    88
    int testFinalField() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    89
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    90
            return finalArr.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    91
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    92
            return -1;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    93
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    94
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    95
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    96
    int testFinalFieldNull() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    97
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    98
            return finalArrNull.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
    99
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   100
            return 42;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   101
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   102
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   103
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   104
    int testStaticField() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   105
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   106
            return staticArr.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   107
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   108
            return -1;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   109
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   110
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   111
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   112
    int testStaticFieldNull() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   113
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   114
            return staticArrNull.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   115
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   116
            return 42;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   117
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   118
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   119
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   120
    int testStaticFinalField() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   121
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   122
            return staticFinalArr.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   123
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   124
            return -1;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   125
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   126
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   127
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   128
    int testStaticFinalFieldNull() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   129
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   130
            return staticFinalArrNull.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   131
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   132
            return 42;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   133
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   134
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   135
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   136
    int testLocal() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   137
        int[] arr = new int[42];
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   138
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   139
            return arr.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   140
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   141
            return -1;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   142
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   143
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   144
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   145
    int testLocalNull() {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   146
        int[] arrNull = null;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   147
        try {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   148
            return arrNull.length;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   149
        } catch (Throwable t) {
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   150
            return 42;
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   151
        }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   152
    }
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   153
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   154
5c78a6c34390 8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
diff changeset
   155
}