Can you clarify?
What kind of information in your opinion is missing from the
--print-code output?
You can use --code-comments to make assembly more human readable.
Strictly speaking there is not such thing as a translated JS program as whole.
V8 compiles different functions separately as application runs. It
might compile the same function several times with different
compilers.
--
Vyacheslav Egorov
> --
> v8-users mailing list
> v8-u...@googlegroups.com
> http://groups.google.com/group/v8-users
>
V8 compiles different functions separately as application runs. It
might compile the same function several times with different
compilers.
Well. There is not data section. The object itself lives in the heap.
If you look at relocation information you can see that object
0x7fe8125aa911 is a two element FixedArray.
You can extend Code::Disassemble to print all referenced objects
recursively but that would produce quite a large output with cycles.
Alternatively you can just put a breakpoint into
CodeGenerator::PrintCode, wait until V8 compiles and prints
interesting function and then expect heap state, print objects that
are interesting to you etc.
> In these two lines, the callees are not shown, I suppose CEntry and StackCheck are both built-in functions of v8.
They will be printed if you pass --print-code-stubs to V8 (your shell
should be compiled with snapshot=off).
> Basically, my goal is to catch runtime instructions trace (this is the easy part) and relate it back to javascript
> source code.
--code-comment will help you to do that.
> Will --gdbjit-dump help? Is this option only available in debug build?
GDBJIT interface produces object that contain debugging information
(like pc to line mapping) but no code. So I don't think --gdbjit-dump
will help you.
--
Vyacheslav Egorov
There are two compilers: non-optimizing (aka full) and optimizing.
Every function starts non-optimized. V8 profiles the application as it
runs and tries to optimize hot functions making assumptions based on
type feedback it gathered during execution of non-optimized code.
--
Vyacheslav Egorov