Only set shape id for CCs on attr_set + ivar
Only ivar reader and writer methods should need the shape ID set on the inline cache. We shouldn't accidentally overwrite parts of the CC union when it's not necessary.
This commit is contained in:
parent
16b0242808
commit
bbeebc9258
Notes:
git
2024-07-31 23:23:45 +00:00
@ -348,7 +348,10 @@ vm_cc_new(VALUE klass,
|
||||
break;
|
||||
}
|
||||
|
||||
if (cme->def->type == VM_METHOD_TYPE_ATTRSET || cme->def->type == VM_METHOD_TYPE_IVAR) {
|
||||
vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID);
|
||||
}
|
||||
|
||||
RB_DEBUG_COUNTER_INC(cc_new);
|
||||
return cc;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user