Class: Optimize::IR::LineEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/optimize/ir/line_entry.rb

Overview

One entry in an iseq’s line-info table.

inst         — the IR::Instruction whose start slot is at or before this entry's
               YARV slot position. For most entries this is the instruction annotated
               by this line entry. For "adjust" entries (added by CRuby for continuation
               points after block calls), the slot may fall inside an instruction's
               operand range — in that case inst is the containing instruction and
               slot_offset records the delta from that instruction's start slot.
slot_offset  — delta from inst's YARV start slot to the actual insns_info slot
               position. 0 for the vast majority of entries; >0 only for adjust-
               style entries that point to a mid-instruction YARV slot.
line_no      — source line number (1-based), absolute (not delta-encoded)
node_id      — parser node id (opaque integer; preserved on round-trip)
events       — flags bitmap for tracepoint events (RUBY_EVENT_LINE, etc.)

Instance Attribute Summary collapse

Instance Attribute Details

#eventsObject

Returns the value of attribute events

Returns:

  • (Object)

    the current value of events



19
20
21
# File 'lib/optimize/ir/line_entry.rb', line 19

def events
  @events
end

#instObject

Returns the value of attribute inst

Returns:

  • (Object)

    the current value of inst



19
20
21
# File 'lib/optimize/ir/line_entry.rb', line 19

def inst
  @inst
end

#line_noObject

Returns the value of attribute line_no

Returns:

  • (Object)

    the current value of line_no



19
20
21
# File 'lib/optimize/ir/line_entry.rb', line 19

def line_no
  @line_no
end

#node_idObject

Returns the value of attribute node_id

Returns:

  • (Object)

    the current value of node_id



19
20
21
# File 'lib/optimize/ir/line_entry.rb', line 19

def node_id
  @node_id
end

#slot_offsetObject

Returns the value of attribute slot_offset

Returns:

  • (Object)

    the current value of slot_offset



19
20
21
# File 'lib/optimize/ir/line_entry.rb', line 19

def slot_offset
  @slot_offset
end