I am using v8 / Node 8.8 with Ignition and Turbofan and tried to get the assembly code that is generated by my JavaScript but so far the asm and code outputs are same in the size independent of actual code differences.
So node --trace-hydrogen --trace_phase=Z --trace_deopt --code_comments --hydroge
n_track_positions --redirect_code_traces --trace_hydrogen_file=test.js --print_
code test.js
seems to only output the code of the compiler itself, not the code behind the processed JS code.
What are the needed flags for Ignition / Turbofan?
1 Answer 1
Ignition, being an interpreter, does not produce assembly code.
For Turbofan, the flag is --print-opt-code
.
17 Comments
--print-opt-code
should work with the node binary by default, see: github.com/nodejs/node/blob/master/common.gypi#L32 --print-bytecode --print-bytecode-filter=my_function
only prints the bytecode for function my_function(....) { ... }
.