public class CallSiteWriter
extends Object
This class represents non-public API used by AsmClassGenerator. Don't use this class in your code
| Modifiers | Name | Description |
|---|---|---|
static String |
CONSTRUCTOR |
Sentinel name for constructor calls. |
| Constructor and description |
|---|
CallSiteWriter(WriterController wc)Creates a call site writer with the given controller. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
fallbackAttributeOrPropertySite(PropertyExpression expression, Expression objectExpression, String name, MethodCallerMultiAdapter adapter)Generates a fallback call for attribute or property access. |
|
public void |
generateCallSiteArray()Generates the call site array field and accessor methods. |
|
public List<String> |
getCallSites()Returns the list of call site names. |
|
public boolean |
hasCallSiteUse()Checks if any call sites have been used. |
|
public void |
makeCallSite(Expression receiver, String message, Expression arguments, boolean safe, boolean implicitThis, boolean callCurrent, boolean callStatic)Generates a general method call through the call site infrastructure. |
|
public void |
makeCallSiteArrayInitializer()Generates bytecode to initialize the call site array field to null. |
|
public void |
makeGetPropertySite(Expression receiver, String methodName, boolean safe, boolean implicitThis)Generates a general getProperty call. |
|
public void |
makeGroovyObjectGetPropertySite(Expression receiver, String methodName, boolean safe, boolean implicitThis)Generates a GroovyObject getProperty call. |
|
public final void |
makeSingleArgumentCall(Expression receiver, String message, Expression arguments)Generates a single-argument method call. |
|
public void |
makeSingleArgumentCall(Expression receiver, String message, Expression arguments, boolean safe)Generates a single-argument method call with optional safe navigation. |
|
public void |
makeSiteEntry()Generates bytecode to load the call site array into a local variable. |
|
public void |
prepareCallSite(String message)Prepares a call-site entry for the named method on the bytecode operand stack, loading the call-site array and selecting the slot for message. |
|
protected void |
prepareSiteAndReceiver(Expression receiver, String methodName, boolean implicitThis, boolean lhs)Generates bytecode to prepare the call site and receiver for a method call. |
|
protected void |
visitBoxedArgument(Expression exp)Visits an argument expression and ensures it is boxed. |
Sentinel name for constructor calls.
Creates a call site writer with the given controller.
wc - the writer controllerGenerates a fallback call for attribute or property access.
expression - the property expressionobjectExpression - the object expressionname - the property nameadapter - the method caller adapterGenerates the call site array field and accessor methods.
Checks if any call sites have been used.
Generates a general method call through the call site infrastructure.
receiver - the receiver expressionmessage - the method namearguments - the arguments expressionsafe - whether to use safe navigationimplicitThis - whether the receiver is implicit 'this'callCurrent - whether to call on the current objectcallStatic - whether this is a static method callGenerates bytecode to initialize the call site array field to null.
Generates a general getProperty call.
receiver - the receiver expressionmethodName - the property namesafe - whether to use safe navigationimplicitThis - whether the receiver is implicit 'this'Generates a GroovyObject getProperty call.
receiver - the receiver expressionmethodName - the property namesafe - whether to use safe navigationimplicitThis - whether the receiver is implicit 'this'Generates a single-argument method call.
receiver - the receiver expressionmessage - the method namearguments - the argument expressionGenerates a single-argument method call with optional safe navigation.
receiver - the receiver expressionmessage - the method namearguments - the argument expressionsafe - whether to use safe navigationGenerates bytecode to load the call site array into a local variable.
Prepares a call-site entry for the named method on the bytecode operand stack,
loading the call-site array and selecting the slot for message.
message - the method name for which to prepare the call siteGenerates bytecode to prepare the call site and receiver for a method call.
receiver - the receiver expressionmethodName - the method nameimplicitThis - whether the receiver is implicit 'this'lhs - whether this is on the left-hand side of an assignmentVisits an argument expression and ensures it is boxed.
exp - the argument expressionCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.