Class IndyCompoundAssign
+=, -=, ...).
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(java.lang.invoke.MethodHandles.Lookup, java.lang.String, java.lang.invoke.MethodType, java.lang.String, int) 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(org.codehaus.groovy.vmplugin.v8.CacheableCallSite, java.lang.Class<?>, java.lang.String, int, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Object, java.lang.Object[])
routes resolution here via resolve(org.codehaus.groovy.vmplugin.v8.CacheableCallSite, java.lang.Class<?>, java.lang.String, java.lang.Object[]).
What remains GEP-15-specific:
- the two operator names (
assignName/baseName) packed into the bootstrapnameand unpacked here; - a
respondsToprobe to pick*Assignvs base — run only on a cache miss; - the in-place return-receiver composition for the assign branch;
- a
(receiver class, arg class)guard (arg class is part of the key so overloads stay correct), under the shared MOP switch point; - a generic fall back to
ScriptBytecodeAdapter.compoundAssign(java.lang.Object, java.lang.Object, java.lang.String, java.lang.String)for null/unresolved receivers.
The actual invocation is built by Selector.selectInvokeHandle(org.codehaus.groovy.vmplugin.v8.CacheableCallSite, java.lang.Class<?>, java.lang.String, java.lang.Object[]), so
selection/coercion/vargs/category/exception handling match a normal call.
WARNING: internal, indy-only. Not for use outside this package.
- Since:
- 6.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charSeparator packingassignNameandbaseNameinto one bootstrap constant (NUL cannot appear in a JVM method name, even a Groovy quoted one). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanGuard: receiver and argument runtime classes both match the cached shape.static StringPacks the two operator names into a single bootstrapnameconstant.static org.codehaus.groovy.vmplugin.v8.MethodHandleWrapperresolve(CacheableCallSite callSite, Class<?> sender, String packedNames, Object[] arguments) Resolves the invocation for one receiver/arg shape and returns aMethodHandleWrapperforIndyInterface's inline cache.
-
Field Details
-
NAME_SEPARATOR
public static final char NAME_SEPARATORSeparator packingassignNameandbaseNameinto one bootstrap constant (NUL cannot appear in a JVM method name, even a Groovy quoted one).- See Also:
-
-
Method Details
-
packNames
Packs the two operator names into a single bootstrapnameconstant. Called from code generation. -
resolve
public static org.codehaus.groovy.vmplugin.v8.MethodHandleWrapper resolve(CacheableCallSite callSite, Class<?> sender, String packedNames, Object[] arguments) Resolves the invocation for one receiver/arg shape and returns aMethodHandleWrapperforIndyInterface'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.- Parameters:
callSite- the compound-assignment call site (type(Object,Object)->Object)sender- the sending classpackedNames-assignNameandbaseNamejoined byNAME_SEPARATORarguments- the runtime arguments:[receiver, arg]
-
guard
Guard: receiver and argument runtime classes both match the cached shape.
-