Skip to content

Commit 74a0208

Browse files
reduce diff
1 parent 548b67c commit 74a0208

File tree

5 files changed

+69
-68
lines changed

5 files changed

+69
-68
lines changed

Include/internal/pycore_opcode_metadata.h

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

Include/internal/pycore_uop_metadata.h

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

Lib/test/test_generated_cases.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,12 +1969,12 @@ def run_cases_test(self, input: str, input2: str, expected: str):
19691969

19701970
def test_overridden_abstract(self):
19711971
input = """
1972-
op(OP, (--)) {
1972+
pure op(OP, (--)) {
19731973
SPAM();
19741974
}
19751975
"""
19761976
input2 = """
1977-
op(OP, (--)) {
1977+
pure op(OP, (--)) {
19781978
eggs();
19791979
}
19801980
"""
@@ -1988,7 +1988,7 @@ def test_overridden_abstract(self):
19881988

19891989
def test_overridden_abstract_args(self):
19901990
input = """
1991-
op(OP, (arg1 -- out)) {
1991+
pure op(OP, (arg1 -- out)) {
19921992
out = SPAM(arg1);
19931993
}
19941994
op(OP2, (arg1 -- out)) {
@@ -2021,16 +2021,16 @@ def test_overridden_abstract_args(self):
20212021

20222022
def test_no_overridden_case(self):
20232023
input = """
2024-
op(OP, (arg1 -- out)) {
2024+
pure op(OP, (arg1 -- out)) {
20252025
out = SPAM(arg1);
20262026
}
20272027
2028-
op(OP2, (arg1 -- out)) {
2028+
pure op(OP2, (arg1 -- out)) {
20292029
}
20302030
20312031
"""
20322032
input2 = """
2033-
op(OP2, (arg1 -- out)) {
2033+
pure op(OP2, (arg1 -- out)) {
20342034
out = NULL;
20352035
}
20362036
"""

Python/bytecodes.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ dummy_func(
143143
switch (opcode) {
144144

145145
// BEGIN BYTECODES //
146-
inst(NOP, (--)) {
146+
pure inst(NOP, (--)) {
147147
}
148148

149149
family(RESUME, 0) = {
@@ -266,12 +266,12 @@ dummy_func(
266266
value = PyStackRef_DUP(value_s);
267267
}
268268

269-
replicate(8) inst(LOAD_FAST, (-- value)) {
269+
replicate(8) pure inst(LOAD_FAST, (-- value)) {
270270
assert(!PyStackRef_IsNull(GETLOCAL(oparg)));
271271
value = PyStackRef_DUP(GETLOCAL(oparg));
272272
}
273273

274-
replicate(8) inst (LOAD_FAST_BORROW, (-- value)) {
274+
replicate(8) pure inst (LOAD_FAST_BORROW, (-- value)) {
275275
assert(!PyStackRef_IsNull(GETLOCAL(oparg)));
276276
value = PyStackRef_Borrow(GETLOCAL(oparg));
277277
}
@@ -340,7 +340,7 @@ dummy_func(
340340
PyStackRef_XCLOSE(tmp);
341341
}
342342

343-
inst(POP_TOP, (value --)) {
343+
pure inst(POP_TOP, (value --)) {
344344
PyStackRef_XCLOSE(value);
345345
}
346346

@@ -349,7 +349,7 @@ dummy_func(
349349
PyStackRef_CLOSE(nos);
350350
}
351351

352-
inst(PUSH_NULL, (-- res)) {
352+
pure inst(PUSH_NULL, (-- res)) {
353353
res = PyStackRef_NULL;
354354
}
355355

@@ -388,7 +388,7 @@ dummy_func(
388388
PyStackRef_CLOSE(iter);
389389
}
390390

391-
inst(END_SEND, (receiver, value -- val)) {
391+
pure inst(END_SEND, (receiver, value -- val)) {
392392
val = value;
393393
DEAD(value);
394394
PyStackRef_CLOSE(receiver);
@@ -769,7 +769,7 @@ dummy_func(
769769
DEOPT_IF(!res);
770770
}
771771

772-
op(_BINARY_OP_EXTEND, (descr/4, left, right -- res)) {
772+
pure op(_BINARY_OP_EXTEND, (descr/4, left, right -- res)) {
773773
PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
774774
PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
775775
assert(INLINE_CACHE_ENTRIES_BINARY_OP == 5);
@@ -3925,7 +3925,7 @@ dummy_func(
39253925
DEOPT_IF(tstate->py_recursion_remaining <= 1);
39263926
}
39273927

3928-
replicate(5) op(_INIT_CALL_PY_EXACT_ARGS, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) {
3928+
replicate(5) pure op(_INIT_CALL_PY_EXACT_ARGS, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) {
39293929
int has_self = !PyStackRef_IsNull(self_or_null);
39303930
STAT_INC(CALL, hit);
39313931
new_frame = _PyFrame_PushUnchecked(tstate, callable, oparg + has_self, frame);
@@ -4991,7 +4991,7 @@ dummy_func(
49914991
res = PyStackRef_FromPyObjectSteal(res_o);
49924992
}
49934993

4994-
inst(COPY, (bottom, unused[oparg-1] -- bottom, unused[oparg-1], top)) {
4994+
pure inst(COPY, (bottom, unused[oparg-1] -- bottom, unused[oparg-1], top)) {
49954995
assert(oparg > 0);
49964996
top = PyStackRef_DUP(bottom);
49974997
}
@@ -5025,7 +5025,7 @@ dummy_func(
50255025

50265026
macro(BINARY_OP) = _SPECIALIZE_BINARY_OP + unused/4 + _BINARY_OP;
50275027

5028-
inst(SWAP, (bottom, unused[oparg-2], top --
5028+
pure inst(SWAP, (bottom, unused[oparg-2], top --
50295029
bottom, unused[oparg-2], top)) {
50305030
_PyStackRef temp = bottom;
50315031
bottom = top;
@@ -5260,16 +5260,16 @@ dummy_func(
52605260
DEOPT_IF(!current_executor->vm_data.valid);
52615261
}
52625262

5263-
tier2 op(_LOAD_CONST_INLINE, (ptr/4 -- value)) {
5263+
tier2 pure op(_LOAD_CONST_INLINE, (ptr/4 -- value)) {
52645264
value = PyStackRef_FromPyObjectNew(ptr);
52655265
}
52665266

5267-
tier2 op (_POP_TOP_LOAD_CONST_INLINE, (ptr/4, pop -- value)) {
5267+
tier2 pure op (_POP_TOP_LOAD_CONST_INLINE, (ptr/4, pop -- value)) {
52685268
PyStackRef_CLOSE(pop);
52695269
value = PyStackRef_FromPyObjectNew(ptr);
52705270
}
52715271

5272-
tier2 op(_LOAD_CONST_INLINE_BORROW, (ptr/4 -- value)) {
5272+
tier2 pure op(_LOAD_CONST_INLINE_BORROW, (ptr/4 -- value)) {
52735273
value = PyStackRef_FromPyObjectBorrow(ptr);
52745274
}
52755275

Tools/cases_generator/generators_common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def write_header(
7575
"""
7676
)
7777

78+
7879
def emit_to(out: CWriter, tkn_iter: TokenIterator, end: str) -> Token:
7980
parens = 0
8081
for tkn in tkn_iter:

0 commit comments

Comments
 (0)