ruby/yjit/src
NARUSE, Yui 1fb5eb5740 merge revision(s) aeddc19340: [Backport #19316]
YJIT: Save PC and SP before calling leaf builtins (#7090)

	Previously, we did not update `cfp->sp` before calling the C function of
	ISEQs marked with `Primitive.attr! "inline"` (leaf builtins). This
	caused the GC to miss temporary values on the stack in case the function
	allocates and triggers a GC run. Right now, there is only a few leaf
	builtins in numeric.rb on Integer methods such as `Integer#~`. Since
	these methods only allocate when operating on big numbers, we missed
	this issue.

	Fix by saving PC and SP before calling the functions -- our usual
	protocol for calling C functions that may allocate on the GC heap.

	[Bug #19316]
	---
	 test/ruby/test_yjit.rb | 16 ++++++++++++++++
	 yjit/src/codegen.rs    |  4 ++++
	 2 files changed, 20 insertions(+)
2023-01-18 18:56:51 +09:00
..
asm YJIT: Remove --yjit-code-page-size (#6865) 2022-12-05 17:43:17 -05:00
backend YJIT: fix 32 and 16 bit register store (#6840) 2022-12-01 10:53:50 -05:00
codegen.rs merge revision(s) aeddc19340: [Backport #19316] 2023-01-18 18:56:51 +09:00
core.rs YJIT: Fix code GC freeing stubs with a trampoline (#6937) 2022-12-15 15:10:14 -05:00
cruby.rs Transition complex objects to "too complex" shape 2022-12-15 10:06:04 -08:00
cruby_bindings.inc.rs MJIT: Export fewer shape functions (#7007) 2022-12-23 10:18:57 -08:00
disasm.rs YJIT: Pack BlockId and CodePtr (#6748) 2022-11-16 15:48:46 -08:00
invariants.rs YJIT: Deallocate struct Block to plug memory leaks 2022-11-30 12:23:50 -05:00
lib.rs Fixes remaining issues and turns back on dead code and unused (#6584) 2022-10-18 16:03:55 -04:00
options.rs YJIT: Change the default mem size to 64MiB (#6912) 2022-12-13 11:00:22 -05:00
stats.rs YJIT: Split send_iseq_complex_callee exit reasons (#6895) 2022-12-09 16:45:38 -08:00
utils.rs YJIT: Interleave inline and outlined code blocks (#6460) 2022-10-17 10:45:59 -07:00
virtualmem.rs YJIT: Use NonNull pointer for CodePtr (#6792) 2022-11-23 12:02:05 -05:00
yjit.rs YJIT: Add RubyVM::YJIT.code_gc (#6644) 2022-10-31 14:29:45 -04:00