hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java
author ykantser
Mon, 04 May 2015 16:30:07 +0200
changeset 30604 b8d532cb6420
parent 30216 5b96c468d591
child 34155 8d9e0cbf93a2
child 33730 30e064828045
permissions -rw-r--r--
8067013: Rename the com.oracle.java.testlibary package Reviewed-by: dholmes, gtriantafill, sla Contributed-by: alexander.kulyakhtin@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28199
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     1
/*
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 29475
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
28199
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     4
 *
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     8
 *
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    13
 * accompanied this code).
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    14
 *
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    18
 *
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    21
 * questions.
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    22
 */
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    23
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    24
/*
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    25
 * @test DeoptimizeFramesTest
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    26
 * @bug 8028595
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    27
 * @library /testlibrary /../../test/lib
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 29475
diff changeset
    28
 * @modules java.management
28199
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    29
 * @build DeoptimizeFramesTest
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    30
 * @run main ClassFileInstaller sun.hotspot.WhiteBox
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    31
 *                              sun.hotspot.WhiteBox$WhiteBoxPermission
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    32
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    33
 *                   -XX:+WhiteBoxAPI -Xmixed
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    34
 *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
30192
87a5d3461a1e 8075488: compiler/whitebox/DeoptimizeFramesTest fails with exit code 1 due to unrecognized VM option -XX:+IgnoreUnexpectedVMOptions
tpivovarova
parents: 29475
diff changeset
    35
 *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
29475
70342c6ce8f7 8073860: [TESTBUG] compiler/whitebox/DeoptimizeFramesTest fails with exit code 1
iignatyev
parents: 28929
diff changeset
    36
 *                   DeoptimizeFramesTest true
28199
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    37
 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    38
 *                   -XX:+WhiteBoxAPI -Xmixed
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    39
 *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
30192
87a5d3461a1e 8075488: compiler/whitebox/DeoptimizeFramesTest fails with exit code 1 due to unrecognized VM option -XX:+IgnoreUnexpectedVMOptions
tpivovarova
parents: 29475
diff changeset
    40
 *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
29475
70342c6ce8f7 8073860: [TESTBUG] compiler/whitebox/DeoptimizeFramesTest fails with exit code 1
iignatyev
parents: 28929
diff changeset
    41
 *                   DeoptimizeFramesTest false
28199
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    42
 * @summary testing of WB::deoptimizeFrames()
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    43
 */
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    44
import java.lang.reflect.Executable;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    45
import java.util.concurrent.Callable;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    46
import java.util.concurrent.Phaser;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    47
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    48
import sun.hotspot.code.NMethod;
30604
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 30216
diff changeset
    49
import jdk.test.lib.Asserts;
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 30216
diff changeset
    50
import jdk.test.lib.InfiniteLoop;
28199
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    51
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    52
public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    53
    private final boolean makeNotEntrant;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    54
    private final Phaser phaser;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    55
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    56
    private DeoptimizeFramesTest(boolean makeNotEntrant, Phaser phaser) {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    57
        super(new TestCaseImpl(phaser));
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    58
        // to prevent inlining of #method
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    59
        WHITE_BOX.testSetDontInlineMethod(method, true);
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    60
        this.makeNotEntrant = makeNotEntrant;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    61
        this.phaser = phaser;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    62
        System.out.printf("DeoptimizeFramesTest(makeNotEntrant = %b)%n",
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    63
                makeNotEntrant);
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    64
    }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    65
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    66
    public static void main(String[] args) throws Exception {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    67
        Asserts.assertEQ(args.length, 1,
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    68
                "[TESTBUG] args should contain 1 element");
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    69
        new DeoptimizeFramesTest(Boolean.valueOf(args[0]), new Phaser()).runTest();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    70
    }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    71
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    72
    @Override
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    73
    protected void test() throws Exception {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    74
        compile();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    75
        checkCompiled();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    76
        NMethod nm = NMethod.get(method, testCase.isOsr());
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    77
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    78
        WHITE_BOX.deoptimizeFrames(makeNotEntrant);
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    79
        // #method should still be compiled, since it didn't have frames on stack
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    80
        checkCompiled();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    81
        NMethod nm2 = NMethod.get(method, testCase.isOsr());
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    82
        Asserts.assertEQ(nm.compile_id, nm2.compile_id,
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    83
                "should be the same nmethod");
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    84
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    85
        phaser.register();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    86
        Thread t = new Thread(() -> compile(1));
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    87
        t.start();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    88
        // pass 1st phase, #method is on stack
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    89
        int p = phaser.arriveAndAwaitAdvance();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    90
        WHITE_BOX.deoptimizeFrames(makeNotEntrant);
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    91
        // pass 2nd phase, #method can exit
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    92
        phaser.awaitAdvance(phaser.arriveAndDeregister());
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    93
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    94
        try {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    95
            t.join();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    96
        } catch (InterruptedException e) {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    97
            throw new Error("method '" + method + "' is still executing", e);
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    98
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
    99
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   100
        // invoke one more time to recompile not entrant if any
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   101
        compile(1);
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   102
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   103
        nm2 = NMethod.get(method, testCase.isOsr());
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   104
        if (makeNotEntrant) {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   105
            if (nm2 != null) {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   106
                Asserts.assertNE(nm.compile_id, nm2.compile_id,
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   107
                        String.format("compilation %d can't be available", nm.compile_id));
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   108
            }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   109
        } else {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   110
            Asserts.assertEQ(nm.compile_id, nm2.compile_id, "should be the same nmethod");
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   111
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   112
    }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   113
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   114
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   115
    private static class TestCaseImpl implements TestCase {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   116
        private static final Executable EXECUTABLE;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   117
        static {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   118
            try {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   119
                EXECUTABLE = TestCaseImpl.class.getDeclaredMethod("method");
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   120
            } catch (NoSuchMethodException e) {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   121
                throw new Error("[TESTBUG] method not found", e);
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   122
            }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   123
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   124
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   125
        private final Phaser phaser;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   126
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   127
        public TestCaseImpl(Phaser phaser) {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   128
            this.phaser = phaser;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   129
            phaser.register();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   130
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   131
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   132
        @Override
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   133
        public String name() {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   134
            return "2phases";
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   135
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   136
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   137
        @Override
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   138
        public Executable getExecutable() {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   139
            return EXECUTABLE;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   140
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   141
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   142
        @Override
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   143
        public Callable<Integer> getCallable() {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   144
            return () -> {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   145
                return method();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   146
            };
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   147
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   148
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   149
        @Override
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   150
        public boolean isOsr() {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   151
            return false;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   152
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   153
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   154
        private int method() {
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   155
            phaser.arriveAndAwaitAdvance();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   156
            phaser.arriveAndAwaitAdvance();
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   157
            return 0;
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   158
        }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   159
    }
b7fb20a745f7 8028595: WhiteBox API for stress testing of TieredCompilation
iignatyev
parents:
diff changeset
   160
}