hotspot/test/compiler/c1/Test6932496.java
author thartmann
Fri, 14 Jul 2017 11:55:58 +0200
changeset 46663 715d5f268f62
parent 41705 332239c052cc
permissions -rw-r--r--
8184271: Time related C1 intrinsics produce inconsistent results when floating around Summary: C1 intrinsics for System.nanoTime(), System.currentTimeMillis() and JVM.counterTime() should be pinned. Reviewed-by: kvn, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     1
/*
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 27699
diff changeset
     2
 * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     4
 *
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     8
 *
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    13
 * accompanied this code).
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    14
 *
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5048
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5048
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5048
diff changeset
    21
 * questions.
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    22
 */
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    23
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    24
/**
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    25
 * @test
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    26
 * @bug 6932496
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    27
 * @summary incorrect deopt of jsr subroutine on 64 bit c1
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 27699
diff changeset
    28
 * @modules java.base/jdk.internal.org.objectweb.asm
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    29
 *
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    30
 * @run main/othervm -Xcomp
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    31
 *      -XX:CompileCommand=compileonly,compiler.c1.Test6932496::test
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    32
 *      compiler.c1.Test6932496
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    33
 */
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    34
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    35
package compiler.c1;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    36
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    37
import jdk.internal.org.objectweb.asm.ClassWriter;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    38
import jdk.internal.org.objectweb.asm.FieldVisitor;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    39
import jdk.internal.org.objectweb.asm.Label;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    40
import jdk.internal.org.objectweb.asm.MethodVisitor;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    41
import jdk.internal.org.objectweb.asm.Opcodes;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    42
import jdk.internal.org.objectweb.asm.Type;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    43
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    44
import java.io.IOException;
25925
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    45
import java.lang.reflect.Method;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    46
import java.nio.file.Files;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    47
import java.nio.file.Paths;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    48
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    49
public class Test6932496 extends ClassLoader {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    50
    private static final int CLASS_FILE_VERSION = 49;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    51
    private static final String CLASS_TEST = "Test";
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    52
    private static final String CLASS_OBJECT = "java/lang/Object";
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    53
    private static final String METHOD_INIT = "<init>";
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    54
    private static final String METHOD_TEST = "test";
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    55
    private static final String DESC_VOID_METHOD = "()V";
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    56
    private static final String FIELD_FLAG = "flag";
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    57
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    58
    public static void main(String[] args) {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    59
        Test6932496 test = new Test6932496();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    60
        test.execute();
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    61
    }
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    62
25925
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    63
    private void execute() {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    64
        byte[] bytecode = Test6932496.generateTestClass();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    65
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    66
        try {
25925
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    67
            Files.write(Paths.get("Test.class.dump"), bytecode);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    68
        } catch (IOException e) {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    69
            System.err.println("classfile dump failed : " + e.getMessage());
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    70
            e.printStackTrace();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    71
        }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    72
        try {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    73
            Class aClass = defineClass(CLASS_TEST, bytecode, 0, bytecode.length);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    74
            Method test = aClass.getDeclaredMethod(METHOD_TEST);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    75
            test.invoke(null);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    76
        } catch (ClassFormatError | IllegalArgumentException
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    77
                    | ReflectiveOperationException e) {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    78
            throw new RuntimeException("TESTBUG : generated class is invalid", e);
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    79
        }
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    80
    }
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
    81
25925
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    82
    /*
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    83
        public class Test {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    84
            volatile boolean flag = false;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    85
            public static void m() {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    86
                try {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    87
                } finally {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    88
                    Test test = new Test();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    89
                    test.flag = true;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    90
                }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    91
            }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    92
        }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    93
    */
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    94
    private static byte[] generateTestClass() {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    95
        ClassWriter cw = new ClassWriter(0);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    96
        cw.visit(CLASS_FILE_VERSION, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    97
                CLASS_TEST, null, CLASS_OBJECT, null);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    98
        // volatile boolean flag;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
    99
        {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   100
            FieldVisitor fv = cw.visitField(Opcodes.ACC_VOLATILE, FIELD_FLAG,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   101
                    Type.BOOLEAN_TYPE.getDescriptor(),
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   102
                    /* signature = */ null, /* value = */ null);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   103
        }
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
   104
25925
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   105
        /*
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   106
            public Test() {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   107
                flag = false;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   108
            }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   109
        */
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   110
        {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   111
            MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   112
                    METHOD_INIT, DESC_VOID_METHOD,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   113
                    /* signature = */ null, /* exceptions = */ null);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   114
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   115
            mv.visitCode();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   116
            mv.visitVarInsn(Opcodes.ALOAD, 0);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   117
            mv.visitMethodInsn(Opcodes.INVOKESPECIAL, CLASS_OBJECT, METHOD_INIT,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   118
                    DESC_VOID_METHOD, false);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   119
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   120
            mv.visitVarInsn(Opcodes.ALOAD, 0);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   121
            mv.visitInsn(Opcodes.ICONST_0);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   122
            mv.visitFieldInsn(Opcodes.PUTFIELD, CLASS_TEST, FIELD_FLAG,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   123
                    Type.BOOLEAN_TYPE.getDescriptor());
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   124
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   125
            mv.visitInsn(Opcodes.RETURN);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   126
            mv.visitMaxs(/* stack = */ 2, /* locals = */ 1);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   127
            mv.visitEnd();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   128
        }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   129
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   130
        /*
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   131
            public static void m() {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   132
                try {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   133
                } finally {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   134
                    Test test = new Test();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   135
                    test.flag = true;
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   136
                }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   137
            }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   138
        */
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   139
        {
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   140
            MethodVisitor mv = cw.visitMethod(
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   141
                    Opcodes.ACC_STATIC + Opcodes.ACC_PUBLIC,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   142
                    METHOD_TEST, DESC_VOID_METHOD,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   143
                    /* signature = */ null, /* exceptions = */ null);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   144
            Label beginLabel = new Label();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   145
            Label block1EndLabel = new Label();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   146
            Label handlerLabel = new Label();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   147
            Label block2EndLabel = new Label();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   148
            Label label = new Label();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   149
            Label endLabel = new Label();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   150
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   151
            mv.visitCode();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   152
            mv.visitTryCatchBlock(beginLabel, block1EndLabel, handlerLabel,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   153
                    /* type = <any> */ null);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   154
            mv.visitTryCatchBlock(handlerLabel, block2EndLabel, handlerLabel,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   155
                    /* type = <any> */ null);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   156
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   157
            mv.visitLabel(beginLabel);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   158
            mv.visitJumpInsn(Opcodes.JSR, label);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   159
            mv.visitLabel(block1EndLabel);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   160
            mv.visitJumpInsn(Opcodes.GOTO, endLabel);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   161
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   162
            mv.visitLabel(handlerLabel);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   163
            mv.visitVarInsn(Opcodes.ASTORE, 0);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   164
            mv.visitJumpInsn(Opcodes.JSR, label);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   165
            mv.visitLabel(block2EndLabel);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   166
            mv.visitVarInsn(Opcodes.ALOAD, 0);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   167
            mv.visitInsn(Opcodes.ATHROW);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   168
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   169
            mv.visitLabel(label);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   170
            mv.visitVarInsn(Opcodes.ASTORE, 1);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   171
            mv.visitTypeInsn(Opcodes.NEW, CLASS_TEST);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   172
            mv.visitInsn(Opcodes.DUP);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   173
            mv.visitMethodInsn(Opcodes.INVOKESPECIAL, CLASS_TEST, METHOD_INIT,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   174
                    DESC_VOID_METHOD);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   175
            mv.visitVarInsn(Opcodes.ASTORE, 2);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   176
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   177
            mv.visitVarInsn(Opcodes.ALOAD, 2);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   178
            mv.visitInsn(Opcodes.ICONST_1);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   179
            mv.visitFieldInsn(Opcodes.PUTFIELD, CLASS_TEST, FIELD_FLAG,
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   180
                    Type.BOOLEAN_TYPE.getDescriptor());
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   181
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   182
            mv.visitVarInsn(Opcodes.RET, 1);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   183
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   184
            mv.visitLabel(endLabel);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   185
            mv.visitInsn(Opcodes.RETURN);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   186
            mv.visitMaxs(/* stack = */ 2, /* locals = */ 3);
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   187
            mv.visitEnd();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   188
        }
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   189
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   190
        cw.visitEnd();
4d05abb05c1a 8051484: Test compiler/6932496/Test6932496.java failed to compile after JDK-8011044: 1.5 is no longer supported
iignatyev
parents: 5547
diff changeset
   191
        return cw.toByteArray();
5048
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
   192
    }
c31b6243f37e 6932496: c1: deoptimization of jsr subroutine fails on sparcv9
roland
parents:
diff changeset
   193
}