diff options
Diffstat (limited to 'lib/ruby_vm/mjit/context.rb')
-rw-r--r-- | lib/ruby_vm/mjit/context.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ruby_vm/mjit/context.rb b/lib/ruby_vm/mjit/context.rb index c5c5e987bd..86aa03514a 100644 --- a/lib/ruby_vm/mjit/context.rb +++ b/lib/ruby_vm/mjit/context.rb @@ -18,5 +18,13 @@ module RubyVM::MJIT self.sp_offset -= size [SP, C.VALUE.size * self.sp_offset] end + + def stack_opnd(depth_from_top) + [SP, C.VALUE.size * (self.sp_offset - 1 - depth_from_top)] + end + + def sp_opnd(offset_bytes) + [SP, (C.VALUE.size * self.sp_offset) + offset_bytes] + end end end |