Comment #51 on issue 2599 by [email protected]: Implement "use asm"
http://code.google.com/p/v8/issues/detail?id=2599

I think that the key of asm.js is that it enforces static types. Not only in the javascript "Number" but low level int's and floats with the enforced size. This means that theoretically code should never have to be "de-optimized" as it should always use the same types.

Now, AFAIK this is already a benefit as once compiled that compiled routine will be good for the lifetime of the program. However, by taking into account the knowledge that the code is asm.js you can take more time optimizing as you know it will be useful, and you can likely optimize earlier because you don't need to take time to track what types are used (you know the types before the code runs once).

I believe that asm.js also ensures that all functions called are static (except for the FFI) so that inlining is easier as you don't have to worry about the inlined function changing.

So some things to take away is that type guarantees are pretty much "free" in that code doesn't get deoptimized but in "use asm" blocks you can make stricter assumptions about types more safely.

The function staticness is also automatically beneficial for the same reason.

So v8 already benefits quite a bit from asm.js and the final tweaks would be minor (they shouldn't change inner loops). One of the largest benefits would be removing the deoptimization checks, but that is very dangerous because if it can't be guaranteed that the assumptions are always valid you could possibly get undefined behaviour.

So we get back to the general agreement that this bug is more about emitting the proper warnings, rather than treating asm.js as special by the jit (and whatever other components).

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to