shape.c: refactor frozen shape to no longer be final

This opens the door to store more informations in shapes, such
as the `object_id` or object address in case it has been observed
and the object has to be moved.
This commit is contained in:
Jean Boussier 2025-04-21 12:01:01 +09:00
parent 6c9b3ac232
commit d34c150547
Notes: git 2025-05-08 05:58:19 +00:00
3 changed files with 20 additions and 2 deletions

View file

@ -358,7 +358,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj)
rb_shape_t *initial_shape = rb_shape_get_shape(dest);
if (initial_shape->heap_index != src_shape->heap_index) {
if (initial_shape->heap_index != src_shape->heap_index || !rb_shape_canonical_p(src_shape)) {
RUBY_ASSERT(initial_shape->type == SHAPE_T_OBJECT);
shape_to_set_on_dest = rb_shape_rebuild_shape(initial_shape, src_shape);