org.jruby.internal.runtime.methods
Class JavaMethod
java.lang.Object
org.jruby.internal.runtime.methods.DynamicMethod
org.jruby.internal.runtime.methods.JavaMethod
- All Implemented Interfaces:
- java.lang.Cloneable, JumpTarget
- Direct Known Subclasses:
- CompiledMethod, JavaMethod.JavaMethodNoBlock, JavaMethod.JavaMethodOne, JavaMethod.JavaMethodOneBlock, JavaMethod.JavaMethodOneOrTwo, JavaMethod.JavaMethodOneOrTwoBlock, JavaMethod.JavaMethodOneOrTwoOrThree, JavaMethod.JavaMethodOneOrTwoOrThreeBlock, JavaMethod.JavaMethodThree, JavaMethod.JavaMethodThreeBlock, JavaMethod.JavaMethodTwo, JavaMethod.JavaMethodTwoBlock, JavaMethod.JavaMethodTwoOrThree, JavaMethod.JavaMethodZero, JavaMethod.JavaMethodZeroBlock, JavaMethod.JavaMethodZeroOrOne, JavaMethod.JavaMethodZeroOrOneBlock, JavaMethod.JavaMethodZeroOrOneOrTwo, JavaMethod.JavaMethodZeroOrOneOrTwoBlock, JavaMethod.JavaMethodZeroOrOneOrTwoOrThree, JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeBlock, MiniJava.AbstractJavaWrapperMethod, ReflectedJavaMethod, ReflectedJavaMultiMethod
public abstract class JavaMethod
- extends DynamicMethod
- implements JumpTarget, java.lang.Cloneable
Method Summary |
abstract IRubyObject |
call(ThreadContext context,
IRubyObject self,
RubyModule clazz,
java.lang.String name,
IRubyObject[] args,
Block block)
The minimum 'call' method required for a dynamic method handle. |
protected void |
callTrace(ThreadContext context,
java.lang.String name)
|
DynamicMethod |
dup()
Duplicate this method, returning DynamicMethod referencing the same code
and with the same attributes. |
java.lang.Class[] |
getArgumentTypes()
Deprecated. |
Arity |
getArity()
Retrieve the arity of this method, used for reporting arity to Ruby
code. |
java.lang.String |
getJavaName()
|
void |
init(RubyModule implementationClass,
Arity arity,
Visibility visibility,
StaticScope staticScope,
CallConfiguration callConfig)
|
boolean |
isNative()
Returns true if this method is backed by native (i.e. |
boolean |
isSingleton()
|
protected void |
postBacktraceAndScope(ThreadContext context)
|
protected void |
postBacktraceOnly(ThreadContext context)
|
protected void |
postFrameAndScope(ThreadContext context)
|
protected void |
postFrameOnly(ThreadContext context)
|
protected void |
postScopeOnly(ThreadContext context)
|
protected void |
preBacktraceAndScope(ThreadContext context,
java.lang.String name)
|
protected void |
preBacktraceOnly(ThreadContext context,
java.lang.String name)
|
protected void |
preFrameAndScope(ThreadContext context,
IRubyObject self,
java.lang.String name,
Block block)
|
protected void |
preFrameOnly(ThreadContext context,
IRubyObject self,
java.lang.String name,
Block block)
|
protected void |
preScopeOnly(ThreadContext context)
|
protected void |
returnTrace(ThreadContext context,
java.lang.String name)
|
void |
setArgumentTypes(java.lang.Class[] argumentTypes)
Deprecated. |
void |
setArity(Arity arity)
|
void |
setJavaName(java.lang.String javaName)
|
void |
setSingleton(boolean isSingleton)
|
Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod |
calculateProtectedClass, call, call, call, call, call, call, call, call, call, getCallConfig, getImplementationClass, getProtectedClass, getRealMethod, getVisibility, handleRedo, handleReturn, init, isCallableFrom, isUndefined, setCallConfig, setImplementationClass, setVisibility |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
arityValue
protected int arityValue
arity
protected Arity arity
staticScope
protected StaticScope staticScope
JavaMethod
public JavaMethod(RubyModule implementationClass,
Visibility visibility)
JavaMethod
public JavaMethod(RubyModule implementationClass,
Visibility visibility,
CallConfiguration callConfig,
StaticScope staticScope,
Arity arity)
JavaMethod
public JavaMethod(RubyModule implementationClass,
Visibility visibility,
int methodIndex)
JavaMethod
protected JavaMethod()
init
public void init(RubyModule implementationClass,
Arity arity,
Visibility visibility,
StaticScope staticScope,
CallConfiguration callConfig)
call
public abstract IRubyObject call(ThreadContext context,
IRubyObject self,
RubyModule clazz,
java.lang.String name,
IRubyObject[] args,
Block block)
- Description copied from class:
DynamicMethod
- The minimum 'call' method required for a dynamic method handle.
Subclasses must impleemnt this method, but may implement the other
signatures to provide faster, non-boxing call paths. Typically
subclasses will implement this method to check variable arity calls,
then performing a specific-arity invocation to the appropriate method
or performing variable-arity logic in-line.
- Specified by:
call
in class DynamicMethod
- Parameters:
context
- The thread context for the currently executing threadself
- The 'self' or 'receiver' object to use for this callname
- The incoming name used to invoke this methodargs
- The argument list to this invocationblock
- The block passed to this invocation
- Returns:
- The result of the call
dup
public DynamicMethod dup()
- Description copied from class:
DynamicMethod
- Duplicate this method, returning DynamicMethod referencing the same code
and with the same attributes.
It is not required that this method produce a new object if the
semantics of the DynamicMethod subtype do not require such.
- Specified by:
dup
in class DynamicMethod
- Returns:
- An identical DynamicMethod object to the target.
preFrameAndScope
protected final void preFrameAndScope(ThreadContext context,
IRubyObject self,
java.lang.String name,
Block block)
preFrameOnly
protected final void preFrameOnly(ThreadContext context,
IRubyObject self,
java.lang.String name,
Block block)
preScopeOnly
protected final void preScopeOnly(ThreadContext context)
preBacktraceOnly
protected final void preBacktraceOnly(ThreadContext context,
java.lang.String name)
preBacktraceAndScope
protected final void preBacktraceAndScope(ThreadContext context,
java.lang.String name)
postFrameAndScope
protected final void postFrameAndScope(ThreadContext context)
postFrameOnly
protected final void postFrameOnly(ThreadContext context)
postScopeOnly
protected final void postScopeOnly(ThreadContext context)
postBacktraceOnly
protected final void postBacktraceOnly(ThreadContext context)
postBacktraceAndScope
protected final void postBacktraceAndScope(ThreadContext context)
callTrace
protected final void callTrace(ThreadContext context,
java.lang.String name)
returnTrace
protected final void returnTrace(ThreadContext context,
java.lang.String name)
setArity
public void setArity(Arity arity)
getArity
public Arity getArity()
- Description copied from class:
DynamicMethod
- Retrieve the arity of this method, used for reporting arity to Ruby
code. This arity may or may not reflect the actual specific or variable
arities of the referenced method.
- Overrides:
getArity
in class DynamicMethod
- Returns:
- The arity of the method, as reported to Ruby consumers.
setArgumentTypes
@Deprecated
public void setArgumentTypes(java.lang.Class[] argumentTypes)
- Deprecated.
getArgumentTypes
@Deprecated
public java.lang.Class[] getArgumentTypes()
- Deprecated.
setJavaName
public void setJavaName(java.lang.String javaName)
getJavaName
public java.lang.String getJavaName()
setSingleton
public void setSingleton(boolean isSingleton)
isSingleton
public boolean isSingleton()
isNative
public boolean isNative()
- Description copied from class:
DynamicMethod
- Returns true if this method is backed by native (i.e. Java) code.
- Overrides:
isNative
in class DynamicMethod
- Returns:
- true If backed by Java code or JVM bytecode; false otherwise
Copyright © 2002-2007 JRuby Team. All Rights Reserved.