Skip to content

Commit a5bd5a0

Browse files
committed
Update node canary
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 4171ae2 commit a5bd5a0

File tree

8 files changed

+20
-10
lines changed

8 files changed

+20
-10
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ var HEAP,
146146
var HEAP_DATA_VIEW;
147147
#endif
148148

149-
#include "runtime_shared.js"
150-
151149
#if PTHREADS
152150
#include "runtime_pthread.js"
153151
#endif
@@ -588,7 +586,7 @@ function instrumentWasmTableWithAbort() {
588586
var realGet = wasmTable.get;
589587
var wrapperCache = {};
590588
wasmTable.get = (i) => {
591-
var func = realGet.call(wasmTable, i);
589+
var func = realGet.call(wasmTable, {{{ toIndexType('i') }}});
592590
var cached = wrapperCache[i];
593591
if (!cached || cached.func !== func) {
594592
cached = wrapperCache[i] = {

src/preamble_minimal.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ var HEAP8, HEAP16, HEAP32, HEAPU8, HEAPU16, HEAPU32, HEAPF32, HEAPF64,
5454
#endif
5555
wasmMemory;
5656

57-
#include "runtime_shared.js"
58-
5957
#if PTHREADS
6058
#include "runtime_pthread.js"
6159
#endif

src/shell.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ if (ENVIRONMENT_IS_NODE) {
155155
var ENVIRONMENT_IS_WASM_WORKER = Module['$ww'];
156156
#endif
157157

158+
#include "runtime_shared.js"
159+
158160
// --pre-jses are emitted after the Module integration code, so that they can
159161
// refer to Module (if they choose; they can also define Module)
160162
{{{ preJS() }}}

src/shell_minimal.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ if (ENVIRONMENT_IS_WORKER) {
162162
}
163163
#endif // PTHREADS
164164

165+
#include "runtime_shared.js"
166+
165167
// --pre-jses are emitted after the Module integration code, so that they can
166168
// refer to Module (if they choose; they can also define Module)
167169
{{{ preJS() }}}

test/core/test_module_wasm_memory.js

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

9-
Module['wasmMemory'] = new WebAssembly.Memory({ 'initial': 256, 'maximum': 256,
9+
Module['wasmMemory'] = new WebAssembly.Memory({
10+
'initial': {{{ toIndexType('256') }}},
11+
'maximum': {{{ toIndexType('256') }}},
1012
#if MEMORY64
11-
'index': 'i64'
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',
1218
#endif
1319
});

0 commit comments

Comments
 (0)