Skip to content

Commit 75a138a

Browse files
committed
Rename JustIf{True,False} => PopJumpIf{...}
1 parent c0367d2 commit 75a138a

12 files changed

+46
-39
lines changed

compiler/codegen/src/compile.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ impl Compiler {
20272027
// We cannot handle this exception type:
20282028
emit!(
20292029
self,
2030-
Instruction::JumpIfFalse {
2030+
Instruction::PopJumpIfFalse {
20312031
target: next_handler,
20322032
}
20332033
);
@@ -3117,7 +3117,7 @@ impl Compiler {
31173117
JumpOp::PopJumpIfFalse => {
31183118
emit!(
31193119
self,
3120-
Instruction::JumpIfFalse {
3120+
Instruction::PopJumpIfFalse {
31213121
target: pc.fail_pop[pops]
31223122
}
31233123
);
@@ -4398,14 +4398,14 @@ impl Compiler {
43984398
if condition {
43994399
emit!(
44004400
self,
4401-
Instruction::JumpIfTrue {
4401+
Instruction::PopJumpIfTrue {
44024402
target: target_block,
44034403
}
44044404
);
44054405
} else {
44064406
emit!(
44074407
self,
4408-
Instruction::JumpIfFalse {
4408+
Instruction::PopJumpIfFalse {
44094409
target: target_block,
44104410
}
44114411
);

compiler/codegen/src/snapshots/rustpython_codegen__compile__tests__if_ands.snap

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/codegen/src/snapshots/rustpython_codegen__compile__tests__if_mixed.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/codegen/src/snapshots/rustpython_codegen__compile__tests__if_ors.snap

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/codegen/src/snapshots/rustpython_codegen__compile__tests__nested_double_async_with.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/codegen/src/snapshots/rustpython_compiler_core__compile__tests__if_ands.snap

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/codegen/src/snapshots/rustpython_compiler_core__compile__tests__if_mixed.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/codegen/src/snapshots/rustpython_compiler_core__compile__tests__if_ors.snap

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/codegen/src/snapshots/rustpython_compiler_core__compile__tests__nested_double_async_with.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/core/src/bytecode.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,11 @@ pub enum Instruction {
548548
target: Arg<Label>,
549549
},
550550
/// Pop the top of the stack, and jump if this value is true.
551-
JumpIfTrue {
551+
PopJumpIfTrue {
552552
target: Arg<Label>,
553553
},
554554
/// Pop the top of the stack, and jump if this value is false.
555-
JumpIfFalse {
555+
PopJumpIfFalse {
556556
target: Arg<Label>,
557557
},
558558
/// Peek at the top of the stack, and jump if this value is true.
@@ -1255,8 +1255,8 @@ impl Instruction {
12551255
pub const fn label_arg(&self) -> Option<Arg<Label>> {
12561256
match self {
12571257
Jump { target: l }
1258-
| JumpIfTrue { target: l }
1259-
| JumpIfFalse { target: l }
1258+
| PopJumpIfTrue { target: l }
1259+
| PopJumpIfFalse { target: l }
12601260
| JumpIfTrueOrPop { target: l }
12611261
| JumpIfFalseOrPop { target: l }
12621262
| ForIter { target: l }
@@ -1341,7 +1341,7 @@ impl Instruction {
13411341
Continue { .. } => 0,
13421342
Break { .. } => 0,
13431343
Jump { .. } => 0,
1344-
JumpIfTrue { .. } | JumpIfFalse { .. } => -1,
1344+
PopJumpIfTrue { .. } | PopJumpIfFalse { .. } => -1,
13451345
JumpIfTrueOrPop { .. } | JumpIfFalseOrPop { .. } => {
13461346
if jump {
13471347
0
@@ -1546,8 +1546,8 @@ impl Instruction {
15461546
Continue { target } => w!(Continue, target),
15471547
Break { target } => w!(Break, target),
15481548
Jump { target } => w!(Jump, target),
1549-
JumpIfTrue { target } => w!(JumpIfTrue, target),
1550-
JumpIfFalse { target } => w!(JumpIfFalse, target),
1549+
PopJumpIfTrue { target } => w!(PopJumpIfTrue, target),
1550+
PopJumpIfFalse { target } => w!(PopJumpIfFalse, target),
15511551
JumpIfTrueOrPop { target } => w!(JumpIfTrueOrPop, target),
15521552
JumpIfFalseOrPop { target } => w!(JumpIfFalseOrPop, target),
15531553
MakeFunction => w!(MakeFunction),

0 commit comments

Comments
 (0)