Package org.jruby.ir.instructions
Class CallBase
java.lang.Object
org.jruby.ir.instructions.Instr
org.jruby.ir.instructions.NOperandInstr
org.jruby.ir.instructions.CallBase
- All Implemented Interfaces:
ClosureAcceptingInstr
,Site
- Direct Known Subclasses:
CallInstr
,NoResultCallInstr
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int
protected final CallSite
static long
long
protected final boolean
protected final RubySymbol
Fields inherited from class org.jruby.ir.instructions.NOperandInstr
operands
Fields inherited from class org.jruby.ir.instructions.Instr
EMPTY_OPERANDS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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 TypeMethodDescriptionvoid
boolean
Operand[]
boolean
computeScopeFlags
(IRScope scope, EnumSet<IRFlags> flags) Does this instruction do anything the scope is interested in?static boolean
containsArgSplat
(Operand[] arguments) void
getArg1()
This getter is potentially unsafe if you do not know you have >=1 arguments to the call.int
Operand[]
protected static CallSite
getCallSiteFor
(IRScope scope, CallType callType, String name, long callsiteId, boolean hasLiteralClosure, boolean potentiallyRefined) long
From interface ClosureAcceptingInstrgetClosureArg
(Operand ifUnspecified) int
getFlags()
getId()
raw identifier string (used by method table).getName()
abstract Variable
boolean
boolean
interpret
(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) static boolean
isAllFixnums
(Operand[] args) static boolean
isAllFloats
(Operand[] args) boolean
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) prepareBlock
(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) void
setCallSiteId
(long callSiteId) protected void
simplifyOperands
(Map<Operand, Operand> valueMap, boolean force) 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.boolean[]
splatMap()
boolean
boolean
String[]
Methods inherited from class org.jruby.ir.instructions.NOperandInstr
getOperands, setOperand
Methods inherited from class org.jruby.ir.instructions.Instr
canBeDeletedFromScope, canRaiseException, clone, cloneOperands, dumpableFields, getOperation, getUsedVariables, hasSideEffects, interpretAndGetNewIPC, isDead, isDeletable, markDead, renameVars, simplifyInstr, simplifyOperands, toString, transfersControl, visit
-
Field Details
-
callSiteCounter
public static long callSiteCounter -
callSiteId
public transient long callSiteId -
name
-
callSite
-
argsCount
protected final transient int argsCount -
hasClosure
protected final transient boolean hasClosure
-
-
Constructor Details
-
CallBase
-
CallBase
-
-
Method Details
-
encode
-
getFlags
public int getFlags() -
getId
raw identifier string (used by method table). -
getCallSiteId
public long getCallSiteId()- Specified by:
getCallSiteId
in interfaceSite
-
setCallSiteId
public void setCallSiteId(long callSiteId) - Specified by:
setCallSiteId
in interfaceSite
-
getName
-
getClosureArg
From interface ClosureAcceptingInstr- Specified by:
getClosureArg
in interfaceClosureAcceptingInstr
-
getClosureArg
-
getReceiver
-
getResult
-
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
-
getCallSite
-
getCallType
-
splatMap
public boolean[] splatMap() -
blockInlining
public void blockInlining() -
inliningBlocked
public boolean inliningBlocked() -
getCallSiteFor
-
hasLiteralClosure
public boolean hasLiteralClosure()- Specified by:
hasLiteralClosure
in interfaceClosureAcceptingInstr
-
isAllFixnums
-
isAllFloats
-
isPotentiallyRefined
public boolean isPotentiallyRefined() -
computeScopeFlags
Description copied from class:Instr
Does this instruction do anything the scope is interested in?- Overrides:
computeScopeFlags
in classInstr
- Returns:
- true if it modified the scope or set any flags.
-
simplifyOperands
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 classInstr
-
cloneCallArgs
-
canBeEval
public boolean canBeEval() -
targetRequiresCallersBinding
public boolean targetRequiresCallersBinding() -
targetRequiresCallersFrame
public boolean targetRequiresCallersFrame() -
toStringNonOperandArgs
- Overrides:
toStringNonOperandArgs
in classInstr
-
containsArgSplat
-
interpret
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) -
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)
-