I've tried the suggest in the url: How can I see the machine code generated by v8?
Here is what I did:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools
sudo apt-get install libv8-dev
sudo apt-get install g++
sudo apt-get install libgtk2.0-dev
sudo apt-get install g++-multilib
export PATH="$PATH":`pwd`/depot_tools
fetch v8
gclient sync
make ia32.release objectprint=on disassembler=on
v8/out/ia32.release/d8 --print-all-code hello.js > output.txt
(The script is just:print("hello"))
Below are the output:
kind = STUB
major_key = JSEntryStub
compiler = unknown
Instructions (size = 131)
0x35d06040 0 55 push ebp
0x35d06041 1 89e5 mov ebp,esp
0x35d06043 3 6a02 push 0x2
......
0x35d060c2 82 c3 ret
Handler Table (size = 12)
RelocInfo (size = 23)
0x35d06047 external reference (Isolate::context_address) (0xa9533dc)
0x35d06050 external reference (Isolate::c_entry_fp_address) (0xa953410)
......
kind = STUB
major_key = JSEntryStub
compiler = unknown
Instructions (size = 131)
0x35d06120 0 55 push ebb
......
Indeed,I have a batch of code,but it doesn't vary from the input script. By the way,the output is certainly too much(about 13M text) for a simple script.
Thanks.