AdoptOpenJDK/jitwatch

Add a decompiler for the disassembly

JCWasmx86 opened this issue · 1 comments

It would be quite cool to see a decompiler for the assembly. Suppose you have following method:

static int divideByTwo(int a){
   return a/2;
}

After that you have for example maybe this assembly for this snippet:

...
mov %rdi, %rax
shr $1,%rax
ret
...

And it would be more readable to see some C-like code:

int divideByTwo(int a){
   return a>>1;
}

You could embed radare or parts of ghidra as a decompiler, so you don't have to write one.

Hi,
You can see the original Java source code alongside the bytecode and the disassembled native code in JITWatch's "TriView" pane.

If you have the real source, I don't think disassembling the native to a different set of Java instructions would be helpful?

Thanks for the suggestion,

Chris