Package: org.codehaus.groovy.classgen.asm.sc

## [Java] Class StaticTypesCallSiteWriter

- org.codehaus.groovy.classgen.asm.sc.StaticTypesCallSiteWriter

-     public class StaticTypesCallSiteWriter
      extends CallSiteWriter

  A call site writer which replaces call site caching with static calls. This means that the generated code looks more like Java code than dynamic Groovy code. Best effort is made to use JVM instructions instead of calls to helper methods.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class CallSiteWriter` | `CONSTRUCTOR`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `StaticTypesCallSiteWriter(StaticTypesWriterController controller)` Creates a call-site writer for statically compiled property and operator access.

  - ### Methods Summary

    Methods
    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. * * Parameters: `expression` - the property expression * `objectExpression` - the object expression * `name` - the property name * `adapter` - the method caller adapter
    `` | `public void` | `generateCallSiteArray()` * Generates the call site array field and accessor methods.
    `` | `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. * * Parameters: `receiver` - the receiver expression * `message` - the method name * `arguments` - the arguments expression * `safe` - whether to use safe navigation * `implicitThis` - whether the receiver is implicit 'this' * `callCurrent` - whether to call on the current object * `callStatic` - whether this is a static method call
    `` | `public void` | `makeCallSiteArrayInitializer()` * Generates bytecode to initialize the call site array field to null.
    `` | `public void` | `makeGetPropertySite(Expression receiver, String propertyName, boolean safe, boolean implicitThis)` * Generates a general getProperty call. * * Parameters: `receiver` - the receiver expression * `methodName` - the property name * `safe` - whether to use safe navigation * `implicitThis` - whether the receiver is implicit 'this'
    `` | `public void` | `makeGroovyObjectGetPropertySite(Expression receiver, String propertyName, boolean safe, boolean implicitThis)` * Generates a GroovyObject getProperty call. * * Parameters: `receiver` - the receiver expression * `methodName` - the property name * `safe` - whether to use safe navigation * `implicitThis` - whether the receiver is implicit 'this'
    `` | `public void` | `makeSingleArgumentCall(Expression receiver, String message, Expression argument, boolean safe)` * Generates a single-argument method call with optional safe navigation. * * Parameters: `receiver` - the receiver expression * `message` - the method name * `arguments` - the argument expression * `safe` - whether to use 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`. * * Parameters: `message` - the method name for which to prepare the call site

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CallSiteWriter` | `fallbackAttributeOrPropertySite, generateCallSiteArray, getCallSites, hasCallSiteUse, makeCallSite, makeCallSiteArrayInitializer, makeGetPropertySite, makeGroovyObjectGetPropertySite, makeSingleArgumentCall, makeSingleArgumentCall, makeSiteEntry, prepareCallSite, prepareSiteAndReceiver, visitBoxedArgument`

- - ### Constructor Detail

    - #### public StaticTypesCallSiteWriter(StaticTypesWriterController controller)

      Creates a call-site writer for statically compiled property and operator access.

  - ### Method Detail

    - #### public void fallbackAttributeOrPropertySite(PropertyExpression expression, Expression objectExpression, String name, MethodCallerMultiAdapter adapter)

      * Generates a fallback call for attribute or property access. * *

      Parameters:
        `expression` - the property expression *
        `objectExpression` - the object expression *
        `name` - the property name *
        `adapter` - the method caller adapter

    - #### public void generateCallSiteArray()

      * Generates the call site array field and accessor methods.

    - #### 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. * *

      Parameters:
        `receiver` - the receiver expression *
        `message` - the method name *
        `arguments` - the arguments expression *
        `safe` - whether to use safe navigation *
        `implicitThis` - whether the receiver is implicit 'this' *
        `callCurrent` - whether to call on the current object *
        `callStatic` - whether this is a static method call

    - #### public void makeCallSiteArrayInitializer()

      * Generates bytecode to initialize the call site array field to null.

    - #### public void makeGetPropertySite(Expression receiver, String propertyName, boolean safe, boolean implicitThis)

      * Generates a general getProperty call. * *

      Parameters:
        `receiver` - the receiver expression *
        `methodName` - the property name *
        `safe` - whether to use safe navigation *
        `implicitThis` - whether the receiver is implicit 'this'

    - #### public void makeGroovyObjectGetPropertySite(Expression receiver, String propertyName, boolean safe, boolean implicitThis)

      * Generates a GroovyObject getProperty call. * *

      Parameters:
        `receiver` - the receiver expression *
        `methodName` - the property name *
        `safe` - whether to use safe navigation *
        `implicitThis` - whether the receiver is implicit 'this'

    - #### public void makeSingleArgumentCall(Expression receiver, String message, Expression argument, boolean safe)

      * Generates a single-argument method call with optional safe navigation. * *

      Parameters:
        `receiver` - the receiver expression *
        `message` - the method name *
        `arguments` - the argument expression *
        `safe` - whether to use 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`. * *

      Parameters:
        `message` - the method name for which to prepare the call site