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 intprotected final CallSitestatic longlongprotected final booleanprotected final RubySymbolFields inherited from class org.jruby.ir.instructions.NOperandInstr
operandsFields inherited from class org.jruby.ir.instructions.Instr
EMPTY_OPERANDS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCallBase(IRScope scope, Operation op, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, int flags, boolean potentiallyRefined) protectedCallBase(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 TypeMethodDescriptionvoidbooleanOperand[]booleancomputeScopeFlags(IRScope scope, EnumSet<IRFlags> flags) Does this instruction do anything the scope is interested in?static booleancontainsArgSplat(Operand[] arguments) voidgetArg1()This getter is potentially unsafe if you do not know you have >=1 arguments to the call.intOperand[]protected static CallSitegetCallSiteFor(IRScope scope, CallType callType, String name, long callsiteId, boolean hasLiteralClosure, boolean potentiallyRefined) longFrom interface ClosureAcceptingInstrgetClosureArg(Operand ifUnspecified) intgetFlags()getId()raw identifier string (used by method table).getName()abstract Variablebooleanbooleaninterpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) static booleanisAllFixnums(Operand[] args) static booleanisAllFloats(Operand[] args) booleanprepareArguments(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) voidsetCallSiteId(long callSiteId) protected voidsimplifyOperands(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()booleanbooleanString[]Methods inherited from class org.jruby.ir.instructions.NOperandInstr
getOperands, setOperandMethods 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:
getCallSiteIdin interfaceSite
-
setCallSiteId
public void setCallSiteId(long callSiteId) - Specified by:
setCallSiteIdin interfaceSite
-
getName
-
getClosureArg
From interface ClosureAcceptingInstr- Specified by:
getClosureArgin 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:
hasLiteralClosurein interfaceClosureAcceptingInstr
-
isAllFixnums
-
isAllFloats
-
isPotentiallyRefined
public boolean isPotentiallyRefined() -
computeScopeFlags
Description copied from class:InstrDoes this instruction do anything the scope is interested in?- Overrides:
computeScopeFlagsin classInstr- Returns:
- true if it modified the scope or set any flags.
-
simplifyOperands
Description copied from class:InstrThis 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:
simplifyOperandsin classInstr
-
cloneCallArgs
-
canBeEval
public boolean canBeEval() -
targetRequiresCallersBinding
public boolean targetRequiresCallersBinding() -
targetRequiresCallersFrame
public boolean targetRequiresCallersFrame() -
toStringNonOperandArgs
- Overrides:
toStringNonOperandArgsin 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)
-