org.jruby.runtime.callsite
Class CachingCallSite

java.lang.Object
  extended by org.jruby.runtime.CallSite
      extended by org.jruby.runtime.callsite.CachingCallSite
Direct Known Subclasses:
FunctionalCachingCallSite, NormalCachingCallSite, VariableCachingCallSite

public abstract class CachingCallSite
extends CallSite


Field Summary
protected  CacheEntry cache
           
static int totalCallSites
           
 
Fields inherited from class org.jruby.runtime.CallSite
callType, methodName
 
Constructor Summary
CachingCallSite(java.lang.String methodName, CallType callType)
           
 
Method Summary
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, Block block, IRubyObject[] args, ThreadContext context, IRubyObject self)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, Block block, ThreadContext context, IRubyObject self)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, Block block, ThreadContext context, IRubyObject self, IRubyObject arg)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, Block block, ThreadContext context, IRubyObject self, IRubyObject arg1, IRubyObject arg2)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, Block block, ThreadContext context, IRubyObject self, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, IRubyObject[] args, ThreadContext context, IRubyObject self)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, ThreadContext context, IRubyObject self)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, ThreadContext context, IRubyObject self, IRubyObject arg)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, ThreadContext context, IRubyObject self, IRubyObject arg1, IRubyObject arg2)
           
protected  IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, ThreadContext context, IRubyObject self, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)
           
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self)
          Call the site's method against the target object passing no args.
 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.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, double flote)
          Call the site's method against the target object, passing a literal double value.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args)
          Call the site's method against the target object passing arguments.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1)
          Call the site's method against the target object passing one argument.
 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.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, Block block)
          Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, IRubyObject arg2)
          Call the site's method against the target object passing two arguments.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, IRubyObject arg2, Block block)
          Call the site's method against the target object passing two arguments and a non-literal (block pass, &) block.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)
          Call the site's method against the target object passing two arguments.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block)
          Call the site's method against the target object passing three arguments and a non-literal (block pass, &) block.
 IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, long fixnum)
          Call the site's method against the target object, passing a literal long value.
 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.
 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.
 IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, Block block)
          Call the site's method against the target object passing one argument and a literal block.
 IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, IRubyObject arg2, Block block)
          Call the site's method against the target object passing two arguments and a literal block.
 IRubyObject callIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block)
          Call the site's method against the target object passing three arguments and a literal block.
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, Block block)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject arg)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject[] args)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject[] args, Block block)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject arg0, Block block)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject arg0, IRubyObject arg1)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject arg0, IRubyObject arg1, Block block)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
           
protected  IRubyObject callMethodMissing(ThreadContext context, IRubyObject self, DynamicMethod method, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
           
 CacheEntry getCache()
           
 int getCachedClassIndex()
           
 long getCachedMethodSerial()
           
 java.lang.String getMethodName()
           
 boolean isOptimizable()
           
protected abstract  boolean methodMissing(DynamicMethod method, IRubyObject caller)
           
protected  void updateCache(CacheEntry newEntry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected CacheEntry cache

totalCallSites

public static volatile int totalCallSites
Constructor Detail

CachingCallSite

public CachingCallSite(java.lang.String methodName,
                       CallType callType)
Method Detail

getCache

public CacheEntry getCache()

isOptimizable

public boolean isOptimizable()

getCachedClassIndex

public int getCachedClassIndex()

getMethodName

public java.lang.String getMethodName()

getCachedMethodSerial

public long getCachedMethodSerial()

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        long fixnum)
Description copied from class: CallSite
Call the site's method against the target object, passing a literal long value.

Specified by:
call in class CallSite
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

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        double flote)
Description copied from class: CallSite
Call the site's method against the target object, passing a literal double value.

Specified by:
call in class CallSite
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

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject... args)
Description copied from class: CallSite
Call the site's method against the target object passing arguments.

Specified by:
call in class CallSite
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 IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject[] args,
                        Block block)
Description copied from class: CallSite
Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.

Specified by:
call in class CallSite
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 IRubyObject callIter(ThreadContext context,
                            IRubyObject caller,
                            IRubyObject self,
                            IRubyObject[] args,
                            Block block)
Description copied from class: CallSite
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.

Specified by:
callIter in class CallSite
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

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self)
Description copied from class: CallSite
Call the site's method against the target object passing no args.

Specified by:
call in class CallSite
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 IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        Block block)
Description copied from class: CallSite
Call the site's method against the target object passing no arguments and a non-literal (block pass, &) block.

Specified by:
call in class CallSite
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

callIter

public IRubyObject callIter(ThreadContext context,
                            IRubyObject caller,
                            IRubyObject self,
                            Block block)
Description copied from class: CallSite
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.

Specified by:
callIter in class CallSite
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

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject arg1)
Description copied from class: CallSite
Call the site's method against the target object passing one argument.

