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
  • Field Details

    • signature

      protected final Signature signature
    • method

      protected IRScope method
    • line

      protected final int line
    • staticScope

      protected final StaticScope staticScope
    • callCount

      protected int callCount
    • interpreterContext

      protected transient InterpreterContext interpreterContext
    • methodData

      private transient MethodData methodData
  • Constructor Details

  • Method Details

    • tryJit

      public static <T extends AbstractIRMethod & Compilable> void tryJit(ThreadContext context, T self)
    • setCallCount

      public final void setCallCount(int callCount)
    • getIRScope

      public IRScope getIRScope()
    • getStaticScope

      public StaticScope getStaticScope()
    • getArgumentDescriptors

      public ArgumentDescriptor[] getArgumentDescriptors()
      Description copied from interface: IRMethodArgs
      Get the array of ArgumentDescriptors that represent the arguments to this method.
      Specified by:
      getArgumentDescriptors in interface IRMethodArgs
    • ensureInstrsReady

      public InterpreterContext ensureInstrsReady()
    • retrieveInterpreterContext

      private InterpreterContext retrieveInterpreterContext()
    • printMethodIR

      protected abstract void printMethodIR()
    • getSignature

      public Signature getSignature()
      Description copied from class: DynamicMethod
      Retrieve the signature of this method.
      Specified by:
      getSignature in interface IRMethodArgs
      Overrides:
      getSignature in class DynamicMethod
      Returns:
      the signature
    • getArity

      @Deprecated public Arity 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 class DynamicMethod
      Returns:
      The arity of the method, as reported to Ruby consumers.
    • dup

      public DynamicMethod 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 class DynamicMethod
      Returns:
      An identical DynamicMethod object to the target.
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • getFile

      public String getFile()
      Description copied from interface: PositionAware
      Get the filename for the method.
      Specified by:
      getFile in interface PositionAware
      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 interface PositionAware
      Returns:
      the line number for the method
    • getMethodData

      public MethodData getMethodData()
      Additional metadata about this method.
      Overrides:
      getMethodData in class DynamicMethod
    • getInstanceVariableNames

      public Collection<String> getInstanceVariableNames()
      Overrides:
      getInstanceVariableNames in class DynamicMethod
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public abstract void finishSplitCall(SplitSuperState state)