Files
ww/selfhost/cmd/wcc
Hojun-Cho 38d6eb667c selfhost/cmd/wcc: inline N_INDEX elem tinfo at 3 tagged push/index sites (#60)
pushargsrev and cgindex re-derived an index element's type via
indexvaluetnode (a base->TPTR/SLICE/ARRAY .lhs AST walk). The checker
stamps the element type on the N_INDEX node itself (indexresult,
check.ww:1710; N_INDEX is in the asserttyped gate), so read n.type_
directly at the 3 sites that only need tagged-ness + element size/sign:
  cgenutil pushargsrev L178/490: pass the N_INDEX arg to istaggedtype/
    slotsize (arg.type_ is the element tinfo).
  cgenexpr cgindex L726: esz = n.type_.size, signed = typeissigned(n.type_).

Polarity DOWN per rule 10: cstage has no indexvaluetnode -- it reads
base->type->sub->size directly (cmd/w6c/cgen.c:2070-2071, :3518). The new
path reads element natural size (tinfo.size == primsize: rune=4, u8=1,
str=16, slice=24), matching cstage; it also retires two latent elemsizeofc
divergences (elemsizeofc returned slotsize N*8 for *[N]i64 / 2D-array
elements where cstage uses sub->size=8) -- those shapes are absent from
self-compile, so byte-id stays green.

indexvaluetnode is NOT deleted: its remaining callers at cgenexpr
L3720/3729 feed cgwidentaggedstore -> resolvetagged -> resolvetype, still
node-keyed (nil for non-N_TNAME). Deleting it waits on the resolvetagged
-> tinfo migration (#11).

make test 133/133 (byte-id 990-997 green, independently re-confirmed on
quiescent tree).
2026-05-23 17:04:31 +09:00
..