Skip to content

[masm] Add methods for GC access and conditional branches - #740

Merged
titzer merged 2 commits into
masterfrom
masm_for_gc
Oct 31, 2026
Merged

titzer merged 2 commits into
masterfrom
masm_for_gc

Conversation

@titzer

@titzer titzer commented Oct 31, 2026

Copy link
Copy Markdown
Owner

No description provided.

titzer and others added 2 commits October 31, 2026 13:06
NativeStack registered a GC scanner even for stacks without a mapping (e.g.
the sample in V3Offsets), whose scan() dereferenced a null range when the
stack was live during a GC (seen with -O3).

New tests:
- regress tests for GC object accesses, allocations, and casts
  (inline_access0, inline_alloc0, inline_cast0)
- 204 generated cast tests for struct hierarchies of up to 5 types, with
  final types, rec groups, unrelated hierarchies, and abstract types
  (gen_cast_display.py)
- a Wasm GC mode for the Virgil tests (test/virgil/test-gc.sh)
- GC microbenchmarks for struct/array reads and writes and subtype casts
- unittest accepts engine and compiler options; RttTestVals uses a
  non-final supertype

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- sized loads and stores of V3 object fields and elements (emit_load_elem,
  emit_store_elem)
- MasmCmpBr compare-and-branch (emit_br_r_r, emit_br_r_i), replacing
  emit_breq_r_i/emit_brne_r_i/emit_breq_r_l
- MasmBrCond.REF_I31/REF_NOT_I31 for i31 reference tests
- descriptor access (emit_v3_getDescriptor_r_r, emit_v3_getDescribedClassId_r_r)
- embedding struct/array decl infos (emit_mov_r_StructDeclInfo/ArrayDeclInfo)
- inline bump allocation with Virgil's heap pointers (emit_v3_bump_alloc)
- implicit null checks: the next access through an armed register records
  a source location
- embedded references now record their objects, and installing code patches
  their current addresses, since a GC may move them before the code is
  installed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@titzer
titzer merged commit 32c6edc into master Oct 31, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant