Home > Back-end >  HotSpot disassembling plug-in HSDIS download to use
HotSpot disassembling plug-in HSDIS download to use

Time:09-18

The HotSpot disassembling HSDIS downloading use

Today learning "deep understanding of the Java virtual machine" chapter 4, introduced the use of HSDIS, generate assembly code, their practice,

1 . First of all, from the Project Kenai website (http://kenai.com/projects/base-hsdis) to download plugin HSDIS disassembly, after open the web site shows:

Good unfortunately site has been closed, so I first to CSDN website search, resources are found in, but download need at least 17 c , alas! Now the domestic platform charging mechanism... So on to making and download again ~ free (has been uploaded to my resources - free of charge), finished download decompression put DLL in JAVA_HOME/jre/bin/client and the JAVA_HOME/jre/bin/server directory.

2 . According to the book write Bar, Java, HTML code is as follows:
 
Package com. Test. MonitorTool;

Public class Bar {
int a=1;
Static int b=2;
Public int the sum (int) c {
The return of a + b + c;
}
Public static void main (String [] args) {
The new Bar (). The sum (3);
}
}

3 will Bar. Java on D: \ com \ test \ MonitorTool directory;
Then use javac commands to compile the generated Bar. The class;
Then you can perform the Java command:
D: \ & gt; Java - XX: + UnlockDiagnosticVMOptions - XX: + PrintAssembly Xcomp - XX: CompileCom
Mand=dontinline, * Bar in sum - XX: CompileCommand=compileonly, * Bar in sum com. Test. Monito
RTool. Bar
Note if there: Unrecognized VM option '+ PrintAssembly must add - XX: + UnlockDiagnosticVMOptions as above;
Finally the disassembly code generation:
Code:
 [Disassembling the for the Mach='i386: x86-64] 
(Entry Point)
(Constants)
# {method} 'sum' (I) I 'in' com/test/MonitorTool/Bar '
# this: RDX: RDX='com/test/MonitorTool/Bar'
R8=# parm0: int
# [sp + 0 x20] (sp of caller)
% 0 x00000000020e1120: mov 0 by 8 (RDX), % r10d
0 x00000000020e1124: SHL $0 x3, % r10
0 x00000000020e1128: rax r10, CMP % %
0 x00000000020e112b: developed 0 x00000000020b7720; {runtime_call}
% % 0 x00000000020e1131: data32 XCHG ax, ax
0 x00000000020e1134: nopl 0 x0 (rax rax, % %, 1)
% % 0 x00000000020e113c: data32 data32 XCHG ax, ax
[Verified Entry Point]
% 0 x00000000020e1140: push RBP
0 x00000000020e1141: sub $0 x10, % RSP
0 x00000000020e1145: nop; * synchronization entry
; - com. Test. MonitorTool. Bar: : su
M @ 1 (line 8)
0 x00000000020e1146: movabs $0 x77d6ee0f0, % r10. {the oop (' com/test/MonitorTool/B
Ar ')}
0 x00000000020e1150: mov 0 x260 r10 (%), % r10d
% 0 x00000000020e1157: add 0 xc (RDX), % r10d
0 x00000000020e115b: r8d, mov % % eax
0 x00000000020e115e: add % r10d, % eax; * iadd
; - com. Test. MonitorTool. Bar: : su
M @ 9 (line 8)
0 x00000000020e1161: add $0 x10, % RSP
0 x00000000020e1165: pop % RBP
0 x00000000020e1166: test % eax, 0 x1d5116c (rip) % # 0 x0000000000390000
; {poll_return}
0 x00000000020e116c: retq
0 x00000000020e116d: HLT
0 x00000000020e116e: HLT
0 x00000000020e116f: HLT
0 x00000000020e1170: HLT
0 x00000000020e1171: HLT
0 x00000000020e1172: HLT
0 x00000000020e1173: HLT
0 x00000000020e1174: HLT
0 x00000000020e1175: HLT
0 x00000000020e1176: HLT
0 x00000000020e1177: HLT
0 x00000000020e1178: HLT
0 x00000000020e1179: HLT
0 x00000000020e117a: HLT
0 x00000000020e117b: HLT
0 x00000000020e117c: HLT
0 x00000000020e117d: HLT
0 x00000000020e117e: HLT
0 x00000000020e117f: HLT
[the Exception Handler]
[Stub Code]
0 x00000000020e1180: JMPQ 0 x00000000020de1a0; {no_reloc}
[Deopt Handler Code]
0 x00000000020e1185: callq 0 x00000000020e118a
% 0 x00000000020e118a: subq $0 x 5, (RSP)
0 x00000000020e118f: JMPQ 0 x00000000020b88c0; {runtime_call}
0 x00000000020e1194: add % al, (% rax)
0 x00000000020e1196: add % al, (% rax)

Explained the content reference materials ~

Thanks ~ ~
  • Related