Skip to content

Commit

Permalink
Cranelift: Traps need not be considered GC safepoints anymore (#8810)
Browse files Browse the repository at this point in the history
After #8809, the mutator cannot
resume from a trap so we don't need to consider them safepoints, as no
GC-managed references are live after the trap. The one exception being the
`debugtrap` CLIF instruction, which is technically still a resumable trap, but
which exists only for emitting the equivalent of an `int3` breakpoint
instruction for pausing in a debugger to inspect state, and should never be used
for mutator-collector interactions.
  • Loading branch information
fitzgen authored Jun 14, 2024
1 parent 9ffc9e6 commit 9c5ec3e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
5 changes: 1 addition & 4 deletions cranelift/codegen/src/isa/aarch64/inst/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,10 +1114,7 @@ impl MachInst for Inst {

fn is_safepoint(&self) -> bool {
match self {
&Inst::Call { .. }
| &Inst::CallInd { .. }
| &Inst::TrapIf { .. }
| &Inst::Udf { .. } => true,
Inst::Call { .. } | Inst::CallInd { .. } => true,
_ => false,
}
}
Expand Down
5 changes: 1 addition & 4 deletions cranelift/codegen/src/isa/riscv64/inst/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,10 +731,7 @@ impl MachInst for Inst {

fn is_safepoint(&self) -> bool {
match self {
&Inst::Call { .. }
| &Inst::CallInd { .. }
| &Inst::TrapIf { .. }
| &Inst::Udf { .. } => true,
Inst::Call { .. } | Inst::CallInd { .. } => true,
_ => false,
}
}
Expand Down
8 changes: 1 addition & 7 deletions cranelift/codegen/src/isa/s390x/inst/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,13 +1073,7 @@ impl MachInst for Inst {

fn is_safepoint(&self) -> bool {
match self {
&Inst::Call { .. }
| &Inst::CallInd { .. }
| &Inst::Trap { .. }
| Inst::TrapIf { .. }
| &Inst::CmpTrapRR { .. }
| &Inst::CmpTrapRSImm16 { .. }
| &Inst::CmpTrapRUImm16 { .. } => true,
Inst::Call { .. } | Inst::CallInd { .. } => true,
_ => false,
}
}
Expand Down
5 changes: 1 addition & 4 deletions cranelift/codegen/src/isa/x64/inst/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2687,10 +2687,7 @@ impl MachInst for Inst {

fn is_safepoint(&self) -> bool {
match self {
Inst::CallKnown { .. }
| Inst::CallUnknown { .. }
| Inst::TrapIf { .. }
| Inst::Ud2 { .. } => true,
Inst::CallKnown { .. } | Inst::CallUnknown { .. } => true,
_ => false,
}
}
Expand Down

0 comments on commit 9c5ec3e

Please sign in to comment.