Skip to content

Commit b0c80c2

Browse files
etiennebarriebyroot
authored andcommitted
Remove unused SPECIAL_CONST_SHAPE_ID
Its usage was removed in 306d508.
1 parent 18aa730 commit b0c80c2

File tree

7 files changed

+4
-8
lines changed

7 files changed

+4
-8
lines changed

shape.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,6 @@ Init_shape(void)
16251625
rb_define_const(rb_cShape, "SHAPE_IVAR", INT2NUM(SHAPE_IVAR));
16261626
rb_define_const(rb_cShape, "SHAPE_ID_NUM_BITS", INT2NUM(SHAPE_ID_NUM_BITS));
16271627
rb_define_const(rb_cShape, "SHAPE_FLAG_SHIFT", INT2NUM(SHAPE_FLAG_SHIFT));
1628-
rb_define_const(rb_cShape, "SPECIAL_CONST_SHAPE_ID", INT2NUM(SPECIAL_CONST_SHAPE_ID));
16291628
rb_define_const(rb_cShape, "SHAPE_MAX_VARIATIONS", INT2NUM(SHAPE_MAX_VARIATIONS));
16301629
rb_define_const(rb_cShape, "SIZEOF_RB_SHAPE_T", INT2NUM(sizeof(rb_shape_t)));
16311630
rb_define_const(rb_cShape, "SIZEOF_REDBLACK_NODE_T", INT2NUM(sizeof(redblack_node_t)));

shape.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ typedef uint32_t redblack_id_t;
7272
#define ROOT_SHAPE_WITH_OBJ_ID 0x1
7373
#define ROOT_TOO_COMPLEX_SHAPE_ID (ROOT_SHAPE_ID | SHAPE_ID_FL_TOO_COMPLEX)
7474
#define ROOT_TOO_COMPLEX_WITH_OBJ_ID (ROOT_SHAPE_WITH_OBJ_ID | SHAPE_ID_FL_TOO_COMPLEX | SHAPE_ID_FL_HAS_OBJECT_ID)
75-
#define SPECIAL_CONST_SHAPE_ID (ROOT_SHAPE_ID | SHAPE_ID_FL_FROZEN)
7675

7776
typedef struct redblack_node redblack_node_t;
7877

test/ruby/test_shapes.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,10 @@ def test_raise_on_special_consts
10511051
# RUBY_PLATFORM =~ /i686/
10521052
end
10531053

1054-
def test_root_shape_transition_to_special_const_on_frozen
1055-
assert_equal(RubyVM::Shape::SPECIAL_CONST_SHAPE_ID, RubyVM::Shape.of([].freeze).id)
1054+
def test_root_shape_frozen
1055+
frozen_root_shape = RubyVM::Shape.of([].freeze)
1056+
assert_predicate(frozen_root_shape, :frozen?)
1057+
assert_equal(RubyVM::Shape.root_shape.id, frozen_root_shape.raw_id)
10561058
end
10571059

10581060
def test_basic_shape_transition

zjit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ rb_zjit_shape_obj_too_complex_p(VALUE obj)
347347
}
348348

349349
enum {
350-
RB_SPECIAL_CONST_SHAPE_ID = SPECIAL_CONST_SHAPE_ID,
351350
RB_INVALID_SHAPE_ID = INVALID_SHAPE_ID,
352351
};
353352

zjit/bindgen/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ fn main() {
361361
.allowlist_function("rb_zjit_singleton_class_p")
362362
.allowlist_type("robject_offsets")
363363
.allowlist_type("rstring_offsets")
364-
.allowlist_var("RB_SPECIAL_CONST_SHAPE_ID")
365364
.allowlist_var("RB_INVALID_SHAPE_ID")
366365

367366
// From jit.c

zjit/src/cruby.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ pub type IseqPtr = *const rb_iseq_t;
269269
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
270270
pub struct ShapeId(pub u32);
271271

272-
pub const SPECIAL_CONST_SHAPE_ID: ShapeId = ShapeId(RB_SPECIAL_CONST_SHAPE_ID);
273272
pub const INVALID_SHAPE_ID: ShapeId = ShapeId(RB_INVALID_SHAPE_ID);
274273

275274
// Given an ISEQ pointer, convert PC to insn_idx

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)