Skip to content Skip to sidebar Skip to footer

V8 Will Not Print Out Disassembly

I compiled v8 with the disassembler option: tools/dev/v8gen.py x64.debug -- v8_enable_disassembler=true v8_enable_object_print=true ninja -C out.gn/x64.debug However, when I att

Solution 1:

V8 compiles functions lazily (i.e. when they are first called), so when your file only contains function add(...) {...}, that is one reason why you're not seeing any output. Try adding a call, e.g. add(1, 1).

Also, recent versions of V8 use a bytecode interpreter instead of generating machine code right away. You can print the bytecode using --print-bytecode.

Machine code is only generated by the optimizing compiler once a function is "hot" (for a small function like add in your test, that means calling it a few thousand times); --print-opt-code prints the optimized machine code.

(Side note: In Debug builds of V8, disassembler support is always enabled, so you don't need any custom flags.)

Post a Comment for "V8 Will Not Print Out Disassembly"