Skip to content

Commit 2a5abb4

Browse files
authored
Update node canary (#22832)
This involved using toIndexType in a few more places due to recent wasm64 changes requiring BitInt in more places. Split out from #22773
1 parent 968bbfe commit 2a5abb4

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ commands:
106106
description: "install canary version of node"
107107
steps:
108108
- install-node-version:
109-
node_version: "23.0.0-v8-canary20240819f52f1c2f1c"
109+
node_version: "24.0.0-v8-canary202411045365c9d9be"
110110
canary: true
111111
install-v8:
112112
description: "install v8 using jsvu"

src/library.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,6 +2344,10 @@ addToLibrary({
23442344
'maximum': {{{ toIndexType(INITIAL_TABLE) }}},
23452345
#endif
23462346
#if MEMORY64 == 1
2347+
'address': 'i64',
2348+
// TODO(sbc): remove this alias for 'address' once both firefox and
2349+
// chrome roll out the spec change.
2350+
// See https://github.com/WebAssembly/memory64/pull/92
23472351
'index': 'i64',
23482352
#endif
23492353
'element': 'anyfunc'

src/library_dylink.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ var LibraryDylink = {
639639
var memAlign = Math.pow(2, metadata.memoryAlign);
640640
// prepare memory
641641
var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0; // TODO: add to cleanups
642-
var tableBase = metadata.tableSize ? wasmTable.length : 0;
642+
var tableBase = metadata.tableSize ? {{{ from64Expr('wasmTable.length') }}} : 0;
643643
if (handle) {
644644
{{{ makeSetValue('handle', C_STRUCTS.dso.mem_allocated, '1', 'i8') }}};
645645
{{{ makeSetValue('handle', C_STRUCTS.dso.mem_addr, 'memoryBase', '*') }}};
@@ -657,7 +657,7 @@ var LibraryDylink = {
657657
#if DYLINK_DEBUG
658658
dbg("loadModule: growing table: " + tableGrowthNeeded);
659659
#endif
660-
wasmTable.grow(tableGrowthNeeded);
660+
wasmTable.grow({{{ toIndexType('tableGrowthNeeded') }}});
661661
}
662662
#if DYLINK_DEBUG
663663
dbg("loadModule: memory[" + memoryBase + ":" + (memoryBase + metadata.memorySize) + "]" +

src/preamble.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ function instrumentWasmTableWithAbort() {
588588
var realGet = wasmTable.get;
589589
var wrapperCache = {};
590590
wasmTable.get = (i) => {
591-
var func = realGet.call(wasmTable, i);
591+
var func = realGet.call(wasmTable, {{{ toIndexType('i') }}});
592592
var cached = wrapperCache[i];
593593
if (!cached || cached.func !== func) {
594594
cached = wrapperCache[i] = {

test/core/test_module_wasm_memory.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@
66
* found in the LICENSE file.
77
*/
88

9-
Module['wasmMemory'] = new WebAssembly.Memory({ 'initial': 256, 'maximum': 256,
9+
Module['wasmMemory'] = new WebAssembly.Memory({
1010
#if MEMORY64
11-
'index': 'i64'
11+
'initial': 256n,
12+
'maximum': 256n,
13+
'address': 'i64',
14+
// TODO(sbc): remove this alias for `address` once both firefox and
15+
// chrome roll out the spec change.
16+
// See https://github.com/WebAssembly/memory64/pull/92
17+
'index': 'i64',
18+
#else
19+
'initial': 256,
20+
'maximum': 256,
1221
#endif
1322
});

0 commit comments

Comments
 (0)