diff options
author | Takashi Kokubun <[email protected]> | 2023-02-08 17:17:36 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-05 22:41:35 -0800 |
commit | eac44ec212cad8c534292447bdf2fd5b795dcf97 (patch) | |
tree | 79db34ec651c783a3d56262c69bd27acb9220e97 /lib/ruby_vm/mjit/context.rb | |
parent | 50bd7326c1a09c9c28f5483299c3f199ac8da7b5 (diff) |
Implement dup
Diffstat (limited to 'lib/ruby_vm/mjit/context.rb')
-rw-r--r-- | lib/ruby_vm/mjit/context.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ruby_vm/mjit/context.rb b/lib/ruby_vm/mjit/context.rb index 86aa03514a..fb9db212d5 100644 --- a/lib/ruby_vm/mjit/context.rb +++ b/lib/ruby_vm/mjit/context.rb @@ -7,16 +7,16 @@ module RubyVM::MJIT def initialize(stack_size: 0, sp_offset: 0, chain_depth: 0) = super def stack_push(size = 1) - opnd = [SP, C.VALUE.size * self.sp_offset] self.stack_size += size self.sp_offset += size - opnd + stack_opnd(0) end def stack_pop(size = 1) + opnd = stack_opnd(0) self.stack_size -= size self.sp_offset -= size - [SP, C.VALUE.size * self.sp_offset] + opnd end def stack_opnd(depth_from_top) |