test/compiler/6636138/Test1.java

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

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 6198
55fb97c4c58d
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

cfang@1102 1 /*
mikael@6198 2 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
cfang@1102 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
cfang@1102 4 *
cfang@1102 5 * This code is free software; you can redistribute it and/or modify it
cfang@1102 6 * under the terms of the GNU General Public License version 2 only, as
cfang@1102 7 * published by the Free Software Foundation.
cfang@1102 8 *
cfang@1102 9 * This code is distributed in the hope that it will be useful, but WITHOUT
cfang@1102 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
cfang@1102 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
cfang@1102 12 * version 2 for more details (a copy is included in the LICENSE file that
cfang@1102 13 * accompanied this code).
cfang@1102 14 *
cfang@1102 15 * You should have received a copy of the GNU General Public License version
cfang@1102 16 * 2 along with this work; if not, write to the Free Software Foundation,
cfang@1102 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
cfang@1102 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.
cfang@1102 22 */
cfang@1102 23
cfang@1102 24 /**
cfang@1102 25 * @test
cfang@1102 26 * @bug 6636138
cfang@1102 27 * @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation.
cfang@1102 28 *
collins@4684 29 * @run main/othervm -Xbatch -XX:CompileOnly=Test1.init Test1
cfang@1102 30 */
cfang@1102 31
twisti@1212 32 public class Test1 {
cfang@1102 33
cfang@1102 34 public static void init(int src[], int [] dst, int[] ref) {
cfang@1102 35 // initialize the arrays
cfang@1102 36 for (int i =0; i<src.length; i++) {
cfang@1102 37 src[i] = i;
cfang@1102 38 dst[i] = 2; // yes, dst[i] needed(otherwise src[i] will be replaced with i)
cfang@1102 39 ref[i] = src[i]; // src[i] depends on the store src[i]
cfang@1102 40 }
cfang@1102 41 }
cfang@1102 42
cfang@1102 43 public static void verify(int src[], int[] ref) {
cfang@1102 44 // check whether src and ref are equal
cfang@1102 45 for (int i = 0; i < src.length; i++) {
cfang@1102 46 if (src[i] != ref[i]) {
cfang@1102 47 System.out.println("Error: src and ref don't match at " + i);
cfang@1387 48 System.exit(97);
cfang@1102 49 }
cfang@1102 50 }
cfang@1102 51 }
cfang@1102 52
cfang@1102 53 public static void test() {
cfang@1102 54 int[] src = new int[34];
cfang@1102 55 int[] dst = new int[34];
cfang@1102 56 int[] ref = new int[34];
cfang@1102 57
cfang@1102 58 init(src, dst, ref);
cfang@1102 59 verify(src, ref);
cfang@1102 60 }
cfang@1102 61
cfang@1102 62 public static void main(String[] args) {
cfang@1102 63 for (int i=0; i< 2000; i++) {
cfang@1102 64 test();
cfang@1102 65 }
cfang@1102 66 }
cfang@1102 67 }

mercurial