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

  • 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

      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
      Returns:
      this methods argument descriptors
    • ensureInstrsReady

      public InterpreterContext ensureInstrsReady()
    • 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
    • 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
      Returns:
      method data (defined in sub classes)
    • getInstanceVariableNames

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

      public String toString()
      Overrides:
      toString in class Object
    • 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 interface IRMethodArgs
      Overrides:
      setRuby2Keywords in class DynamicMethod
    • getRuby2Keywords

      public boolean getRuby2Keywords()
    • startSplitSuperCall

      public abstract SplitSuperState startSplitSuperCall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)
    • finishSplitCall

      public abstract void finishSplitCall(SplitSuperState state)