Commit 1343895
committed
Phase 3 Batch 2: findExceptionHandler port + Class B closure
Port HIRBuilder::findExceptionHandler to a pure-C body that scans the
exception_table_ via two new C++-side read bridges (size + entry
field-by-value access). C++ shim preserves caller-contract by
returning &exception_table_[idx] from the matching index.
Per spec §5 Class B-kept disposition for exception_table_ now CLOSED
(read+write both via bridge):
- Batch 1: hir_builder_state_exception_table_push_cpp (write)
- Batch 2: hir_builder_state_exception_table_size_cpp (read meta)
- Batch 2: hir_builder_state_exception_table_entry_cpp (read field)
- Batch 2: hir_builder_state_find_exception_handler_c (C body)
Pattern propagatable to similar Class B-kept members (pending_b2_blocks_,
etc.) in subsequent batches.
Bridges added (3, within W25b ≤5/batch):
hir_builder_state_exception_table_size_cpp(builder) -> int
hir_builder_state_exception_table_entry_cpp(builder, idx, *out_5fields)
hir_builder_state_find_exception_handler_c(state, builder, off, *out_idx) -> int
Cumulative exception_table_ bridge surface = 4 (push + size + entry + find);
all under cumulative budget for the member.
Numstat (vs HEAD c905827):
Python/jit/hir/builder.cpp +29 -4 (size + entry impls; shim)
Python/jit/hir/builder.h +5 -0 (2 friend decls + comment)
Python/jit/hir/builder_state_c.h +27 -0 (3 new bridge decls)
Python/jit/hir/builder_state_c.c +19 -0 (find_exception_handler_c)
scripts/w45_bridge_drift_falsifier.sh +8 -4 (3 new fixtures + non-void
return-type regex update)
TOTAL: NET +80L (forecast +74L; +6L variance ~8%, within theologian
15% threshold for forecast accuracy).
W45 fixtures: 3 new (state_exception_table_size_cpp,
state_exception_table_entry_cpp, state_find_exception_handler_c) added
per shepard 22:46:33Z same-commit discipline. W45 perl regex updated
to match any return type (was void-only) since size_cpp returns int.
Dry-run: 12/12 fixtures stage cleanly.
Pre-commit compile-check: testkeeper 23:27:11Z BUILD_EXIT=0,
3-test sanity green (partial_conversions + W22 + W44).
W44 gate: PASS.
Authorization: theologian 23:22:59Z + supervisor 23:23:10Z. Per spec
§6 python#9 + amendment 23:09:50Z, per-commit benchmark gate runs post-
commit (geo-mean must stay >=1.0x parity floor).1 parent c905827 commit 1343895
5 files changed
Lines changed: 88 additions & 8 deletions
File tree
- Python/jit/hir
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1243 | 1243 | | |
1244 | 1244 | | |
1245 | 1245 | | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1246 | 1268 | | |
1247 | 1269 | | |
1248 | 1270 | | |
1249 | 1271 | | |
1250 | 1272 | | |
1251 | 1273 | | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1256 | 1281 | | |
1257 | 1282 | | |
1258 | 1283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
64 | 91 | | |
65 | 92 | | |
66 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | | - | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
0 commit comments