hotspot/test/compiler/osr/TestOSRWithNonEmptyStack.java
author rfield
Mon, 06 Mar 2017 15:44:37 -0800
changeset 44066 336ca6c49e10
parent 40059 c2304140ed64
permissions -rw-r--r--
8176241: JShell tests: on full builds CompletionSuggestionTest.testImportStart() fails Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25917
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     1
/*
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 25917
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
25917
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     4
 *
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     7
 * published by the Free Software Foundation.
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     8
 *
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    13
 * accompanied this code).
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    14
 *
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    18
 *
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    21
 * questions.
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    22
 */
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    23
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    24
/**
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    25
 * @test
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    26
 * @bug 8051344
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    27
 * @summary Force OSR compilation with non-empty stack at the OSR entry point.
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 25917
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
 * @run main/othervm -XX:CompileCommand=compileonly,TestCase::test
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    30
 *                   compiler.osr.TestOSRWithNonEmptyStack
25917
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    31
 */
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    32
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    33
package compiler.osr;
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
import jdk.internal.org.objectweb.asm.ClassWriter;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    36
import jdk.internal.org.objectweb.asm.Label;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    37
import jdk.internal.org.objectweb.asm.MethodVisitor;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    38
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    39
import java.lang.reflect.Constructor;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    40
import java.lang.reflect.Method;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    41
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    42
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    43
import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    44
import static jdk.internal.org.objectweb.asm.Opcodes.DUP;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    45
import static jdk.internal.org.objectweb.asm.Opcodes.IADD;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    46
import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    47
import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_1;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    48
import static jdk.internal.org.objectweb.asm.Opcodes.IF_ICMPLT;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    49
import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    50
import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    51
import static jdk.internal.org.objectweb.asm.Opcodes.ISTORE;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    52
import static jdk.internal.org.objectweb.asm.Opcodes.POP;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    53
import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 29678
diff changeset
    54
25917
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    55
public class TestOSRWithNonEmptyStack extends ClassLoader {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    56
    private static final int CLASS_FILE_VERSION = 52;
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    57
    private static final String CLASS_NAME = "TestCase";
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    58
    private static final String METHOD_NAME = "test";
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    59
    private static final int ITERATIONS = 1_000_000;
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    60
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    61
    private static byte[] generateTestClass() {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    62
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    63
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    64
        cw.visit(TestOSRWithNonEmptyStack.CLASS_FILE_VERSION, ACC_PUBLIC,
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    65
                TestOSRWithNonEmptyStack.CLASS_NAME, null, "java/lang/Object",
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    66
                null);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    67
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    68
        TestOSRWithNonEmptyStack.generateConstructor(cw);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    69
        TestOSRWithNonEmptyStack.generateTestMethod(cw);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    70
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    71
        cw.visitEnd();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    72
        return cw.toByteArray();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    73
    }
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    74
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    75
    private static void generateConstructor(ClassWriter classWriter) {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    76
        MethodVisitor mv = classWriter.visitMethod(ACC_PUBLIC, "<init>", "()V",
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    77
                null, null);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    78
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    79
        mv.visitCode();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    80
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    81
        mv.visitVarInsn(ALOAD, 0);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    82
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V",
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    83
                false);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    84
        mv.visitInsn(RETURN);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    85
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    86
        mv.visitMaxs(0, 0);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    87
        mv.visitEnd();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    88
    }
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    89
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    90
    private static void generateTestMethod(ClassWriter classWriter) {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    91
        MethodVisitor mv = classWriter.visitMethod(ACC_PUBLIC,
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    92
                TestOSRWithNonEmptyStack.METHOD_NAME, "()V", null, null);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    93
        Label osrEntryPoint = new Label();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    94
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    95
        mv.visitCode();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    96
        // Push 'this' into stack before OSR entry point to bail out compilation
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    97
        mv.visitVarInsn(ALOAD, 0);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    98
        // Setup loop counter
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
    99
        mv.visitInsn(ICONST_0);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   100
        mv.visitVarInsn(ISTORE, 1);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   101
        // Begin loop
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   102
        mv.visitLabel(osrEntryPoint);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   103
        // Increment loop counter
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   104
        mv.visitVarInsn(ILOAD, 1);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   105
        mv.visitInsn(ICONST_1);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   106
        mv.visitInsn(IADD);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   107
        // Duplicate it for loop condition check
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   108
        mv.visitInsn(DUP);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   109
        mv.visitVarInsn(ISTORE, 1);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   110
        // Check loop condition
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   111
        mv.visitLdcInsn(TestOSRWithNonEmptyStack.ITERATIONS);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   112
        mv.visitJumpInsn(IF_ICMPLT, osrEntryPoint);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   113
        // Pop 'this'.
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   114
        mv.visitInsn(POP);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   115
        mv.visitInsn(RETURN);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   116
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   117
        mv.visitMaxs(0, 0);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   118
        mv.visitEnd();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   119
    }
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   120
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   121
    private void run() {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   122
        byte[] bytecode = TestOSRWithNonEmptyStack.generateTestClass();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   123
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   124
        try {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   125
            Class klass = defineClass(TestOSRWithNonEmptyStack.CLASS_NAME,
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   126
                    bytecode, 0, bytecode.length);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   127
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   128
            Constructor ctor = klass.getConstructor();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   129
            Method method = klass.getDeclaredMethod(
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   130
                    TestOSRWithNonEmptyStack.METHOD_NAME);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   131
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   132
            Object testCase = ctor.newInstance();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   133
            method.invoke(testCase);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   134
        } catch (Exception e) {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   135
            throw new RuntimeException(
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   136
                    "Test bug: generated class should be valid.", e);
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   137
        }
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   138
    }
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   139
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   140
    public static void main(String args[]) {
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   141
        new TestOSRWithNonEmptyStack().run();
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   142
    }
4502b5680f05 8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
fzhinkin
parents:
diff changeset
   143
}