mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Refactor rb_shape_transition_frozen
to return a shape_id
.
This commit is contained in:
parent
31d0a5815c
commit
f82523f14b
Notes:
git
2025-05-09 08:23:10 +00:00
4 changed files with 21 additions and 21 deletions
|
@ -2010,14 +2010,14 @@ void rb_obj_freeze_inline(VALUE x)
|
|||
RB_FL_UNSET_RAW(x, FL_USER2 | FL_USER3); // STR_CHILLED
|
||||
}
|
||||
|
||||
rb_shape_t * next_shape = rb_shape_transition_shape_frozen(x);
|
||||
shape_id_t next_shape_id = rb_shape_transition_frozen(x);
|
||||
|
||||
// If we're transitioning from "not complex" to "too complex"
|
||||
// then evict ivars. This can happen if we run out of shapes
|
||||
if (rb_shape_too_complex_p(next_shape) && !rb_shape_obj_too_complex(x)) {
|
||||
if (rb_shape_id_too_complex_p(next_shape_id) && !rb_shape_obj_too_complex(x)) {
|
||||
rb_evict_fields_to_hash(x);
|
||||
}
|
||||
rb_shape_set_shape(x, next_shape);
|
||||
rb_shape_set_shape_id(x, next_shape_id);
|
||||
|
||||
if (RBASIC_CLASS(x)) {
|
||||
rb_freeze_singleton_class(x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue