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 SummaryNested ClassesModifier and TypeClassDescriptionstatic enumEnum for easy differentiation between call types
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intflags for method and property callsstatic final intflags for method and property callsprotected static final LoggerLoggerprotected static final booleanboolean to indicate if logging for indy is enabledstatic final MethodHandles.LookupLOOKUP constant used for example in unreflect callsstatic final intflags for method and property callsstatic final intflags for method and property callsprotected static SwitchPointstatic final intflags for method and property callsstatic final intflags for method and property calls
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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 enabled.static ObjectfromCache(MutableCallSite callSite, Class<?> sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) Get the cached methodhandle.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 selectionstatic ObjectselectMethod(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.static CallSitestaticArrayAccess(MethodHandles.Lookup lookup, String name, MethodType type) 
- 
Field Details- 
SAFE_NAVIGATIONpublic static final int SAFE_NAVIGATIONflags for method and property calls- See Also:
 
- 
THIS_CALLpublic static final int THIS_CALLflags for method and property calls- See Also:
 
- 
GROOVY_OBJECTpublic static final int GROOVY_OBJECTflags for method and property calls- See Also:
 
- 
IMPLICIT_THISpublic static final int IMPLICIT_THISflags for method and property calls- See Also:
 
- 
SPREAD_CALLpublic static final int SPREAD_CALLflags for method and property calls- See Also:
 
- 
UNCACHED_CALLpublic static final int UNCACHED_CALLflags for method and property calls- See Also:
 
- 
LOGLogger
- 
LOG_ENABLEDprotected static final boolean LOG_ENABLEDboolean to indicate if logging for indy is enabled
- 
LOOKUPLOOKUP constant used for example in unreflect calls
- 
switchPoint
 
- 
- 
Constructor Details- 
IndyInterfacepublic IndyInterface()
 
- 
- 
Method Details- 
invalidateSwitchPointsprotected static void invalidateSwitchPoints()Callback for constant metaclass update change
- 
bootstrappublic 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 caller
- callType- - the type of the call
- type- - the call site type
- name- - the real method name
- flags- - call flags
- Returns:
- the produced CallSite
- Since:
- Groovy 2.1.0
 
- 1 is the flag value for safe navigation see 
- 
makeFallBackprotected 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
- 
fromCachepublic static Object fromCache(MutableCallSite callSite, Class<?> sender, String methodName, int callID, Boolean safeNavigation, Boolean thisCall, Boolean spreadCall, Object dummyReceiver, Object[] arguments) throws Throwable Get the cached methodhandle. if the related methodhandle is not found in the inline cache, cache and return it.- Throws:
- Throwable
 
- 
selectMethodpublic 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
 
- 
staticArrayAccess- Since:
- 2.5.0
 
 
-