Class IndyCallSiteWriter

java.lang.Object
org.codehaus.groovy.classgen.asm.CallSiteWriter
org.codehaus.groovy.classgen.asm.indy.IndyCallSiteWriter

public class IndyCallSiteWriter extends CallSiteWriter
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.
  • Constructor Details

    • IndyCallSiteWriter

      public IndyCallSiteWriter(WriterController controller)
      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:
      generateCallSiteArray in class CallSiteWriter
    • 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:
      makeCallSite in class CallSiteWriter
      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
    • makeSingleArgumentCall

      public void makeSingleArgumentCall(Expression receiver, String message, Expression arguments, boolean safe)
      Generates a single-argument method call with optional safe navigation.
      Overrides:
      makeSingleArgumentCall in class CallSiteWriter
      Parameters:
      receiver - the receiver expression
      message - the method name
      arguments - the argument expression
      safe - whether to use safe navigation
    • prepareCallSite

      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.
      Overrides:
      prepareCallSite in class CallSiteWriter
      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:
      makeSiteEntry in class CallSiteWriter
    • makeCallSiteArrayInitializer

      public void makeCallSiteArrayInitializer()
      Generates bytecode to initialize the call site array field to null.
      Overrides:
      makeCallSiteArrayInitializer in class CallSiteWriter
    • makeGetPropertySite

      public void makeGetPropertySite(Expression receiver, String name, boolean safe, boolean implicitThis)
      Generates a general getProperty call.
      Overrides:
      makeGetPropertySite in class CallSiteWriter
      Parameters:
      receiver - the receiver expression
      name - the property name
      safe - whether to use safe navigation
      implicitThis - whether the receiver is implicit 'this'
    • makeGroovyObjectGetPropertySite

      public void makeGroovyObjectGetPropertySite(Expression receiver, String name, boolean safe, boolean implicitThis)
      Generates a GroovyObject getProperty call.
      Overrides:
      makeGroovyObjectGetPropertySite in class CallSiteWriter
      Parameters:
      receiver - the receiver expression
      name - the property name
      safe - whether to use safe navigation
      implicitThis - whether the receiver is implicit 'this'