< prev index next >

test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java

Print this page
*** 52,14 ***
  import jdk.test.lib.Platform;
  import sun.hotspot.WhiteBox;
  import sun.hotspot.code.NMethod;
  
  public class TestJFRIntrinsic {
- 
      private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
      public Object eventWriter;
  
      public static void main(String... args) throws Exception {
          JVM.getJVM().createNativeJFR();
          TestJFRIntrinsic ti = new TestJFRIntrinsic();
          Method classid = TestJFRIntrinsic.class.getDeclaredMethod("getClassIdIntrinsic",  Class.class);
          ti.runIntrinsicTest(classid);
--- 52,19 ---
  import jdk.test.lib.Platform;
  import sun.hotspot.WhiteBox;
  import sun.hotspot.code.NMethod;
  
  public class TestJFRIntrinsic {
      private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+     public Class<?> eventWriterClazz;
      public Object eventWriter;
  
+     TestJFRIntrinsic() throws Exception {
+         // the intrinsic is premised on this class being loaded already - the event writer object is massaged heavily before returning
+         eventWriterClazz = Class.forName("jdk.jfr.internal.EventWriter", true, TestJFRIntrinsic.class.getClassLoader());
+     }
+ 
      public static void main(String... args) throws Exception {
          JVM.getJVM().createNativeJFR();
          TestJFRIntrinsic ti = new TestJFRIntrinsic();
          Method classid = TestJFRIntrinsic.class.getDeclaredMethod("getClassIdIntrinsic",  Class.class);
          ti.runIntrinsicTest(classid);
< prev index next >