[前][次][番号順一覧][スレッド一覧]

ruby-changes:74331

From: Takashi <ko1@a...>
Date: Fri, 4 Nov 2022 02:34:15 +0900 (JST)
Subject: [ruby-changes:74331] 124f10f56b (master): YJIT: Fix a wrong type reference (#6661)

https://git.ruby-lang.org/ruby.git/commit/?id=124f10f56b

From 124f10f56b16e4fa4572b6dffde7487dcf914b26 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Thu, 3 Nov 2022 10:33:49 -0700
Subject: YJIT: Fix a wrong type reference (#6661)

* YJIT: Fix a wrong type reference

* YJIT: Just remove CapturedSelfOpnd for now
---
 yjit/src/codegen.rs |  2 +-
 yjit/src/core.rs    | 10 ----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 9ec6c26f89..8e36c44823 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -5073,7 +5073,7 @@ fn gen_send_iseq( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L5073
     }
 
     let recv_type = if captured_self {
-        ctx.get_opnd_type(CapturedSelfOpnd)
+        Type::Unknown // we don't track the type information of captured->self for now
     } else {
         ctx.get_opnd_type(StackOpnd(argc.try_into().unwrap()))
     };
diff --git a/yjit/src/core.rs b/yjit/src/core.rs
index afa7604aaf..c0e48e87b2 100644
--- a/yjit/src/core.rs
+++ b/yjit/src/core.rs
@@ -269,9 +269,6 @@ pub enum InsnOpnd { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L269
     // The value is self
     SelfOpnd,
 
-    // Captured block's self
-    CapturedSelfOpnd,
-
     // Temporary stack operand with stack index
     StackOpnd(u16),
 }
@@ -300,9 +297,6 @@ pub struct Context { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L297
     // Type we track for self
     self_type: Type,
 
-    // Type we track for captured block's self
-    captured_self_type: Type,
-
     // Mapping of temp stack entries to types we track
     temp_mapping: [TempMapping; MAX_TEMP_TYPES],
 }
@@ -1166,7 +1160,6 @@ impl Context { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1160
     pub fn get_opnd_type(&self, opnd: InsnOpnd) -> Type {
         match opnd {
             SelfOpnd => self.self_type,
-            CapturedSelfOpnd => self.captured_self_type,
             StackOpnd(idx) => {
                 let idx = idx as u16;
                 assert!(idx < self.stack_size);
@@ -1208,7 +1201,6 @@ impl Context { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1201
 
         match opnd {
             SelfOpnd => self.self_type.upgrade(opnd_type),
-            CapturedSelfOpnd => self.self_type.upgrade(opnd_type),
             StackOpnd(idx) => {
                 let idx = idx as u16;
                 assert!(idx < self.stack_size);
@@ -1244,7 +1236,6 @@ impl Context { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1236
 
         match opnd {
             SelfOpnd => (MapToSelf, opnd_type),
-            CapturedSelfOpnd => unreachable!("not used for captured self"),
             StackOpnd(idx) => {
                 let idx = idx as u16;
                 assert!(idx < self.stack_size);
@@ -1266,7 +1257,6 @@ impl Context { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1257
     pub fn set_opnd_mapping(&mut self, opnd: InsnOpnd, (mapping, opnd_type): (TempMapping, Type)) {
         match opnd {
             SelfOpnd => unreachable!("self always maps to self"),
-            CapturedSelfOpnd => unreachable!("not used for captured self"),
             StackOpnd(idx) => {
                 assert!(idx < self.stack_size);
                 let stack_idx = (self.stack_size - 1 - idx) as usize;
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]