문제

So how can I check if it's executed like normal Javascript via for example Google's V8 engine or executed with near native performance using assembly?

도움이 되었습니까?

해결책

If you just look at the console, Firefox will tell you whether your asm.js validated or not. In the case of the script pasted above, I get:

TypeError: asm.js type error: non-expression-statement call must be coerced test.html:23

which suggests not. Line 23 in this case is:

                return +sqrt(square(x) + square(y));

If I replace that line with this:

                return +sqrt(+square(x) + +square(y));

then the error console says:

Error: successfully compiled asm.js code (total compilation time 0ms)

which means it all worked fine (and the "Error" there is just a bogus quirk of how the JS engine reports success in this case; I filed https://bugzilla.mozilla.org/show_bug.cgi?id=950527 to get that fixed).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top