Class CallSite

java.lang.Object
org.jruby.runtime.CallSite
Direct Known Subclasses:
CachingCallSite, SuperCallSite

public abstract class CallSite extends Object
This is the abstract superclass for all call sites in the system.
  • Field Details

    • methodName

      public final String methodName
      The method name this site calls and caches
    • callType

      protected final CallType callType
      The type of call this site makes
  • Constructor Details

    • CallSite

      public CallSite(String methodName, CallType callType)
      Construct a new CallSite with the given method name and call type.
      Parameters:
      methodName - the method name this site will call and cache
      callType - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      fixnum - the literal long value to pass
      Returns:
      the result of the call
    • fcall

      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 - the ThreadContext for the current thread
      self - the target object to call against
      fixnum - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      flote - the literal double value to pass
      Returns:
      the result of the call
    • fcall

      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 - the ThreadContext for the current thread
      self - the target object to call against
      flote - the literal double value to pass
      Returns:
      the result of the call
    • call

      public abstract IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self)
      Call the site's method against the target object passing no args.
      Parameters:
      context - the ThreadContext for the current thread
      caller - the caller, for visibility checks
      self - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the first argument to pass
      arg1 - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the first argument to pass
      arg1 - the second argument to pass
      arg2 - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      args - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      args - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the argument to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the first argument to pass
      arg1 - the second argument to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the first argument to pass
      arg1 - the second argument to pass
      arg2 - the third argument to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      args - the arguments to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      args - the arguments to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the argument to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the first argument to pass
      arg1 - the second argument to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      arg0 - the first argument to pass
      arg1 - the second argument to pass
      arg2 - the third argument to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      args - the arguments to pass
      block - 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 thread
      caller - the caller, for visibility checks
      self - the target object to call against
      args - the arguments to pass
      block - the literal block to pass
      Returns:
      the result of the call
    • toString

      public String toString()
      Produce a string representation of this CallSite, for informational purposes. Subclasses can override this to provide more information.
      Overrides:
      toString in class Object
      Returns:
      an informational string representation of this CallSite