public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bryce McKinlay <bmckinlay@gmail.com>
To: majia gm <gmmajia@gmail.com>
Cc: gcc-help@gcc.gnu.org, Java List <java@gcc.gnu.org>
Subject: Re: a question about directory structure of libjava
Date: Thu, 20 Jan 2011 13:24:00 -0000	[thread overview]
Message-ID: <AANLkTimoVhFfh9qeKoGt6OEQu1AbYCqqNGzdAJ4z8L4=@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimJc-qn320hWE86goMdQ9bdd5yqOONmWSyodjc-@mail.gmail.com>

On Thu, Jan 20, 2011 at 12:42 PM, majia gm <gmmajia@gmail.com> wrote:

> Hi, Bryce.
>
> Thanks for your reply. It's very kind of you.
>
> I'v read a little document of JNI and CNI.
>
> CNI seems to layout data such as classes and objects conforming to
> C++, so there comes the header file.
>
>  What I'm really curious about is how the non-native methods in
> library being executed in runtime. One way I can imagine is to
> interpret the byte codes.
>
> But when I use GDB to track gij,  I found native codes,  source lines
> of which is in Java files of the library.
>
> Dose it mean the byte codes in library may be translated into native codes?
>  If it is the truth, then when dose it happen?

gcj is a java-to-native-code compiler. So, the Java code in libjava is
compiled, by gcj, into a native code library, libgcj.so. libgcj.so
contains both the Java and C/C++ parts of the library. This all
happens at the time you build GCC, rather than at runtime like a
traditional JVM.

Bryce

      reply	other threads:[~2011-01-20 13:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20  8:50 majia gm
2011-01-20  9:08 ` Bryce McKinlay
2011-01-20 12:42   ` majia gm
2011-01-20 13:24     ` Bryce McKinlay [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTimoVhFfh9qeKoGt6OEQu1AbYCqqNGzdAJ4z8L4=@mail.gmail.com' \
    --to=bmckinlay@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gmmajia@gmail.com \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).