|
|
@@ -33,14 +33,26 @@ at lowering time (module scope is open — workable) and qualified-call
|
|
|
resolution in `LowerCall` (currently `CalleeName` reads only the base
|
|
|
ident).
|
|
|
|
|
|
-### Classes/vtables — large, single-unit, verifiable
|
|
|
-Surface: `NkClassDecl`/`NkFieldDecl`, `CLASS IMPLEMENTATION`, method
|
|
|
-binding (`obj.Method` + `ArmRecv`), virtual dispatch, inheritance, `NEW`
|
|
|
-for classes, vtables (`QbeGen.EmitVTables`), `THIS`. Independent of
|
|
|
-imports, so it can be byte-verified with `lower_ok` on a self-contained
|
|
|
-class program.
|
|
|
-
|
|
|
-## Suggested order
|
|
|
-1. Classes/vtables (verifiable now).
|
|
|
-2. The per-unit lowering mechanism (unblocks imports and is the L7
|
|
|
- prerequisite).
|
|
|
+### Classes/vtables — done
|
|
|
+`751a227` (methods, fields, sibling calls, inheritance) and `7aa21ff`
|
|
|
+(virtual dispatch, class pointers, empty class `BEGIN`).
|
|
|
+
|
|
|
+- Class declarations (op=0) emit nothing but replay each method heading
|
|
|
+ (`BeginFunc`/`FuncParam`/`AbortFunc`) so the backend temp counters
|
|
|
+ advance exactly as the legacy parse did.
|
|
|
+- Class implementations (op=1) emit each method with a hidden `THIS`
|
|
|
+ receiver, `THIS` pushed as the WITH base (bare field names resolve);
|
|
|
+ a `BEGIN` body emits `<class>_init` (empty `BEGIN` is marked with an
|
|
|
+ empty `NkBlock` in `M2.atg` so it is distinguishable from "no BEGIN").
|
|
|
+- Method calls: `obj.Method`, `p^.Method` and bare sibling names bind the
|
|
|
+ receiver (`ArmRecv`) and dispatch via `VirtCallBegin`/`CallBegin`.
|
|
|
+- `CanType` accepts `ClClass`; methods are gated by `CanMethod`/
|
|
|
+ `CanMethods` with the class pushed as the WITH base.
|
|
|
+
|
|
|
+`lower_ok`: `t_class`, `t_classinit`, `t_classmethod`, `t_classinherit`,
|
|
|
+`t_classsibling`, `t_virtual`. Suite **200/200**; FIXPOINT OK
|
|
|
+(3,378,633 bytes).
|
|
|
+
|
|
|
+## Remaining
|
|
|
+Imports only (see above): blocked by the session-image model, needs the
|
|
|
+per-unit lowering mechanism that L7 also requires.
|