Commit f176f2e
authored
cleanup(codegen): remove dead Codegen fields region_stack + bump_ptr (+ orphaned RegionInfo) (#250)
## Summary
Per typed-wasm proposal 0001 Appendix B "Producer-readiness checklist"
follow-up. Both fields in \`Codegen\` were marked
\`#[allow(dead_code)]\`
with the comment "reserved for future interpreter use" — declared,
initialized in \`Codegen::new()\`, never read or written elsewhere in
the crate.
## Removed
- \`Codegen.region_stack: Vec<RegionInfo>\` field + its constructor init
- \`Codegen.bump_ptr: u32\` field + its constructor init (adjacent dead
code in the same struct, same "reserved" comment)
- \`RegionInfo\` struct (only consumer was \`region_stack\`; orphaned
after removal — its own fields were already \`#[allow(dead_code)]\`)
## Retained
- \`REGION_HEADER_SIZE\` constant — \`pub\`, conceptually describes the
linear-memory layout (used by comments at lines 28 + 76 + within the
wasm-side memory-layout code at ~1506-1531 that manipulates the
wasm-memory \`bump_ptr\` cell at offset 0). Removing the Rust-side
dead struct field does not affect the wasm-side memory layout.
## Important disambiguation
The wasm-side \`bump_ptr\` (a value stored in wasm linear memory at
offset 0, real and load-bearing) is unrelated to the removed Rust
\`Codegen.bump_ptr\` struct field of the same name. The struct field
was a stale carry-over from an earlier design where the Codegen
tracked it Rust-side; the actual implementation tracks it inside the
emitted wasm. The naming collision is what kept the dead field
camouflaged.
## Verification
- \`cargo check -p ephapax-wasm\` — clean, no warnings
- \`cargo test -p ephapax-wasm\` — 84/84 pass
## Carry-forward note
This closes the dead-code item from typed-wasm proposal 0001 Appendix B.
The access-sites codegen follow-up is filed at the ephapax counterpart
to affinescript#462.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 538957c commit f176f2e
1 file changed
Lines changed: 0 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | 266 | | |
273 | 267 | | |
274 | 268 | | |
| |||
387 | 381 | | |
388 | 382 | | |
389 | 383 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 384 | | |
401 | 385 | | |
402 | 386 | | |
| |||
407 | 391 | | |
408 | 392 | | |
409 | 393 | | |
410 | | - | |
411 | | - | |
412 | 394 | | |
413 | 395 | | |
414 | 396 | | |
| |||
0 commit comments