Skip to content

Commit

Permalink
Assert we never need to deopt a Direct location.
Browse files Browse the repository at this point in the history
  • Loading branch information
ptersilie committed Jan 8, 2025
1 parent d82f450 commit a810142
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ykrt/src/compile/jitc_yk/codegen/x64/deopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,12 @@ pub(crate) extern "C" fn __yk_deopt(
VarLocation::ConstInt { bits: _, v } => v,
VarLocation::ConstFloat(f) => f.to_bits(),
VarLocation::ConstPtr(v) => u64::try_from(v).unwrap(),
VarLocation::Direct { .. } => {
VarLocation::Direct { frame_off, size } => {
// See comment below: this case never needs to do anything.
debug_assert_eq!(
*aotvar.get(0).unwrap(),
SMLocation::Direct(6, frame_off, u16::try_from(size).unwrap())
);
varidx += 1;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion yksmp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Record {
}

/// Describes where live variables are stored at specific times during execution.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq)]
pub enum Location {
/// The live variable is stored in a register. Note, that LLVM's stackmap only stores one
/// location per live variable, which is enough for reading them out. For deoptimisation
Expand Down

0 comments on commit a810142

Please sign in to comment.