summaryrefslogtreecommitdiff
path: root/shape.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-03-12 14:34:17 -0400
committerPeter Zhu <[email protected]>2024-03-13 09:55:52 -0400
commit3896f9940e7f663dd4db8162c071d72e2539addf (patch)
tree0fe380931280db7693778a067750d0f093ee2cb2 /shape.c
parent6b0434c0f721a62d617b26986565985598c7b8c9 (diff)
Make special const and too complex shapes before T_OBJECT shapes
Diffstat (limited to 'shape.c')
-rw-r--r--shape.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/shape.c b/shape.c
index d3e68ef1dc..63493be21b 100644
--- a/shape.c
+++ b/shape.c
@@ -1256,18 +1256,6 @@ Init_default_shapes(void)
GET_SHAPE_TREE()->root_shape = root;
RUBY_ASSERT(rb_shape_id(GET_SHAPE_TREE()->root_shape) == ROOT_SHAPE_ID);
- // Make shapes for T_OBJECT
- size_t *sizes = rb_gc_size_pool_sizes();
- for (int i = 0; sizes[i] > 0; i++) {
- rb_shape_t *t_object_shape =
- rb_shape_alloc_with_parent_id(0, INVALID_SHAPE_ID);
- t_object_shape->type = SHAPE_T_OBJECT;
- t_object_shape->capacity = (uint32_t)((sizes[i] - offsetof(struct RObject, as.ary)) / sizeof(VALUE));
- t_object_shape->edges = rb_id_table_create(0);
- t_object_shape->ancestor_index = LEAF;
- RUBY_ASSERT(rb_shape_id(t_object_shape) == (shape_id_t)(i + 1));
- }
-
bool dont_care;
// Special const shape
#if RUBY_DEBUG
@@ -1323,6 +1311,7 @@ Init_shape(void)
rb_define_const(rb_cShape, "SHAPE_FLAG_SHIFT", INT2NUM(SHAPE_FLAG_SHIFT));
rb_define_const(rb_cShape, "SPECIAL_CONST_SHAPE_ID", INT2NUM(SPECIAL_CONST_SHAPE_ID));
rb_define_const(rb_cShape, "OBJ_TOO_COMPLEX_SHAPE_ID", INT2NUM(OBJ_TOO_COMPLEX_SHAPE_ID));
+ rb_define_const(rb_cShape, "FIRST_T_OBJECT_SHAPE_ID", INT2NUM(FIRST_T_OBJECT_SHAPE_ID));
rb_define_const(rb_cShape, "SHAPE_MAX_VARIATIONS", INT2NUM(SHAPE_MAX_VARIATIONS));
rb_define_const(rb_cShape, "SIZEOF_RB_SHAPE_T", INT2NUM(sizeof(rb_shape_t)));
rb_define_const(rb_cShape, "SIZEOF_REDBLACK_NODE_T", INT2NUM(sizeof(redblack_node_t)));