On Wed, Oct 8, 2014 at 5:56 PM, John Feminella <j...@jxf.me> wrote:

> As an educational exercise, I'd like to inspect disassembled JS generated
> by JS, and compare both the optimized and unoptimized versions to see what
> changes and what doesn't.
>
> In Vyacheslav Egorov's JSConf 2012 excellent slides (
> http://s3.mrale.ph/jsconf2012.pdf) he recommends compiling V8 like so:
>
> =====
> make ia32.release objectprint=on \
>   disassembler=on
>
> out/ia32.release/d8 --print-opt-code \
>   --code-comments \
>   --trace-hydrogen \
>   test.js
> =====
>
> which will enable the disassembler for introspection by the curious.
>
> I'm having a little trouble understanding the current state of affairs,
> though:
>
> 0. Is this the best way of doing things? How do I generate the
> *unoptimized* JS versus the *optimized* JS for test.js in this example?
>

I guess by "optimized JS" you mean "optimized machine code". Try
"out/ia32.release/d8
--help | grep print | grep code". You probably want "--print-opt-code
--print-unopt-code".

1. Are Hydrogen and Crankshaft still relevant?
>

Yes.


> For example, my limited understanding is that TurboFan will be replacing
> Hydrogen: https://codereview.chromium.org/426233002
>


Is there somewhere I can read about the relevance and lifecycle of
> different pieces like Hydrogen and Crankshaft and how they play a role in
> code generation/optimization?
>

The short version is "full codegen, then Hydrogen". wingolog.org has some
more in-depth articles.


> 2. Why does Vyacheslav suggest using --trace-hydrogen? Is that needed to
> see the disassembly?
>

No, it's needed for other things (c1visualizer, ir-hydra).

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to