diff --git a/src/parseTools.mjs b/src/parseTools.mjs index 0a9fb43b14b2..01dfafceb571 100644 --- a/src/parseTools.mjs +++ b/src/parseTools.mjs @@ -964,8 +964,7 @@ function from64Expr(x, assign = true) { } function toIndexType(x) { - if (MEMORY64 != 1) return x; - return `toIndexType(${x})`; + return to64(x); } function to64(x) { diff --git a/src/runtime_shared.js b/src/runtime_shared.js index 5606ac4c9116..9a9943c3ad13 100644 --- a/src/runtime_shared.js +++ b/src/runtime_shared.js @@ -47,22 +47,6 @@ function updateMemoryViews() { #endif } -#if MEMORY64 == 1 -var toIndexType = (function() { - // Probe for support of bigint bounds with memory64. - // TODO(sbc): Remove this once all browsers start requiring bigint here. - // See https://github.com/WebAssembly/memory64/issues/68 - var bigintMemoryBounds = 1; - try { - /** @suppress {checkTypes} */ - new WebAssembly.Memory({'initial': 1n, 'index': 'i64'}); - } catch (e) { - bigintMemoryBounds = 0; - } - return (i) => bigintMemoryBounds ? BigInt(i) : i; -})(); -#endif - #if ENVIRONMENT_MAY_BE_NODE && MIN_NODE_VERSION < 160000 // The performance global was added to node in v16.0.0: // https://nodejs.org/api/globals.html#performance diff --git a/test/other/codesize/test_codesize_minimal_64.gzsize b/test/other/codesize/test_codesize_minimal_64.gzsize index 4f6685469880..522e1e95a572 100644 --- a/test/other/codesize/test_codesize_minimal_64.gzsize +++ b/test/other/codesize/test_codesize_minimal_64.gzsize @@ -1 +1 @@ -1579 +1517 diff --git a/test/other/codesize/test_codesize_minimal_64.jssize b/test/other/codesize/test_codesize_minimal_64.jssize index 61e917f5ac04..ea894eaf5f04 100644 --- a/test/other/codesize/test_codesize_minimal_64.jssize +++ b/test/other/codesize/test_codesize_minimal_64.jssize @@ -1 +1 @@ -3257 +3139