From e06bebff5ef57dd4c32acb77001df230520c5449 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 3 Apr 2023 00:49:32 -0700 Subject: RJIT: Propagate argument types on method calls --- lib/ruby_vm/rjit/insn_compiler.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/ruby_vm') diff --git a/lib/ruby_vm/rjit/insn_compiler.rb b/lib/ruby_vm/rjit/insn_compiler.rb index 6bb802150a..10222bd8f4 100644 --- a/lib/ruby_vm/rjit/insn_compiler.rb +++ b/lib/ruby_vm/rjit/insn_compiler.rb @@ -4815,6 +4815,13 @@ module RubyVM::RJIT # Create a context for the callee callee_ctx = Context.new + # Set the argument types in the callee's context + argc.times do |arg_idx| + stack_offs = argc - arg_idx - 1 + arg_type = ctx.get_opnd_type(StackOpnd[stack_offs]) + callee_ctx.set_local_type(arg_idx, arg_type) + end + recv_type = if calling.block_handler == :captured Type::Unknown # we don't track the type information of captured->self for now else -- cgit v1.2.3