Top Fields Constructors Methods
org.jruby.internal.runtime

public abstract Class AbstractIRMethod

extends DynamicMethod
implements IRMethodArgs, PositionAware, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.jruby.runtime.PositionAware, org.jruby.internal.runtime.methods.IRMethodArgs
Known Direct Subclasses
org.jruby.internal.runtime.methods.CompiledIRMethod, org.jruby.internal.runtime.methods.CompiledIRNoProtocolMethod, org.jruby.internal.runtime.methods.InterpretedIRMethod, org.jruby.internal.runtime.methods.MixedModeIRMethod
Imports
java.util.Collection, org.jruby.Ruby, .RubyModule, org.jruby.compiler.Compilable, org.jruby.internal.runtime.methods.DynamicMethod, .IRMethodArgs, org.jruby.ir.IRFlags, .IRMethod, .IRScope, org.jruby.ir.interpreter.InterpreterContext, org.jruby.ir.runtime.IRRuntimeHelpers, org.jruby.parser.StaticScope, org.jruby.runtime.ArgumentDescriptor, .Arity, .Block, .PositionAware, .Signature, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.ivars.MethodData, org.jruby.util.cli.Options

Field Summary

Modifier and TypeField and Description
protected int
protected transient InterpreterContext
protected final int
protected IRScope
private transient MethodData
private boolean
protected final Signature
protected final StaticScope
Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
aliasCountdefinedClassflagshandleimplementationClassnameprotectedClassserialNumber

Constructor Summary

AccessConstructor and Description
public
AbstractIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass)

public
AbstractIRMethod(StaticScope scope, String id, int line, Visibility visibility, RubyModule implementationClass)

Method Summary

Modifier and TypeMethod and Description
protected static <T extends AbstractIRMethod & Compilable<T>> void
build(ThreadContext context, T self, boolean force)

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public DynamicMethod
dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.

public InterpreterContext
public abstract void
public ArgumentDescriptor[]
getArgumentDescriptors()

Implements org.jruby.internal.runtime.methods.IRMethodArgs.getArgumentDescriptors.

Get the array of ArgumentDescriptors that represent the arguments to this method.

public Arity
getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

Retrieve the arity of this method, used for reporting arity to Ruby code.

public String
getFile()

Implements org.jruby.runtime.PositionAware.getFile.

Get the filename for the method.

public Collection<String>
public IRScope
public int
getLine()

Implements org.jruby.runtime.PositionAware.getLine.

Get the line number for the method.

public MethodData
getMethodData()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getMethodData.

Additional metadata about this method.

public boolean
public Signature
public StaticScope
public boolean
public boolean
protected abstract void
public final void
setCallCount(int callCount)

public void
setRuby2Keywords()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setRuby2Keywords.

Implements org.jruby.internal.runtime.methods.IRMethodArgs.setRuby2Keywords.

Indicates the method will behave like a ruby2 keywords accepting method.

public abstract SplitSuperState<T extends InternalSplitState>
startSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

protected static <T extends AbstractIRMethod & Compilable<T>> void
tryJit(ThreadContext context, T self, boolean force)

Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
adjustAliasCountcalculateProtectedClasscallcallcallcallcallcallcallcallcallcallcallRespondTogetAliasCountgetCallConfiggetDefinedClassgetHandlegetImplementationClassgetNamegetProtectedClassgetRealMethodgetSerialNumbergetVisibilityinitinitisBuiltinisCallableFromisImplementedByisNativeisNotImplementedisNullisRefinedisUndefinedsetCallConfigsetDefinedClasssetHandlesetImplementationClasssetIsBuiltinsetNotImplementedsetVisibility

Field Detail

callCountback to summary
protected int callCount
interpreterContextback to summary
protected transient InterpreterContext interpreterContext
lineback to summary
protected final int line
methodback to summary
protected IRScope method
methodDataback to summary
private transient MethodData methodData
ruby2Keywordsback to summary
private boolean ruby2Keywords
signatureback to summary
protected final Signature signature
staticScopeback to summary
protected final StaticScope staticScope

Constructor Detail

AbstractIRMethodback to summary
public AbstractIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass)
AbstractIRMethodback to summary
public AbstractIRMethod(StaticScope scope, String id, int line, Visibility visibility, RubyModule implementationClass)

Method Detail

buildback to summary
protected static <T extends AbstractIRMethod & Compilable<T>> void build(ThreadContext context, T self, boolean force)
cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
dupback to summary
public DynamicMethod dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.dup.

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.

Returns:DynamicMethod

An identical DynamicMethod object to the target.

Annotations
@Override
ensureInstrsReadyback to summary
public InterpreterContext ensureInstrsReady()
finishSplitCallback to summary
public abstract void finishSplitCall(SplitSuperState<T extends InternalSplitState> state)
getArgumentDescriptorsback to summary
public ArgumentDescriptor[] getArgumentDescriptors()

Implements org.jruby.internal.runtime.methods.IRMethodArgs.getArgumentDescriptors.

Doc from org.jruby.internal.runtime.methods.IRMethodArgs.getArgumentDescriptors.

Get the array of ArgumentDescriptors that represent the arguments to this method.

Returns:ArgumentDescriptor[]

this methods argument descriptors

getArityback to summary
public Arity getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

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.

Returns:Arity

The arity of the method, as reported to Ruby consumers.

Annotations
@Deprecated
@Override
getFileback to summary
public String getFile()

Implements org.jruby.runtime.PositionAware.getFile.

Doc from org.jruby.runtime.PositionAware.getFile.

Get the filename for the method.

Returns:String

the filename for the method

getInstanceVariableNamesback to summary
public Collection<String> getInstanceVariableNames()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getInstanceVariableNames.

Annotations
@Override
getIRScopeback to summary
public IRScope getIRScope()
getLineback to summary
public int getLine()

Implements org.jruby.runtime.PositionAware.getLine.

Doc from org.jruby.runtime.PositionAware.getLine.

Get the line number for the method. 0-based (ie. line 1 returns a 0)

Returns:int

the line number for the method

getMethodDataback to summary
public MethodData getMethodData()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getMethodData.

Additional metadata about this method.

Returns:MethodData

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getMethodData.

method data (defined in sub classes)

Annotations
@Override
getRuby2Keywordsback to summary
public boolean getRuby2Keywords()
getSignatureback to summary
public Signature getSignature()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Implements org.jruby.internal.runtime.methods.IRMethodArgs.getSignature.

Doc from org.jruby.internal.runtime.methods.IRMethodArgs.getSignature.

Get the Signature for this method.

Returns:Signature

this methods signature

getStaticScopeback to summary
public StaticScope getStaticScope()
isBuildCompleteback to summary
public boolean isBuildComplete()
needsToFindImplementerback to summary
public boolean needsToFindImplementer()
printMethodIRback to summary
protected abstract void printMethodIR()
setCallCountback to summary
public final void setCallCount(int callCount)
setRuby2Keywordsback to summary
public void setRuby2Keywords()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setRuby2Keywords.

Implements org.jruby.internal.runtime.methods.IRMethodArgs.setRuby2Keywords.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setRuby2Keywords.

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.

startSplitSuperCallback to summary
public abstract SplitSuperState<T extends InternalSplitState> startSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
tryJitback to summary
protected static <T extends AbstractIRMethod & Compilable<T>> void tryJit(ThreadContext context, T self, boolean force)