hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
author fzhinkin
Tue, 20 Jan 2015 11:26:20 +0300
changeset 28722 51fe60d9e30c
parent 28498 c90265622ab7
child 29678 dd2f3932c21e
permissions -rw-r--r--
8069126: compiler/rtm/locking/TestRTMTotalCountIncrRate.java nightly failure Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     1
/*
28722
51fe60d9e30c 8069126: compiler/rtm/locking/TestRTMTotalCountIncrRate.java nightly failure
fzhinkin
parents: 28498
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     4
 *
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     7
 * published by the Free Software Foundation.
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     8
 *
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    13
 * accompanied this code).
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    14
 *
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    18
 *
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    21
 * questions.
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    22
 *
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    23
 */
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    24
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    25
/**
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    26
 * @test
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    27
 * @bug 8031320
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    28
 * @summary Verify that RTMTotalCountIncrRate option affects
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    29
 *          RTM locking statistics.
28190
5a6b07edeb21 8066433: Move Whitebox test library to top level repository
thartmann
parents: 25958
diff changeset
    30
 * @library /testlibrary /../../test/lib /compiler/testlibrary
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    31
 * @build TestRTMTotalCountIncrRate
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    32
 * @run main ClassFileInstaller sun.hotspot.WhiteBox
25958
8dc85547d6d6 8011397: JTREG needs to copy additional WhiteBox class file to JTwork/scratch/sun/hotspot
mgerdin
parents: 24006
diff changeset
    33
 *                              sun.hotspot.WhiteBox$WhiteBoxPermission
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    34
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    35
 *                   -XX:+WhiteBoxAPI TestRTMTotalCountIncrRate
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    36
 */
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    37
28498
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
    38
