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 change use makeGetValue helper macros to avoid direct heap access.
This does come with a 11 byte code size cost (I measured the size of the
JS code generated for core3.test_em_asm going from 15091 to 15102) but
I think its useful enough to pay that price.
assert(validChars.includes(chr),`Invalid character ${ch}("${chr}") in readEmAsmArgs! Use only [${validChars}], and do not specify "v" for void return argument.`);
2887
2886
#endif
2888
-
// Floats are always passed as doubles, and doubles and int64s take up 8
2889
-
// bytes (two 32-bit slots) in memory, align reads to these:
2890
-
buf+=(ch!=105/*i*/)&buf;
2887
+
// Floats are always passed as doubles, so all types except for 'i'
2888
+
// are 8 bytes and require alignment.
2889
+
buf+=(ch!={{{charCode('i')}}})&&buf%8 ? 4 : 0;
2890
+
readEmAsmArgsArray.push(
2891
2891
#if MEMORY64
2892
2892
// Special case for pointers under wasm64 which we read as int53 Numbers.
0 commit comments