Top Fields Constructors Methods
org.jruby.ir.instructions

public abstract Class CallBase

extends NOperandInstr
implements ClosureAcceptingInstr, Site
Class Inheritance
All Implemented Interfaces
org.jruby.ir.instructions.Site, org.jruby.ir.instructions.ClosureAcceptingInstr
Known Direct Subclasses
org.jruby.ir.instructions.CallInstr, org.jruby.ir.instructions.NoResultCallInstr
Imports
org.jruby.RubySymbol, org.jruby.anno.FrameField, org.jruby.ir.IRFlags, .IRManager, .IRScope, .Operation, org.jruby.ir.operands.*, .Float, org.jruby.ir.persistence.IRWriterEncoder, org.jruby.ir.runtime.IRRuntimeHelpers, org.jruby.ir.transformations.inlining.CloneInfo, org.jruby.parser.StaticScope, org.jruby.runtime.*, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.callsite.RefinedCachingCallSite, org.jruby.util.ArraySupport, java.util.Collections, .EnumSet, .Map, .Set

Field Summary

Modifier and TypeField and Description
private static final EnumSet<FrameField>
protected final transient int
protected final transient CallSite
public static long
public transient long
private final CallType
private transient boolean
private transient boolean
private final int
private transient boolean
private transient Set<FrameField>
private transient Set<FrameField>
protected final transient boolean
protected final RubySymbol
private final boolean
private static final int
private transient boolean[]
private transient boolean
private transient boolean
Inherited from org.jruby.ir.instructions.NOperandInstr:
operands

Constructor Summary

AccessConstructor and Description
protected
CallBase(IRScope scope, Operation op, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, int flags, boolean potentiallyRefined)

protected
CallBase(IRScope scope, Operation op, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, int flags, boolean potentiallyRefined, CallSite callSite, long callSiteId)

Method Summary

Modifier and TypeMethod and Description
private static Operand[]
arrayifyOperands(Operand receiver, Operand[] callArgs, Operand closure)

public void
private int
public boolean
private void
captureFrameReadsAndWrites()

Determine based on the method name what frame fields it is likely to need.

public Operand[]
private boolean
private void
private boolean
private boolean
public boolean
computeScopeFlags(IRScope scope, EnumSet<IRFlags> flags)

Overrides org.jruby.ir.instructions.Instr.computeScopeFlags.

Does this instruction do anything the scope is interested in?

public static boolean
public void
public Operand
getArg1()

This getter is potentially unsafe if you do not know you have >=1 arguments to the call.

public int
public Operand[]
public CallSite
protected static CallSite
getCallSiteFor(IRScope scope, CallType callType, String name, long callsiteId, boolean hasLiteralClosure, boolean potentiallyRefined)

public long
public CallType
public Operand
getClosureArg()

Implements org.jruby.ir.instructions.ClosureAcceptingInstr.getClosureArg.

From interface ClosureAcceptingInstr

public Operand
getClosureArg(Operand ifUnspecified)

public int
public String
getId()

raw identifier string (used by method table).

public RubySymbol
public Operand
public abstract Variable
public boolean
public boolean
public Object
public static boolean
public static boolean
public boolean
private static boolean
potentiallySend(String name, int argsCount)

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

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

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

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

public void
private boolean
protected void
simplifyOperands(Map<Operand, Operand> valueMap, boolean force)

Overrides org.jruby.ir.instructions.Instr.simplifyOperands.

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.

public boolean[]
public boolean
public boolean
public String[]
Inherited from org.jruby.ir.instructions.NOperandInstr:
getOperandssetOperand

Field Detail

ALLback to summary
private static final EnumSet<FrameField> ALL
argsCountback to summary
protected final transient int argsCount
callSiteback to summary
protected final transient CallSite callSite
callSiteCounterback to summary
public static long callSiteCounter
callSiteIdback to summary
public transient long callSiteId
callTypeback to summary
private final CallType callType
canBeEvalback to summary
private transient boolean canBeEval
dontInlineback to summary
private transient boolean dontInline
flagsback to summary
private final int flags
flagsComputedback to summary
private transient boolean flagsComputed
frameReadsback to summary
private transient Set<FrameField> frameReads
frameWritesback to summary
private transient Set<FrameField> frameWrites
hasClosureback to summary
protected final transient boolean hasClosure
nameback to summary
protected final RubySymbol name
potentiallyRefinedback to summary
private final boolean potentiallyRefined
REQUIRED_OPERANDSback to summary
private static final int REQUIRED_OPERANDS
splatMapback to summary
private transient boolean[] splatMap
targetRequiresCallersBindingback to summary
private transient boolean targetRequiresCallersBinding
targetRequiresCallersFrameback to summary
private transient boolean targetRequiresCallersFrame

Constructor Detail

