2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
- // Excerpt from `build/run_wasm.js` to add own task queue implementation, since
6
- // `setTimeout` and `queueMicrotask` are not always available in shells.
5
+ // Excerpt from `wasm_gc_benchmarks/tools/run_wasm.js` to add own task queue
6
+ // implementation, since `setTimeout` and `queueMicrotask` are not always
7
+ // available in shells.
8
+ // TODO: Now (2025-08-14) that all shells have `setTimeout` available, can we
9
+ // remove this? Talk to Dart2wasm folks.
7
10
function addTaskQueue ( self ) {
8
11
"use strict" ;
9
12
@@ -62,8 +65,7 @@ function addTaskQueue(self) {
62
65
ms = Math . max ( 0 , ms ) ;
63
66
var id = timerIdCounter ++ ;
64
67
// A callback can be scheduled at most once.
65
- // (console.assert is only available on D8)
66
- // if (isD8) console.assert(f.$timerId === undefined);
68
+ console . assert ( f . $timerId === undefined ) ;
67
69
f . $timerId = id ;
68
70
timerIds [ id ] = f ;
69
71
if ( ms == 0 && ! isNextTimerDue ( ) ) {
@@ -262,8 +264,8 @@ class Benchmark {
262
264
// The generated JavaScript code from dart2wasm is an ES module, which we
263
265
// can only load with a dynamic import (since this file is not a module.)
264
266
265
- Module . wasmBinary = await getBinary ( wasmBinary ) ;
266
- this . dart2wasmJsModule = await dynamicImport ( jsModule ) ;
267
+ Module . wasmBinary = await JetStream . getBinary ( JetStream . preload . wasmBinary ) ;
268
+ this . dart2wasmJsModule = await JetStream . dynamicImport ( JetStream . preload . jsModule ) ;
267
269
}
268
270
269
271
async runIteration ( ) {
@@ -283,7 +285,7 @@ class Benchmark {
283
285
const framesToDraw = 100 ;
284
286
const initialFramesToSkip = 0 ;
285
287
const dartArgs = [
286
- startTimeSinceEpochSeconds ,
288
+ startTimeSinceEpochSeconds . toString ( ) ,
287
289
framesToDraw . toString ( ) ,
288
290
initialFramesToSkip . toString ( )
289
291
] ;
0 commit comments