@@ -347,12 +347,6 @@ RSHAPE(shape_id_t shape_id)
347347 return & GET_SHAPE_TREE ()-> shape_list [shape_id ];
348348}
349349
350- rb_shape_t *
351- rb_shape_get_parent (rb_shape_t * shape )
352- {
353- return RSHAPE (shape -> parent_id );
354- }
355-
356350#if !SHAPE_IN_BASIC_FLAGS
357351shape_id_t rb_generic_shape_id (VALUE obj );
358352#endif
@@ -388,7 +382,7 @@ rb_shape_depth(shape_id_t shape_id)
388382
389383 while (shape -> parent_id != INVALID_SHAPE_ID ) {
390384 depth ++ ;
391- shape = rb_shape_get_parent (shape );
385+ shape = RSHAPE (shape -> parent_id );
392386 }
393387
394388 return depth ;
@@ -446,7 +440,7 @@ redblack_cache_ancestors(rb_shape_t *shape)
446440 if (!(shape -> ancestor_index || shape -> parent_id == INVALID_SHAPE_ID )) {
447441 redblack_node_t * parent_index ;
448442
449- parent_index = redblack_cache_ancestors (rb_shape_get_parent (shape ));
443+ parent_index = redblack_cache_ancestors (RSHAPE (shape -> parent_id ));
450444
451445 if (shape -> type == SHAPE_IVAR ) {
452446 shape -> ancestor_index = redblack_insert (parent_index , shape -> edge_name , shape );
@@ -612,11 +606,11 @@ remove_shape_recursive(rb_shape_t *shape, ID id, rb_shape_t **removed_shape)
612606 if (shape -> type == SHAPE_IVAR && shape -> edge_name == id ) {
613607 * removed_shape = shape ;
614608
615- return rb_shape_get_parent (shape );
609+ return RSHAPE (shape -> parent_id );
616610 }
617611 else {
618612 // This isn't the IV we want to remove, keep walking up.
619- rb_shape_t * new_parent = remove_shape_recursive (rb_shape_get_parent (shape ), id , removed_shape );
613+ rb_shape_t * new_parent = remove_shape_recursive (RSHAPE (shape -> parent_id ), id , removed_shape );
620614
621615 // We found a new parent. Create a child of the new parent that
622616 // has the same attributes as this shape.
@@ -765,7 +759,7 @@ rb_shape_object_id_shape(VALUE obj)
765759
766760 if (shape -> flags & SHAPE_FL_HAS_OBJECT_ID ) {
767761 while (shape -> type != SHAPE_OBJ_ID ) {
768- shape = rb_shape_get_parent (shape );
762+ shape = RSHAPE (shape -> parent_id );
769763 }
770764 return shape ;
771765 }
@@ -886,7 +880,7 @@ rb_shape_get_iv_index_with_hint(shape_id_t shape_id, ID id, attr_index_t *value,
886880
887881 while (depth > 0 && shape -> next_field_index > index_hint ) {
888882 while (shape_hint -> next_field_index > shape -> next_field_index ) {
889- shape_hint = rb_shape_get_parent (shape_hint );
883+ shape_hint = RSHAPE (shape_hint -> parent_id );
890884 }
891885
892886 if (shape_hint == shape ) {
@@ -902,7 +896,7 @@ rb_shape_get_iv_index_with_hint(shape_id_t shape_id, ID id, attr_index_t *value,
902896 return true;
903897 }
904898
905- shape = rb_shape_get_parent (shape );
899+ shape = RSHAPE (shape -> parent_id );
906900 depth -- ;
907901 }
908902
@@ -938,7 +932,7 @@ shape_get_iv_index(rb_shape_t *shape, ID id, attr_index_t *value)
938932 }
939933 }
940934
941- shape = rb_shape_get_parent (shape );
935+ shape = RSHAPE (shape -> parent_id );
942936 }
943937
944938 return false;
@@ -1009,7 +1003,7 @@ shape_traverse_from_new_root(rb_shape_t *initial_shape, rb_shape_t *dest_shape)
10091003 rb_shape_t * next_shape = initial_shape ;
10101004
10111005 if (dest_shape -> type != initial_shape -> type ) {
1012- next_shape = shape_traverse_from_new_root (initial_shape , rb_shape_get_parent (dest_shape ));
1006+ next_shape = shape_traverse_from_new_root (initial_shape , RSHAPE (dest_shape -> parent_id ));
10131007 if (!next_shape ) {
10141008 return NULL ;
10151009 }
@@ -1075,7 +1069,7 @@ rb_shape_rebuild_shape(rb_shape_t *initial_shape, rb_shape_t *dest_shape)
10751069 RUBY_ASSERT (initial_shape -> type == SHAPE_T_OBJECT || initial_shape -> type == SHAPE_ROOT );
10761070
10771071 if (dest_shape -> type != initial_shape -> type ) {
1078- midway_shape = rb_shape_rebuild_shape (initial_shape , rb_shape_get_parent (dest_shape ));
1072+ midway_shape = rb_shape_rebuild_shape (initial_shape , RSHAPE (dest_shape -> parent_id ));
10791073 if (UNLIKELY (rb_shape_id (midway_shape ) == ROOT_TOO_COMPLEX_SHAPE_ID )) {
10801074 return midway_shape ;
10811075 }
@@ -1257,7 +1251,7 @@ rb_shape_parent(VALUE self)
12571251 rb_shape_t * shape ;
12581252 shape = RSHAPE (NUM2INT (rb_struct_getmember (self , rb_intern ("id" ))));
12591253 if (shape -> parent_id != INVALID_SHAPE_ID ) {
1260- return rb_shape_t_to_rb_cShape (rb_shape_get_parent (shape ));
1254+ return rb_shape_t_to_rb_cShape (RSHAPE (shape -> parent_id ));
12611255 }
12621256 else {
12631257 return Qnil ;
0 commit comments