diff options
author | Jean Boussier <[email protected]> | 2025-06-04 09:05:55 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-06-04 13:13:50 +0200 |
commit | 675f33508cc08cbd17ff8dc1b14bbbe256a709ba () | |
tree | 297157b7801b54afd789a032b616f15f8d16e671 /yjit | |
parent | 8d49c05c134702c321198b70fbbf34dd80cc1ba6 (diff) |
Get rid of TOO_COMPLEX shape type
Instead it's now a `shape_id` flag. This allows to check if an object is complex without having to chase the `rb_shape_t` pointer.
Notes: Merged: https://.com/ruby/ruby/pull/13511
-rw-r--r-- | yjit/bindgen/src/main.rs | 4 | ||||
-rw-r--r-- | yjit/src/codegen.rs | 2 | ||||
-rw-r--r-- | yjit/src/cruby.rs | 2 | ||||
-rw-r--r-- | yjit/src/cruby_bindings.inc.rs | 4 |
4 files changed, 6 insertions, 6 deletions
@@ -99,8 +99,8 @@ fn main() { .allowlist_function("rb_shape_id_offset") .allowlist_function("rb_shape_get_iv_index") .allowlist_function("rb_shape_transition_add_ivar_no_warnings") - .allowlist_function("rb_shape_obj_too_complex_p") - .allowlist_function("rb_shape_too_complex_p") .allowlist_var("SHAPE_ID_NUM_BITS") // From ruby/internal/intern/object.h @@ -3124,7 +3124,7 @@ fn gen_set_ivar( // If the VM ran out of shapes, or this class generated too many leaf, // it may be de-optimized into OBJ_TOO_COMPLEX_SHAPE (hash-table). - new_shape_too_complex = unsafe { rb_shape_too_complex_p(next_shape_id) }; if new_shape_too_complex { Some((next_shape_id, None, 0_usize)) } else { @@ -441,7 +441,7 @@ impl VALUE { } pub fn shape_too_complex(self) -> bool { - unsafe { rb_shape_obj_too_complex_p(self) } } pub fn shape_id_of(self) -> u32 { @@ -1137,8 +1137,6 @@ extern "C" { pub fn rb_shape_lookup(shape_id: shape_id_t) -> *mut rb_shape_t; pub fn rb_obj_shape_id(obj: VALUE) -> shape_id_t; pub fn rb_shape_get_iv_index(shape_id: shape_id_t, id: ID, value: *mut attr_index_t) -> bool; - pub fn rb_shape_obj_too_complex_p(obj: VALUE) -> bool; - pub fn rb_shape_too_complex_p(shape_id: shape_id_t) -> bool; pub fn rb_shape_transition_add_ivar_no_warnings(obj: VALUE, id: ID) -> shape_id_t; pub fn rb_gvar_get(arg1: ID) -> VALUE; pub fn rb_gvar_set(arg1: ID, arg2: VALUE) -> VALUE; @@ -1265,6 +1263,8 @@ extern "C" { line: ::std::os::raw::c_int, ); pub fn rb_object_shape_count() -> VALUE; pub fn rb_yjit_assert_holding_vm_lock(); pub fn rb_yjit_sendish_sp_pops(ci: *const rb_callinfo) -> usize; pub fn rb_yjit_invokeblock_sp_pops(ci: *const rb_callinfo) -> usize; |