hotspot/test/compiler/6849574/Test.java
author pchelko
Wed, 23 Apr 2014 17:56:05 +0400
changeset 24529 c580bcb3aabc
parent 5547 f4b087cbb361
permissions -rw-r--r--
8027148: SystemFlavorMap.getNativesForFlavor returns list of native formats in incorrect order Reviewed-by: anthony, serb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3172
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     1
/*
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3172
diff changeset
     2
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3172
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     4
 *
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     8
 *
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    13
 * accompanied this code).
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    14
 *
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3172
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3172
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3172
diff changeset
    21
 * questions.
3172
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    22
 *
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    23
 */
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    24
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    25
/**
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    26
 * @test
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    27
 * @bug 6849574
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    28
 * @summary VM crash using NonBlockingHashMap (high_scale_lib)
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    29
 *
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    30
 * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC Test
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    31
 */
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    32
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    33
import java.util.concurrent.atomic.*;
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    34
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    35
public class Test extends Thread {
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    36
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    37
    public static void main(String[] args) {
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    38
        AtomicReferenceArray a = new AtomicReferenceArray(10000);
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    39
        for (int i = 0; i < 100000; i++) {
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    40
            a.getAndSet(9999, new Object());
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    41
            if (i > 99990) System.gc();
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    42
        }
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    43
    }
ad4ba6ce75a5 6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff changeset
    44
}