зеркало из https://github.com/github/ruby.git
YJIT: Fix a wrong type reference (#6661)
* YJIT: Fix a wrong type reference * YJIT: Just remove CapturedSelfOpnd for now
This commit is contained in:
Родитель
00f559641a
Коммит
124f10f56b
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче