Skip to content

Commit b449415

Browse files
authored
GH-111485: Separate out parsing, analysis and code-gen phases of tier 1 code generator (GH-112299)
1 parent 3d712a9 commit b449415

15 files changed

+1675
-526
lines changed

Include/internal/pycore_opcode_metadata.h

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

Makefile.pre.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,14 +1587,15 @@ regen-cases:
15871587
$(PYTHON_FOR_REGEN) \
15881588
$(srcdir)/Tools/cases_generator/generate_cases.py \
15891589
$(CASESFLAG) \
1590-
-o $(srcdir)/Python/generated_cases.c.h.new \
15911590
-n $(srcdir)/Include/opcode_ids.h.new \
15921591
-t $(srcdir)/Python/opcode_targets.h.new \
15931592
-m $(srcdir)/Include/internal/pycore_opcode_metadata.h.new \
15941593
-e $(srcdir)/Python/executor_cases.c.h.new \
15951594
-p $(srcdir)/Lib/_opcode_metadata.py.new \
15961595
-a $(srcdir)/Python/abstract_interp_cases.c.h.new \
15971596
$(srcdir)/Python/bytecodes.c
1597+
$(PYTHON_FOR_REGEN) \
1598+
$(srcdir)/Tools/cases_generator/tier1_generator.py -o $(srcdir)/Python/generated_cases.c.h.new $(srcdir)/Python/bytecodes.c
15981599
$(UPDATE_FILE) $(srcdir)/Python/generated_cases.c.h $(srcdir)/Python/generated_cases.c.h.new
15991600
$(UPDATE_FILE) $(srcdir)/Include/opcode_ids.h $(srcdir)/Include/opcode_ids.h.new
16001601
$(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new

Python/abstract_interp_cases.c.h

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

Python/bytecodes.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,11 +800,11 @@ dummy_func(
800800
// We also push it onto the stack on exit, but that's a
801801
// different frame, and it's accounted for by _PUSH_FRAME.
802802
op(_POP_FRAME, (retval --)) {
803-
assert(EMPTY());
804803
#if TIER_ONE
805804
assert(frame != &entry_frame);
806805
#endif
807806
STORE_SP();
807+
assert(EMPTY());
808808
_Py_LeaveRecursiveCallPy(tstate);
809809
// GH-99729: We need to unlink the frame *before* clearing it:
810810
_PyInterpreterFrame *dying = frame;
@@ -1165,7 +1165,6 @@ dummy_func(
11651165
}
11661166
}
11671167

1168-
11691168
inst(STORE_NAME, (v -- )) {
11701169
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg);
11711170
PyObject *ns = LOCALS();
@@ -3130,7 +3129,7 @@ dummy_func(
31303129
// The 'unused' output effect represents the return value
31313130
// (which will be pushed when the frame returns).
31323131
// It is needed so CALL_PY_EXACT_ARGS matches its family.
3133-
op(_PUSH_FRAME, (new_frame: _PyInterpreterFrame* -- unused)) {
3132+
op(_PUSH_FRAME, (new_frame: _PyInterpreterFrame* -- unused if (0))) {
31343133
// Write it out explicitly because it's subtly different.
31353134
// Eventually this should be the only occurrence of this code.
31363135
assert(tstate->interp->eval_frame == NULL);

Python/executor_cases.c.h

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

0 commit comments

Comments
 (0)