@@ -1570,8 +1570,8 @@ rb_obj_init_too_complex(VALUE obj, st_table *table)
15701570{
15711571 // This method is meant to be called on newly allocated object.
15721572 RUBY_ASSERT (!rb_shape_obj_too_complex_p (obj ));
1573- RUBY_ASSERT (rb_shape_canonical_p (RB_OBJ_SHAPE (obj )));
1574- RUBY_ASSERT (RB_OBJ_SHAPE (obj )-> next_field_index == 0 );
1573+ RUBY_ASSERT (rb_shape_canonical_p (rb_obj_shape (obj )));
1574+ RUBY_ASSERT (rb_obj_shape (obj )-> next_field_index == 0 );
15751575
15761576 obj_transition_too_complex (obj , table );
15771577}
@@ -1584,7 +1584,7 @@ rb_evict_fields_to_hash(VALUE obj)
15841584
15851585 RUBY_ASSERT (!rb_shape_obj_too_complex_p (obj ));
15861586
1587- rb_shape_t * shape = RB_OBJ_SHAPE (obj );
1587+ rb_shape_t * shape = rb_obj_shape (obj );
15881588 st_table * table = st_init_numtable_with_size (shape -> next_field_index );
15891589 rb_obj_copy_fields_to_hash_table (obj , table );
15901590 obj_transition_too_complex (obj , table );
@@ -1624,7 +1624,7 @@ general_ivar_set(VALUE obj, ID id, VALUE val, void *data,
16241624 .existing = true
16251625 };
16261626
1627- rb_shape_t * current_shape = RB_OBJ_SHAPE (obj );
1627+ rb_shape_t * current_shape = rb_obj_shape (obj );
16281628
16291629 if (UNLIKELY (rb_shape_too_complex_p (current_shape ))) {
16301630 goto too_complex ;
@@ -1681,7 +1681,7 @@ general_field_set(VALUE obj, rb_shape_t *target_shape, VALUE val, void *data,
16811681 void (* transition_too_complex_func )(VALUE , void * ),
16821682 st_table * (* too_complex_table_func )(VALUE , void * ))
16831683{
1684- rb_shape_t * current_shape = RB_OBJ_SHAPE (obj );
1684+ rb_shape_t * current_shape = rb_obj_shape (obj );
16851685
16861686 if (UNLIKELY (rb_shape_too_complex_p (target_shape ))) {
16871687 if (UNLIKELY (!rb_shape_too_complex_p (current_shape ))) {
@@ -1964,7 +1964,7 @@ rb_vm_set_ivar_id(VALUE obj, ID id, VALUE val)
19641964bool
19651965rb_shape_set_shape_id (VALUE obj , shape_id_t shape_id )
19661966{
1967- if (RB_OBJ_SHAPE_ID (obj ) == shape_id ) {
1967+ if (rb_obj_shape_id (obj ) == shape_id ) {
19681968 return false;
19691969 }
19701970
@@ -2119,7 +2119,7 @@ rb_ivar_defined(VALUE obj, ID id)
21192119 return Qtrue ;
21202120 }
21212121 else {
2122- return RBOOL (rb_shape_get_iv_index (RB_OBJ_SHAPE (obj ), id , & index ));
2122+ return RBOOL (rb_shape_get_iv_index (rb_obj_shape (obj ), id , & index ));
21232123 }
21242124}
21252125
@@ -2206,7 +2206,7 @@ obj_fields_each(VALUE obj, rb_ivar_foreach_callback_func *func, st_data_t arg, b
22062206 .ivar_only = ivar_only ,
22072207 };
22082208
2209- rb_shape_t * shape = RB_OBJ_SHAPE (obj );
2209+ rb_shape_t * shape = rb_obj_shape (obj );
22102210 if (rb_shape_too_complex_p (shape )) {
22112211 rb_st_foreach (ROBJECT_FIELDS_HASH (obj ), each_hash_iv , (st_data_t )& itr_data );
22122212 }
@@ -2218,7 +2218,7 @@ obj_fields_each(VALUE obj, rb_ivar_foreach_callback_func *func, st_data_t arg, b
22182218static void
22192219gen_fields_each (VALUE obj , rb_ivar_foreach_callback_func * func , st_data_t arg , bool ivar_only )
22202220{
2221- rb_shape_t * shape = RB_OBJ_SHAPE (obj );
2221+ rb_shape_t * shape = rb_obj_shape (obj );
22222222 struct gen_fields_tbl * fields_tbl ;
22232223 if (!rb_gen_fields_tbl_get (obj , 0 , & fields_tbl )) return ;
22242224
@@ -2243,7 +2243,7 @@ class_fields_each(VALUE obj, rb_ivar_foreach_callback_func *func, st_data_t arg,
22432243{
22442244 RUBY_ASSERT (RB_TYPE_P (obj , T_CLASS ) || RB_TYPE_P (obj , T_MODULE ));
22452245
2246- rb_shape_t * shape = RB_OBJ_SHAPE (obj );
2246+ rb_shape_t * shape = rb_obj_shape (obj );
22472247 struct iv_itr_data itr_data = {
22482248 .obj = obj ,
22492249 .arg = arg ,
@@ -2276,7 +2276,7 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
22762276 goto clear ;
22772277 }
22782278
2279- rb_shape_t * src_shape = RB_OBJ_SHAPE (obj );
2279+ rb_shape_t * src_shape = rb_obj_shape (obj );
22802280
22812281 if (rb_gen_fields_tbl_get (obj , 0 , & obj_fields_tbl )) {
22822282 if (gen_fields_tbl_count (obj , obj_fields_tbl ) == 0 )
@@ -2297,7 +2297,7 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
22972297 }
22982298
22992299 rb_shape_t * shape_to_set_on_dest = src_shape ;
2300- rb_shape_t * initial_shape = RB_OBJ_SHAPE (dest );
2300+ rb_shape_t * initial_shape = rb_obj_shape (dest );
23012301
23022302 if (!rb_shape_canonical_p (src_shape )) {
23032303 RUBY_ASSERT (initial_shape -> type == SHAPE_ROOT );
@@ -4586,7 +4586,7 @@ rb_fields_tbl_copy(VALUE dst, VALUE src)
45864586 RUBY_ASSERT (rb_type (dst ) == rb_type (src ));
45874587 RUBY_ASSERT (RB_TYPE_P (dst , T_CLASS ) || RB_TYPE_P (dst , T_MODULE ));
45884588
4589- RUBY_ASSERT (RB_OBJ_SHAPE (dst )-> type == SHAPE_ROOT );
4589+ RUBY_ASSERT (rb_obj_shape (dst )-> type == SHAPE_ROOT );
45904590 RUBY_ASSERT (!RCLASS_FIELDS (dst ));
45914591
45924592 rb_ivar_foreach (src , tbl_copy_i , dst );
0 commit comments