Class ToggleBacktraceInstr


public class ToggleBacktraceInstr extends NoOperandInstr
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.
  • Constructor Details

    • ToggleBacktraceInstr

      public ToggleBacktraceInstr(boolean requiresBacktrace)
  • Method Details

    • requiresBacktrace

      public boolean requiresBacktrace()
    • toStringNonOperandArgs

      public String[] toStringNonOperandArgs()
      Overrides:
      toStringNonOperandArgs in class Instr
    • encode

      public void encode(IRWriterEncoder e)
      Overrides:
      encode in class Instr
    • decode

      public static ToggleBacktraceInstr decode(IRReaderDecoder d)
    • visit

      public void visit(IRVisitor visitor)
      Overrides:
      visit in class Instr
    • clone

      public Instr clone(CloneInfo info)
      Description copied from class: Instr
      Clone 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.
      Specified by:
      clone in class Instr
      Parameters:
      info - This object manages renaming of variables and labels, handles args and return values.
      Returns:
      a new instruction that can be used in the target scope.