ruby/lib/ruby_vm/mjit/context.rb
2023-03-05 22:11:20 -08:00

15 lines
387 B
Ruby

class RubyVM::MJIT::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
)
def initialize(stack_size: 0, sp_offset: 0) = super
def stack_push(size)
self.stack_size += size
self.sp_offset += size
end
def stack_pop(size)
stack_push(-size)
end
end