Skip to content

Commit d239a63

Browse files
committed
[wasm64] Remove temporary toIndexType workaround
Now the firefox and chrome both use BigInt for indexing 64-bit memories and tables this workaround is no longer needed.
1 parent 0bf241c commit d239a63

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

src/parseTools.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,7 @@ function from64Expr(x, assign = true) {
964964
}
965965

966966
function toIndexType(x) {
967-
if (MEMORY64 != 1) return x;
968-
return `toIndexType(${x})`;
967+
return to64(x);
969968
}
970969

971970
function to64(x) {

src/runtime_shared.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,6 @@ function updateMemoryViews() {
4747
#endif
4848
}
4949

50-
#if MEMORY64 == 1
51-
var toIndexType = (function() {
52-
// Probe for support of bigint bounds with memory64.
53-
// TODO(sbc): Remove this once all browsers start requiring bigint here.
54-
// See https://github.com/WebAssembly/memory64/issues/68
55-
var bigintMemoryBounds = 1;
56-
try {
57-
/** @suppress {checkTypes} */
58-
new WebAssembly.Memory({'initial': 1n, 'index': 'i64', 'address': 'i64'});
59-
} catch (e) {
60-
bigintMemoryBounds = 0;
61-
}
62-
return (i) => bigintMemoryBounds ? BigInt(i) : i;
63-
})();
64-
#endif
65-
6650
#if ENVIRONMENT_MAY_BE_NODE && MIN_NODE_VERSION < 160000
6751
// The performance global was added to node in v16.0.0:
6852
// https://nodejs.org/api/globals.html#performance
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1589
1+
1522
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3311
1+
3179

0 commit comments

Comments
 (0)