|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.dyn.Linkage
public class Linkage
Disabled: no SafeJ information.
Static methods which control the linkage of invokedynamic call sites.
Field Summary | |
---|---|
static MethodType |
BOOTSTRAP_METHOD_TYPE
PROVISIONAL API, WORK IN PROGRESS: The type of any bootstrap method is a three-argument method (Class, String, MethodType) returning a CallSite . |
Method Summary | |
---|---|
static MethodHandle |
getBootstrapMethod(Class callerClass)
PROVISIONAL API, WORK IN PROGRESS: Report the bootstrap method registered for a given class. |
static Object |
invalidateAll()
PROVISIONAL API, WORK IN PROGRESS: Invalidate all invokedynamic call sites everywhere. |
static Object |
invalidateCallerClass(Class<?> callerClass)
PROVISIONAL API, WORK IN PROGRESS: Invalidate all invokedynamic call sites in the bytecodes
of any methods of the given class. |
static void |
registerBootstrapMethod(Class<?> runtime,
String name)
PROVISIONAL API, WORK IN PROGRESS: Simplified version of registerBootstrapMethod for self-registration, to be called from a static initializer. |
static void |
registerBootstrapMethod(Class callerClass,
MethodHandle bootstrapMethod)
PROVISIONAL API, WORK IN PROGRESS: Register a bootstrap method to use when linking a given caller class. |
static void |
registerBootstrapMethod(String name)
PROVISIONAL API, WORK IN PROGRESS: Simplified version of registerBootstrapMethod for self-registration, to be called from a static initializer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MethodType BOOTSTRAP_METHOD_TYPE
(Class, String, MethodType)
returning a CallSite
.
Method Detail |
---|
public static void registerBootstrapMethod(Class callerClass, MethodHandle bootstrapMethod)
CallSite.CallSite(java.lang.Object, java.lang.String, java.dyn.MethodType)
.
In other words, it must act as a factory method which accepts the arguments
to CallSite
's constructor (a class, a string, and a method type),
and returns a CallSite
object (possibly of a subclass of CallSite
).
The registration will fail with an IllegalStateException
if any of the following conditions hold:
callerClass
,
and there is a security manager, and its checkPermission
call throws
when passed LinkagePermission
("registerBootstrapMethod",callerClass).
CallSite
object has already been returned from
a bootstrap method call to another invokedynamic
call site.
callerClass
- a class that may have invokedynamic
sitesbootstrapMethod
- the method to use to bootstrap all such sitespublic static void registerBootstrapMethod(Class<?> runtime, String name)
IllegalArgumentException
- if there is no such methodpublic static void registerBootstrapMethod(String name)
IllegalArgumentException
- if there is no such methodpublic static MethodHandle getBootstrapMethod(Class callerClass)
public static Object invalidateAll()
invokedynamic
call sites everywhere.
When this method returns, every invokedynamic
instruction
will invoke its bootstrap method on next call.
It is unspecified whether call sites already known to the Java
code will continue to be associated with invokedynamic
instructions. If any call site is still so associated, its
CallSite.getTarget()
method is guaranteed to return null
the invalidation operation completes.
Invalidation operations are likely to be slow. Use them sparingly.
public static Object invalidateCallerClass(Class<?> callerClass)
invokedynamic
call sites in the bytecodes
of any methods of the given class.
(These are exactly those sites which report the given class
via the CallSite.callerClass()
method.)
When this method returns, every matching invokedynamic
instruction will invoke its bootstrap method on next call.
For additional semantics of call site invalidation,
see invalidateAll()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |