public class InvokeDynamicWriter
extends InvocationWriter
This Writer is used to generate the call invocation byte codes for usage by invokedynamic.
| Fields inherited from class | Fields |
|---|---|
class InvocationWriter |
castToVargsArray, controller, currentCall, invokeClosureMethod, invokeMethod, invokeMethodOnCurrent, invokeMethodOnSuper, invokeStaticMethod |
| Constructor and description |
|---|
InvokeDynamicWriter(WriterController controller)Creates an invocation writer that emits invokedynamic call sites. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
castNonPrimitiveToBool(ClassNode sourceType)* Unboxes a non-primitive value on the operand stack to a primitive boolean.
*
*
|
|
public void |
castToNonPrimitiveIfNecessary(ClassNode sourceType, ClassNode targetType)* Converts sourceType to a non-primitive by using Groovy casting. * sourceType might be a primitive * This might be done using SBA#castToType |
|
public void |
coerce(ClassNode from, ClassNode target)* Emits a Groovy as coercion from from to target.
*
*
|
|
protected boolean |
makeCachedCall(Expression origin, ClassExpression sender, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis, boolean containsSpreadExpression)* Attempts to emit a call-site-cached invocation (or invokedynamic). * Returns false if the call cannot be cached, causing the caller to
* fall through to the uncached path.
*
*
|
|
public void |
makeSingleArgumentCall(Expression receiver, String message, Expression arguments, boolean safe)* Generates a single-argument method call via the call-site writer. * *
|
|
protected void |
writeGetProperty(Expression receiver, String propertyName, boolean safe, boolean implicitThis, boolean groovyObject)Emits an invokedynamic property-get call site with the given flags. |
|
protected void |
writeNormalConstructorCall(ConstructorCallExpression call)* Emits a normal (non-direct, non-AIC) constructor call via the call-site writer. * *
|
Creates an invocation writer that emits invokedynamic call sites.
* Unboxes a non-primitive value on the operand stack to a primitive boolean.
*
*
last - the type currently on top of the operand stack* Converts sourceType to a non-primitive by using Groovy casting. * sourceType might be a primitive * This might be done using SBA#castToType
* Emits a Groovy as coercion from from to target.
*
*
from - the source type currently on the operand stack
*target - the target type to coerce to
* Attempts to emit a call-site-cached invocation (or invokedynamic).
* Returns false if the call cannot be cached, causing the caller to
* fall through to the uncached path.
*
*
origin - the original call expression
*sender - the class from which the call is dispatched
*receiver - the receiver expression
*message - the method name expression
*arguments - the arguments expression
*adapter - the method caller adapter
*safe - whether to use safe navigation
*spreadSafe - whether to use spread-safe navigation
*implicitThis - whether the receiver is implicit this
*containsSpreadExpression - whether any argument uses spread
*true if a cached call was emitted* Generates a single-argument method call via the call-site writer. * *
receiver - the receiver expression
*message - the method name
*arguments - the single argument expression
*safe - whether to use safe navigation (?.) Emits an invokedynamic property-get call site with the given flags.
* Emits a normal (non-direct, non-AIC) constructor call via the call-site writer. * *
call - the constructor call expression to compileCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.