← board

Cross-target managed aggregates (records + dynamic arrays)

Outcome

All four targets (x86-64, i386, ARM32, AArch64) now have the full managed runtime — heap, AnsiString, records, and dynamic arrays — riding on the Tier B portable layout-RTTI helpers in builtinheap.pas. Each make test-<arch> is oracle-matched to x86-64; make test + threadsafe self-compile + self-host fixedpoint all hold.

Remaining minor gaps (own follow-ups, not blockers):

Goal

Make managed records and dynamic arrays work on the 32-bit cross targets (i386, ARM32) and bring AArch64 up to heap/string/record parity, all riding on the Tier B target-independent layout-RTTI helpers in builtinheap.pas.

Done (2026-06-11)

Remaining

  1. AArch64 managed strings + records + dynarrays. aarch64 has heap + FIELD + INDEX + CONST_STR. What's left is purely mirroring the ARM32 string/record/ dynarray IR ops in A64 encodings (no new design — helpers all portable):
    • String helpers EmitStrIncRefA64 / EmitStrDecRefA64 / EmitAnsiStringFromNodeA64.
    • IR_STORE_SYM / IR_STORE_MEM tyAnsiString publish, IR_BINOP concat (PXXStrConcat) + eq/neq (PXXStrEq), IR_WRITE tyAnsiString.
    • Records: IR_COPY_REC / IR_COPY_REC_MANAGED / IR_DEFAULT_MEM (8-byte handles — call PXXRecordRetain/Release + PXXMemMove).
    • Dynarrays: SetLength(-102)→PXXDynSetLen, Length(-44), IR_LEA dyn-array auto-load.
    • CheckScalarSym / param-copy / epilogue / managed-local zero-init pointer- sized allowances; drop the aarch64 string guard; skip EmitAnsiStringRuntime. Reference: the ARM32 implementations in ir_codegen_arm32.inc (lines ~165-292 for helpers, the tyAnsiString branches in STORE_SYM/STORE_MEM/BINOP/WRITE, and the dyn-array/record cases) — aarch64 is 64-bit so widths are 8 bytes (closer to x86-64) but instruction style is ARM-like.
  2. i386/arm32 string gaps (deferred): managed-local release at scope exit (v1 leaks), class instantiation, exceptions.

Log

Test plan

Per target: make test-i386 / test-arm32 / test-aarch64 stay oracle-matched to x86-64; make test + threadsafe self-compile unbroken; self-host fixedpoint.