8000 Get rid of rb_shape_t.heap_id · ruby/ruby@be681b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit be681b4

Browse files
committed
Get rid of rb_shape_t.heap_id
1 parent 99cbd22 commit be681b4

File tree

4 files changed

+2
-8
lines changed

4 files changed

+2
-8
lines changed

shape.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ rb_shape_alloc(ID edge_name, rb_shape_t *parent, enum shape_type type)
451451
{
452452
rb_shape_t *shape = rb_shape_alloc_with_parent_id(edge_name, raw_shape_id(parent));
453453
shape->type = (uint8_t)type;
454-
shape->heap_index = parent->heap_index;
455454
shape->capacity = parent->capacity;
456455
shape->edges = 0;
457456
return shape;
@@ -755,7 +754,7 @@ rb_shape_object_id(shape_id_t original_shape_id)
755754
static inline shape_id_t
756755
transition_complex(shape_id_t shape_id)
757756
{
758-
uint8_t heap_index = RSHAPE(shape_id)->heap_index;
757+
uint8_t heap_index = rb_shape_heap_index(shape_id);
759758
shape_id_t next_shape_id;
760759

761760
if (heap_index) {
@@ -1341,7 +1340,7 @@ shape_id_t_to_rb_cShape(shape_id_t shape_id)
13411340
INT2NUM(shape->parent_id),
13421341
rb_shape_edge_name(shape),
13431342
INT2NUM(shape->next_field_index),
1344-
INT2NUM(shape->heap_index),
1343+
INT2NUM(rb_shape_heap_index(shape_id)),
13451344
INT2NUM(shape->type),
13461345
INT2NUM(RSHAPE_CAPACITY(shape_id)));
13471346
rb_obj_freeze(obj);
@@ -1562,15 +1561,13 @@ Init_default_shapes(void)
15621561
rb_shape_t *root = rb_shape_alloc_with_parent_id(0, INVALID_SHAPE_ID);
15631562
root->capacity = 0;
15641563
root->type = SHAPE_ROOT;
1565-
root->heap_index = 0;
15661564
GET_SHAPE_TREE()->root_shape = root;
15671565
RUBY_ASSERT(raw_shape_id(GET_SHAPE_TREE()->root_shape) == ROOT_SHAPE_ID);
15681566

15691567
rb_shape_t *root_with_obj_id = rb_shape_alloc_with_parent_id(0, ROOT_SHAPE_ID);
15701568
root_with_obj_id->type = SHAPE_OBJ_ID;
15711569
root_with_obj_id->edge_name = ruby_internal_object_id;
15721570
root_with_obj_id->next_field_index++;
1573-
root_with_obj_id->heap_index = 0;
15741571
RUBY_ASSERT(raw_shape_id(root_with_obj_id) == ROOT_SHAPE_WITH_OBJ_ID);
15751572
}
15761573

shape.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ struct rb_shape {
5757
attr_index_t next_field_index; // Fields are either ivars or internal properties like `object_id`
5858
attr_index_t capacity; // Total capacity of the object with this shape
5959
uint8_t type;
60-
uint8_t heap_index;
6160
};
6261

6362
typedef struct rb_shape rb_shape_t;

yjit/src/cruby_bindings.inc.rs

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zjit/src/cruby_bindings.inc.rs

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0