ABI

Bryce McKinlay bmckinlay@gmail.com
Thu Apr 11 21:42:00 GMT 2013


On Thu, Apr 11, 2013 at 12:56 PM, Bucher Fabio <fabio.bucher@ntb.ch> wrote:

> I am looking for the ABI the GCJ uses. Wich file contains the information a= =3D bout it?
>
> Is it in the sourcecode or exist a pdf-documantation?

GCJ actually has two ABIs. The first, "old ABI" mimics the C++ ABI in
most respects: C++ code can call Java classes as if they were C++,
more-or-less. This results in a "brittle" ABI: any non-trivial change
to an underlying library requires re-compilation of binaries built
against it.

The second, "BC ABI" (enabled with --indirect-dispatch) changes the
way things like method calls, field accesses, and class loading work
so that compiled code more closely adheres to the binary compatibility
rules of Java bytecode.

Unfortunately there isn't a full BC ABI specification document, but
you can read a bit about the implementation here:
ftp://gcc.gnu.org/pub/gcc/summit/2004/GCJ%20New%20ABI.pdf

If you're looking at the libgcj source code, java/lang/Class.h,
java/lang/natClass.cc, and link.cc would be good places to start. In
the front end (gcc/java), look for code that's conditional on
flag_indirect_dispatch.

Bryce



More information about the Java mailing list