Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 47436 invoked from network); 11 May 2005 11:51:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 May 2005 11:51:43 -0000 Received: (qmail 97818 invoked by uid 500); 11 May 2005 11:55:18 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 97746 invoked by uid 500); 11 May 2005 11:55:17 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 97729 invoked by uid 99); 11 May 2005 11:55:17 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from omta01sl.mx.bigpond.com (HELO omta01sl.mx.bigpond.com) (144.140.92.153) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 11 May 2005 04:55:17 -0700 Received: from [192.168.0.4] (really [147.10.90.177]) by omta01sl.mx.bigpond.com with ESMTP id <20050511115131.WIKK25106.omta01sl.mx.bigpond.com@[192.168.0.4]> for ; Wed, 11 May 2005 11:51:31 +0000 Mime-Version: 1.0 (Apple Message framework v728) In-Reply-To: <4281AAFF.3030805@apache.org> References: <69f3b8db050510185671455bd7@mail.gmail.com> <69f3b8db0505101900427c1bfe@mail.gmail.com> <4281998C.607@apache.org> <4281A302.9030105@apache.org> <69f3b8db0505102326223883a4@mail.gmail.com> <4281AAFF.3030805@apache.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Paul Gearon Subject: Re: I hope the JVM implements most using Java itself Date: Wed, 11 May 2005 21:51:14 +1000 To: harmony-dev@incubator.apache.org X-Mailer: Apple Mail (2.728) X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 11/05/2005, at 4:49 PM, Torsten Curdt wrote: >> maybe we can think the JIT Compiler as a simple box which input >> "bytecode" >> and output "machine code". >> > > ...native machine code I assume. > > All ok but ...now how do you > want to execute that from java - easily? Not saying you want to do it this way, but a question like this demands an answer. :-) Use System.getProperty() with os.arch for the CPU type and os.name/ os.version for the OS. These tell you what type of native code to generate. It doesn't matter what language you write it in, you need different implementations for different OS/architectures. Put the generated code into a byte array, or better yet, a MappedByteBuffer. Then send the whole lot off to a native method that calls into the pointer it's given. The native library needed to do that could be implemented in a trivially small dll, so, dylib, etc. If you really want to avoid using other languages, even for this, then since you already have Java building native code, the startup code for the JIT could write out it's own binary library before loading it. The hardest part about all of this, is the code that JITs bytecode into native instructions. Not difficult, but very time consuming. The alternatives are probably better, but this doesn't sound hard to me. :-) Regards, Paul Gearon