Class CallSiteArray

java.lang.Object
org.codehaus.groovy.runtime.callsite.CallSiteArray

public final class CallSiteArray extends Object
Array of classic (non-invokedynamic) call sites for a compiled class.

Prefer invokedynamic call sites for new code. Planned for deprecation/removal in a future Groovy version.

  • Field Details

    • NOPARAM

      public static final Object[] NOPARAM
      Empty argument array shared by sites that pass no arguments.
    • array

      public final CallSite[] array
      Sites for owner, replaced in place when a site is specialized.
    • owner

      public final Class owner
      Class whose compiled call sites this array holds.
  • Constructor Details

  • Method Details

    • defaultCall

      public static Object defaultCall(CallSite callSite, Object receiver, Object[] args) throws Throwable
      Selects a site for receiver (null, a Class, a GroovyObject, or a plain object) and invokes it with args. A null receiver is not cached. Any other site is installed when the receiver's meta-class version stays unchanged while the site is created.
      Throws:
      Throwable
    • defaultCallCurrent

      public static Object defaultCallCurrent(CallSite callSite, GroovyObject receiver, Object[] args) throws Throwable
      Selects a callCurrent site for receiver, using the call-site array's owner as the sender, and invokes it with args. The site is installed when the receiver's meta-class version stays unchanged while the site is created.
      Throws:
      Throwable
    • defaultCallStatic

      public static Object defaultCallStatic(CallSite callSite, Class receiver, Object[] args) throws Throwable
      Forces receiver's static initializer to run, ignoring a failure to load the class, then selects a static site and invokes it with args. The site is installed when the meta-class version stays unchanged while the site is created.
      Throws:
      Throwable
    • defaultCallConstructor

      public static Object defaultCallConstructor(CallSite callSite, Object receiver, Object[] args) throws Throwable
      Treats receiver as the class to construct, selects a constructor site, and invokes it with args. The site is installed when the meta-class version stays unchanged while the site is created.
      Throws:
      Throwable