Package org.jruby.ir.instructions
Class BSwitchInstr
java.lang.Object
org.jruby.ir.instructions.Instr
org.jruby.ir.instructions.MultiBranchInstr
org.jruby.ir.instructions.BSwitchInstr
Represents a multiple-target jump instruction based on a switch-like table
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Labelprivate final int[]private Operandprivate final Labelprivate final Label[]Fields inherited from class org.jruby.ir.instructions.Instr
EMPTY_OPERANDS -
Constructor Summary
ConstructorsConstructorDescriptionBSwitchInstr(int[] jumps, Operand operand, Label rubyCase, Label[] targets, Label elseTarget) -
Method Summary
Modifier and TypeMethodDescriptionClone the instruction for use in an inlining context (either when a scope is inlined into another scope, or when a block has to be cloned because its associated call belongs to an inlined scope).static BSwitchInstrvoidint[]getJumps()Label[]Operand[]Label[]intinterpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, StaticScope currScope, IRubyObject self, Object[] temp, int ipc) private static booleanjumpsAreSorted(int[] jumps) voidsetOperand(int i, Operand operand) voidMethods inherited from class org.jruby.ir.instructions.Instr
canBeDeletedFromScope, canRaiseException, cloneOperands, computeScopeFlags, dumpableFields, getOperation, getUsedVariables, hasSideEffects, interpret, isDead, isDeletable, markDead, renameVars, simplifyAndGetResult, simplifyOperands, toString, toStringNonOperandArgs, transfersControl
-
Field Details
-
jumps
private final int[] jumps -
operand
-
rubyCase
-
targets
-
elseTarget
-
-
Constructor Details
-
BSwitchInstr
-
-
Method Details
-
getOperands
- Specified by:
getOperandsin classInstr
-
getCaseOperand
-
getJumps
public int[] getJumps() -
getRubyCaseLabel
-
getTargets
-
getElseTarget
-
setOperand
- Specified by:
setOperandin classInstr
-
clone
Description copied from class:InstrClone the instruction for use in an inlining context (either when a scope is inlined into another scope, or when a block has to be cloned because its associated call belongs to an inlined scope). This might renaming variables and labels to eliminate naming conflicts. The implementation might vary on the cloning mode. -
encode
-
decode
-
interpretAndGetNewIPC
public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, StaticScope currScope, IRubyObject self, Object[] temp, int ipc) - Overrides:
interpretAndGetNewIPCin classInstr
-
visit
-
getJumpTargets
- Specified by:
getJumpTargetsin classMultiBranchInstr
-
jumpsAreSorted
private static boolean jumpsAreSorted(int[] jumps)
-