Skip to content

v2.3.0 - Wasm: static class fields

Choose a tag to compare

@gmpassos gmpassos released this 18 Jul 06:27
· 149 commits to master since this release
cd03e5d

Wasm: static class fields

The on-the-fly WebAssembly compiler now supports static class fields (bringing it toward parity with the interpreter, which gained them in 2.1.1).

  • Each static field becomes a typed, mutable module global (i64 for int, f64 for double, i32 for bool/other), seeded with its literal initializer.
  • A bare reference inside a static method reads and writes it (global.get/global.set), including compound assignment (c += 1), and values persist across calls.
  • Static-field globals coexist with the enum-entry caches (stable global-index layout).

Qualified Class.field from another class, inherited static fields, and non-literal initializers remain follow-ups (WASM_BACKEND_PLAN.md, GAP D).

Full changelog: https://github.com/ApolloVM/apollovm_dart/blob/v2.3.0/CHANGELOG.md