Package org.codehaus.groovy.vmplugin.v8
Class IndyInterface
java.lang.Object
org.codehaus.groovy.vmplugin.v8.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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum for easy differentiation between call types. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlags for method and property calls.static final intFlags for method and property calls.protected static final LoggerLogger.protected static final booleanIndicates if indy logging is enabled.static final MethodHandles.LookupLOOKUP constant used for example in unreflect callsstatic final intFlags for method and property calls.static final intFlags for method and property calls.protected static SwitchPointstatic final intFlags for method and property calls.static final intFlags for method and property calls. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CallSitebootstrap(MethodHandles.Lookup caller, String callType, MethodType type, String name, int flags) Bootstrap method for method calls from Groovy-compiled code with indy.static ObjectfromCache(CacheableCallSite callSite, Class<?> sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) Deprecated.Use the new bootHandle-based approach instead.protected static voidCallback for constant metaclass update changeprotected static MethodHandlemakeFallBack(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.static ObjectselectMethod(CacheableCallSite callSite, Class<?> sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) Deprecated.Use the new bootHandle-based approach instead.static CallSitestaticArrayAccess(MethodHandles.Lookup lookup, String name, MethodType type)
-
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_ENABLEDIndicates if indy logging is enabled. -
LOOKUP
LOOKUP constant used for example in unreflect calls -
switchPoint
-
-
Constructor Details
-
IndyInterface
public IndyInterface()
-
-
Method Details
-
invalidateSwitchPoints
protected static void invalidateSwitchPoints()Callback for constant metaclass 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.- Parameters:
caller- - the callercallType- - the type of calltype- - the parameter(s) and return type specificationname- - the real method nameflags- - call flags- 1 is the flag value for safe navigation; see
SAFE_NAVIGATION - 2 is the flag value for a call on this; see
THIS_CALL - 16 is the flag value for a spread call; see
SPREAD_CALL
- 1 is the flag value for safe navigation; see
- Since:
- 2.1.0
-
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. -
fromCache
@Deprecated public static Object fromCache(CacheableCallSite callSite, Class<?> sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) throws Throwable Deprecated.Use the new bootHandle-based approach instead.Get the cached methodHandle. if the related methodHandle is not found in the inline cache, cache and return it.- Throws:
Throwable
-
selectMethod
@Deprecated public static Object selectMethod(CacheableCallSite callSite, Class<?> sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) throws Throwable Deprecated.Use the new bootHandle-based approach instead.Core method for indy method selection using runtime types.- Throws:
Throwable
-
staticArrayAccess
- Since:
- 2.5.0
-