Package org.jruby.ir.instructions
Class ToggleBacktraceInstr
java.lang.Object
org.jruby.ir.instructions.Instr
org.jruby.ir.instructions.NoOperandInstr
org.jruby.ir.instructions.ToggleBacktraceInstr
This instruction toggles a single per thread field which specifies whether an exception
being thrown needs to generate backtrace info. At any point after toggling this to be
false (no backtrace) you may encounter a nested exception which does require a backtrace.
This nested exception will toggle back to needing an exception.
In theory, we could restore this field as we unwind frames but largely this optimization
only occurs in very simple scenarios.
Also important to note this is only requesting for a backtrace or not. If you request
no backtrace but the error is not a StandardError exception it will still be required
to generate a backtrace.
-
Field Summary
Fields inherited from class org.jruby.ir.instructions.Instr
EMPTY_OPERANDS -
Constructor Summary
Constructors -
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 ToggleBacktraceInstrvoidbooleanString[]voidMethods inherited from class org.jruby.ir.instructions.NoOperandInstr
getOperands, setOperandMethods inherited from class org.jruby.ir.instructions.Instr
canBeDeletedFromScope, canRaiseException, cloneOperands, computeScopeFlags, dumpableFields, getOperation, getUsedVariables, hasSideEffects, interpret, interpretAndGetNewIPC, isDead, isDeletable, markDead, renameVars, simplifyInstr, simplifyOperands, simplifyOperands, toString, transfersControl
-
Constructor Details
-
ToggleBacktraceInstr
public ToggleBacktraceInstr(boolean requiresBacktrace)
-
-
Method Details
-
requiresBacktrace
public boolean requiresBacktrace() -
toStringNonOperandArgs
- Overrides:
toStringNonOperandArgsin classInstr
-
encode
-
decode
-
visit
-
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.
-