diff --git a/current/CHECKPOINT-FFI.md b/current/CHECKPOINT-FFI.md index 51c0ea0..d2774d8 100644 --- a/current/CHECKPOINT-FFI.md +++ b/current/CHECKPOINT-FFI.md @@ -260,13 +260,25 @@ plus 2 codegen fixes surfaced along the way.** - Smoke test [examples/ffi-objc-arc-01-autoreleasepool.sx](../examples/ffi-objc-arc-01-autoreleasepool.sx) exercises the retain/release + autoreleasepool round-trip. -**M4.B remaining** (compiler-internal property ARC ops; not yet -landed): -- `objcPropertyKind(field)` helper + `ensureArcRuntimeDecls`. -- Setter wiring strong/weak/copy ops. -- Getter via objc_loadWeakRetained for weak properties. -- Dealloc property-aware cleanup (release strong/copy, destroyWeak - weak) before freeing state struct. +**M4.B — property ARC ops** (4 commits, done): +- `objcPropertyKind(field)` + `ensureArcRuntimeDecls` helpers. The + kind helper validates `#property(...)` modifiers and emits loud + diagnostics for: unknown modifier names, conflicting modifiers, + weak/copy on non-object fields, `#property(strong)` on `*void`. +- Setter emits ARC ops per kind: strong → retain new + release old; + weak → `objc_storeWeak`; copy → `[val copy]` + release old; assign + → bare store. +- Getter weak path → `objc_loadWeakRetained` + `objc_autorelease` + for race-safe reads. Strong/copy/assign keep the bare load. +- Dealloc walks `#property` ivars BEFORE freeing the state struct: + release strong/copy ivars, destroyWeak weak ivars. Order: property + cleanup → state free → [super dealloc]. + +Smoke tests `ffi-objc-arc-02-strong-property` (TrackingAllocator +midpoint + balance) and `ffi-objc-arc-03-weak-property` (auto-nil +after target dealloc) both pass. + +189/189 example tests pass; chess on iOS-sim green throughout M4. **Previous-session wins still in this checkpoint:** - M4.0 / M4.A built on top of these earlier commits this session: