Package org.jruby.internal.runtime
Class AbstractIRMethod
java.lang.Object
org.jruby.internal.runtime.methods.DynamicMethod
org.jruby.internal.runtime.AbstractIRMethod
- All Implemented Interfaces:
Cloneable,IRMethodArgs,PositionAware
- Direct Known Subclasses:
CompiledIRMethod,CompiledIRNoProtocolMethod,InterpretedIRMethod,MixedModeIRMethod
public abstract class AbstractIRMethod
extends DynamicMethod
implements IRMethodArgs, PositionAware, Cloneable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.internal.runtime.methods.DynamicMethod
DynamicMethod.NativeCall, DynamicMethod.Version -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected InterpreterContextprotected final intprotected IRScopeprivate MethodDataprotected final Signatureprotected final StaticScopeFields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
definedClass, flags, handle, implementationClass, name, protectedClass, serialNumber -
Constructor Summary
ConstructorsConstructorDescriptionAbstractIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass) AbstractIRMethod(StaticScope scope, String id, int line, Visibility visibility, RubyModule implementationClass) -
Method Summary
Modifier and TypeMethodDescriptionclone()dup()Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.abstract voidfinishSplitCall(SplitSuperState state) Get the array of ArgumentDescriptors that represent the arguments to this method.getArity()Deprecated.getFile()Get the filename for the method.intgetLine()Get the line number for the method.Additional metadata about this method.Retrieve the signature of this method.booleanprotected abstract voidprivate InterpreterContextfinal voidsetCallCount(int callCount) abstract SplitSuperStatestartSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) Calls a split method (java constructor-invoked initialize) and returns the paused state.toString()static <T extends AbstractIRMethod & Compilable>
voidtryJit(ThreadContext context, T self) Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
calculateProtectedClass, call, call, call, call, call, call, call, call, call, call, callRespondTo, getCallConfig, getDefinedClass, getHandle, getImplementationClass, getName, getProtectedClass, getRealMethod, getSerialNumber, getVisibility, init, init, isBuiltin, isCallableFrom, isImplementedBy, isNative, isNotImplemented, isNull, isRefined, isUndefined, setCallConfig, setDefinedClass, setHandle, setImplementationClass, setIsBuiltin, setNotImplemented, setVisibility
-
Field Details
-
signature
-
method
-
line
protected final int line -
staticScope
-
callCount
protected int callCount -
interpreterContext
-
methodData
-
-
Constructor Details
-
AbstractIRMethod
-
AbstractIRMethod
public AbstractIRMethod(StaticScope scope, String id, int line, Visibility visibility, RubyModule implementationClass)
-
-
Method Details
-
tryJit
-
setCallCount
public final void setCallCount(int callCount) -
getIRScope
-
getStaticScope
-
getArgumentDescriptors
Description copied from interface:IRMethodArgsGet the array of ArgumentDescriptors that represent the arguments to this method.- Specified by:
getArgumentDescriptorsin interfaceIRMethodArgs
-
ensureInstrsReady
-
retrieveInterpreterContext
-
printMethodIR
protected abstract void printMethodIR() -
getSignature
Description copied from class:DynamicMethodRetrieve the signature of this method.- Specified by:
getSignaturein interfaceIRMethodArgs- Overrides:
getSignaturein classDynamicMethod- Returns:
- the signature
-
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.
-
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.
-
clone
-
getFile
Description copied from interface:PositionAwareGet the filename for the method.- Specified by:
getFilein interfacePositionAware- Returns:
- the filename for the method
-
getLine
public int getLine()Description copied from interface:PositionAwareGet the line number for the method. 0-based (ie. line 1 returns a 0)- Specified by:
getLinein interfacePositionAware- Returns:
- the line number for the method
-
getMethodData
Additional metadata about this method.- Overrides:
getMethodDatain classDynamicMethod
-
getInstanceVariableNames
- Overrides:
getInstanceVariableNamesin classDynamicMethod
-
toString
-
needsToFindImplementer
public boolean needsToFindImplementer() -
startSplitSuperCall
public abstract SplitSuperState startSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) Calls a split method (java constructor-invoked initialize) and returns the paused state. If this method doesn't have a super call, returns null without execution. -
finishSplitCall
-