YJIT: Fix a wrong type reference (#6661)

* YJIT: Fix a wrong type reference

* YJIT: Just remove CapturedSelfOpnd for now
This commit is contained in:
Takashi Kokubun 2022-11-03 10:33:49 -07:00 коммит произвёл GitHub
Родитель 00f559641a
Коммит 124f10f56b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 1 добавлений и 11 удалений

Просмотреть файл

@ -5073,7 +5073,7 @@ fn gen_send_iseq(
}
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()))
};

Просмотреть файл

@ -269,9 +269,6 @@ pub enum InsnOpnd {
// 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 {
// 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 {
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 {
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 {
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 {
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;