Remove numiv from RObject

Since object shapes store the capacity of an object, we no longer
need the numiv field on RObjects. This gives us one extra slot which
we can use to give embedded objects one more instance variable (for a
total of 3 ivs). This commit removes the concept of numiv from RObject.
This commit is contained in:
Jemma Issroff 2022-11-08 14:09:43 -05:00 committed by Peter Zhu
parent 5246f4027e
commit c726c48a3d
Notes: git 2022-11-10 15:12:04 +00:00
9 changed files with 16 additions and 106 deletions

View file

@ -386,7 +386,7 @@ module RubyVM::MJIT
src << " dest_shape_id != ROBJECT_SHAPE_ID(obj)) {\n"
# Conditionally generate a capacity change if there is one
# between the destination and the parent IV set
src << " rb_ensure_iv_list_size(obj, RBOJECT_NUMIV(obj), #{capa});\n" if capa
src << " rb_ensure_iv_list_size(obj, ROBJECT_IV_CAPACITY(obj), #{capa});\n" if capa
src << " ROBJECT_SET_SHAPE_ID(obj, dest_shape_id);\n"
src << " VALUE *ptr = ROBJECT_IVPTR(obj);\n"
src << " RB_OBJ_WRITE(obj, &ptr[index], stack[#{stack_size - 1}]);\n"