public final class IndyCompoundAssign
extends Object
GEP-15: resolver for dynamic compound-assignment operators
(+=, -=, ...).
This class holds only the GEP-15-specific policy; the call-site
lifecycle is owned by IndyInterface. A compound-assignment
op= is emitted as an invokedynamic to
IndyInterface.bootstrap with call type
IndyInterface.CallType#COMPOUND_ASSIGN, so it rides the same boot
handle, per-receiver-class inline cache, monomorphic-promotion and
deopt-storm protection as a normal method call. IndyInterface.fallback
routes resolution here via resolve.
What remains GEP-15-specific:
assignName/baseName) packed into
the bootstrap name and unpacked here;respondsTo probe to pick *Assign vs base — run only on
a cache miss;(receiver class, arg class) guard (arg class is part of the
key so overloads stay correct), under the shared MOP switch point;The actual invocation is built by Selector.selectInvokeHandle, so selection/coercion/vargs/category/exception handling match a normal call.
WARNING: internal, indy-only. Not for use outside this package.
| Modifiers | Name | Description |
|---|---|---|
static char |
NAME_SEPARATOR |
Separator packing assignName and baseName into one bootstrap constant (NUL cannot appear in a JVM method name, even a Groovy quoted one). |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static boolean |
guard(Class<?> rc, Class<?> ac, Object receiver, Object arg)Guard: receiver and argument runtime classes both match the cached shape. |
|
public static String |
packNames(String assignName, String baseName)Packs the two operator names into a single bootstrap name constant.
|
|
public static MethodHandleWrapper |
resolve(CacheableCallSite callSite, Class<?> sender, String packedNames, Object[] arguments)Resolves the invocation for one receiver/arg shape and returns a MethodHandleWrapper for IndyInterface's inline cache. |
Separator packing assignName and baseName into one bootstrap constant (NUL cannot appear in a JVM method name, even a Groovy quoted one).
Guard: receiver and argument runtime classes both match the cached shape.
Packs the two operator names into a single bootstrap name constant.
Called from code generation.
Resolves the invocation for one receiver/arg shape and returns a
MethodHandleWrapper for IndyInterface's inline cache. The
wrapper's target handle is (Object receiver, Object arg) -> Object,
guarded on the receiver/arg classes and the shared MOP switch point with
the call site's fallback (re-resolve) path as the else-branch.
callSite - the compound-assignment call site (type (Object,Object)->Object)sender - the sending classpackedNames - assignName and baseName joined by NAME_SEPARATORarguments - the runtime arguments: [receiver, arg]