ruby/yjit
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
..
bindgen Transition complex objects to "too complex" shape 2022-12-15 10:06:04 -08:00
src merge revision(s) aeddc19340: [Backport #19316] 2023-01-18 18:56:51 +09:00
.gitignore
Cargo.lock YJIT: Instrument global allocations on stats build (#6712) 2022-11-13 12:54:41 -05:00
Cargo.toml YJIT: Generate debug info in release builds (#6910) 2022-12-12 15:59:29 -05:00
not_gmake.mk YJIT: Support MAKE=bmake for release build 2022-09-20 14:17:27 -04:00
yjit.mk Suppress the output of if [ 'xyes' = xyes ]; code 2022-12-13 22:26:24 -08:00