Class CallSiteArray
java.lang.Object
org.codehaus.groovy.runtime.callsite.CallSiteArray
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCallSiteArray(Class owner, String[] names) Builds oneAbstractCallSiteper entry ofnames, in order. -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectdefaultCall(CallSite callSite, Object receiver, Object[] args) Selects a site forreceiver(null, aClass, aGroovyObject, or a plain object) and invokes it withargs.static ObjectdefaultCallConstructor(CallSite callSite, Object receiver, Object[] args) Treatsreceiveras the class to construct, selects a constructor site, and invokes it withargs.static ObjectdefaultCallCurrent(CallSite callSite, GroovyObject receiver, Object[] args) Selects acallCurrentsite forreceiver, using the call-site array's owner as the sender, and invokes it withargs.static ObjectdefaultCallStatic(CallSite callSite, Class receiver, Object[] args) Forcesreceiver's static initializer to run, ignoring a failure to load the class, then selects a static site and invokes it withargs.
-
Field Details
-
NOPARAM
Empty argument array shared by sites that pass no arguments. -
array
Sites forowner, replaced in place when a site is specialized. -
owner
Class whose compiled call sites this array holds.
-
-
Constructor Details
-
CallSiteArray
Builds oneAbstractCallSiteper entry ofnames, in order.
-
-
Method Details
-
defaultCall
public static Object defaultCall(CallSite callSite, Object receiver, Object[] args) throws Throwable Selects a site forreceiver(null, aClass, aGroovyObject, or a plain object) and invokes it withargs. 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 acallCurrentsite forreceiver, using the call-site array's owner as the sender, and invokes it withargs. 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 Forcesreceiver's static initializer to run, ignoring a failure to load the class, then selects a static site and invokes it withargs. 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 Treatsreceiveras the class to construct, selects a constructor site, and invokes it withargs. The site is installed when the meta-class version stays unchanged while the site is created.- Throws:
Throwable
-