selfhost/cmd/wcc: route remaining wwstage size dispatch through SSoT
Followup to 8e93b31 (#43). Audit caught dispatch-gate sites the
sweep missed:
- cgen.ww letpreintern's `sz == 16` str-let detector — would
desync from emitletdataw's matching `sz == primtypesize("str"):
i32` strlit-init branch under #1.
- cgenstmt.ww cglet str-init MOVQ-BX gate and slice-init MOVQ-BX/CX
gate (and the belt-and-suspenders N_TSLICE shape check at l.607).
- cgenexpr.ww cgindex str-element loads (3 sites: globalarr,
baselocal, generic fallback) and the matching cgassign N_INDEX
str-element write pair (BX spill + post-index store).
All gates now read `primtypesize("str"): i32` / `tyslicesize(): i32`,
so #1's ty_str.size bump propagates through the same two-place edit
the original commit advertised. Combined files (w6c/wwdump) updated
in lockstep.
131/131 + 994 + 995 byte-identity green; smoke.combined.ww (lib-only
consumer) emits the same asm pre vs post, confirming the change is
SSoT routing only (no behaviour shift).
This commit is contained in:
@@ -1199,7 +1199,10 @@ export fn letpreintern(c: *cgen, file: *node) void = {
|
||||
for (d != nil) {
|
||||
if (d.kind == nkind.N_LET) {
|
||||
let sz: i32 = letemitsize(c, d);
|
||||
if (sz == 16) {
|
||||
// #43: route the str-let gate through primtypesize so
|
||||
// #1 doesn't desync this with emitletdataw's matching
|
||||
// `sz == primtypesize("str"): i32` strlit-init branch.
|
||||
if (sz == primtypesize("str"): i32) {
|
||||
let r: *node = d.rhs;
|
||||
for (r != nil) {
|
||||
if (r.kind != nkind.N_CAST) { break; };
|
||||
|
||||
Reference in New Issue
Block a user