Class: Furnace::AVM2::ABC::ExceptionInfo

Inherits:
Record show all
Defined in:
lib/furnace-avm2/abc/metadata/exception_info.rb

Instance Attribute Summary collapse

Attributes inherited from Binary::Record

#root

Instance Method Summary collapse

Methods inherited from Record

abc_array_of, flag, pool_array, pool_array_of, pool_ref, subset, xlat_direct, xlat_field, xlat_inverse

Methods inherited from Binary::Record

#byte_length, codegen, codegen_each, inherited, #inspect, method_missing, register, #to_hash, trace, trace_scope, trace_value

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



10
11
12
# File 'lib/furnace-avm2/abc/metadata/exception_info.rb', line 10

def from
  @from
end

#targetObject (readonly)

Returns the value of attribute target.



10
11
12
# File 'lib/furnace-avm2/abc/metadata/exception_info.rb', line 10

def target
  @target
end

#toObject (readonly)

Returns the value of attribute to.



10
11
12
# File 'lib/furnace-avm2/abc/metadata/exception_info.rb', line 10

def to
  @to
end

Instance Method Details

#initialize_record(options) ⇒ Object



12
13
14
# File 'lib/furnace-avm2/abc/metadata/exception_info.rb', line 12

def initialize_record(options)
  @parent = options[:parent]
end

#lookup!Object



24
25
26
27
28
29
# File 'lib/furnace-avm2/abc/metadata/exception_info.rb', line 24

def lookup!
  # HACK ALERT this fixes improper DCE implementation failures
  self.from_offset   = @from.offset    || 0
  self.to_offset     = @to.offset      || 0
  self.target_offset = @target.offset  || 0
end

#rangeObject



31
32
33
# File 'lib/furnace-avm2/abc/metadata/exception_info.rb', line 31

def range
  from_offset..to_offset
end

#resolve!Object



16
17
18
19
20
21
22
# File 'lib/furnace-avm2/abc/metadata/exception_info.rb', line 16

def resolve!
  sequence = @parent.code

  @from   = sequence.opcode_at(from_offset)
  @to     = sequence.opcode_at(to_offset)
  @target = sequence.opcode_at(target_offset)
end