I have read the question How to test and develop with asm.js?, and the accepted answer gives a link to http://kripken.github.com/mloc_emscripten_talk/#/.
The conclus
It may be possible to convert regular JavaScript into ams.js by first compiling it into C or C++, and then compiling the generated code into asm.js using Emscripten. I'm not sure if this would be practical, but it's an interesting concept nonetheless.
More recently, I found another tool called NectarJS that compiles JavaScript into WebAssembly and ASM.js.