Package org.codehaus.groovy.vmplugin.v7
Class IndyInterface
java.lang.Object
org.codehaus.groovy.vmplugin.v7.IndyInterface
Bytecode level interface for bootstrap methods used by invokedynamic.
This class provides a logging ability by using the boolean system property
groovy.indy.logging. Other than that this class contains the
interfacing methods with bytecode for invokedynamic as well as some helper
methods and classes.
- Author:
- Jochen "blackdrag" Theodorou
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum for easy differentiation between call types -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
flags for method and property callsstatic final int
flags for method and property callsprotected static final Logger
Loggerprotected static final boolean
boolean to indicate if logging for indy is enabledstatic final MethodHandles.Lookup
LOOKUP constant used for for example unreflect callsstatic final int
flags for method and property callsstatic final int
flags for method and property callsprotected static SwitchPoint
static final int
flags for method and property callsstatic final int
flags for method and property calls -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CallSite
bootstrap
(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0static CallSite
bootstrap
(MethodHandles.Lookup caller, String callType, MethodType type, String name, int flags) bootstrap method for method calls from Groovy compiled code with indy enabled.static CallSite
bootstrapCurrent
(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0static CallSite
bootstrapCurrentSafe
(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0static CallSite
bootstrapSafe
(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0protected static void
Callback for constant meta class update changeprotected static MethodHandle
makeFallBack
(MutableCallSite mc, Class<?> sender, String name, int callID, MethodType type, boolean safeNavigation, boolean thisCall, boolean spreadCall) Makes a fallback method for an invalidated method selectionstatic Object
selectMethod
(MutableCallSite callSite, Class sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) Core method for indy method selection using runtime types.
-
Field Details
-
SAFE_NAVIGATION
public static final int SAFE_NAVIGATIONflags for method and property calls- See Also:
-
THIS_CALL
public static final int THIS_CALLflags for method and property calls- See Also:
-
GROOVY_OBJECT
public static final int GROOVY_OBJECTflags for method and property calls- See Also:
-
IMPLICIT_THIS
public static final int IMPLICIT_THISflags for method and property calls- See Also:
-
SPREAD_CALL
public static final int SPREAD_CALLflags for method and property calls- See Also:
-
UNCACHED_CALL
public static final int UNCACHED_CALLflags for method and property calls- See Also:
-
LOG
Logger -
LOG_ENABLED
protected static final boolean LOG_ENABLEDboolean to indicate if logging for indy is enabled -
LOOKUP
LOOKUP constant used for for example unreflect calls -
switchPoint
-
-
Constructor Details
-
IndyInterface
public IndyInterface()
-
-
Method Details
-
invalidateSwitchPoints
protected static void invalidateSwitchPoints()Callback for constant meta class update change -
bootstrap
public static CallSite bootstrap(MethodHandles.Lookup caller, String callType, MethodType type, String name, int flags) bootstrap method for method calls from Groovy compiled code with indy enabled. This method gets a flags parameter which uses the following encoding:- 1 is the flag value for safe navigation see
SAFE_NAVIGATION
- 2 is the flag value for a call on this see
THIS_CALL
- Parameters:
caller
- - the callercallType
- - the type of the calltype
- - the call site typename
- - the real method nameflags
- - call flags- Returns:
- the produced CallSite
- Since:
- Groovy 2.1.0
- 1 is the flag value for safe navigation see
-
bootstrapCurrent
@Deprecated public static CallSite bootstrapCurrent(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0bootstrap method for method calls with "this" as receiver -
bootstrapCurrentSafe
@Deprecated public static CallSite bootstrapCurrentSafe(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0bootstrap method for method calls with "this" as receiver safe -
bootstrap
@Deprecated public static CallSite bootstrap(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0bootstrap method for standard method calls -
bootstrapSafe
@Deprecated public static CallSite bootstrapSafe(MethodHandles.Lookup caller, String name, MethodType type) Deprecated.since Groovy 2.1.0bootstrap method for null safe standard method calls -
makeFallBack
protected static MethodHandle makeFallBack(MutableCallSite mc, Class<?> sender, String name, int callID, MethodType type, boolean safeNavigation, boolean thisCall, boolean spreadCall) Makes a fallback method for an invalidated method selection -
selectMethod
public static Object selectMethod(MutableCallSite callSite, Class sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) throws Throwable Core method for indy method selection using runtime types.- Throws:
Throwable
-