import sun.misc.Unsafe;
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    39
import java.util.List;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    40
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    41
import com.oracle.java.testlibrary.*;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    42
import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    43
import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    44
import rtm.*;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    45
import rtm.predicate.SupportedCPU;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    46
import rtm.predicate.SupportedVM;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    47
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    48
/**
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    49
 * Test verifies that with RTMTotalCountIncrRate=1 RTM locking statistics
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    50
 * contains precise information abort attempted locks and that with other values
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    51
 * statistics contains information abort non-zero locking attempts.
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    52
 * Since assert done for RTMTotalCountIncrRate=1 is pretty strict, test uses
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    53
 * -XX:RTMRetryCount=0 to avoid issue with retriable aborts. For more details on
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    54
 * that issue see {@link TestUseRTMAfterLockInflation}.
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    55
 */
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    56
public class TestRTMTotalCountIncrRate extends CommandLineOptionTest {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    57
    private TestRTMTotalCountIncrRate() {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    58
        super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    59
    }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    60
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    61
    @Override
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    62
    protected void runTestCases() throws Throwable {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    63
        verifyLocksCount(1, false);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    64
        verifyLocksCount(64, false);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    65
        verifyLocksCount(128, false);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    66
        verifyLocksCount(1, true);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    67
        verifyLocksCount(64, true);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    68
        verifyLocksCount(128, true);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    69
    }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    70
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    71
    private void verifyLocksCount(int incrRate, boolean useStackLock)
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    72
            throws Throwable{
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    73
        CompilableTest test = new Test();
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    74
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    75
        OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    76
                test,
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    77
                CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks",
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    78
                        useStackLock),
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    79
                CommandLineOptionTest.prepareNumericFlag(
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    80
                        "RTMTotalCountIncrRate", incrRate),
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    81
                "-XX:RTMRetryCount=0",
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    82
                "-XX:+PrintPreciseRTMLockingStatistics",
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    83
                Test.class.getName(),
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    84
                Boolean.toString(!useStackLock)
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    85
        );
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    86
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    87
        outputAnalyzer.shouldHaveExitValue(0);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    88
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    89
        List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString(
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    90
                test.getMethodWithLockName(), outputAnalyzer.getOutput());
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    91
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    92
        Asserts.assertEQ(statistics.size(), 1, "VM output should contain "
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    93
                + "exactly one RTM locking statistics entry for method "
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    94
                + test.getMethodWithLockName());
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    95
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    96
        RTMLockingStatistics lock = statistics.get(0);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    97
        if (incrRate == 1) {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    98
            Asserts.assertEQ(lock.getTotalLocks(), Test.TOTAL_ITERATIONS,
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
    99
                    "Total locks should be exactly the same as amount of "
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   100
                    + "iterations.");
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   101
        }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   102
    }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   103
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   104
    public static class Test implements CompilableTest {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   105
        private static final long TOTAL_ITERATIONS = 10000L;
28498
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   106
        private static final Unsafe UNSAFE = Utils.getUnsafe();
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   107
        private final Object monitor = new Object();
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   108
        // Following field have to be static in order to avoid escape analysis.
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   109
        @SuppressWarnings("UnsuedDeclaration")
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   110
        private static int field = 0;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   111
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   112
        @Override
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   113
        public String getMethodWithLockName() {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   114
            return this.getClass().getName() + "::lock";
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   115
        }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   116
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   117
        @Override
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   118
        public String[] getMethodsToCompileNames() {
28394
6d382dc493e5 8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization
fzhinkin
parents: 28190
diff changeset
   119
            return new String[] { getMethodWithLockName() };
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   120
        }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   121
28722
51fe60d9e30c 8069126: compiler/rtm/locking/TestRTMTotalCountIncrRate.java nightly failure
fzhinkin
parents: 28498
diff changeset
   122
        public void lock(boolean forceAbort) {
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   123
            synchronized(monitor) {
28498
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   124
                if (forceAbort) {
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   125
                    // We're calling native method in order to force
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   126
                    // abort. It's done by explicit xabort call emitted
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   127
                    // in SharedRuntime::generate_native_wrapper.
28722
51fe60d9e30c 8069126: compiler/rtm/locking/TestRTMTotalCountIncrRate.java nightly failure
fzhinkin
parents: 28498
diff changeset
   128
                    // If an actual JNI call will be replaced by
28498
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   129
                    // intrinsic - we'll be in trouble, since xabort
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   130
                    // will be no longer called and test may fail.
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   131
                    UNSAFE.addressSize();
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   132
                }
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   133
                Test.field++;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   134
            }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   135
        }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   136
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   137
        /**
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   138
         * Usage:
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   139
         * Test &lt;inflate monitor&gt;
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   140
         */
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   141
        public static void main(String args[]) throws Throwable {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   142
            Asserts.assertGTE(args.length, 1, "One argument required.");
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   143
            Test test = new Test();
28394
6d382dc493e5 8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization
fzhinkin
parents: 28190
diff changeset
   144
            boolean shouldBeInflated = Boolean.valueOf(args[0]);
6d382dc493e5 8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization
fzhinkin
parents: 28190
diff changeset
   145
            if (shouldBeInflated) {
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   146
                AbortProvoker.inflateMonitor(test.monitor);
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   147
            }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   148
            for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) {
28394
6d382dc493e5 8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization
fzhinkin
parents: 28190
diff changeset
   149
                AbortProvoker.verifyMonitorState(test.monitor,
6d382dc493e5 8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization
fzhinkin
parents: 28190
diff changeset
   150
                        shouldBeInflated);
28498
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   151
                // Force abort on first iteration to avoid rare case when
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   152
                // there were no aborts and locks count was not incremented
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   153
                // with RTMTotalCountIncrRate > 1 (in such case JVM won't
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   154
                // print JVM locking statistics).
c90265622ab7 8068269: RTM tests that assert on non-zero lock statistics are too strict in RTMTotalCountIncrRate > 1 cases
fzhinkin
parents: 28394
diff changeset
   155
                test.lock(i == 0);
24006
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   156
            }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   157
        }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   158
    }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   159
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   160
    public static void main(String args[]) throws Throwable {
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   161
        new TestRTMTotalCountIncrRate().test();
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   162
    }
54399106938f 8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff changeset
   163
}