< prev index next >

test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java

Print this page
rev 12121 : 8167180: [JVMCI] Exported elements referring to inaccessible types in jdk.vm.ci


  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 8156034
  27  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  28  * @library / /test/lib
  29  * @library ../common/patches
  30  * @modules java.base/jdk.internal.misc
  31  *          java.base/jdk.internal.org.objectweb.asm
  32  *          java.base/jdk.internal.org.objectweb.asm.tree
  33  *          jdk.vm.ci/jdk.vm.ci.hotspot
  34  *          jdk.vm.ci/jdk.vm.ci.code
  35  *          jdk.vm.ci/jdk.vm.ci.meta
  36  *          jdk.vm.ci/jdk.vm.ci.runtime
  37  *
  38  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  39  * @build compiler.jvmci.common.JVMCIHelpers
  40  * @run driver jdk.test.lib.FileInstaller ../common/services/ ./META-INF/services/
  41  * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyBootstrapFinishedEventTest.config
  42  *     ./META-INF/services/jdk.vm.ci.hotspot.services.HotSpotVMEventListener
  43  * @run driver ClassFileInstaller
  44  *      compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
  45  *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
  46  *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult
  47  *      compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
  48  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  49  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
  50  *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
  51  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=false
  52  *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
  53  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  54  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
  55  *     -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI
  56  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=true
  57  *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
  58  */
  59 
  60 package compiler.jvmci.events;
  61 
  62 import jdk.test.lib.Asserts;
  63 import jdk.vm.ci.hotspot.services.HotSpotVMEventListener;

  64 
  65 public class JvmciNotifyBootstrapFinishedEventTest extends HotSpotVMEventListener {
  66     private static final boolean BOOTSTRAP = Boolean
  67             .getBoolean("compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap");
  68     private static volatile int gotBoostrapNotification = 0;
  69 
  70     public static void main(String args[]) {
  71         if (BOOTSTRAP) {
  72             Asserts.assertEQ(gotBoostrapNotification, 1, "Did not receive expected number of bootstrap events");
  73         } else {
  74             Asserts.assertEQ(gotBoostrapNotification, 0, "Got unexpected bootstrap event");
  75         }
  76     }
  77 
  78     @Override








  79     public void notifyBootstrapFinished() {
  80         gotBoostrapNotification++;
  81     }
  82 }


  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 8156034
  27  * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
  28  * @library / /test/lib
  29  * @library ../common/patches
  30  * @modules java.base/jdk.internal.misc
  31  *          java.base/jdk.internal.org.objectweb.asm
  32  *          java.base/jdk.internal.org.objectweb.asm.tree
  33  *          jdk.vm.ci/jdk.vm.ci.hotspot
  34  *          jdk.vm.ci/jdk.vm.ci.code
  35  *          jdk.vm.ci/jdk.vm.ci.meta
  36  *          jdk.vm.ci/jdk.vm.ci.runtime
  37  *
  38  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  39  * @build compiler.jvmci.common.JVMCIHelpers

  40  * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyBootstrapFinishedEventTest.config
  41  *     ./META-INF/services/jdk.vm.ci.services.JVMCIServiceLocator
  42  * @run driver ClassFileInstaller
  43  *      compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler
  44  *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory
  45  *      compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult
  46  *      compiler.jvmci.common.JVMCIHelpers$EmptyVMEventListener
  47  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  48  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
  49  *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
  50  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=false
  51  *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
  52  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  53  *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:.
  54  *     -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI
  55  *     -Dcompiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap=true
  56  *     compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest
  57  */
  58 
  59 package compiler.jvmci.events;
  60 
  61 import jdk.test.lib.Asserts;
  62 import jdk.vm.ci.services.JVMCIServiceLocator;
  63 import jdk.vm.ci.hotspot.HotSpotVMEventListener;
  64 
  65 public class JvmciNotifyBootstrapFinishedEventTest extends JVMCIServiceLocator implements HotSpotVMEventListener {
  66     private static final boolean BOOTSTRAP = Boolean
  67             .getBoolean("compiler.jvmci.events.JvmciNotifyBootstrapFinishedEventTest.bootstrap");
  68     private static volatile int gotBoostrapNotification = 0;
  69 
  70     public static void main(String args[]) {
  71         if (BOOTSTRAP) {
  72             Asserts.assertEQ(gotBoostrapNotification, 1, "Did not receive expected number of bootstrap events");
  73         } else {
  74             Asserts.assertEQ(gotBoostrapNotification, 0, "Got unexpected bootstrap event");
  75         }
  76     }
  77 
  78     @Override
  79     public <S> S getProvider(Class<S> service) {
  80         if (service == HotSpotVMEventListener.class) {
  81             return service.cast(this);
  82         }
  83         return null;
  84     }
  85 
  86     @Override
  87     public void notifyBootstrapFinished() {
  88         gotBoostrapNotification++;
  89     }
  90 }
< prev index next >