Skip to content

Commit 7971941

Browse files
committed
Phase 3 Batch 6: temps_ Class B-kept closure (R-single ATOMIC)
Rename hir_builder_temps_alloc_stack to hir_builder_state_temps_alloc_stack_cpp, aligning with the state-bridge _cpp suffix convention established in Batches 2/4/5. Decl moved from the legacy extern "C" block in builder.h to builder_state_c.h alongside other state bridges. 71 C-side caller sites in builder_emit_c.c renamed in lockstep (mechanical sed-style; line-count preserved). Class B-kept disposition for temps_ (TempAllocator) now CLOSED: - AllocateStack side: hir_builder_state_temps_alloc_stack_cpp bridge (renamed) + 71 C-side callers in builder_emit_c.c - AllocateNonStack + GetOrAllocateStack: stay C++-direct (zero C-side callers verified pre-Step-A by generalist 00:51:54Z + theologian 00:53:06Z); per as-needed discipline. Phase 3 §5 forcing-decision now COMPLETE across all 5 Class B members: - exception_table_ CLOSED via Batch 2 (push + size + entry + find) - block_map_ CLOSED via Batch 4 (blocks_lookup_cpp) - pending_b2_blocks_ DELETED via Batch 3 (dead-state, post-W26 refactor) - static_method_stack_ CLOSED via Batch 5 (pop_cpp rename) - temps_ CLOSED via Batch 6 (alloc_stack_cpp rename) Post-this-commit, theologian will amend spec §5 to declare "Class B-kept is FINAL disposition for HirBuilder state" per pythia python#94 (3) cathedral-scaffold concern + supervisor 23:59:54Z + 00:00:42Z closure-amendment commitment. Numstat (vs HEAD 782d56d): Python/jit/hir/builder.cpp +1 -1 (extern "C" decl rename) Python/jit/hir/builder.h +1 -2 (delete top-of-file extern; rename friend) Python/jit/hir/builder_emit_c.c +73 -73 (mechanical sed: 1 extern + 71 callers + 1 doc-comment) Python/jit/hir/builder_state_c.h +14 -0 (NEW decl with §5 closure history doc) scripts/w45_bridge_drift_falsifier.sh +1 -0 (1 new fixture) TOTAL: NET +14L (forecast +10L; +4L variance from larger §5 closure history doc-comment in builder_state_c.h — substantive explanatory content, not surface-bloat). W45 fixture: 1 new (state_temps_alloc_stack_cpp) added per shepard 22:46:33Z same-commit discipline. Dry-run: 15/15 fixtures stage cleanly. Pre-commit compile-check: testkeeper 00:56:59Z BUILD_EXIT=0, 3-test sanity green (partial_conversions + W22 + W44). W44 gate: PASS. §3.5 BUILD MODE required this batch (touched-files heuristic per supervisor 00:39:20Z amendment — all 4 builder*.{cpp,h,c} files in scope). To be exercised in testkeeper STRICT VERIFY post-commit. Authorization: theologian 00:53:06Z (R-single ATOMIC GO + +10L forecast confirmed; 73-site mechanical rename mitigated by sed-discipline + per-bench floor + §3.5 BUILD MODE catch any unintended runtime change) + supervisor 00:53:18Z (Step B GO).
1 parent 782d56d commit 7971941

5 files changed

Lines changed: 90 additions & 76 deletions

File tree

Python/jit/hir/builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3163,7 +3163,7 @@ void HIRBuilder::emitLoadIterableArg(
31633163
bc_instr.oparg());
31643164
}
31653165

3166-
extern "C" void *hir_builder_temps_alloc_stack(void *builder) {
3166+
extern "C" void *hir_builder_state_temps_alloc_stack_cpp(void *builder) {
31673167
auto *b = static_cast<HIRBuilder*>(builder);
31683168
return static_cast<void*>(b->temps_.AllocateStack());
31693169
}

Python/jit/hir/builder.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ void hir_builder_insert_run_periodic_activities_c(
2727
void *check_block, void *succ_block, void *frame_state);
2828
void *hir_builder_get_kwnames(void *builder);
2929
void hir_builder_set_kwnames(void *builder, void *reg);
30-
void *hir_builder_temps_alloc_stack(void *builder);
3130
void hir_builder_fix_static_return_c(
3231
void *builder, void *tc, void *ret_val, HirType ret_type);
3332

@@ -179,7 +178,7 @@ class HIRBuilder {
179178
void*, void*, void*, void*, void*);
180179
friend void* ::hir_builder_get_kwnames(void*);
181180
friend void ::hir_builder_set_kwnames(void*, void*);
182-
friend void* ::hir_builder_temps_alloc_stack(void*);
181+
friend void* ::hir_builder_state_temps_alloc_stack_cpp(void*);
183182
friend void ::hir_builder_fix_static_return_c(void*, void*, void*, HirType);
184183
// INVOKE_* Phase 2 #2 (theologian L2430): bridges into emitInvokeMethod's
185184
// C++ helpers (tryEmitDirectMethodCall, setupStaticArgs, static_method_stack_).

0 commit comments

Comments
 (0)