CallBaseback to summary
protected CallBase(IRScope scope, Operation op, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, int flags, boolean potentiallyRefined)
CallBaseback to summary
protected CallBase(IRScope scope, Operation op, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, int flags, boolean potentiallyRefined, CallSite callSite, long callSiteId)

Method Detail

arrayifyOperandsback to summary
private static Operand[] arrayifyOperands(Operand receiver, Operand[] callArgs, Operand closure)
blockInliningback to summary
public void blockInlining()
calculateArityback to summary
private int calculateArity()
canBeEvalback to summary
public boolean canBeEval()
captureFrameReadsAndWritesback to summary
private void captureFrameReadsAndWrites()

Determine based on the method name what frame fields it is likely to need.

cloneCallArgsback to summary
public Operand[] cloneCallArgs(CloneInfo ii)
computeEvalFlagback to summary
private boolean computeEvalFlag()
computeFlagsback to summary
private void computeFlags()
computeRequiresCallersBindingFlagback to summary
private boolean computeRequiresCallersBindingFlag()
computeRequiresCallersFrameFlagback to summary
private boolean computeRequiresCallersFrameFlag()
computeScopeFlagsback to summary
public boolean computeScopeFlags(IRScope scope, EnumSet<IRFlags> flags)

Overrides org.jruby.ir.instructions.Instr.computeScopeFlags.

Doc from org.jruby.ir.instructions.Instr.computeScopeFlags.

Does this instruction do anything the scope is interested in?

Returns:boolean

true if it modified the scope or set any flags.

Annotations
@Override
containsArgSplatback to summary
public static boolean containsArgSplat(Operand[] arguments)
encodeback to summary
public void encode(IRWriterEncoder e)

Overrides org.jruby.ir.instructions.Instr.encode.

Annotations
@Override
getArg1back to summary
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.

getArgsCountback to summary
public int getArgsCount()
getCallArgsback to summary
public Operand[] getCallArgs()
getCallSiteback to summary
public CallSite getCallSite()
getCallSiteForback to summary
protected static CallSite getCallSiteFor(IRScope scope, CallType callType, String name, long callsiteId, boolean hasLiteralClosure, boolean potentiallyRefined)
getCallSiteIdback to summary
public long getCallSiteId()

Implements org.jruby.ir.instructions.Site.getCallSiteId.

getCallTypeback to summary
public CallType getCallType()
getClosureArgback to summary
public Operand getClosureArg()

Implements org.jruby.ir.instructions.ClosureAcceptingInstr.getClosureArg.

From interface ClosureAcceptingInstr

getClosureArgback to summary
public Operand getClosureArg(Operand ifUnspecified)
getFlagsback to summary
public int getFlags()
getIdback to summary
public String getId()

raw identifier string (used by method table).

getNameback to summary
public RubySymbol getName()
getReceiverback to summary
public Operand getReceiver()
getResultback to summary
public abstract Variable getResult()
hasLiteralClosureback to summary
public boolean hasLiteralClosure()

Implements org.jruby.ir.instructions.ClosureAcceptingInstr.hasLiteralClosure.

inliningBlockedback to summary
public boolean inliningBlocked()
interpretback to summary
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp)

Overrides org.jruby.ir.instructions.Instr.interpret.

Annotations
@Override
isAllFixnumsback to summary
public static boolean isAllFixnums(Operand[] args)
isAllFloatsback to summary
public static boolean isAllFloats(Operand[] args)
isPotentiallyRefinedback to summary
public boolean isPotentiallyRefined()
potentiallySendback to summary
private static boolean potentiallySend(String name, int argsCount)
prepareArgumentsback to summary
public IRubyObject[] prepareArguments(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope dynamicScope, Object[] temp)
prepareArgumentsComplexback to summary
protected IRubyObject[] prepareArgumentsComplex(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)
prepareArgumentsSimpleback to summary
protected IRubyObject[] prepareArgumentsSimple(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)
prepareBlockback to summary
public Block prepareBlock(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)
setCallSiteIdback to summary
public void setCallSiteId(long callSiteId)

Implements org.jruby.ir.instructions.Site.setCallSiteId.

setIRFlagsFromFrameFieldsback to summary
private boolean setIRFlagsFromFrameFields(EnumSet<IRFlags> flags, Set<FrameField> frameFields)
simplifyOperandsback to summary
protected void simplifyOperands(Map<Operand, Operand> valueMap, boolean force)

Overrides org.jruby.ir.instructions.Instr.simplifyOperands.

Doc from org.jruby.ir.instructions.Instr.simplifyOperands.

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

Annotations
@Override
splatMapback to summary
public boolean[] splatMap()
targetRequiresCallersBindingback to summary
public boolean targetRequiresCallersBinding()
targetRequiresCallersFrameback to summary
public boolean targetRequiresCallersFrame()
toStringNonOperandArgsback to summary
public String[] toStringNonOperandArgs()

Overrides org.jruby.ir.instructions.Instr.toStringNonOperandArgs.

Annotations
@Override