public final class InvokerFactory
extends Object
Factory for DirectInvoker instances bound to one CachedMethod.
Not user API. CachedMethod.invoke is the only production caller.
Package-visible helpers exist so tests can drive generation without going
through the hit-count hook.
Define path (one order):
INVOKE* when the member is publicly
invocable from this class and every type is resolvable here
(String.startsWith).INVOKE* when
privateLookupIn is worth attempting and the host can resolve
DirectInvoker.MethodHandle when this
loader can resolve the erased invokeExact types.null; they must not propagate to
CachedMethod.invoke.
| Modifiers | Name | Description |
|---|---|---|
static long |
DEFAULT_THRESHOLD |
Default for PROPERTY_THRESHOLD. |
static String |
PROPERTY_DISABLE |
Kill switch. |
static String |
PROPERTY_THRESHOLD |
Hits before generation. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static boolean |
generationAllowed()Package-visible predicate. |
|
public static DirectInvoker |
tryCreate(CachedMethod method)Attempts to bind a trampoline for method. |
Default for PROPERTY_THRESHOLD.
Kill switch. Default false.
Hits before generation. Default DEFAULT_THRESHOLD — the same
order as groovy.indy.optimize.threshold, so a method that stays
on doMethodInvoke long enough to look hot also qualifies for a
trampoline.
Package-visible predicate. Android cannot be flipped with a property
(AndroidSupport.isRunningAndroid() is Class.forName(
"android.app.Activity") captured at class-init). Native image is
HiddenClassDefiner.isEnabled — do not also gate on
AotDispatch.isAotLinkRequested(), which is true on HotSpot when
-Dgroovy.indy.aot.link=true and would silently disable generation
in AOT-dispatch unit tests.
true when generation may be attempted Attempts to bind a trampoline for method. Returns null
on any failure (sticky-fail). Public so CachedMethod in another
package can call it; not user API (Internal, internal
package). Tests in this package also drive generation through this
method without going through the hit-count hook.
method - the cached method to bindnull