aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ruby_vm
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-04-04 00:40:31 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2023-04-04 00:41:58 -0700
commit98f0e2c330a261a96e3a90ff4f5a8c671abdbec5 (patch)
treecda67c635aafbb90cb885aaa9c7e8a9a5255a70e /lib/ruby_vm
parent19506650efeb8b19cea3f72d3f95547c5cbc3659 (diff)
downloadruby-98f0e2c330a261a96e3a90ff4f5a8c671abdbec5.tar.gz
RJIT: Fix the argument for defined
Diffstat (limited to 'lib/ruby_vm')
-rw-r--r--lib/ruby_vm/rjit/insn_compiler.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ruby_vm/rjit/insn_compiler.rb b/lib/ruby_vm/rjit/insn_compiler.rb
index d9aca5b52c..51ff1667b4 100644
--- a/lib/ruby_vm/rjit/insn_compiler.rb
+++ b/lib/ruby_vm/rjit/insn_compiler.rb
@@ -1283,7 +1283,7 @@ module RubyVM::RJIT
asm.cmovnz(:rax, :rcx)
# Push the return value onto the stack
- out_type = if C::SPECIAL_CONST_P(C.to_ruby(pushval))
+ out_type = if C::SPECIAL_CONST_P(pushval)
Type::UnknownImm
else
Type::Unknown
@@ -1307,7 +1307,7 @@ module RubyVM::RJIT
ivar_name = jit.operand(0)
# Value that will be pushed on the stack if the ivar is defined. In practice this is always the
# string "instance-variable". If the ivar is not defined, nil will be pushed instead.
- pushval = jit.operand(2)
+ pushval = jit.operand(2, ruby: true)
# Get the receiver
recv = :rcx
@@ -1333,11 +1333,11 @@ module RubyVM::RJIT
# }
asm.test(C_RET, 255)
asm.mov(:rax, Qnil)
- asm.mov(:rcx, pushval)
+ asm.mov(:rcx, to_value(pushval))
asm.cmovnz(:rax, :rcx)
# Push the return value onto the stack
- out_type = C::SPECIAL_CONST_P(C.to_ruby(pushval)) ? Type::UnknownImm : Type::Unknown
+ out_type = C::SPECIAL_CONST_P(pushval) ? Type::UnknownImm : Type::Unknown
stack_ret = ctx.stack_push(out_type)
asm.mov(stack_ret, :rax)
@@ -1358,7 +1358,7 @@ module RubyVM::RJIT
asm.cmp(shape_opnd, shape_id)
jit_chain_guard(:jne, jit, ctx, asm, side_exit)
- result = ivar_exists ? pushval : Qnil
+ result = ivar_exists ? C.to_value(pushval) : Qnil
putobject(jit, ctx, asm, val: result)
# Jump to next instruction. This allows guard chains to share the same successor.