Class: Rubinius::InstructionSequence

Inherits:
Object
  • Object
show all
Defined in:
lib/rubinius/bridge/iseq.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size) ⇒ InstructionSequence

Returns a new instance of InstructionSequence.



5
6
7
8
9
10
11
# File 'lib/rubinius/bridge/iseq.rb', line 5

def initialize(size)
  if size.kind_of? Tuple
    @opcodes = size
  else
    @opcodes = Tuple.new(size)
  end
end

Instance Attribute Details

#opcodesObject (readonly)

Returns the value of attribute opcodes.



13
14
15
# File 'lib/rubinius/bridge/iseq.rb', line 13

def opcodes
  @opcodes
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
# File 'lib/rubinius/bridge/iseq.rb', line 15

def ==(other)
  other.kind_of?(InstructionSequence) and @opcodes == other.opcodes
end

#[](idx) ⇒ Object



23
24
25
# File 'lib/rubinius/bridge/iseq.rb', line 23

def [](idx)
  @opcodes[idx]
end

#[]=(idx, val) ⇒ Object



19
20
21
# File 'lib/rubinius/bridge/iseq.rb', line 19

def []=(idx, val)
  @opcodes[idx] = val
end

#sizeObject



27
28
29
# File 'lib/rubinius/bridge/iseq.rb', line 27

def size
  @opcodes.size
end