From 0c2a0f4b160b9791d2b9ce61dd97359fbe1a310c Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 24 Oct 2024 15:51:27 -0700 Subject: [PATCH] [wasm64] Rename `index` -> `address in new WebAssembly.Memory See https://github.com/WebAssembly/memory64/pull/92 --- src/runtime_init_memory.js | 4 ++++ src/runtime_shared.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runtime_init_memory.js b/src/runtime_init_memory.js index 7f3574f131e05..b3e71ac2154fe 100644 --- a/src/runtime_init_memory.js +++ b/src/runtime_init_memory.js @@ -46,6 +46,10 @@ if (!ENVIRONMENT_IS_PTHREAD) { 'shared': true, #endif #if MEMORY64 == 1 + 'address': 'i64', + // TODO(sbc): remove this alias for `address` once both firefox and + // chrome roll out the spec change. + // See https://github.com/WebAssembly/memory64/pull/92 'index': 'i64', #endif }); diff --git a/src/runtime_shared.js b/src/runtime_shared.js index 5606ac4c91162..ea63e247a6a5d 100644 --- a/src/runtime_shared.js +++ b/src/runtime_shared.js @@ -55,7 +55,7 @@ var toIndexType = (function() { var bigintMemoryBounds = 1; try { /** @suppress {checkTypes} */ - new WebAssembly.Memory({'initial': 1n, 'index': 'i64'}); + new WebAssembly.Memory({'initial': 1n, 'index': 'i64', 'address': 'i64'}); } catch (e) { bigintMemoryBounds = 0; }