From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15470 invoked by alias); 20 Jan 2011 13:24:31 -0000 Received: (qmail 15448 invoked by uid 22791); 20 Jan 2011 13:24:29 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_IB X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 13:24:22 +0000 Received: by qyk36 with SMTP id 36so589979qyk.20 for ; Thu, 20 Jan 2011 05:24:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.250.82 with SMTP id mn18mr1753433qcb.142.1295529860818; Thu, 20 Jan 2011 05:24:20 -0800 (PST) Received: by 10.229.136.207 with HTTP; Thu, 20 Jan 2011 05:24:20 -0800 (PST) In-Reply-To: References: Date: Thu, 20 Jan 2011 13:24:00 -0000 Message-ID: Subject: Re: a question about directory structure of libjava From: Bryce McKinlay To: majia gm Cc: gcc-help@gcc.gnu.org, Java List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00014.txt.bz2 On Thu, Jan 20, 2011 at 12:42 PM, majia gm 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. > > =A0What 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, =A0I found native codes, =A0source lines > of which is in Java files of the library. > > Dose it mean the byte codes in library may be translated into native code= s? > =A0If 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