wwstage: add tinfo.module field, P0 of (module,name) NAMED interning (#10)
Append module:str to tinfo and set "" in newtype (the sole tinfo constructor); the field is set-not-keyed here — P1 keys typeeq's NAMED arm on (module,name) to collapse cross-module same-nominal duplicates. Byte-id neutral: only w6c/wwdump combined.ww regenerated (sole typ.ww embedders); cs==ww and 990-997 hold; neutrality proven on the tinfo-free corpus (w6a/w6l/ww/smoke).
This commit is contained in:
@@ -136,6 +136,18 @@ type tinfo = struct {
|
|||||||
// still lives at slotsize()'s read site;
|
// still lives at slotsize()'s read site;
|
||||||
// graduating it here would break `[N]i32`
|
// graduating it here would break `[N]i32`
|
||||||
// stride (4*N stays natural).
|
// stride (4*N stays natural).
|
||||||
|
module: str, // #10 P0: defining module of a TY_NAMED, the
|
||||||
|
// declaring `// MODULE: foo` (node.nmod) where
|
||||||
|
// `type foo = …` lives — NOT the importing
|
||||||
|
// referrer. With `name` it forms the (module,
|
||||||
|
// name) intern key that re-keys the canonical-
|
||||||
|
// NAMED cache off the per-module sym, so one
|
||||||
|
// nominal type yields one tinfo pointer across
|
||||||
|
// modules (typeeq's NAMED arm is pure ptr-id).
|
||||||
|
// Mirrors harec alias.ident (type_store.c:737).
|
||||||
|
// "" for primitives + builtins + every non-
|
||||||
|
// NAMED tinfo (consulted only by the NAMED
|
||||||
|
// intern path). P0 sets the field; P1 keys on it.
|
||||||
};
|
};
|
||||||
|
|
||||||
// #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes
|
// #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes
|
||||||
@@ -185,7 +197,7 @@ type tctx = struct {
|
|||||||
// ---- constructors -----------------------------------------------------
|
// ---- constructors -----------------------------------------------------
|
||||||
|
|
||||||
export fn newtype(k: tykind) *tinfo = {
|
export fn newtype(k: tykind) *tinfo = {
|
||||||
let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64})!;
|
let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64, module=""})!;
|
||||||
return t;
|
return t;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9378,6 +9378,18 @@ type tinfo = struct {
|
|||||||
// still lives at slotsize()'s read site;
|
// still lives at slotsize()'s read site;
|
||||||
// graduating it here would break `[N]i32`
|
// graduating it here would break `[N]i32`
|
||||||
// stride (4*N stays natural).
|
// stride (4*N stays natural).
|
||||||
|
module: str, // #10 P0: defining module of a TY_NAMED, the
|
||||||
|
// declaring `// MODULE: foo` (node.nmod) where
|
||||||
|
// `type foo = …` lives — NOT the importing
|
||||||
|
// referrer. With `name` it forms the (module,
|
||||||
|
// name) intern key that re-keys the canonical-
|
||||||
|
// NAMED cache off the per-module sym, so one
|
||||||
|
// nominal type yields one tinfo pointer across
|
||||||
|
// modules (typeeq's NAMED arm is pure ptr-id).
|
||||||
|
// Mirrors harec alias.ident (type_store.c:737).
|
||||||
|
// "" for primitives + builtins + every non-
|
||||||
|
// NAMED tinfo (consulted only by the NAMED
|
||||||
|
// intern path). P0 sets the field; P1 keys on it.
|
||||||
};
|
};
|
||||||
|
|
||||||
// #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes
|
// #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes
|
||||||
@@ -9427,7 +9439,7 @@ type tctx = struct {
|
|||||||
// ---- constructors -----------------------------------------------------
|
// ---- constructors -----------------------------------------------------
|
||||||
|
|
||||||
export fn newtype(k: tykind) *tinfo = {
|
export fn newtype(k: tykind) *tinfo = {
|
||||||
let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64})!;
|
let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64, module=""})!;
|
||||||
return t;
|
return t;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9378,6 +9378,18 @@ type tinfo = struct {
|
|||||||
// still lives at slotsize()'s read site;
|
// still lives at slotsize()'s read site;
|
||||||
// graduating it here would break `[N]i32`
|
// graduating it here would break `[N]i32`
|
||||||
// stride (4*N stays natural).
|
// stride (4*N stays natural).
|
||||||
|
module: str, // #10 P0: defining module of a TY_NAMED, the
|
||||||
|
// declaring `// MODULE: foo` (node.nmod) where
|
||||||
|
// `type foo = …` lives — NOT the importing
|
||||||
|
// referrer. With `name` it forms the (module,
|
||||||
|
// name) intern key that re-keys the canonical-
|
||||||
|
// NAMED cache off the per-module sym, so one
|
||||||
|
// nominal type yields one tinfo pointer across
|
||||||
|
// modules (typeeq's NAMED arm is pure ptr-id).
|
||||||
|
// Mirrors harec alias.ident (type_store.c:737).
|
||||||
|
// "" for primitives + builtins + every non-
|
||||||
|
// NAMED tinfo (consulted only by the NAMED
|
||||||
|
// intern path). P0 sets the field; P1 keys on it.
|
||||||
};
|
};
|
||||||
|
|
||||||
// #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes
|
// #61 audit §1.8 / Rob+Drew convergence 2026-05-20: memoizes
|
||||||
@@ -9427,7 +9439,7 @@ type tctx = struct {
|
|||||||
// ---- constructors -----------------------------------------------------
|
// ---- constructors -----------------------------------------------------
|
||||||
|
|
||||||
export fn newtype(k: tykind) *tinfo = {
|
export fn newtype(k: tykind) *tinfo = {
|
||||||
let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64})!;
|
let t: *tinfo = alloc(tinfo{kind=k, size=0u64, align=0u64, sub=nil, alen=0u64, fields=nil, params=nil, tupleelems=nil, ret=nil, variadic=0, nullable=0, name="", under=nil, slotsize=0u64, module=""})!;
|
||||||
return t;
|
return t;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user