Java to C through an intermediate assembly

Tony Kimball alk@pobox.com
Tue Nov 20 12:21:00 GMT 2001


Quoth Hamdy Mobarak on Tuesday, 20 November:
: Dear,
: I am asking about if it is possible to convert java program to an
: intermediate
: assembly (say assembly of Intel microprocessor), and then decompile this
: intermediate
: assembly to get the C version of the input java program?
: Thanks

Darling,
It all depends on finding a good -- nay, superlative -- C decompiler
for one of the supported targets. I've not worked with recent
decompilers. I did use a SPARC decompiler from circa 1992 once, but
it wasn't up to this sort of task: It was tuned to recognize optimized
code produced by the then-current Sun C compiler (which was primitive
by modern standards), and would choke on some gcc-emitted code. But,
Jeff Sturms discouraging comment notwithstanding, such beasts do
exist. They are generally closely held and hard to find. Of course
the result for gcj-emitted code would be C code that depended
extensively on libgcj.
At a guess, I'd say the first place to look for a high-quality
decompiler would be Windows, and the second would be Solaris. To
round-trip on Windows you'd need to finish the mingw32 port of GCJ, to
get GCJ to emit something that runs correctly in its runtime first.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /