6

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?

asked Nov 11, 2017 at 20:29

1 Answer 1

5

Ignition, being an interpreter, does not produce assembly code.

For Turbofan, the flag is --print-opt-code.

answered Nov 13, 2017 at 8:09

17 Comments

Are there prebuilt binaries with debugging enabled? It does not work with the node binary by default.
Also, turns out --print-opt-code should work with the node binary by default, see: github.com/nodejs/node/blob/master/common.gypi#L32
So there is no reliable way to always get the assembly code for further analysis without forcing optimization? As I already wrote, .-print-opt-code outputs nothing in most cases. So the bytecode is only shown if it is optimized?
Is it possible to remove the code of the node/v8 engine but keep the code of the analysed js file? 1.8MB is quite much overhead.
V8 itself doesn't print any (byte)code on startup. I don't know what you're seeing; I would guess it's Node's initialization/startup. Anyway, --print-bytecode --print-bytecode-filter=my_function only prints the bytecode for function my_function(....) { ... }.
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.