diff options
author | Jean Boussier <[email protected]> | 2025-06-07 14:44:13 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-06-07 18:30:44 +0200 |
commit | 6eb0cd8df703d0a2edf7b11eab3255295e58c888 (patch) | |
tree | 4d3e7e6a860a1ff5ca18b91a807bc5a7eb9236b7 /test | |
parent | 1c96aed6eea39a06a4b790ddc7a31a0b35a9330e (diff) |
Get rid of SHAPE_T_OBJECT
Now that we have the `heap_index` in shape flags we no longer
need `T_OBJECT` shapes.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13556
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_shapes.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index e62b8c33e7..a4cf23c6d5 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -905,13 +905,15 @@ class TestShapes < Test::Unit::TestCase def test_remove_instance_variable_capacity_transition assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") begin; - t_object_shape = RubyVM::Shape.find_by_id(RubyVM::Shape::FIRST_T_OBJECT_SHAPE_ID) - assert_equal(RubyVM::Shape::SHAPE_T_OBJECT, t_object_shape.type) - - initial_capacity = t_object_shape.capacity # a does not transition in capacity a = Class.new.new + root_shape = RubyVM::Shape.of(a) + + assert_equal(RubyVM::Shape::SHAPE_ROOT, root_shape.type) + initial_capacity = root_shape.capacity + refute_equal(0, initial_capacity) + initial_capacity.times do |i| a.instance_variable_set(:"@ivar#{i + 1}", i) end @@ -1007,7 +1009,7 @@ class TestShapes < Test::Unit::TestCase def test_new_obj_has_t_object_shape obj = TestObject.new shape = RubyVM::Shape.of(obj) - assert_equal RubyVM::Shape::SHAPE_T_OBJECT, shape.type + assert_equal RubyVM::Shape::SHAPE_ROOT, shape.type assert_nil shape.parent end @@ -1039,7 +1041,7 @@ class TestShapes < Test::Unit::TestCase assert_equal RubyVM::Shape::SHAPE_IVAR, shape.type shape = shape.parent - assert_equal RubyVM::Shape::SHAPE_T_OBJECT, shape.type + assert_equal RubyVM::Shape::SHAPE_ROOT, shape.type assert_nil shape.parent assert_equal(1, obj.instance_variable_get(:@a)) |