diff options
Diffstat (limited to 'lib/ruby_vm/mjit/context.rb')
-rw-r--r-- | lib/ruby_vm/mjit/context.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/ruby_vm/mjit/context.rb b/lib/ruby_vm/mjit/context.rb deleted file mode 100644 index e834b42999..0000000000 --- a/lib/ruby_vm/mjit/context.rb +++ /dev/null @@ -1,30 +0,0 @@ -module RubyVM::MJIT - class Context < Struct.new( - :stack_size, # @param [Integer] The number of values on the stack - :sp_offset, # @param [Integer] JIT sp offset relative to the interpreter's sp - :chain_depth, # @param [Integer] jit_chain_guard depth - ) - def initialize(stack_size: 0, sp_offset: 0, chain_depth: 0) = super - - def stack_push(size = 1) - self.stack_size += size - self.sp_offset += size - stack_opnd(0) - end - - def stack_pop(size = 1) - opnd = stack_opnd(0) - self.stack_size -= size - self.sp_offset -= size - opnd - end - - def stack_opnd(depth_from_top) - [SP, C.VALUE.size * (self.sp_offset - 1 - depth_from_top)] - end - - def sp_opnd(offset_bytes = 0) - [SP, (C.VALUE.size * self.sp_offset) + offset_bytes] - end - end -end |