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 int
protected InterpreterContext
protected final int
protected IRScope
protected final Signature
protected final StaticScope
Fields 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 void
finishSplitCall
(SplitSuperState state) Get the array of ArgumentDescriptors that represent the arguments to this method.getArity()
Deprecated.getFile()
Get the filename for the method.int
getLine()
Get the line number for the method.Additional metadata about this method.boolean
Retrieve the signature of this method.boolean
boolean
protected abstract void
final void
setCallCount
(int callCount) void
Indicates the method will behave like a ruby2 keywords accepting method.abstract SplitSuperState
startSplitSuperCall
(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:IRMethodArgs
Get the array of ArgumentDescriptors that represent the arguments to this method.- Specified by:
getArgumentDescriptors
in interfaceIRMethodArgs
- Returns:
- this methods argument descriptors
-
ensureInstrsReady
-
printMethodIR
protected abstract void printMethodIR() -
getSignature
Description copied from class:DynamicMethod
Retrieve the signature of this method.- Specified by:
getSignature
in interfaceIRMethodArgs
- Overrides:
getSignature
in classDynamicMethod
- Returns:
- the signature
-
getArity
Deprecated.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 classDynamicMethod
- Returns:
- The arity of the method, as reported to Ruby consumers.
-
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 classDynamicMethod
- Returns:
- An identical DynamicMethod object to the target.
-
clone
-
getFile
Description copied from interface:PositionAware
Get the filename for the method.- Specified by:
getFile
in interfacePositionAware
- Returns:
- the filename for the method
-
getLine
public int getLine()Description copied from interface:PositionAware
Get the line number for the method. 0-based (ie. line 1 returns a 0)- Specified by:
getLine
in interfacePositionAware
- Returns:
- the line number for the method
-
getMethodData
Additional metadata about this method.- Overrides:
getMethodData
in classDynamicMethod
- Returns:
- method data (defined in sub classes)
-
getInstanceVariableNames
- Overrides:
getInstanceVariableNames
in classDynamicMethod
-
toString
-
needsToFindImplementer
public boolean needsToFindImplementer() -
setRuby2Keywords
public void setRuby2Keywords()Description copied from class:DynamicMethod
Indicates 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:
setRuby2Keywords
in interfaceIRMethodArgs
- Overrides:
setRuby2Keywords
in classDynamicMethod
-
getRuby2Keywords
public boolean getRuby2Keywords() -
startSplitSuperCall
public abstract SplitSuperState startSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) -
finishSplitCall
-