Class: YTLJit::AsmType::PointedData

Inherits:
TypeCommon show all
Defined in:
lib/ytljit/type.rb

Instance Attribute Summary collapse

Attributes inherited from TypeCommon

#type

Instance Method Summary collapse

Constructor Details

#initialize(type, index, offset) ⇒ PointedData

Returns a new instance of PointedData.



27
28
29
30
31
# File 'lib/ytljit/type.rb', line 27

def initialize(type, index, offset)
  @type = type
  @index = index
  @offset = offset + index * type.size
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



33
34
35
# File 'lib/ytljit/type.rb', line 33

def index
  @index
end

#offsetObject (readonly)

Returns the value of attribute offset.



34
35
36
# File 'lib/ytljit/type.rb', line 34

def offset
  @offset
end

Instance Method Details

#[](*args) ⇒ Object



40
41
42
# File 'lib/ytljit/type.rb', line 40

def [](*args)
  @type[*args]
end

#alignmentObject



44
45
46
# File 'lib/ytljit/type.rb', line 44

def alignment
  @type.alignment
end

#sizeObject



36
37
38
# File 'lib/ytljit/type.rb', line 36

def size
  @type.size
end