Top Fields Constructors Methods
org.jruby.ir.instructions

public Class LineNumberInstr

extends NoOperandInstr
implements FixedArityInstr
Class Inheritance
All Implemented Interfaces
org.jruby.ir.instructions.FixedArityInstr
Known Direct Subclasses
org.jruby.ir.instructions.InlinedLineNumberInstr
Imports
org.jruby.ext.coverage.CoverageData, org.jruby.ir.IRVisitor, .Operation, org.jruby.ir.persistence.IRReaderDecoder, .IRWriterEncoder, org.jruby.ir.transformations.inlining.CloneInfo, .InlineCloneInfo

Field Summary

Modifier and TypeField and Description
public boolean
coverage

Whether to update coverage data when executing this instruction.

public final int
public final boolean
oneshot

Whether to disable coverage after the first execution.

Constructor Summary

AccessConstructor and Description
public
LineNumberInstr(int lineNumber, int coverageMode)

public
LineNumberInstr(int lineNumber)

Method Summary

Modifier and TypeMethod and Description
public Instr
clone(CloneInfo
This object manages renaming of variables and labels, handles args and return values.
ii
)

Implements abstract org.jruby.ir.instructions.Instr.clone.

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).

public static LineNumberInstr
public void
public int
public boolean
public boolean
public String[]
public void
Inherited from org.jruby.ir.instructions.NoOperandInstr:
getOperandssetOperand

Field Detail

coverageback to summary
public boolean coverage

Whether to update coverage data when executing this instruction. Note this is non-final so that `oneshot_lines` mode can disable coverage.

lineNumberback to summary
public final int lineNumber
oneshotback to summary
public final boolean oneshot

Whether to disable coverage after the first execution. This allows lightweight "covered or not" coverage that only updates once per line.

Constructor Detail

LineNumberInstrback to summary
public LineNumberInstr(int lineNumber, int coverageMode)
LineNumberInstrback to summary
public LineNumberInstr(int lineNumber)

Method Detail

cloneback to summary
public Instr clone(CloneInfo ii)

Implements abstract org.jruby.ir.instructions.Instr.clone.

Doc from org.jruby.ir.instructions.Instr.clone.

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.

Parameters
ii:CloneInfo

This object manages renaming of variables and labels, handles args and return values.

Returns:Instr

a new instruction that can be used in the target scope.

Annotations
@Override
decodeback to summary
public static LineNumberInstr decode(IRReaderDecoder d)
encodeback to summary
public void encode(IRWriterEncoder e)

Overrides org.jruby.ir.instructions.Instr.encode.

Annotations
@Override
getLineNumberback to summary
public int getLineNumber()
isCoverageback to summary
public boolean isCoverage()
isOneshotback to summary
public boolean isOneshot()
toStringNonOperandArgsback to summary
public String[] toStringNonOperandArgs()

Overrides org.jruby.ir.instructions.Instr.toStringNonOperandArgs.

Annotations
@Override
visitback to summary
public void visit(IRVisitor visitor)

Overrides org.jruby.ir.instructions.Instr.visit.

Annotations
@Override