4 ms·
I think some of those optimizations were implemented because of asm.js, at least in Spider Monkey and old Edge's JavaScript engine, but yes, they should be gene
by jraph 4y ago
I think some of those optimizations were implemented because of asm.js, at least in Spider Monkey and old Edge's JavaScript engine, but yes, they should be generic in theory.
https://en.wikipedia.org/wiki/Asmjs#Implementations https://en.wikipedia.org/wiki/Asmjs#Implementations
- pizlonator 4y agoI added the |0 optimization to JSC’s optimizer before asm.js was a thing. It worked for any use of a number in bit math, so like ~~x also had the same effect as x|0. Hilariously, I didn’t actually do the folding of x|0 to x because I didn’t know folks would do that. I just wanted to eliminate int overflow checks if the use didn’t care about the high bits. We only implemented the folding once asm.js became a thing.