You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a flag WASM_BIGINT which enables this feature, with
which we let the JS VM use a JS BigInt for a wasm i64. In that case
we don't need to legalize i64s into pairs of i32s.
This is fairly straightforward, but we do need to modify the JS code
of each library method that receives or returns an i64.
Tests verify that we can send and receive i64s from wasm to JS,
and also that a dynCall works. This depends on
WebAssembly/binaryen#2726 for that.
Copy file name to clipboardExpand all lines: src/support.js
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -444,9 +444,13 @@ function loadWebAssemblyModule(binary, flags) {
444
444
varmoduleLocal={};
445
445
446
446
varresolveSymbol=function(sym,type,legalized){
447
+
#if WASM_BIGINT
448
+
assert(!legalized);
449
+
#else
447
450
if(legalized){
448
451
sym='orig$'+sym;
449
452
}
453
+
#endif
450
454
451
455
varresolved=Module["asm"][sym];
452
456
if(!resolved){
@@ -460,7 +464,7 @@ function loadWebAssemblyModule(binary, flags) {
460
464
#if ASSERTIONS
461
465
assert(resolved,'missing linked '+type+' `'+sym+'`. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment');
462
466
#endif
463
-
}
467
+
}
464
468
returnresolved;
465
469
}
466
470
@@ -510,7 +514,11 @@ function loadWebAssemblyModule(binary, flags) {
510
514
assert(parts.length==3)
511
515
varname=parts[1];
512
516
varsig=parts[2];
517
+
#if WASM_BIGINT
518
+
varlegalized=false;
519
+
#else
513
520
varlegalized=sig.indexOf('j')>=0;// check for i64s
0 commit comments