< prev index next >

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


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 
78         static CallSiteContext make(CallSite cs) {                                                                                   
79             final CallSiteContext newContext = new CallSiteContext();                                                                
80             // CallSite instance is tracked by a Cleanable which clears native                                                       
81             // structures allocated for CallSite context. Though the CallSite can                                                    
82             // become unreachable, its Context is retained by the Cleanable instance                                                 
83             // (which is referenced from Cleaner instance which is referenced from                                                   
84             // CleanerFactory class) until cleanup is performed.                                                                     
85             CleanerFactory.cleaner().register(cs, newContext);                                                                       
86             return newContext;                                                                                                       
87         }                                                                                                                            
88 
89         @Override                                                                                                                    
90         public void run() {                                                                                                          
91             MethodHandleNatives.clearCallSiteContext(this);                                                                          
92         }                                                                                                                            
93     }                                                                                                                                
94 
95     /** Invalidate all recorded nmethods. */                                                                                         

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         }
94     }
95 
96     /** Invalidate all recorded nmethods. */
< prev index next >