internals · 6 of 6 · webassembly

WebAssembly

The ABI reaches V8′s WebAssembly objects too. deno_core expects constructors and accessors for modules, instances, memories, tables, and globals. quickjs-ng has no WebAssembly surface, so the QuickJS backend embeds WAMR and wraps its native objects in JavaScript objects. This is a second ownership boundary, and three rules keep it sound:

  1. a JavaScript wrapper retains its native WAMR object until the engine collects the wrapper, never the reverse
  2. imported functions cross from Wasm into a QuickJS callback and then the same trampoline as ordinary functions, so host calls behave the same from JavaScript and from Wasm
  3. when linear memory grows, the JavaScript ArrayBuffer view is re-synced to the new memory; reference values crossing tables and globals keep their QuickJS ownership count

Next: The hill climb: how progress is measured