java.dyn
Class Linkage

java.lang.Object
  extended by java.dyn.Linkage

public class Linkage
extends Object

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

BOOTSTRAP_METHOD_TYPE

public static final MethodType BOOTSTRAP_METHOD_TYPE
Class is disabled.

PROVISIONAL API, WORK IN PROGRESS: The type of any bootstrap method is a three-argument method (Class, String, MethodType) returning a CallSite.

Method Detail

registerBootstrapMethod

public static void registerBootstrapMethod(Class callerClass,
                                           MethodHandle bootstrapMethod)
Class is disabled.

PROVISIONAL API, WORK IN PROGRESS: Register a bootstrap method to use when linking a given caller class. It must be a method handle of a type equivalent to 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:

Because of these rules, a class may install its own bootstrap method in a static initializer.

Parameters:
callerClass - a class that may have invokedynamic sites
bootstrapMethod - the method to use to bootstrap all such sites

registerBootstrapMethod

public static void registerBootstrapMethod(Class<?> runtime,
                                           String name)
Class is disabled.

PROVISIONAL API, WORK IN PROGRESS: Simplified version of registerBootstrapMethod for self-registration, to be called from a static initializer. Finds a static method of the required type in the given class, and installs it on the caller.

Throws:
IllegalArgumentException - if there is no such method

registerBootstrapMethod

public static void registerBootstrapMethod(String name)
Class is disabled.

PROVISIONAL API, WORK IN PROGRESS: Simplified version of registerBootstrapMethod for self-registration, to be called from a static initializer. Finds a static method of the required type in the caller's class, and installs it on the caller.

Throws:
IllegalArgumentException - if there is no such method

getBootstrapMethod

public static MethodHandle getBootstrapMethod(Class callerClass)
Class is disabled.

PROVISIONAL API, WORK IN PROGRESS: Report the bootstrap method registered for a given class. Returns null if the class has never yet registered a bootstrap method. Only callers privileged to set the bootstrap method may inquire about it, because a bootstrap method is potentially a back-door entry point into its class.


invalidateAll

public static Object invalidateAll()
Class is disabled.

PROVISIONAL API, WORK IN PROGRESS: Invalidate all 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.


invalidateCallerClass

public static Object invalidateCallerClass(Class<?> callerClass)
Class is disabled.

PROVISIONAL API, WORK IN PROGRESS: Invalidate all 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().