Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 77235 invoked from network); 18 Oct 2006 06:47:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Oct 2006 06:47:43 -0000 Received: (qmail 57593 invoked by uid 500); 18 Oct 2006 06:47:36 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 57558 invoked by uid 500); 18 Oct 2006 06:47:36 -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 57547 invoked by uid 99); 18 Oct 2006 06:47:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 23:47:36 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mike.fursov@gmail.com designates 66.249.92.171 as permitted sender) Received: from [66.249.92.171] (HELO ug-out-1314.google.com) (66.249.92.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 23:47:33 -0700 Received: by ug-out-1314.google.com with SMTP id y2so138285uge for ; Tue, 17 Oct 2006 23:47:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=UR/cWDx4jLj2t0TNVt+VeJy71k94QUAgiAzBkihv7heY/1rUQLDKzLFuB4zlVWgIRRfyUqKNbG+tYfzGJbChkoKwVuCDTkxA+vCdGJcmRIGIBDKfjTR7Tn6Snh2l1sUinQDoanpe20bWI6RX5693gc2du3Lhql8z5NQr1rLO5fI= Received: by 10.78.165.16 with SMTP id n16mr10357741hue; Tue, 17 Oct 2006 23:47:12 -0700 (PDT) Received: by 10.78.180.1 with HTTP; Tue, 17 Oct 2006 23:47:11 -0700 (PDT) Message-ID: Date: Wed, 18 Oct 2006 13:47:11 +0700 From: "Mikhail Fursov" To: harmony-dev@incubator.apache.org Subject: Re: [drlvm] Calling native methods from Java code: implementation details In-Reply-To: <9623c9a50610171736x39ee6619o68558e4fd39c4564@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_66004_1233585.1161154031450" References: <51d555c70610171014gd507b14hce9f2c80b6096c04@mail.gmail.com> <783bf8b0610171212n41d1f47cm37fd77670039c9ec@mail.gmail.com> <9623c9a50610171736x39ee6619o68558e4fd39c4564@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_66004_1233585.1161154031450 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/18/06, Xiao-Feng Li wrote: > > Pavel's looks like more flexible, but I have a question with the > special interface approach: is it possible that sometimes we want to > call a library native method in fast way? If possible, shall we > require all library classes that have the native method implement the > special interface? The solution if my proposal is accepted: to call any native method from a native library user must 1) Create a "header"-like Java file with a static method stub and describe its parameters 2) Add the "Java header" to the protected by VM classes (e.g. load it with bootstrap classloader) 3) Create a library that will be loaded by component manager and will resolve the method by (void* getAddress(name)) request. I think this is reasonable amount of actions to add unsafe functionality into VM. Or, is it possible for the VM developer to override a library native > method with a fast internal replacement that still keeps the > semantics? In this situation, this method is not really implemented in > the library class. Where will JIT find it? In my proposal: Yes. A component (VM,GC) can return an address not only for 'persistent' functions but of generated ones (like helpers we have today) And we probably don't want over-generality to the design of fast > native method invocation. We'd better keep them internally to the VM > at the moment until we see real need to open this contract interface > to external library/application developers. So if you agree with this, > the set of non-JNI native methods for JIT to handle are very limited > -- they are actually just some JVM internal functions (plus some > special cases for speedup). We probably want them more closed than > open just like the inlined helpers. Completely agree. This functionality must be invisible for usual Java developers. Before we realize we need it we must hide the functionality from classlib developers too. -- Mikhail Fursov ------=_Part_66004_1233585.1161154031450--