< prev index next >

src/jdk.unsupported/share/classes/sun/misc/Unsafe.java

Print this page




 796     }
 797 
 798     /** The value of {@code addressSize()} */
 799     public static final int ADDRESS_SIZE = theInternalUnsafe.addressSize();
 800 
 801     /**
 802      * Reports the size in bytes of a native memory page (whatever that is).
 803      * This value will always be a power of two.
 804      */
 805     @ForceInline
 806     public int pageSize() {
 807         return theInternalUnsafe.pageSize();
 808     }
 809 
 810 
 811     /// random trusted operations from JNI:
 812 
 813     /**
 814      * Tells the VM to define a class, without security checks.  By default, the
 815      * class loader and protection domain come from the caller's class.

 816      */
 817     @ForceInline
 818     public Class<?> defineClass(String name, byte[] b, int off, int len,
 819                                 ClassLoader loader,
 820                                 ProtectionDomain protectionDomain) {
 821         return theInternalUnsafe.defineClass(name, b, off, len, loader, protectionDomain);
 822     }
 823 
 824     /**
 825      * Defines a class but does not make it known to the class loader or system dictionary.
 826      * <p>
 827      * For each CP entry, the corresponding CP patch must either be null or have
 828      * the a format that matches its tag:
 829      * <ul>
 830      * <li>Integer, Long, Float, Double: the corresponding wrapper object type from java.lang
 831      * <li>Utf8: a string (must have suitable syntax if used as signature or name)
 832      * <li>Class: any java.lang.Class object
 833      * <li>String: any object (not just a java.lang.String)
 834      * <li>InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments
 835      * </ul>




 796     }
 797 
 798     /** The value of {@code addressSize()} */
 799     public static final int ADDRESS_SIZE = theInternalUnsafe.addressSize();
 800 
 801     /**
 802      * Reports the size in bytes of a native memory page (whatever that is).
 803      * This value will always be a power of two.
 804      */
 805     @ForceInline
 806     public int pageSize() {
 807         return theInternalUnsafe.pageSize();
 808     }
 809 
 810 
 811     /// random trusted operations from JNI:
 812 
 813     /**
 814      * Tells the VM to define a class, without security checks.  By default, the
 815      * class loader and protection domain come from the caller's class.
 816      * @see java.lang.invoke.MethodHandles.Lookup#defineClass(byte[])
 817      */
 818     @ForceInline
 819     public Class<?> defineClass(String name, byte[] b, int off, int len,
 820                                 ClassLoader loader,
 821                                 ProtectionDomain protectionDomain) {
 822         return theInternalUnsafe.defineClass(name, b, off, len, loader, protectionDomain);
 823     }
 824 
 825     /**
 826      * Defines a class but does not make it known to the class loader or system dictionary.
 827      * <p>
 828      * For each CP entry, the corresponding CP patch must either be null or have
 829      * the a format that matches its tag:
 830      * <ul>
 831      * <li>Integer, Long, Float, Double: the corresponding wrapper object type from java.lang
 832      * <li>Utf8: a string (must have suitable syntax if used as signature or name)
 833      * <li>Class: any java.lang.Class object
 834      * <li>String: any object (not just a java.lang.String)
 835      * <li>InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments
 836      * </ul>


< prev index next >