test/compiler/6799693/Test.java

Mon, 28 Jul 2014 15:06:38 -0700

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 1907
c18cbe5936b8
child 6876
710a3c8b516e
permissions
-rw-r--r--

8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
Summary: call rtm_deopt() only if there were no compilation bailouts before.
Reviewed-by: kvn

kvn@1000 1 /*
trims@1907 2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
kvn@1000 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
kvn@1000 4 *
kvn@1000 5 * This code is free software; you can redistribute it and/or modify it
kvn@1000 6 * under the terms of the GNU General Public License version 2 only, as
kvn@1000 7 * published by the Free Software Foundation.
kvn@1000 8 *
kvn@1000 9 * This code is distributed in the hope that it will be useful, but WITHOUT
kvn@1000 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kvn@1000 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kvn@1000 12 * version 2 for more details (a copy is included in the LICENSE file that
kvn@1000 13 * accompanied this code).
kvn@1000 14 *
kvn@1000 15 * You should have received a copy of the GNU General Public License version
kvn@1000 16 * 2 along with this work; if not, write to the Free Software Foundation,
kvn@1000 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
kvn@1000 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
kvn@1000 22 *
kvn@1000 23 */
kvn@1000 24
kvn@1000 25 /*
kvn@1000 26 * @test
kvn@1000 27 * @bug 6799693
kvn@1000 28 * @summary Server compiler leads to data corruption when expression throws an Exception
kvn@1000 29 * @run main/othervm -Xcomp -XX:CompileOnly=Test Test
kvn@1000 30 */
kvn@1000 31
kvn@1000 32 public class Test {
kvn@1000 33 static int var_bad = 1;
kvn@1000 34
kvn@1000 35 public static void main(String[] args)
kvn@1000 36 {
kvn@1000 37 var_bad++;
kvn@1000 38
kvn@1000 39 try {
kvn@1000 40 for (int i = 0; i < 10; i++) (new byte[((byte)-1 << i)])[0] = 0;
kvn@1000 41 }
kvn@1000 42 catch (Exception e) { System.out.println("Got " + e); }
kvn@1000 43
kvn@1000 44 System.out.println("Test.var_bad = " + var_bad + " (expected 2)\n");
kvn@1000 45 }
kvn@1000 46 }
kvn@1000 47

mercurial