annotate test/compiler/loopopts/TestCountedLoopSafepointBackedge.java @ 24225:a2dbb6fcc923

Added tag jvmci-0.33 for changeset 3aed4cb813f4
author Doug Simon <doug.simon@oracle.com>
date Fri, 18 Aug 2017 22:47:33 +0200
parents 5b3cb4fbdbc7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24182
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
1 /*
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
2 * Copyright (c) 2016, Red Hat, Inc. All rights reserved.
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
4 *
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
7 * published by the Free Software Foundation.
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
8 *
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
13 * accompanied this code).
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
14 *
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
18 *
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
21 * questions.
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
22 */
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
23
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
24 /**
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
25 * @test
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
26 * @bug 8161147
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
27 * @summary Safepoint on backedge breaks UseCountedLoopSafepoints
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
28 * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+UseCountedLoopSafepoints TestCountedLoopSafepointBackedge
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
29 *
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
30 */
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
31
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
32 public class TestCountedLoopSafepointBackedge {
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
33 static void test(int[] arr, int inc) {
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
34 int i = 0;
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
35 for (;;) {
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
36 for (int j = 0; j < 10; j++);
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
37 arr[i] = i;
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
38 i++;
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
39 if (i >= 100) {
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
40 break;
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
41 }
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
42 for (int j = 0; j < 10; j++);
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
43 }
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
44 }
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
45
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
46 static public void main(String[] args) {
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
47 int[] arr = new int[100];
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
48 for (int i = 0; i < 20000; i++) {
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
49 test(arr, 1);
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
50 }
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
51 }
5b3cb4fbdbc7 8161147: jvm crashes when -XX:+UseCountedLoopSafepoints is enabled
roland
parents:
diff changeset
52 }