简体   繁体   English

在OdinMonkey中优化asm.js

[英]Optimize for asm.js in OdinMonkey

Assume that I am writing a compiler with an asm.js-backend. 假设我正在使用asm.js-backend编写编译器。 In order to generate the most efficient code, I'd like to know how the generated asm.js code is translated to machine code. 为了生成最有效的代码,我想知道如何将生成的asm.js代码转换为机器代码。 Is there a way to dump the (x86-64 in my case) assembly generated by OdinMonkey with a SpiderMonkey build like here: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Build_Documentation ? 有没有办法像这样在转储由SpiderMonkey构建的OdinMonkey(在我的情况下为x86-64)程序集: https : //developer.mozilla.org/en-US/docs/SpiderMonkey/Build_Documentation

I have just learnt that OdinMonkey does not directly generate assembler code ( https://github.com/dherman/asm.js/issues/80#issuecomment-31673247 ) but does generate optimized MIR code for IonMonkey, which is then translated to LIR code and then to machine code. 我刚刚了解到OdinMonkey不会直接生成汇编代码( https://github.com/dherman/asm.js/issues/80#issuecomment-31673247 ),但会为IonMonkey生成优化的MIR代码,然后将其转换为LIR代码,然后再输入机器代码。

Thus my question should have been how to dump the assembly that IonMonkey processes and outputs. 因此,我的问题应该是如何转储IonMonkey处理和输出的程序集。 For the intermediate code one can use a debug build of SpiderMonkey's js shell with IONFLAGS=logs. 对于中间代码,可以使用带有IONFLAGS = logs的SpiderMonkey js shell的调试版本。 This gives quite a lot of information in /tmp/ion.cfg. 这在/tmp/ion.cfg中提供了很多信息。 For the assembly code, this site ( https://developer.mozilla.org/en-US/docs/SpiderMonkey/Hacking_Tips ) suggests to use gdb to disassemble the machine code. 对于汇编代码,此站点( https://developer.mozilla.org/en-US/docs/SpiderMonkey/Hacking_Tips )建议使用gdb分解机器代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM