diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-04-01 21:34:19 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-04-01 21:34:19 -0700 |
commit | 2ce5cfa2be927acfd20c2543e0580cbef715213d (patch) | |
tree | 914fb2c6053cc6206e0ed9bbc58d861e8ab96bab | |
parent | e45ed2da5046f7ee2a82f332d211ddbd7108fc22 (diff) | |
download | ruby-2ce5cfa2be927acfd20c2543e0580cbef715213d.tar.gz |
RJIT: Save PC on String#concat
-rw-r--r-- | lib/ruby_vm/rjit/insn_compiler.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ruby_vm/rjit/insn_compiler.rb b/lib/ruby_vm/rjit/insn_compiler.rb index 27031dc0e3..8be29b6dd7 100644 --- a/lib/ruby_vm/rjit/insn_compiler.rb +++ b/lib/ruby_vm/rjit/insn_compiler.rb @@ -2903,8 +2903,10 @@ module RubyVM::RJIT asm.mov(:rax, ctx.stack_opnd(0)) guard_object_is_string(asm, :rax, :rcx, side_exit) - # Guard buffers from GC since rb_str_buf_append may allocate. - jit_save_sp(ctx, asm) + # Guard buffers from GC since rb_str_buf_append may allocate. During the VM lock on GC, + # other Ractors may trigger global invalidation, so we need record_boundary_patch_point. + # PC is used on errors like Encoding::CompatibilityError raised by rb_str_buf_append. + jit_prepare_routine_call(jit, ctx, asm) concat_arg = ctx.stack_pop(1) recv = ctx.stack_pop(1) |