Class CallBase

All Implemented Interfaces:
ClosureAcceptingInstr, Site
Direct Known Subclasses:
CallInstr, NoResultCallInstr

public abstract class CallBase extends NOperandInstr implements ClosureAcceptingInstr, Site
  • Field Details

    • callSiteCounter

      public static long callSiteCounter
    • callSiteId

      public transient long callSiteId
    • name

      protected final RubySymbol name
    • callSite

      protected final transient CallSite callSite
    • argsCount

      protected final transient int argsCount
    • hasClosure

      protected final transient boolean hasClosure
  • Constructor Details

  • Method Details

    • encode

      public void encode(IRWriterEncoder e)
      Overrides:
      encode in class Instr
    • getFlags

      public int getFlags()
    • getId

      public String getId()
      raw identifier string (used by method table).
    • getCallSiteId

      public long getCallSiteId()
      Specified by:
      getCallSiteId in interface Site
    • setCallSiteId

      public void setCallSiteId(long callSiteId)
      Specified by:
      setCallSiteId in interface Site
    • getName

      public RubySymbol getName()
    • getClosureArg

      public Operand getClosureArg()
      From interface ClosureAcceptingInstr
      Specified by:
      getClosureArg in interface ClosureAcceptingInstr
    • getClosureArg

      public Operand getClosureArg(Operand ifUnspecified)
    • getReceiver

      public Operand getReceiver()
    • getResult

      public abstract Variable getResult()
    • getArg1

      public Operand getArg1()
      This getter is potentially unsafe if you do not know you have >=1 arguments to the call. It may return null of the closure argument from operands.
    • getArgsCount

      public int getArgsCount()
    • getCallArgs

      public Operand[] getCallArgs()
    • getCallSite

      public CallSite getCallSite()
    • getCallType

      public CallType getCallType()
    • splatMap

      public boolean[] splatMap()
    • blockInlining

      public void blockInlining()
    • inliningBlocked

      public boolean inliningBlocked()
    • getCallSiteFor

      protected static CallSite getCallSiteFor(IRScope scope, CallType callType, String name, long callsiteId, boolean hasLiteralClosure, boolean potentiallyRefined)
    • hasLiteralClosure

      public boolean hasLiteralClosure()
      Specified by:
      hasLiteralClosure in interface ClosureAcceptingInstr
    • isAllFixnums

      public static boolean isAllFixnums(Operand[] args)
    • isAllFloats

      public static boolean isAllFloats(Operand[] args)
    • isPotentiallyRefined

      public boolean isPotentiallyRefined()
    • computeScopeFlags

      public boolean computeScopeFlags(IRScope scope, EnumSet<IRFlags> flags)
      Description copied from class: Instr
      Does this instruction do anything the scope is interested in?
      Overrides:
      computeScopeFlags in class Instr
      Returns:
      true if it modified the scope or set any flags.
    • simplifyOperands

      protected void simplifyOperands(Map<Operand,Operand> valueMap, boolean force)
      Description copied from class: Instr
      This method takes as input a map of operands to their values, and outputs If the value map provides a value for any of the instruction's operands this method is expected to replace the original operands with the simplified values. It is not required that it do so -- code correctness is not compromised by failure to simplify
      Overrides:
      simplifyOperands in class Instr
    • cloneCallArgs

      public Operand[] cloneCallArgs(CloneInfo ii)
    • canBeEval

      public boolean canBeEval()
    • targetRequiresCallersBinding

      public boolean targetRequiresCallersBinding()
    • targetRequiresCallersFrame

      public boolean targetRequiresCallersFrame()
    • toStringNonOperandArgs

      public String[] toStringNonOperandArgs()
      Overrides:
      toStringNonOperandArgs in class Instr
    • containsArgSplat

      public static boolean containsArgSplat(Operand[] arguments)
    • interpret

      public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp)
      Overrides:
      interpret in class Instr
    • prepareArguments

      public IRubyObject[] prepareArguments(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope dynamicScope, Object[] temp)
    • prepareArgumentsSimple

      protected IRubyObject[] prepareArgumentsSimple(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)
    • prepareArgumentsComplex

      protected IRubyObject[] prepareArgumentsComplex(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)
    • prepareBlock

      public Block prepareBlock(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)