File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -997,11 +997,17 @@ function from64Expr(x) {
997
997
return `Number(${ x } )` ;
998
998
}
999
999
1000
+ // Converts a value to BigInt if building for wasm64, with both 64-bit pointers
1001
+ // and 64-bit memory. Used for indices into the memory tables, for example.
1000
1002
function toIndexType ( x ) {
1001
1003
if ( MEMORY64 == 1 ) return `BigInt(${ x } )` ;
1002
1004
return x ;
1003
1005
}
1004
1006
1007
+ // Converts a value to BigInt if building for wasm64, regardless of whether the
1008
+ // memory is 32- or 64-bit. Used for passing pointer-width values to native
1009
+ // code (since pointers are presented as Number in JS and BigInt in wasm we need
1010
+ // this conversion before passing them).
1005
1011
function to64 ( x ) {
1006
1012
if ( ! MEMORY64 ) return x ;
1007
1013
return `BigInt(${ x } )` ;
You can’t perform that action at this time.
0 commit comments