‘w’ ‘a’ ‘s’ ‘m’ Linear Memory Copy by VM Component A Component B Shared-nothing architecture: コンポーネント間で線形メモリなどの共有無 引数と返り値はそれぞれ、以下の方法で交換される • 各コンポーネントは線形メモリにデータを配置 • ランタイムがデータを別コンポーネントにコピー 11/15
(ref any)) ;; ... ;; check if $x fits in ;; 31-bit signed integer if (result (ref any)) local.get $x call $boxInt else local.get $x ref.i31 end) If it doesn’t fit in 31bit int, use JS number If it’s small enough, use i31ref. No Wasm-to-JS call Boxing without crossing Wasm/JS boundary. i31 values are seen as JS numbers from JS host. https://www.w3.org/TR/wasm-js-api/#tojsvalue 11/18
+ JS String Builtins Linked list around (array i16) Boxing/Unboxing JS primitive + i31ref I31ref + Box class class IntBox(value: Int) … JDK API impl Based on JS interop Regex, Math, Variable-Length Array, Encode/Decode decimal float, System APIs, etc WASI preview2 + reimplement in Scala