summaryrefslogtreecommitdiff
path: root/lib/ruby_vm/mjit/insn_compiler.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2023-02-08 17:33:27 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 22:41:35 -0800
commit98a3b40d5517d0d7444597f49287830b8ec2f041 (patch)
treeb6a895440944dabe7ec87215a72bd42e874c31d9 /lib/ruby_vm/mjit/insn_compiler.rb
parentdcdffb1aa009252fb7ad240c262d6232a053e29e (diff)
Implement pop
Diffstat (limited to 'lib/ruby_vm/mjit/insn_compiler.rb')
-rw-r--r--lib/ruby_vm/mjit/insn_compiler.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ruby_vm/mjit/insn_compiler.rb b/lib/ruby_vm/mjit/insn_compiler.rb
index d53fec1feb..ed004c99e9 100644
--- a/lib/ruby_vm/mjit/insn_compiler.rb
+++ b/lib/ruby_vm/mjit/insn_compiler.rb
@@ -18,7 +18,7 @@ module RubyVM::MJIT
asm.incr_counter(:mjit_insns_count)
asm.comment("Insn: #{insn.name}")
- # 28/101
+ # 29/101
case insn.name
when :nop then nop(jit, ctx, asm)
# getlocal
@@ -55,7 +55,7 @@ module RubyVM::MJIT
# splatarray
# newhash
# newrange
- # pop
+ when :pop then pop(jit, ctx, asm)
when :dup then dup(jit, ctx, asm)
# dupn
# swap
@@ -243,7 +243,14 @@ module RubyVM::MJIT
# splatarray
# newhash
# newrange
- # pop
+
+ # @param jit [RubyVM::MJIT::JITState]
+ # @param ctx [RubyVM::MJIT::Context]
+ # @param asm [RubyVM::MJIT::Assembler]
+ def pop(jit, ctx, asm)
+ ctx.stack_pop
+ KeepCompiling
+ end
# @param jit [RubyVM::MJIT::JITState]
# @param ctx [RubyVM::MJIT::Context]