Class IndyCallSiteWriter
java.lang.Object
org.codehaus.groovy.classgen.asm.CallSiteWriter
org.codehaus.groovy.classgen.asm.indy.IndyCallSiteWriter
Dummy class used by the indy implementation.
This class mostly contains empty stubs for calls to the call site writer,
since this class is normally used to prepare call site caching and in indy
call site caching is done by the jvm.
-
Field Summary
Fields inherited from class org.codehaus.groovy.classgen.asm.CallSiteWriter
CONSTRUCTOR -
Constructor Summary
ConstructorsConstructorDescriptionIndyCallSiteWriter(WriterController controller) Creates a call-site writer that delegates property access to indy bytecode. -
Method Summary
Modifier and TypeMethodDescriptionvoidGenerates the call site array field and accessor methods.voidmakeCallSite(Expression receiver, String message, Expression arguments, boolean safe, boolean implicitThis, boolean callCurrent, boolean callStatic) Generates a general method call through the call site infrastructure.voidGenerates bytecode to initialize the call site array field to null.voidmakeGetPropertySite(Expression receiver, String name, boolean safe, boolean implicitThis) Generates a general getProperty call.voidmakeGroovyObjectGetPropertySite(Expression receiver, String name, boolean safe, boolean implicitThis) Generates a GroovyObject getProperty call.voidmakeSingleArgumentCall(Expression receiver, String message, Expression arguments, boolean safe) Generates a single-argument method call with optional safe navigation.voidGenerates bytecode to load the call site array into a local variable.voidprepareCallSite(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 formessage.Methods inherited from class org.codehaus.groovy.classgen.asm.CallSiteWriter
fallbackAttributeOrPropertySite, getCallSites, hasCallSiteUse, makeSingleArgumentCall, prepareSiteAndReceiver, visitBoxedArgument
-
Constructor Details
-
IndyCallSiteWriter
Creates a call-site writer that delegates property access to indy bytecode.
-
-
Method Details
-
generateCallSiteArray
public void generateCallSiteArray()Generates the call site array field and accessor methods.- Overrides:
generateCallSiteArrayin classCallSiteWriter
-
makeCallSite
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.- Overrides:
makeCallSitein classCallSiteWriter- Parameters:
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 call
-
makeSingleArgumentCall
public void makeSingleArgumentCall(Expression receiver, String message, Expression arguments, boolean safe) Generates a single-argument method call with optional safe navigation.- Overrides:
makeSingleArgumentCallin classCallSiteWriter- Parameters:
receiver- the receiver expressionmessage- the method namearguments- the argument expressionsafe- whether to use safe navigation
-
prepareCallSite
Prepares a call-site entry for the named method on the bytecode operand stack, loading the call-site array and selecting the slot formessage.- Overrides:
prepareCallSitein classCallSiteWriter- Parameters:
message- the method name for which to prepare the call site
-
makeSiteEntry
public void makeSiteEntry()Generates bytecode to load the call site array into a local variable.- Overrides:
makeSiteEntryin classCallSiteWriter
-
makeCallSiteArrayInitializer
public void makeCallSiteArrayInitializer()Generates bytecode to initialize the call site array field to null.- Overrides:
makeCallSiteArrayInitializerin classCallSiteWriter
-
makeGetPropertySite
public void makeGetPropertySite(Expression receiver, String name, boolean safe, boolean implicitThis) Generates a general getProperty call.- Overrides:
makeGetPropertySitein classCallSiteWriter- Parameters:
receiver- the receiver expressionname- the property namesafe- whether to use safe navigationimplicitThis- whether the receiver is implicit 'this'
-
makeGroovyObjectGetPropertySite
public void makeGroovyObjectGetPropertySite(Expression receiver, String name, boolean safe, boolean implicitThis) Generates a GroovyObject getProperty call.- Overrides:
makeGroovyObjectGetPropertySitein classCallSiteWriter- Parameters:
receiver- the receiver expressionname- the property namesafe- whether to use safe navigationimplicitThis- whether the receiver is implicit 'this'
-