Specified by:
call in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the argument to pass
Returns:
the result of the call

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject arg1,
                        Block block)
Description copied from class: CallSite
Call the site's method against the target object passing one argument and a non-literal (block pass, &) block.

Specified by:
call in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the argument to pass
block - the block argument to pass
Returns:
the result of the call

callIter

public IRubyObject callIter(ThreadContext context,
                            IRubyObject caller,
                            IRubyObject self,
                            IRubyObject arg1,
                            Block block)
Description copied from class: CallSite
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.

Specified by:
callIter in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the argument to pass
block - the literal block to pass
Returns:
the result of the call

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject arg1,
                        IRubyObject arg2)
Description copied from class: CallSite
Call the site's method against the target object passing two arguments.

Specified by:
call in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the first argument to pass
arg2 - the second argument to pass
Returns:
the result of the call

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        Block block)
Description copied from class: CallSite
Call the site's method against the target object passing two arguments and a non-literal (block pass, &) block.

Specified by:
call in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the first argument to pass
arg2 - the second argument to pass
block - the block argument to pass
Returns:
the result of the call

callIter

public IRubyObject callIter(ThreadContext context,
                            IRubyObject caller,
                            IRubyObject self,
                            IRubyObject arg1,
                            IRubyObject arg2,
                            Block block)
Description copied from class: CallSite
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.

Specified by:
callIter in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the first argument to pass
arg2 - the second argument to pass
block - the literal block to pass
Returns:
the result of the call

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3)
Description copied from class: CallSite
Call the site's method against the target object passing two arguments.

Specified by:
call in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the first argument to pass
arg2 - the second argument to pass
arg3 - the third argument to pass
Returns:
the result of the call

call

public IRubyObject call(ThreadContext context,
                        IRubyObject caller,
                        IRubyObject self,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        Block block)
Description copied from class: CallSite
Call the site's method against the target object passing three arguments and a non-literal (block pass, &) block.

Specified by:
call in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the first argument to pass
arg2 - the second argument to pass
block - the block argument to pass
Returns:
the result of the call

callIter

public IRubyObject callIter(ThreadContext context,
                            IRubyObject caller,
                            IRubyObject self,
                            IRubyObject arg1,
                            IRubyObject arg2,
                            IRubyObject arg3,
                            Block block)
Description copied from class: CallSite
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.

Specified by:
callIter in class CallSite
Parameters:
context - the ThreadContext for the current thread
caller - the caller, for visibility checks
self - the target object to call against
arg1 - the first argument to pass
arg2 - the second argument to pass
arg3 - the third argument to pass
block - the literal block to pass
Returns:
the result of the call

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   Block block,
                                   IRubyObject[] args,
                                   ThreadContext context,
                                   IRubyObject self)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   IRubyObject[] args,
                                   ThreadContext context,
                                   IRubyObject self)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   ThreadContext context,
                                   IRubyObject self)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   Block block,
                                   ThreadContext context,
                                   IRubyObject self)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   ThreadContext context,
                                   IRubyObject self,
                                   IRubyObject arg)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   Block block,
                                   ThreadContext context,
                                   IRubyObject self,
                                   IRubyObject arg)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   ThreadContext context,
                                   IRubyObject self,
                                   IRubyObject arg1,
                                   IRubyObject arg2)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   Block block,
                                   ThreadContext context,
                                   IRubyObject self,
                                   IRubyObject arg1,
                                   IRubyObject arg2)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   ThreadContext context,
                                   IRubyObject self,
                                   IRubyObject arg1,
                                   IRubyObject arg2,
                                   IRubyObject arg3)

cacheAndCall

protected IRubyObject cacheAndCall(IRubyObject caller,
                                   RubyClass selfType,
                                   Block block,
                                   ThreadContext context,
                                   IRubyObject self,
                                   IRubyObject arg1,
                                   IRubyObject arg2,
                                   IRubyObject arg3)

updateCache

protected void updateCache(CacheEntry newEntry)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject[] args)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        Block block)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject arg)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject[] args,
                                        Block block)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject arg0,
                                        Block block)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject arg0,
                                        IRubyObject arg1)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject arg0,
                                        IRubyObject arg1,
                                        Block block)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject arg0,
                                        IRubyObject arg1,
                                        IRubyObject arg2)

callMethodMissing

protected IRubyObject callMethodMissing(ThreadContext context,
                                        IRubyObject self,
                                        DynamicMethod method,
                                        IRubyObject arg0,
                                        IRubyObject arg1,
                                        IRubyObject arg2,
                                        Block block)

methodMissing

protected abstract boolean methodMissing(DynamicMethod method,
                                         IRubyObject caller)


Copyright © 2002-2009 JRuby Team. All Rights Reserved.