Skip to content

Commit 9136aae

Browse files
committed
ZJIT: Rename PadPatchPoint to PatchPointPad
Two reasons for this: 1. It's less weird for a pad to be zero width than for an imperative to pad to not actually pad. 2. PatchPoint is a noun so its related padding reads better when can only be interpreted as a noun.
1 parent 9ddf0d3 commit 9136aae

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

zjit/src/backend/arm64/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,8 +1528,8 @@ impl Assembler {
15281528
Insn::Jonz(opnd, target) => {
15291529
emit_cmp_zero_jump(cb, opnd.into(), false, target.clone());
15301530
},
1531-
Insn::PatchPoint(..) => unreachable!("PatchPoint should have been lowered to PadPatchPoint in arm64_scratch_split"),
1532-
Insn::PadPatchPoint => {
1531+
Insn::PatchPoint(..) => unreachable!("PatchPoint should have been lowered to PatchPointPad in arm64_scratch_split"),
1532+
Insn::PatchPointPad => {
15331533
emit_pad_after_patch_point(cb, last_patch_pos);
15341534
// This position is itself where a jump gets written on invalidation, so it
15351535
// becomes what following code has to keep its distance from.

zjit/src/backend/lir.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -898,12 +898,12 @@ pub enum Insn {
898898
///
899899
/// Zero-width whenever there is already enough room, which is the common
900900
/// case.
901-
PadPatchPoint,
901+
PatchPointPad,
902902

903903
/// Space reserved at a boundary that a preceding PatchPoint's invalidation
904904
/// jump must not cross: the start of a non-entry block, the start of a side
905905
/// exit, or the end of the last block. Nothing is ever patched at a
906-
/// boundary, so unlike [`Insn::PadPatchPoint`] this only protects what comes
906+
/// boundary, so unlike [`Insn::PatchPointPad`] this only protects what comes
907907
/// after it, and it does not become something later code has to keep away
908908
/// from — the first patch point of a block needs no padding in front of it.
909909
///
@@ -1001,7 +1001,7 @@ macro_rules! for_each_operand_impl {
10011001
Insn::Breakpoint | Insn::Abort |
10021002
Insn::Comment(_) |
10031003
Insn::CPop { .. } |
1004-
Insn::PadPatchPoint |
1004+
Insn::PatchPointPad |
10051005
Insn::PosMarker(_) |
10061006
Insn::PosMarkerAtBlockEnd(_) => {},
10071007

@@ -1185,7 +1185,7 @@ impl Insn {
11851185
Insn::Not { .. } => "Not",
11861186
Insn::Or { .. } => "Or",
11871187
Insn::PatchPoint(..) => "PatchPoint",
1188-
Insn::PadPatchPoint => "PadPatchPoint",
1188+
Insn::PatchPointPad => "PatchPointPad",
11891189
Insn::PosMarker(_) => "PosMarker",
11901190
Insn::PosMarkerAtBlockEnd(_) => "PosMarkerAtBlockEnd",
11911191
Insn::RShift { .. } => "RShift",
@@ -3970,8 +3970,8 @@ impl Assembler {
39703970
self.push_insn(Insn::PatchPoint(Box::new(PatchPointData { target, invariant, version })));
39713971
}
39723972

3973-
pub fn pad_patch_point(&mut self) {
3974-
self.push_insn(Insn::PadPatchPoint);
3973+
pub fn patch_point_pad(&mut self) {
3974+
self.push_insn(Insn::PatchPointPad);
39753975
}
39763976

39773977
pub fn boundary_pad(&mut self) {

zjit/src/backend/x86_64/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,8 @@ impl Assembler {
10691069

10701070
Insn::Joz(..) | Insn::Jonz(..) => unreachable!("Joz/Jonz should be unused for now"),
10711071

1072-
Insn::PatchPoint(..) => unreachable!("PatchPoint should have been lowered to PadPatchPoint in x86_scratch_split"),
1073-
Insn::PadPatchPoint => {
1072+
Insn::PatchPoint(..) => unreachable!("PatchPoint should have been lowered to PatchPointPad in x86_scratch_split"),
1073+
Insn::PatchPointPad => {
10741074
emit_pad_after_patch_point(cb, last_patch_pos);
10751075
// This position is itself where a jump gets written on invalidation, so it
10761076
// becomes what following code has to keep its distance from.

zjit/src/codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,15 +977,15 @@ fn gen_patch_point(jit: &mut JITState, asm: &mut Assembler, function: &Function,
977977
asm.patch_point(Target::SideExit(Box::new(SideExitTarget { exit, reason: PatchPoint(invariant) })), invariant, jit.version);
978978
}
979979

980-
/// This is used by scratch_split to lower PatchPoint into PadPatchPoint and PosMarker.
980+
/// This is used by scratch_split to lower PatchPoint into PatchPointPad and PosMarker.
981981
/// It's called at scratch_split so that we can use the Label after side-exit deduplication in compile_exits.
982982
pub fn split_patch_point(asm: &mut Assembler, target: &Target, invariant: Invariant, version: IseqVersionRef) {
983983
let Target::Label(exit_label) = *target else {
984984
unreachable!("PatchPoint's target should have been lowered to Target::Label by compile_exits: {target:?}");
985985
};
986986

987987
// Fill nop instructions if the last patch point is too close.
988-
asm.pad_patch_point();
988+
asm.patch_point_pad();
989989

990990
// Remember the current address as a patch point
991991
asm.pos_marker(move |code_ptr, cb| {

0 commit comments

Comments
 (0)