Package org.jruby.runtime
Class CallSite
java.lang.Object
org.jruby.runtime.CallSite
- Direct Known Subclasses:
CachingCallSite
,SuperCallSite
This is the abstract superclass for all call sites in the system.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract IRubyObject
call
(ThreadContext context, IRubyObject caller, IRubyObject self) Call the site's method against the target object passing no args.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.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.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.abstract IRubyObject
call
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0) Call the site's method against the target object passing one argument.abstract IRubyObject
call
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args) Call the site's method against the target object passing arguments.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.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.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.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.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.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.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.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.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.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.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.abstract IRubyObject
callVarargs
(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args) Call the site's method against the target object passing arguments.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.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.fcall
(ThreadContext context, IRubyObject self, double flote) Call the site's method against the target object, passing a literal double value.fcall
(ThreadContext context, IRubyObject self, long fixnum) Call the site's method against the target object, passing a literal long value.toString()
Produce a string representation of this CallSite, for informational purposes.
-
Field Details
-
methodName
The method name this site calls and caches -
callType
The type of call this site makes
-
-
Constructor Details
-
CallSite
Construct a new CallSite with the given method name and call type.- Parameters:
methodName
- the method name this site will call and cachecallType
- the type of call to perform (normal, functional, etc)- See Also:
-
-
Method Details
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstfixnum
- the literal long value to pass- Returns:
- the result of the call
-
fcall
Call the site's method against the target object, passing a literal long value. This version does not check visibility.- Parameters:
context
- the ThreadContext for the current threadself
- the target object to call againstfixnum
- the literal long value to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstflote
- the literal double value to pass- Returns:
- the result of the call
-
fcall
Call the site's method against the target object, passing a literal double value. This version does not check visibility.- Parameters:
context
- the ThreadContext for the current threadself
- the target object to call againstflote
- the literal double value to pass- Returns:
- the result of the call
-
call
Call the site's method against the target object passing no args.- Parameters:
context
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call against- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the argument to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the first argument to passarg1
- the second argument to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the first argument to passarg1
- the second argument to passarg2
- the third argument to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstargs
- the arguments to pass- Returns:
- the result of the call
-
callVarargs
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstargs
- the arguments to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstblock
- the block argument to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the argument to passblock
- the block argument to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the first argument to passarg1
- the second argument to passblock
- the block argument to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the first argument to passarg1
- the second argument to passarg2
- the third argument to passblock
- the block argument to pass- Returns:
- the result of the call
-
call
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstargs
- the arguments to passblock
- the block argument to pass- Returns:
- the result of the call
-
callVarargs
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstargs
- the arguments to passblock
- the block argument to pass- Returns:
- the result of the call
-
callIter
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstblock
- the literal block to pass- Returns:
- the result of the call
-
callIter
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the argument to passblock
- the literal block to pass- Returns:
- the result of the call
-
callIter
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the first argument to passarg1
- the second argument to passblock
- the literal block to pass- Returns:
- the result of the call
-
callIter
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstarg0
- the first argument to passarg1
- the second argument to passarg2
- the third argument to passblock
- the literal block to pass- Returns:
- the result of the call
-
callIter
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstargs
- the arguments to passblock
- the literal block to pass- Returns:
- the result of the call
-
callVarargsIter
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
- the ThreadContext for the current threadcaller
- the caller, for visibility checksself
- the target object to call againstargs
- the arguments to passblock
- the literal block to pass- Returns:
- the result of the call
-
toString
Produce a string representation of this CallSite, for informational purposes. Subclasses can override this to provide more information.
-