closure-compiler
closure-compiler copied to clipboard
Transport asm.js correctly
Peephole passes and others should not traverse into functions annotated with 'use asm'. The 'use asm' string needs to be retained.
It seems rather strange to me, to use both asm.js and Closure Compiler on the same code. But I have heard that some people do it, so I guess we could do this.
Is there any progress on this? Would be very nice to have asm.js in very hot functions without closure compiler ripping it apart into normal js code.
I have not much knowledge how closure-compiler works but I assume that it would be enough to just fall back to white-space only (and maybe variable renaming) inside of blocks that have "use-asm"; at their beginning. Is that somewhat easy to implement? I have code where hot loops were converted to asm code, like you would do it in c projects with inline assembly.
The "only" thing really needed is that a function with "use asm" at its beginning is just handled like a text, so that if not making it smaller, it is at least preserved 1:1 instead of loosing its performance gains...