test/compiler/whitebox/DeoptimizeFramesTest.java

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test DeoptimizeFramesTest
  26  * @bug 8028595
  27  * @library /testlibrary /../../test/lib
  28  * @build DeoptimizeFramesTest
  29  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  30  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  31  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  32  *                   -XX:+WhiteBoxAPI -Xmixed
  33  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  34  *                   -XX:-DeoptimizeRandom DeoptimizeFramesTest true
  35  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  36  *                   -XX:+WhiteBoxAPI -Xmixed
  37  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  38  *                   -XX:-DeoptimizeRandom DeoptimizeFramesTest false
  39  * @summary testing of WB::deoptimizeFrames()
  40  */
  41 import java.lang.reflect.Executable;
  42 import java.util.concurrent.Callable;
  43 import java.util.concurrent.Phaser;
  44 
  45 import sun.hotspot.code.NMethod;
  46 import com.oracle.java.testlibrary.Asserts;
  47 import com.oracle.java.testlibrary.InfiniteLoop;
  48 
  49 public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
  50     private final boolean makeNotEntrant;
  51     private final Phaser phaser;
  52 
  53     private DeoptimizeFramesTest(boolean makeNotEntrant, Phaser phaser) {
  54         super(new TestCaseImpl(phaser));
  55         // to prevent inlining of #method
  56         WHITE_BOX.testSetDontInlineMethod(method, true);
  57         this.makeNotEntrant = makeNotEntrant;
  58         this.phaser = phaser;




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test DeoptimizeFramesTest
  26  * @bug 8028595
  27  * @library /testlibrary /../../test/lib
  28  * @build DeoptimizeFramesTest
  29  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  30  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  31  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  32  *                   -XX:+WhiteBoxAPI -Xmixed
  33  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  34  *                   -XX:-DeoptimizeRandom -XX:-DeoptimizeALot DeoptimizeFramesTest true
  35  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  36  *                   -XX:+WhiteBoxAPI -Xmixed
  37  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  38  *                   -XX:-DeoptimizeRandom -XX:-DeoptimizeALot DeoptimizeFramesTest false
  39  * @summary testing of WB::deoptimizeFrames()
  40  */
  41 import java.lang.reflect.Executable;
  42 import java.util.concurrent.Callable;
  43 import java.util.concurrent.Phaser;
  44 
  45 import sun.hotspot.code.NMethod;
  46 import com.oracle.java.testlibrary.Asserts;
  47 import com.oracle.java.testlibrary.InfiniteLoop;
  48 
  49 public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
  50     private final boolean makeNotEntrant;
  51     private final Phaser phaser;
  52 
  53     private DeoptimizeFramesTest(boolean makeNotEntrant, Phaser phaser) {
  54         super(new TestCaseImpl(phaser));
  55         // to prevent inlining of #method
  56         WHITE_BOX.testSetDontInlineMethod(method, true);
  57         this.makeNotEntrant = makeNotEntrant;
  58         this.phaser = phaser;