Can node.js (or some other v8 interface or wrapper around v8) output the generated assembly from the v8 JIT?
I’d like to see what the generated assembly looks like for various snippets.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to ensure that node.js is built with V8 disassembler enabled. Debug builds will have it enabled by default. For release builds (in recent enough node that uses GYP build) you can enable it by doing:
and rebuilding node.
When disassembler is enabled you can use flags like
--print-code,--print-code-stubs,--print-opt-codeand--code-commentsto check out the code generated by V8.If you would like to investigate IR used by optimizing compiler use
--trace-hydrogenand look athydrogen.cfg(it can be viewed with C1 Visualizer).