< prev index next >

src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java

Print this page

 54             boolean speculativeResolve) throws LinkageError, ClassNotFoundException;
 55 
 56     //--- Field layout queries parallel to jdk.internal.misc.Unsafe:
 57     static native long objectFieldOffset(MemberName self);  // e.g., returns vmindex
 58     static native long staticFieldOffset(MemberName self);  // e.g., returns vmindex
 59     static native Object staticFieldBase(MemberName self);  // e.g., returns clazz
 60     static native Object getMemberVMInfo(MemberName self);  // returns {vmindex,vmtarget}
 61 
 62     //--- CallSite support
 63 
 64     /** Tell the JVM that we need to change the target of a CallSite. */
 65     static native void setCallSiteTargetNormal(CallSite site, MethodHandle target);
 66     static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target);
 67 
 68     static native void copyOutBootstrapArguments(Class<?> caller, int[] indexInfo,
 69                                                  int start, int end,
 70                                                  Object[] buf, int pos,
 71                                                  boolean resolve,
 72                                                  Object ifNotAvailable);
 73 



 74     /** Represents a context to track nmethod dependencies on CallSite instance target. */
 75     static class CallSiteContext implements Runnable {
 76         //@Injected JVM_nmethodBucket* vmdependencies;
 77         //@Injected jlong last_cleanup;
 78 
 79         static CallSiteContext make(CallSite cs) {
 80             final CallSiteContext newContext = new CallSiteContext();
 81             // CallSite instance is tracked by a Cleanable which clears native
 82             // structures allocated for CallSite context. Though the CallSite can
 83             // become unreachable, its Context is retained by the Cleanable instance
 84             // (which is referenced from Cleaner instance which is referenced from
 85             // CleanerFactory class) until cleanup is performed.
 86             CleanerFactory.cleaner().register(cs, newContext);
 87             return newContext;
 88         }
 89 
 90         @Override
 91         public void run() {
 92             MethodHandleNatives.clearCallSiteContext(this);
 93         }

 54             boolean speculativeResolve) throws LinkageError, ClassNotFoundException;
 55 
 56     //--- Field layout queries parallel to jdk.internal.misc.Unsafe:
 57     static native long objectFieldOffset(MemberName self);  // e.g., returns vmindex
 58     static native long staticFieldOffset(MemberName self);  // e.g., returns vmindex
 59     static native Object staticFieldBase(MemberName self);  // e.g., returns clazz
 60     static native Object getMemberVMInfo(MemberName self);  // returns {vmindex,vmtarget}
 61 
 62     //--- CallSite support
 63 
 64     /** Tell the JVM that we need to change the target of a CallSite. */
 65     static native void setCallSiteTargetNormal(CallSite site, MethodHandle target);
 66     static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target);
 67 
 68     static native void copyOutBootstrapArguments(Class<?> caller, int[] indexInfo,
 69                                                  int start, int end,
 70                                                  Object[] buf, int pos,
 71                                                  boolean resolve,
 72                                                  Object ifNotAvailable);
 73 
 74     /// CDS support
 75     static native void checkArchivable(Class<?> type);
 76 
 77     /** Represents a context to track nmethod dependencies on CallSite instance target. */
 78     static class CallSiteContext implements Runnable {
 79         //@Injected JVM_nmethodBucket* vmdependencies;
 80         //@Injected jlong last_cleanup;
 81 
 82         static CallSiteContext make(CallSite cs) {
 83             final CallSiteContext newContext = new CallSiteContext();
 84             // CallSite instance is tracked by a Cleanable which clears native
 85             // structures allocated for CallSite context. Though the CallSite can
 86             // become unreachable, its Context is retained by the Cleanable instance
 87             // (which is referenced from Cleaner instance which is referenced from
 88             // CleanerFactory class) until cleanup is performed.
 89             CleanerFactory.cleaner().register(cs, newContext);
 90             return newContext;
 91         }
 92 
 93         @Override
 94         public void run() {
 95             MethodHandleNatives.clearCallSiteContext(this);
 96         }
< prev index next >