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 IRScopeprotected final Signatureprotected final StaticScopeFields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
aliasCount, 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 TypeMethodDescriptionprotected static <T extends AbstractIRMethod & Compilable>
voidbuild(ThreadContext context, T self, boolean force) clone()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.booleanRetrieve the signature of this method.booleanbooleanprotected abstract voidfinal voidsetCallCount(int callCount) voidIndicates the method will behave like a ruby2 keywords accepting method.abstract SplitSuperStatestartSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) toString()protected static <T extends AbstractIRMethod & Compilable>
voidtryJit(ThreadContext context, T self, boolean force) Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
adjustAliasCount, calculateProtectedClass, call, call, call, call, call, call, call, call, call, call, callRespondTo, getAliasCount, 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
-
-
Constructor Details
-
AbstractIRMethod
-
AbstractIRMethod
public AbstractIRMethod(StaticScope scope, String id, int line, Visibility visibility, RubyModule implementationClass)
-
-
Method Details
-
tryJit
protected static <T extends AbstractIRMethod & Compilable> void tryJit(ThreadContext context, T self, boolean force) -
build
protected static <T extends AbstractIRMethod & Compilable> void build(ThreadContext context, T self, boolean force) -
setCallCount
public final void setCallCount(int callCount) -
isBuildComplete
public boolean isBuildComplete() -
getIRScope
-
getStaticScope
-
getArgumentDescriptors
Description copied from interface:IRMethodArgsGet the array of ArgumentDescriptors that represent the arguments to this method.- Specified by:
getArgumentDescriptorsin interfaceIRMethodArgs- Returns:
- this methods argument descriptors
-
ensureInstrsReady
-
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- Returns:
- method data (defined in sub classes)
-
getInstanceVariableNames
- Overrides:
getInstanceVariableNamesin classDynamicMethod
-
toString
-
needsToFindImplementer
public boolean needsToFindImplementer() -
setRuby2Keywords
public void setRuby2Keywords()Description copied from class:DynamicMethodIndicates the method will behave like a ruby2 keywords accepting method. This must be a Ruby implementation to work. See Module#ruby2_keywords for information on the semantics of a method which is marked this way.- Specified by:
setRuby2Keywordsin interfaceIRMethodArgs- Overrides:
setRuby2Keywordsin classDynamicMethod
-
getRuby2Keywords
public boolean getRuby2Keywords() -
startSplitSuperCall
public abstract SplitSuperState startSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) -
finishSplitCall
-