Question about build mode: release/debug/optdebug

204 views
Skip to first unread message

Sunghyun Park

unread,
May 28, 2019, 7:52:32 PM5/28/19
to v8-users
Hi, all.

I'm trying to count the number of dynamic instructions for jitted code in V8 by using PIN. 
Since PIN leverages symbol table to identify jitted code, I needed to compile V8 with debug mode to provide information for the symbol table. 

However, I'm not sure whether debug mode applies the same level of optimization as release mode. 
I spent some time searching, but I couldn't find any useful information. 
Is there anyone who can clarify the difference between release/debug/optdebug in V8?
Any advice would be greatly helpful.

Thank you!

Jakob Kummerow

unread,
May 29, 2019, 5:41:23 AM5/29/19
to v8-users
It's complicated and for the details, you'll have to look at build configuration files (start with BUILD.gn and gni/v8.gni, if needed continue with generated .ninja files in the output directory), but the short answer is that the three build modes affect C++ compilation as follows:
release: -O3
debug: -O0 -DDEBUG
optdebug: -O2 -DDEBUG
Additionally, there is a flag --debug-code that controls whether extra checks are emitted in generated code. It is on by default in when DEBUG is defined, and off by default otherwise, but can be overridden.
So for your purposes, you probably want an optdebug build and the --nodebug-code command-line flag.

Please double-check everything I've said here before blindly trusting any results.


--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/88fe04cf-252e-4d1d-9199-6cc868e3723b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages