Mon, 28 Jul 2014 15:06:38 -0700
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@1293 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
kvn@1293 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
kvn@1293 | 4 | * |
kvn@1293 | 5 | * This code is free software; you can redistribute it and/or modify it |
kvn@1293 | 6 | * under the terms of the GNU General Public License version 2 only, as |
kvn@1293 | 7 | * published by the Free Software Foundation. |
kvn@1293 | 8 | * |
kvn@1293 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
kvn@1293 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
kvn@1293 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
kvn@1293 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
kvn@1293 | 13 | * accompanied this code). |
kvn@1293 | 14 | * |
kvn@1293 | 15 | * You should have received a copy of the GNU General Public License version |
kvn@1293 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
kvn@1293 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
kvn@1293 | 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@1293 | 22 | * |
kvn@1293 | 23 | */ |
kvn@1293 | 24 | |
kvn@1293 | 25 | /** |
kvn@1293 | 26 | * @test |
kvn@1293 | 27 | * @bug 6826736 |
kvn@1293 | 28 | * @summary CMS: core dump with -XX:+UseCompressedOops |
kvn@1293 | 29 | * |
anoll@6315 | 30 | * @run main/othervm/timeout=600 -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+ScavengeALot -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g -XX:CompileThreshold=100 -XX:CompileOnly=Test.test -XX:-BlockLayoutRotateLoops -XX:LoopUnrollLimit=0 -Xmx256m -XX:ParallelGCThreads=4 Test |
kvn@1293 | 31 | */ |
kvn@1293 | 32 | |
kvn@1293 | 33 | public class Test { |
kvn@1293 | 34 | int[] arr; |
kvn@1293 | 35 | int[] arr2; |
kvn@1293 | 36 | int test(int r) { |
kvn@1293 | 37 | for (int i = 0; i < 100; i++) { |
kvn@1293 | 38 | for (int j = i; j < 100; j++) { |
kvn@1293 | 39 | int a = 0; |
kvn@1293 | 40 | for (long k = 0; k < 100; k++) { |
kvn@1293 | 41 | a += k; |
kvn@1293 | 42 | } |
kvn@1293 | 43 | if (arr != null) |
kvn@1293 | 44 | a = arr[j]; |
kvn@1293 | 45 | r += a; |
kvn@1293 | 46 | } |
kvn@1293 | 47 | } |
kvn@1293 | 48 | return r; |
kvn@1293 | 49 | } |
kvn@1293 | 50 | |
kvn@1293 | 51 | public static void main(String[] args) { |
kvn@1293 | 52 | int r = 0; |
kvn@1293 | 53 | Test t = new Test(); |
kvn@1293 | 54 | for (int i = 0; i < 100; i++) { |
kvn@1293 | 55 | t.arr = new int[100]; |
kvn@1293 | 56 | r = t.test(r); |
kvn@1293 | 57 | } |
kvn@1293 | 58 | System.out.println("Warmup 1 is done."); |
kvn@1293 | 59 | for (int i = 0; i < 100; i++) { |
kvn@1293 | 60 | t.arr = null; |
kvn@1293 | 61 | r = t.test(r); |
kvn@1293 | 62 | } |
kvn@1293 | 63 | System.out.println("Warmup 2 is done."); |
kvn@1293 | 64 | for (int i = 0; i < 100; i++) { |
kvn@1293 | 65 | t.arr = new int[100]; |
kvn@1293 | 66 | r = t.test(r); |
kvn@1293 | 67 | } |
kvn@1293 | 68 | System.out.println("Warmup is done."); |
kvn@1293 | 69 | for (int i = 0; i < 100; i++) { |
kvn@1293 | 70 | t.arr = new int[1000000]; |
kvn@1293 | 71 | t.arr = null; |
kvn@1293 | 72 | r = t.test(r); |
kvn@1293 | 73 | } |
kvn@1293 | 74 | } |
kvn@1293 | 75 | } |