summaryrefslogtreecommitdiff
path: root/yjit/src/codegen.rs
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-05-27 12:57:03 +0200
committerJean Boussier <[email protected]>2025-05-27 15:34:02 +0200
commita59835e1d53d3fb673978e93417f4080774f905a (patch)
tree9e270ff8d69e6bee682bcaf93f6b517808880b6a /yjit/src/codegen.rs
parente535f8248b1ad9f18cfc8134dd7e8056d97a6244 (diff)
Refactor `rb_shape_get_iv_index` to take a `shape_id_t`
Further reduce exposure of `rb_shape_t`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13450
Diffstat (limited to 'yjit/src/codegen.rs')
-rw-r--r--yjit/src/codegen.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 7cc4aff473..c31d5fa726 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -2904,9 +2904,8 @@ fn gen_get_ivar(
let ivar_index = unsafe {
let shape_id = comptime_receiver.shape_id_of();
- let shape = rb_shape_lookup(shape_id);
let mut ivar_index: u32 = 0;
- if rb_shape_get_iv_index(shape, ivar_name, &mut ivar_index) {
+ if rb_shape_get_iv_index(shape_id, ivar_name, &mut ivar_index) {
Some(ivar_index as usize)
} else {
None
@@ -3107,9 +3106,8 @@ fn gen_set_ivar(
let shape_too_complex = comptime_receiver.shape_too_complex();
let ivar_index = if !shape_too_complex {
let shape_id = comptime_receiver.shape_id_of();
- let shape = unsafe { rb_shape_lookup(shape_id) };
let mut ivar_index: u32 = 0;
- if unsafe { rb_shape_get_iv_index(shape, ivar_name, &mut ivar_index) } {
+ if unsafe { rb_shape_get_iv_index(shape_id, ivar_name, &mut ivar_index) } {
Some(ivar_index as usize)
} else {
None
@@ -3397,9 +3395,8 @@ fn gen_definedivar(
let shape_id = comptime_receiver.shape_id_of();
let ivar_exists = unsafe {
- let shape = rb_shape_lookup(shape_id);
let mut ivar_index: u32 = 0;
- rb_shape_get_iv_index(shape, ivar_name, &mut ivar_index)
+ rb_shape_get_iv_index(shape_id, ivar_name, &mut ivar_index)
};
// Guard heap object (recv_opnd must be used before stack_pop)