Re: ABI

Bryce McKinlay <[email protected]> Thu, 11 Apr 2013 22:42:45 +0100
Newsgroups gmane.comp.gcc.java.devel
Message-ID <CALUNu-p64Fj9+BV1GGJbvAV7CRZR4GRFBO8VYMF03bqwd6ZqDw@mail.gmail.com>
On Thu, Apr 11, 2013 at 12:56 PM, Bucher Fabio <[email protected]> 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