summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorJean byroot Boussier <jean.boussier+github@shopify.com>2024-06-04 22:21:58 +0200
committerGitHub <noreply@github.com>2024-06-04 13:21:58 -0700
commit4f00d98b327e3aa23564aa765488d15bc60c9e79 (patch)
tree40fd378a201878c820cf4738ea66f66bee18a6b6 /yjit/src
parentb74f669e2fbe5c63409878e7a9f9d39c8554ff77 (diff)
[3.3 backport] Do not emit shape transition warnings when YJIT is compiling (#10911)
Do not emit shape transition warnings when YJIT is compiling [Bug #20522] If `Warning.warn` is redefined in Ruby, emitting a warning would invoke Ruby code, which can't safely be done when YJIT is compiling. Co-authored-by: Jean Boussier <jean.boussier@gmail.com> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/codegen.rs2
-rw-r--r--yjit/src/cruby_bindings.inc.rs6
2 files changed, 6 insertions, 2 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index ca987eaf78..c672a40d1e 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -2484,7 +2484,7 @@ fn gen_setinstancevariable(
// The current shape doesn't contain this iv, we need to transition to another shape.
let new_shape = if !shape_too_complex && receiver_t_object && ivar_index.is_none() {
let current_shape = comptime_receiver.shape_of();
- let next_shape = unsafe { rb_shape_get_next(current_shape, comptime_receiver, ivar_name) };
+ let next_shape = unsafe { rb_shape_get_next_no_warnings(current_shape, comptime_receiver, ivar_name) };
let next_shape_id = unsafe { rb_shape_id(next_shape) };
// If the VM ran out of shapes, or this class generated too many leaf,
diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs
index 7a54b177f1..cf33f2cdb6 100644
--- a/yjit/src/cruby_bindings.inc.rs
+++ b/yjit/src/cruby_bindings.inc.rs
@@ -981,7 +981,11 @@ extern "C" {
pub fn rb_shape_get_shape_id(obj: VALUE) -> shape_id_t;
pub fn rb_shape_get_iv_index(shape: *mut rb_shape_t, id: ID, value: *mut attr_index_t) -> bool;
pub fn rb_shape_obj_too_complex(obj: VALUE) -> bool;
- pub fn rb_shape_get_next(shape: *mut rb_shape_t, obj: VALUE, id: ID) -> *mut rb_shape_t;
+ pub fn rb_shape_get_next_no_warnings(
+ shape: *mut rb_shape_t,
+ obj: VALUE,
+ id: ID,
+ ) -> *mut rb_shape_t;
pub fn rb_shape_id(shape: *mut rb_shape_t) -> shape_id_t;
pub fn rb_gvar_get(arg1: ID) -> VALUE;
pub fn rb_gvar_set(arg1: ID, arg2: VALUE) -> VALUE;