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 TypeFieldDescriptionprivate static final EnumSet<FrameField>protected final intprotected final CallSitestatic longlongprivate final CallTypeprivate booleanprivate booleanprivate booleanprivate Set<FrameField>private Set<FrameField>protected final booleanprotected final RubySymbolprivate final booleanprotected booleanprivate static final intprivate boolean[]private booleanprivate booleanFields 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, boolean potentiallyRefined) protectedCallBase(IRScope scope, Operation op, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, boolean potentiallyRefined, CallSite callSite, long callSiteId) -
Method Summary
Modifier and TypeMethodDescriptionprivate static Operand[]arrayifyOperands(Operand receiver, Operand[] callArgs, Operand closure) voidprivate intbooleanprivate voidDetermine based on the method name what frame fields it is likely to need.Operand[]private booleanprivate voidprivate booleanprivate booleanbooleancomputeScopeFlags(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) 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) booleanprivate static booleanpotentiallySend(String name, int argsCount) 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) voidsetCallSiteId(long callSiteId) private booleansetIRFlagsFromFrameFields(EnumSet<IRFlags> flags, Set<FrameField> frameFields) voidsetProcNew(boolean procNew) 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, simplifyAndGetResult, toString, transfersControl, visit
-
Field Details
-
callSiteCounter
public static long callSiteCounter -
ALL
-
callSiteId
public transient long callSiteId -
callType
-
name
-
callSite
-
argsCount
protected final transient int argsCount -
hasClosure
protected final transient boolean hasClosure -
flagsComputed
private transient boolean flagsComputed -
canBeEval
private transient boolean canBeEval -
targetRequiresCallersBinding
private transient boolean targetRequiresCallersBinding -
targetRequiresCallersFrame
private transient boolean targetRequiresCallersFrame -
dontInline
private transient boolean dontInline -
splatMap
private transient boolean[] splatMap -
procNew
protected transient boolean procNew -
potentiallyRefined
private final boolean potentiallyRefined -
frameReads
-
frameWrites
-
REQUIRED_OPERANDS
private static final int REQUIRED_OPERANDS- See Also:
-
-
Constructor Details
-
CallBase
-
CallBase
-
-
Method Details
-
encode
-
calculateArity
private int calculateArity() -
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() -
setProcNew
public void setProcNew(boolean procNew) -
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.
-
setIRFlagsFromFrameFields
-
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
-
computeEvalFlag
private boolean computeEvalFlag() -
computeRequiresCallersBindingFlag
private boolean computeRequiresCallersBindingFlag() -
computeRequiresCallersFrameFlag
private boolean computeRequiresCallersFrameFlag() -
potentiallySend
-
captureFrameReadsAndWrites
private void captureFrameReadsAndWrites()Determine based on the method name what frame fields it is likely to need. -
computeFlags
private void computeFlags() -
canBeEval
public boolean canBeEval() -
targetRequiresCallersBinding
public boolean targetRequiresCallersBinding() -
targetRequiresCallersFrame
public boolean targetRequiresCallersFrame() -
toStringNonOperandArgs
- Overrides:
toStringNonOperandArgsin classInstr
-
containsArgSplat
-
arrayifyOperands
-
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)
-