Skip to content

GH-130296: Avoid stack transients in four instructions. #130310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 28, 2025
355 changes: 179 additions & 176 deletions Include/internal/pycore_opcode_metadata.h

Large diffs are not rendered by default.

300 changes: 147 additions & 153 deletions Include/internal/pycore_uop_ids.h

Large diffs are not rendered by default.

50 changes: 13 additions & 37 deletions Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 0 additions & 49 deletions Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1931,55 +1931,6 @@ def test_pystackref_frompyobject_new_next_to_cmacro(self):
"""
self.run_cases_test(input, output)

def test_pop_input(self):
input = """
inst(OP, (a, b --)) {
POP_INPUT(b);
HAM(a);
INPUTS_DEAD();
}
"""
output = """
TARGET(OP) {
#if Py_TAIL_CALL_INTERP
int opcode = OP;
(void)(opcode);
#endif
frame->instr_ptr = next_instr;
next_instr += 1;
INSTRUCTION_STATS(OP);
_PyStackRef a;
_PyStackRef b;
b = stack_pointer[-1];
a = stack_pointer[-2];
stack_pointer += -1;
assert(WITHIN_STACK_BOUNDS());
HAM(a);
stack_pointer += -1;
assert(WITHIN_STACK_BOUNDS());
DISPATCH();
}
"""
self.run_cases_test(input, output)

def test_pop_input_with_empty_stack(self):
input = """
inst(OP, (--)) {
POP_INPUT(foo);
}
"""
with self.assertRaises(SyntaxError):
self.run_cases_test(input, "")

def test_pop_input_with_non_tos(self):
input = """
inst(OP, (a, b --)) {
POP_INPUT(a);
}
"""
with self.assertRaises(SyntaxError):
self.run_cases_test(input, "")

def test_no_escaping_calls_in_branching_macros(self):

input = """
Expand Down
Loading
Loading