Class DelegatingDynamicMethod
java.lang.Object
org.jruby.internal.runtime.methods.DynamicMethod
org.jruby.internal.runtime.methods.DelegatingDynamicMethod
- Direct Known Subclasses:
ProfilingDynamicMethod,SynchronizedDynamicMethod
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.internal.runtime.methods.DynamicMethod
DynamicMethod.NativeCall, DynamicMethod.Version -
Field Summary
FieldsFields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
aliasCount, definedClass, flags, handle, implementationClass, name, protectedClass, serialNumber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(ThreadContext context, IRubyObject self, RubyModule klazz, String name) call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, Block block) call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg) call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args) A default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) The minimum 'call' method required for a dynamic method handle.call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, Block block) call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2) call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, Block block) call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) abstract DynamicMethoddup()Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.booleangetArity()Deprecated.Get the "handle" associated with this DynamicMethod.Retrieve the class or module on which this method is implemented, used for 'super' logic among others.Additional metadata about this method.getName()Get the base name this method was defined as.protected RubyModuleRetrieve the pre-calculated "protected class" used for access checks.Get the "real" method contained within this method.longGet the global serial number for this method objectRetrieve the signature of this method.Get the visibility of this method.inthashCode()booleanWhether this method is a builtin method, i.e.booleanisCallableFrom(IRubyObject caller, CallType callType) Determine whether this method is callable from the given object using the given call type.booleanisImplementedBy(RubyModule other) booleanisNative()Returns true if this method is backed by native (i.e.booleanWhether this method is "not implemented".booleanvoidSet the "handle" associated with this DynamicMethod.voidsetImplementationClass(RubyModule implClass) Set the class on which this method is implemented, used for 'super' logic, among others.voidsetIsBuiltin(boolean isBuiltin) Force this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.voidsetNotImplemented(boolean setNotImplemented) Set whether this method is "not implemented".voidsetVisibility(Visibility visibility) Set the visibility of this method.Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
adjustAliasCount, calculateProtectedClass, callRespondTo, getAliasCount, getCallConfig, getDefinedClass, init, init, isNull, isUndefined, setCallConfig, setDefinedClass, setRuby2Keywords
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegatingDynamicMethod
-
-
Method Details
-
getDelegate
-
call
- Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg) - Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2) - Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) - Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args) Description copied from class:DynamicMethodA default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.- Overrides:
callin classDynamicMethod- Parameters:
context- The thread context for the currently executing threadself- The 'self' or 'receiver' object to use for this callklazz- The Ruby class against which this method is bindingname- The incoming name used to invoke this methodargs- The first argument to this invocation- Returns:
- The result of the call
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, Block block) - Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, Block block) - Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, Block block) - Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) - Overrides:
callin classDynamicMethod
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) Description copied from class:DynamicMethodThe minimum 'call' method required for a dynamic method handle. Subclasses must implement 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:
callin classDynamicMethod- Parameters:
context- The thread context for the currently executing threadself- The 'self' or 'receiver' object to use for this callklazz- The Ruby class against which this method is bindingname- 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
-
setVisibility
Description copied from class:DynamicMethodSet the visibility of this method.- Overrides:
setVisibilityin classDynamicMethod- Parameters:
visibility- The visibility of this method
-
setIsBuiltin
public void setIsBuiltin(boolean isBuiltin) Description copied from class:DynamicMethodForce this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.- Overrides:
setIsBuiltinin classDynamicMethod- Parameters:
isBuiltin- true if this is a core built-in method, false otherwise
-
setImplementationClass
Description copied from class:DynamicMethodSet the class on which this method is implemented, used for 'super' logic, among others.- Overrides:
setImplementationClassin classDynamicMethod- Parameters:
implClass- The class on which this method is implemented
-
isNative
public boolean isNative()Description copied from class:DynamicMethodReturns true if this method is backed by native (i.e. Java) code.- Overrides:
isNativein classDynamicMethod- Returns:
- true If backed by Java code or JVM bytecode; false otherwise
-
isCallableFrom
Description copied from class:DynamicMethodDetermine whether this method is callable from the given object using the given call type.- Overrides:
isCallableFromin classDynamicMethod- Parameters:
caller- The calling objectcallType- The type of call- Returns:
- true if the call would not violate visibility; false otherwise
-
isBuiltin
public boolean isBuiltin()Description copied from class:DynamicMethodWhether this method is a builtin method, i.e. a method built-in to JRuby and loaded during its core boot process.- Overrides:
isBuiltinin classDynamicMethod- Returns:
- true if this is a core built-in method, false otherwise
-
getVisibility
Description copied from class:DynamicMethodGet the visibility of this method.- Overrides:
getVisibilityin classDynamicMethod- Returns:
- The visibility of this method
-
getSerialNumber
public long getSerialNumber()Description copied from class:DynamicMethodGet the global serial number for this method object- Overrides:
getSerialNumberin classDynamicMethod- Returns:
- This method object's serial number
-
getRealMethod
Description copied from class:DynamicMethodGet the "real" method contained within this method. This simply returns self except in cases where a method is wrapped to give it a new name or new implementation class (AliasMethod, PartialDelegatingMethod, ...).- Overrides:
getRealMethodin classDynamicMethod- Returns:
- The "real" method associated with this one
-
getProtectedClass
Description copied from class:DynamicMethodRetrieve the pre-calculated "protected class" used for access checks.- Overrides:
getProtectedClassin classDynamicMethod- Returns:
- The "protected class" for access checks.
-
getImplementationClass
Description copied from class:DynamicMethodRetrieve the class or module on which this method is implemented, used for 'super' logic among others.- Overrides:
getImplementationClassin classDynamicMethod- Returns:
- The class on which this method is implemented
-
isImplementedBy
- Overrides:
isImplementedByin classDynamicMethod
-
getArity
Deprecated.Description copied from class:DynamicMethodRetrieve 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:
getArityin classDynamicMethod- Returns:
- The arity of the method, as reported to Ruby consumers.
-
getSignature
Description copied from class:DynamicMethodRetrieve the signature of this method.- Overrides:
getSignaturein classDynamicMethod- Returns:
- the signature
-
getName
Description copied from class:DynamicMethodGet the base name this method was defined as.- Overrides:
getNamein classDynamicMethod- Returns:
- the base name for the method
-
isNotImplemented
public boolean isNotImplemented()Description copied from class:DynamicMethodWhether this method is "not implemented". This is primarily to support Ruby 1.9's behavior of respond_to? yielding false if the feature in question is unsupported (but still having the method defined).- Overrides:
isNotImplementedin classDynamicMethod- Returns:
- is this a method which is marked as not implemented
-
setNotImplemented
public void setNotImplemented(boolean setNotImplemented) Description copied from class:DynamicMethodSet whether this method is "not implemented".- Overrides:
setNotImplementedin classDynamicMethod- Parameters:
setNotImplemented- is this not implement or not
-
getMethodData
Description copied from class:DynamicMethodAdditional metadata about this method.- Overrides:
getMethodDatain classDynamicMethod- Returns:
- method data (defined in sub classes)
-
getInstanceVariableNames
- Overrides:
getInstanceVariableNamesin classDynamicMethod
-
setHandle
Description copied from class:DynamicMethodSet the "handle" associated with this DynamicMethod.- Overrides:
setHandlein classDynamicMethod- Parameters:
handle- the handle
-
getHandle
Description copied from class:DynamicMethodGet the "handle" associated with this DynamicMethod.- Overrides:
getHandlein classDynamicMethod- Returns:
- the handle
-
isRefined
public boolean isRefined()- Overrides:
isRefinedin classDynamicMethod
-
dup
Description copied from class:DynamicMethodDuplicate 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:
dupin classDynamicMethod- Returns:
- An identical DynamicMethod object to the target.
-
equals
-
hashCode
public int hashCode()
-