Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2025-07-25 07:33:44 +08:00
commit be6796bb20
9 changed files with 401 additions and 65 deletions

View file

@ -148,11 +148,11 @@ var exp = asmLink(asmCompile(USE_ASM + "var x=0; function a() { return x|0 } fun
assertEq(exp.c(10), undefined);
assertEq(exp.a(), 10);
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=-1; break; case 133742: i=2; break; default: i=42; break } return i|0 } return f"));
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=-1; break; case 65520: i=2; break; default: i=42; break } return i|0 } return f"));
assertEq(f(1), -1);
assertEq(f(2), 42);
assertEq(f(133742), 2);
assertEq(f(133743), 42);
assertEq(f(65520), 2);
assertEq(f(65521), 42);
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=42; break; default: i=13 } return i|0 } return f"));
assertEq(f(-1), 13);

View file

@ -1332,7 +1332,7 @@ static const unsigned MaxTableElems = 1024 * 1024;
static const unsigned MaxDataSegments = 64 * 1024;
static const unsigned MaxElemSegments = 64 * 1024;
static const unsigned MaxArgsPerFunc = 4 * 1024;
static const unsigned MaxBrTableElems = 4 * 1024 * 1024;
static const unsigned MaxBrTableElems = 65520;
// To be able to assign function indices during compilation while the number of
// imports is still unknown, asm.js sets a maximum number of imports so it can