--print-code does not work

94 views
Skip to first unread message

Istvan Tabanyi

unread,
Feb 9, 2018, 4:18:53 AM2/9/18
to v8-users
Hi,

I compiled v8 from sources successfully, but --print-code/--print-opt-code gives me no output at all.
--print-bytecode works fine, --print-all-code prints something, but the actual code is definitely not in the output(Created a simple function with unique name, called in a loop, grepped for it and nothing)

Tried release and debug builds, also with custom options like this:
gn gen out.gn/x64.debug --args='is_debug=true target_cpu="x64" v8_target_cpu="x64" v8_enable_disassembler=true'

I tried to look for tutorials on this topic, but most of it really outdated and using make/gyp.
Can someone give me some tips about this? And sorry if this is not the right place to ask questions like this.

Jakob Kummerow

unread,
Feb 9, 2018, 5:23:01 PM2/9/18
to v8-users
If --print-opt-code prints nothing, then probably your function isn't getting optimized. Try calling it more often.

--print-code is "technically correct" in the sense that it prints all of the unoptimized machine code that V8 doesn't generate any more ;-) 
(We should remove the flag.)


--
--
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.
For more options, visit https://groups.google.com/d/optout.

Istvan Tabanyi

unread,
Feb 12, 2018, 3:01:58 AM2/12/18
to v8-users
Oh god, I put it in a for loop already, but turned out 9000 iterations was not enough, doh.

Thanks for advice, all fine:)

Mathias Bynens

unread,
Feb 12, 2018, 4:45:32 AM2/12/18
to v8-users
Tracking issue for the removal of --print-code: https://bugs.chromium.org/p/v8/issues/detail?id=7437 

To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
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+unsubscribe@googlegroups.com.

Jakob Kummerow

unread,
Feb 23, 2018, 1:38:47 PM2/23/18
to v8-users
Correction: Looking at the code, it turns out that --print-code still does what the name implies: it prints all code (optimized code, regexp code, wasm code). It's just that there is no unoptimized code any more (which arguably was the flag's primary use case in the past).


On Mon, Feb 12, 2018 at 1:45 AM 'Mathias Bynens' via v8-users <v8-u...@googlegroups.com> wrote:
Tracking issue for the removal of --print-code: https://bugs.chromium.org/p/v8/issues/detail?id=7437 
On Fri, Feb 9, 2018 at 11:22 PM, Jakob Kummerow <jkum...@chromium.org> wrote:
If --print-opt-code prints nothing, then probably your function isn't getting optimized. Try calling it more often.

--print-code is "technically correct" in the sense that it prints all of the unoptimized machine code that V8 doesn't generate any more ;-) 
(We should remove the flag.)
On Fri, Feb 9, 2018 at 1:18 AM Istvan Tabanyi <st...@powerednow.com> wrote:
Hi,

I compiled v8 from sources successfully, but --print-code/--print-opt-code gives me no output at all.
--print-bytecode works fine, --print-all-code prints something, but the actual code is definitely not in the output(Created a simple function with unique name, called in a loop, grepped for it and nothing)

Tried release and debug builds, also with custom options like this:
gn gen out.gn/x64.debug --args='is_debug=true target_cpu="x64" v8_target_cpu="x64" v8_enable_disassembler=true'

I tried to look for tutorials on this topic, but most of it really outdated and using make/gyp.
Can someone give me some tips about this? And sorry if this is not the right place to ask questions like this.

--
--
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.

For more options, visit https://groups.google.com/d/optout.

--
--
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.

For more options, visit https://groups.google.com/d/optout.

--
--
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.

Andrzej Trzaska

unread,
Feb 27, 2018, 10:21:09 AM2/27/18
to v8-users

Andrzej Trzaska

unread,
Feb 27, 2018, 10:21:50 AM2/27/18
to v8-users


W dniu piątek, 9 lutego 2018 10:18:53 UTC+1 użytkownik Istvan Tabanyi napisał:
Reply all
Reply to author
Forward
0 new messages