Skip to content

Commit

Permalink
Added ref count instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Jan 26, 2020
1 parent c1a0fa9 commit 7b7a5d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/rubinius/code/compiler/generator_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1982,5 +1982,17 @@ def r_load_index(arg1, arg2, arg3)
@ip += 4
@instruction = 282
end

def r_refcnt_inc(arg1)
@stream << 283 << arg1
@ip += 2
@instruction = 283
end

def r_refcnt_dec(arg1)
@stream << 284 << arg1
@ip += 2
@instruction = 284
end
end
end
2 changes: 2 additions & 0 deletions lib/rubinius/code/compiler/opcodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,5 +322,7 @@ class InstructionSet
opcode 281, :r_store_ivar, :stack => [0, 0], :args => [:r0, :r1, :literal], :control_flow => :next
opcode 282, :r_load_index, :stack => [0, 0], :args => [:r0, :r1, :literal], :control_flow => :next

opcode 283, :r_refcnt_inc, :stack => [0, 0], :args => [:r0], :control_flow => :next
opcode 284, :r_refcnt_dec, :stack => [0, 0], :args => [:r0], :control_flow => :next
end
end

0 comments on commit 7b7a5d0

Please sign in to comment.