public class StaticInvocationWriter
extends InvocationWriter
Invocation writer for statically compiled code paths.
| Fields inherited from class | Fields |
|---|---|
class InvocationWriter |
castToVargsArray, controller, currentCall, invokeClosureMethod, invokeMethod, invokeMethodOnCurrent, invokeMethodOnSuper, invokeStaticMethod |
| Constructor and description |
|---|
StaticInvocationWriter(WriterController wc)Creates an invocation writer that favors direct bytecode calls over dynamic dispatch. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected static boolean |
isPrivateBridgeMethodsCallAllowed(ClassNode receiver, ClassNode caller)
|
|
protected void |
loadArguments(List<Expression> argumentList, Parameter[] parameters)* Evaluates and loads each argument expression, handling varargs packing. * *
|
|
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 |
makeCall(Expression origin, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis)* Generates bytecode for a method call. * *
|
|
protected boolean |
tryBridgeMethod(MethodNode target, Expression receiver, boolean implicitThis, TupleExpression args)Attempts to make a direct method call on a bridge method, if it exists. |
|
protected boolean |
tryBridgeMethod(MethodNode target, Expression receiver, boolean implicitThis, TupleExpression args, ClassNode thisClass)Attempts to make a direct method call on a bridge method, if it exists. |
|
protected boolean |
writeDirectMethodCall(MethodNode target, boolean implicitThis, Expression receiver, TupleExpression args)* Emits a direct (INVOKE*) bytecode call to target when static type
* information is available. Returns false if a direct call cannot be made.
*
*
|
|
public void |
writeInvokeConstructor(ConstructorCallExpression call)* Generates bytecode for a constructor call expression, choosing the * appropriate strategy (direct, AIC, or normal call-site). * *
|
|
public void |
writeSpecialConstructorCall(ConstructorCallExpression call)* Generates bytecode for a this() or super() constructor
* call at the start of a constructor body.
*
*
|
Creates an invocation writer that favors direct bytecode calls over dynamic dispatch.
* Evaluates and loads each argument expression, handling varargs packing. * *
arguments - the argument expressions to evaluate
*parameters - the declared parameters of the target method
* 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 bytecode for a method call. * *
origin - the original expression
*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'Attempts to make a direct method call on a bridge method, if it exists.
Attempts to make a direct method call on a bridge method, if it exists.
* Emits a direct (INVOKE*) bytecode call to target when static type
* information is available. Returns false if a direct call cannot be made.
*
*
target - the resolved method node to call directly
*implicitThis - whether the receiver is implicit this
*receiver - the receiver expression (may be null)
*args - the argument tuple
*true if the call was emitted, false otherwise* Generates bytecode for a constructor call expression, choosing the * appropriate strategy (direct, AIC, or normal call-site). * *
call - the constructor call expression to compile
* Generates bytecode for a this() or super() constructor
* call at the start of a constructor body.
*
*
call - the constructor call expression representing this() or super()Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.