test/compiler/6741738/Tester.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@741 1 /*
trims@1907 2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
kvn@741 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
kvn@741 4 *
kvn@741 5 * This code is free software; you can redistribute it and/or modify it
kvn@741 6 * under the terms of the GNU General Public License version 2 only, as
kvn@741 7 * published by the Free Software Foundation.
kvn@741 8 *
kvn@741 9 * This code is distributed in the hope that it will be useful, but WITHOUT
kvn@741 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kvn@741 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kvn@741 12 * version 2 for more details (a copy is included in the LICENSE file that
kvn@741 13 * accompanied this code).
kvn@741 14 *
kvn@741 15 * You should have received a copy of the GNU General Public License version
kvn@741 16 * 2 along with this work; if not, write to the Free Software Foundation,
kvn@741 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
kvn@741 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@741 22 */
kvn@741 23
kvn@741 24 /*
kvn@741 25 * @test
kvn@741 26 * @bug 6741738
kvn@741 27 * @summary TypePtr::add_offset() set incorrect offset when the add overflows
kvn@741 28 * @run main/othervm -Xcomp -XX:CompileOnly=Tester.foo Tester
kvn@741 29 */
kvn@741 30
kvn@741 31 public class Tester {
kvn@741 32 private String[] values;
kvn@741 33 private int count;
kvn@741 34
kvn@741 35 String foo() {
kvn@741 36 int i = Integer.MAX_VALUE-1;
kvn@741 37 String s;
kvn@741 38 try {
kvn@741 39 s = values[i];
kvn@741 40 } catch (Throwable e) {
kvn@741 41 s = "";
kvn@741 42 }
kvn@741 43 return s;
kvn@741 44 }
kvn@741 45
kvn@741 46 public static void main(String[] args) {
kvn@741 47 Tester t = new Tester();
kvn@741 48 String s = t.foo();
kvn@741 49 }
kvn@741 50 }

mercurial