mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
YJIT: Fix a wrong type reference (#6661)
* YJIT: Fix a wrong type reference * YJIT: Just remove CapturedSelfOpnd for now
This commit is contained in:
parent
00f559641a
commit
124f10f56b
Notes:
git
2022-11-03 17:34:11 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>
2 changed files with 1 additions and 11 deletions
|
@ -5073,7 +5073,7 @@ fn gen_send_iseq(
|
||||||
}
|
}
|
||||||
|
|
||||||
let recv_type = if captured_self {
|
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 {
|
} else {
|
||||||
ctx.get_opnd_type(StackOpnd(argc.try_into().unwrap()))
|
ctx.get_opnd_type(StackOpnd(argc.try_into().unwrap()))
|
||||||
};
|
};
|
||||||
|
|
|
@ -269,9 +269,6 @@ pub enum InsnOpnd {
|
||||||
// The value is self
|
// The value is self
|
||||||
SelfOpnd,
|
SelfOpnd,
|
||||||
|
|
||||||
// Captured block's self
|
|
||||||
CapturedSelfOpnd,
|
|
||||||
|
|
||||||
// Temporary stack operand with stack index
|
// Temporary stack operand with stack index
|
||||||
StackOpnd(u16),
|
StackOpnd(u16),
|
||||||
}
|
}
|
||||||
|
@ -300,9 +297,6 @@ pub struct Context {
|
||||||
// Type we track for self
|
// Type we track for self
|
||||||
self_type: Type,
|
self_type: Type,
|
||||||
|
|
||||||
// Type we track for captured block's self
|
|
||||||
captured_self_type: Type,
|
|
||||||
|
|
||||||
// Mapping of temp stack entries to types we track
|
// Mapping of temp stack entries to types we track
|
||||||
temp_mapping: [TempMapping; MAX_TEMP_TYPES],
|
temp_mapping: [TempMapping; MAX_TEMP_TYPES],
|
||||||
}
|
}
|
||||||
|
@ -1166,7 +1160,6 @@ impl Context {
|
||||||
pub fn get_opnd_type(&self, opnd: InsnOpnd) -> Type {
|
pub fn get_opnd_type(&self, opnd: InsnOpnd) -> Type {
|
||||||
match opnd {
|
match opnd {
|
||||||
SelfOpnd => self.self_type,
|
SelfOpnd => self.self_type,
|
||||||
CapturedSelfOpnd => self.captured_self_type,
|
|
||||||
StackOpnd(idx) => {
|
StackOpnd(idx) => {
|
||||||
let idx = idx as u16;
|
let idx = idx as u16;
|
||||||
assert!(idx < self.stack_size);
|
assert!(idx < self.stack_size);
|
||||||
|
@ -1208,7 +1201,6 @@ impl Context {
|
||||||
|
|
||||||
match opnd {
|
match opnd {
|
||||||
SelfOpnd => self.self_type.upgrade(opnd_type),
|
SelfOpnd => self.self_type.upgrade(opnd_type),
|
||||||
CapturedSelfOpnd => self.self_type.upgrade(opnd_type),
|
|
||||||
StackOpnd(idx) => {
|
StackOpnd(idx) => {
|
||||||
let idx = idx as u16;
|
let idx = idx as u16;
|
||||||
assert!(idx < self.stack_size);
|
assert!(idx < self.stack_size);
|
||||||
|
@ -1244,7 +1236,6 @@ impl Context {
|
||||||
|
|
||||||
match opnd {
|
match opnd {
|
||||||
SelfOpnd => (MapToSelf, opnd_type),
|
SelfOpnd => (MapToSelf, opnd_type),
|
||||||
CapturedSelfOpnd => unreachable!("not used for captured self"),
|
|
||||||
StackOpnd(idx) => {
|
StackOpnd(idx) => {
|
||||||
let idx = idx as u16;
|
let idx = idx as u16;
|
||||||
assert!(idx < self.stack_size);
|
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)) {
|
pub fn set_opnd_mapping(&mut self, opnd: InsnOpnd, (mapping, opnd_type): (TempMapping, Type)) {
|
||||||
match opnd {
|
match opnd {
|
||||||
SelfOpnd => unreachable!("self always maps to self"),
|
SelfOpnd => unreachable!("self always maps to self"),
|
||||||
CapturedSelfOpnd => unreachable!("not used for captured self"),
|
|
||||||
StackOpnd(idx) => {
|
StackOpnd(idx) => {
|
||||||
assert!(idx < self.stack_size);
|
assert!(idx < self.stack_size);
|
||||||
let stack_idx = (self.stack_size - 1 - idx) as usize;
|
let stack_idx = (self.stack_size - 1 - idx) as usize;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue