Top Description Fields Constructors Methods
org.jruby.runtime

public abstract Class CallSite

extends Object
Class Inheritance
Known Direct Subclasses
org.jruby.runtime.callsite.CachingCallSite, org.jruby.runtime.callsite.SuperCallSite
Imports
org.jruby.runtime.builtin.IRubyObject

This is the abstract superclass for all call sites in the system.

Field Summary

Modifier and TypeField and Description
protected final CallType
callType

The type of call this site makes

public final String
methodName

The method name this site calls and caches

Constructor Summary

AccessConstructor and Description
public
CallSite(String
the method name this site will call and cache
methodName
,
CallType
the type of call to perform (normal, functional, etc)
callType
)

Construct a new CallSite with the given method name and call type.

Method Summary

Modifier and TypeMethod and Description
public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
long
the literal long value to pass
fixnum
)

Call the site's method against the target object, passing a literal long value.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
double
the literal double value to pass
flote
)

Call the site's method against the target object, passing a literal double value.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
)

Call the site's method against the target object passing no args.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the argument to pass
arg0
)

Call the site's method against the target object passing one argument.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the first argument to pass
arg0
,
IRubyObject
the second argument to pass
arg1
)

Call the site's method against the target object passing two arguments.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the first argument to pass
arg0
,
IRubyObject
the second argument to pass
arg1
,
IRubyObject
the third argument to pass
arg2
)

Call the site's method against the target object passing two arguments.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject...
the arguments to pass
args
)

Call the site's method against the target object passing arguments.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
Block
the block argument to pass
block
)

Call the site's method against the target object passing no arguments and a non-literal (block pass, &) block.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the argument to pass
arg0
,
Block
the block argument to pass
block
)

Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the first argument to pass
arg0
,
IRubyObject
the second argument to pass
arg1
,
Block
the block argument to pass
block
)

Call the site's method against the target object passing two arguments and a non-literal (block pass, &) block.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the first argument to pass
arg0
,
IRubyObject
the second argument to pass
arg1
,
IRubyObject
the third argument to pass
arg2
,
Block
the block argument to pass
block
)

Call the site's method against the target object passing three arguments and a non-literal (block pass, &) block.

public abstract IRubyObject

Returns:

the result of the call
call
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject[]
the arguments to pass
args
,
Block
the block argument to pass
block
)

Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.

public abstract IRubyObject

Returns:

the result of the call
callIter
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
Block
the literal block to pass
block
)

Call the site's method against the target object passing no arguments and a literal block.

public abstract IRubyObject

Returns:

the result of the call
callIter
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the argument to pass
arg0
,
Block
the literal block to pass
block
)

Call the site's method against the target object passing one argument and a literal block.

public abstract IRubyObject

Returns:

the result of the call
callIter
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the first argument to pass
arg0
,
IRubyObject
the second argument to pass
arg1
,
Block
the literal block to pass
block
)

Call the site's method against the target object passing two arguments and a literal block.

public abstract IRubyObject

Returns:

the result of the call
callIter
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject
the first argument to pass
arg0
,
IRubyObject
the second argument to pass
arg1
,
IRubyObject
the third argument to pass
arg2
,
Block
the literal block to pass
block
)

Call the site's method against the target object passing three arguments and a literal block.

public abstract IRubyObject

Returns:

the result of the call
callIter
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject[]
the arguments to pass
args
,
Block
the literal block to pass
block
)

Call the site's method against the target object passing arguments and a literal block.

public abstract IRubyObject

Returns:

the result of the call
callVarargs
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject...
the arguments to pass
args
)

Call the site's method against the target object passing arguments.

public abstract IRubyObject

Returns:

the result of the call
callVarargs
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject[]
the arguments to pass
args
,
Block
the block argument to pass
block
)

Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.

public abstract IRubyObject

Returns:

the result of the call
callVarargsIter
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the caller, for visibility checks
caller
,
IRubyObject
the target object to call against
self
,
IRubyObject[]
the arguments to pass
args
,
Block
the literal block to pass
block
)

Call the site's method against the target object passing arguments and a literal block.

public IRubyObject

Returns:

the result of the call
fcall
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the target object to call against
self
,
long
the literal long value to pass
fixnum
)

Call the site's method against the target object, passing a literal long value.

public IRubyObject

Returns:

the result of the call
fcall
(ThreadContext
the ThreadContext for the current thread
context
,
IRubyObject
the target object to call against
self
,
double
the literal double value to pass
flote
)

Call the site's method against the target object, passing a literal double value.

public String

Returns:

an informational string representation of this CallSite
toString
()

Overrides java.lang.Object.toString.

Produce a string representation of this CallSite, for informational purposes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

callTypeback to summary
protected final CallType callType

The type of call this site makes

methodNameback to summary
public final String methodName

The method name this site calls and caches

Constructor Detail

CallSiteback to summary
public CallSite(String methodName, CallType callType)

Construct a new CallSite with the given method name and call type.

Parameters
methodName:String

the method name this site will call and cache

callType:CallType

the type of call to perform (normal, functional, etc)

See Also
org.jruby.runtime.CallType

Method Detail

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, long fixnum)

Call the site's method against the target object, passing a literal long value.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

fixnum:long

the literal long value to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, double flote)

Call the site's method against the target object, passing a literal double value.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

flote:double

the literal double value to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self)

Call the site's method against the target object passing no args.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0)

Call the site's method against the target object passing one argument.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the argument to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1)

Call the site's method against the target object passing two arguments.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the first argument to pass

arg1:IRubyObject

the second argument to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)

Call the site's method against the target object passing two arguments.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the first argument to pass

arg1:IRubyObject

the second argument to pass

arg2:IRubyObject

the third argument to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args)

Call the site's method against the target object passing arguments.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

args:IRubyObject[]

the arguments to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, Block block)

Call the site's method against the target object passing no arguments and a non-literal (block pass, &) block.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

block:Block

the block argument to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, Block block)

Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the argument to pass

block:Block

the block argument to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block)

Call the site's method against the target object passing two arguments and a non-literal (block pass, &) block.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the first argument to pass

arg1:IRubyObject

the second argument to pass

block:Block

the block argument to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

Call the site's method against the target object passing three arguments and a non-literal (block pass, &) block.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the first argument to pass

arg1:IRubyObject

the second argument to pass

arg2:IRubyObject

the third argument to pass

block:Block

the block argument to pass

Returns:IRubyObject

the result of the call

callback to summary
public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block)

Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

args:IRubyObject[]

the arguments to pass

block:Block

the block argument to pass

Returns:IRubyObject

the result of the call

callIterback to summary
public abstract IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, Block block)

Call the site's method against the target object passing no arguments and a literal block. This version handles break jumps by returning their value if this is the appropriate place in the call stack to do so.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

block:Block

the literal block to pass

Returns:IRubyObject

the result of the call

callIterback to summary
public abstract IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, Block block)

Call the site's method against the target object passing one argument and a literal block. This version handles break jumps by returning their value if this is the appropriate place in the call stack to do so.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the argument to pass

block:Block

the literal block to pass

Returns:IRubyObject

the result of the call

callIterback to summary
public abstract IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block)

Call the site's method against the target object passing two arguments and a literal block. This version handles break jumps by returning their value if this is the appropriate place in the call stack to do so.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the first argument to pass

arg1:IRubyObject

the second argument to pass

block:Block

the literal block to pass

Returns:IRubyObject

the result of the call

callIterback to summary
public abstract IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

Call the site's method against the target object passing three arguments and a literal block. This version handles break jumps by returning their value if this is the appropriate place in the call stack to do so.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

arg0:IRubyObject

the first argument to pass

arg1:IRubyObject

the second argument to pass

arg2:IRubyObject

the third argument to pass

block:Block

the literal block to pass

Returns:IRubyObject

the result of the call

callIterback to summary
public abstract IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block)

Call the site's method against the target object passing arguments and a literal block. This version handles break jumps by returning their value if this is the appropriate place in the call stack to do so.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

args:IRubyObject[]

the arguments to pass

block:Block

the literal block to pass

Returns:IRubyObject

the result of the call

callVarargsback to summary
public abstract IRubyObject callVarargs(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args)

Call the site's method against the target object passing arguments. As a "varargs" method, this will use the length of the args array to dispatch to the correct arity call, rather than dispatching unconditionally to the IRubyObject[] path.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

args:IRubyObject[]

the arguments to pass

Returns:IRubyObject

the result of the call

callVarargsback to summary
public abstract IRubyObject callVarargs(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block)

Call the site's method against the target object passing one argument and a non-literal (block pass, &) block. As a "varargs" method, this will use the length of the args array to dispatch to the correct arity call, rather than dispatching unconditionally to the IRubyObject[] path.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

args:IRubyObject[]

the arguments to pass

block:Block

the block argument to pass

Returns:IRubyObject

the result of the call

callVarargsIterback to summary
public abstract IRubyObject callVarargsIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block)

Call the site's method against the target object passing arguments and a literal block. This version handles break jumps by returning their value if this is the appropriate place in the call stack to do so. As a "varargs" method, this will use the length of the args array to dispatch to the correct arity call, rather than dispatching unconditionally to the IRubyObject[] path.

Parameters
context:ThreadContext

the ThreadContext for the current thread

caller:IRubyObject

the caller, for visibility checks

self:IRubyObject

the target object to call against

args:IRubyObject[]

the arguments to pass

block:Block

the literal block to pass

Returns:IRubyObject

the result of the call

fcallback to summary
public IRubyObject fcall(ThreadContext context, IRubyObject self, long fixnum)

Call the site's method against the target object, passing a literal long value. This version does not check visibility.

Parameters
context:ThreadContext

the ThreadContext for the current thread

self:IRubyObject

the target object to call against

fixnum:long

the literal long value to pass

Returns:IRubyObject

the result of the call

fcallback to summary
public IRubyObject fcall(ThreadContext context, IRubyObject self, double flote)

Call the site's method against the target object, passing a literal double value. This version does not check visibility.

Parameters
context:ThreadContext

the ThreadContext for the current thread

self:IRubyObject

the target object to call against

flote:double

the literal double value to pass

Returns:IRubyObject

the result of the call

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Produce a string representation of this CallSite, for informational purposes. Subclasses can override this to provide more information.

Returns:String

an informational string representation of this CallSite