Skip to content

Commit 240f760

Browse files
committed
Rename DSL macro for clarity
1 parent ea5b15e commit 240f760

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Python/bytecodes.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5186,28 +5186,28 @@ dummy_func(
51865186
op (_GUARD_IS_TRUE_POP, (flag -- )) {
51875187
int is_true = PyStackRef_IsTrue(flag);
51885188
DEAD(flag);
5189-
EXIT_IF_AFTER(!is_true);
5189+
AT_END_EXIT_IF(!is_true);
51905190
}
51915191

51925192
op (_GUARD_IS_FALSE_POP, (flag -- )) {
51935193
int is_false = PyStackRef_IsFalse(flag);
51945194
DEAD(flag);
5195-
EXIT_IF_AFTER(!is_false);
5195+
AT_END_EXIT_IF(!is_false);
51965196
}
51975197

51985198
op (_GUARD_IS_NONE_POP, (val -- )) {
51995199
int is_none = PyStackRef_IsNone(val);
52005200
if (!is_none) {
52015201
PyStackRef_CLOSE(val);
5202-
EXIT_IF_AFTER(1);
5202+
AT_END_EXIT_IF(1);
52035203
}
52045204
DEAD(val);
52055205
}
52065206

52075207
op (_GUARD_IS_NOT_NONE_POP, (val -- )) {
52085208
int is_none = PyStackRef_IsNone(val);
52095209
PyStackRef_CLOSE(val);
5210-
EXIT_IF_AFTER(is_none);
5210+
AT_END_EXIT_IF(is_none);
52115211
}
52125212

52135213
op(_JUMP_TO_TOP, (--)) {

Tools/cases_generator/analyzer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ def visit(stmt: Stmt) -> None:
709709
in_if = 0
710710
tkn_iter = iter(stmt.contents)
711711
for tkn in tkn_iter:
712-
if tkn.kind == "IDENTIFIER" and tkn.text in ("DEOPT_IF", "ERROR_IF", "EXIT_IF", "PERIODIC_IF", "EXIT_IF_AFTER"):
712+
if tkn.kind == "IDENTIFIER" and tkn.text in ("DEOPT_IF", "ERROR_IF", "EXIT_IF", "PERIODIC_IF", "AT_END_EXIT_IF"):
713713
in_if = 1
714714
next(tkn_iter)
715715
elif tkn.kind == "LPAREN":
@@ -836,7 +836,7 @@ def stmt_is_simple_exit(stmt: Stmt) -> bool:
836836
if len(tokens) < 4:
837837
return False
838838
return (
839-
tokens[0].text in ("ERROR_IF", "DEOPT_IF", "EXIT_IF", "EXIT_IF_AFTER")
839+
tokens[0].text in ("ERROR_IF", "DEOPT_IF", "EXIT_IF", "AT_END_EXIT_IF")
840840
and
841841
tokens[1].text == "("
842842
and
@@ -892,7 +892,7 @@ def compute_properties(op: parser.CodeDef) -> Properties:
892892
or variable_used(op, "PyCell_SwapTakeRef")
893893
)
894894
deopts_if = variable_used(op, "DEOPT_IF")
895-
exits_if = variable_used(op, "EXIT_IF") or variable_used(op, "EXIT_IF_AFTER")
895+
exits_if = variable_used(op, "EXIT_IF") or variable_used(op, "AT_END_EXIT_IF")
896896
deopts_periodic = variable_used(op, "PERIODIC_IF")
897897
exits_and_deopts = sum((deopts_if, exits_if, deopts_periodic))
898898
if exits_and_deopts > 1:

Tools/cases_generator/generators_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Emitter:
111111
def __init__(self, out: CWriter, labels: dict[str, Label], cannot_escape: bool = False):
112112
self._replacers = {
113113
"EXIT_IF": self.exit_if,
114-
"EXIT_IF_AFTER": self.exit_if_after,
114+
"AT_END_EXIT_IF": self.exit_if_after,
115115
"DEOPT_IF": self.deopt_if,
116116
"PERIODIC_IF": self.periodic_if,
117117
"ERROR_IF": self.error_if,
@@ -191,7 +191,7 @@ def exit_if_after(
191191
storage: Storage,
192192
inst: Instruction | None,
193193
) -> bool:
194-
storage.clear_inputs("in EXIT_IF_AFTER")
194+
storage.clear_inputs("in AT_END_EXIT_IF")
195195
storage.flush(self.out)
196196
storage.stack.clear(self.out)
197197
return self.exit_if(tkn, tkn_iter, uop, storage, inst)

Tools/cases_generator/tier1_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def uses_this(inst: Instruction) -> bool:
132132
continue
133133
for tkn in uop.body.tokens():
134134
if (tkn.kind == "IDENTIFIER"
135-
and (tkn.text in {"DEOPT_IF", "EXIT_IF", "EXIT_IF_AFTER"})):
135+
and (tkn.text in {"DEOPT_IF", "EXIT_IF", "AT_END_EXIT_IF"})):
136136
return True
137137
return False
138138

0 commit comments

Comments
 (0)