ZJIT: Annotate BasicObject#initialize (#14590)

It's a no-op and always returns `nil`.

Fixes https://github.com/Shopify/ruby/issues/755
This commit is contained in:
Max Bernstein 2025-09-18 10:03:28 -04:00 committed by GitHub
parent 4e05fe54e2
commit 7e6f7fbf9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -177,6 +177,7 @@ pub fn init() -> Annotations {
annotate!(rb_mKernel, "nil?", types::FalseClass, no_gc, leaf, elidable);
annotate!(rb_cBasicObject, "==", types::BoolExact, no_gc, leaf, elidable);
annotate!(rb_cBasicObject, "!", types::BoolExact, no_gc, leaf, elidable);
annotate!(rb_cBasicObject, "initialize", types::NilClass, no_gc, leaf, elidable);
annotate_builtin!(rb_mKernel, "Float", types::Float);
annotate_builtin!(rb_mKernel, "Integer", types::Integer);

View File

@ -8121,7 +8121,8 @@ mod opt_tests {
v6:NilClass = Const Value(nil)
PatchPoint MethodRedefined(C@0x1008, new@0x1010, cme:0x1018)
v37:HeapObject[class_exact:C] = ObjectAllocClass VALUE(0x1008)
v12:BasicObject = SendWithoutBlock v37, :initialize
PatchPoint MethodRedefined(C@0x1008, initialize@0x1040, cme:0x1048)
v39:NilClass = CCall initialize@0x1070, v37
CheckInterrupts
CheckInterrupts
Return v37