harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Pervov" <pmcfi...@gmail.com>
Subject Re: [drlvm] Using JNI methods in VM's components.
Date Fri, 20 Oct 2006 09:45:07 GMT
Mikhail,

You certainly can. Just add System.loadLibrary(<component name>) to the
static initialization block of a class, which declares that method and call
<clinit> for such class.

Example.
----------------------
Component: gcv5.dll
Class, implementing fast path magics: GCv5Magics
Class source:
class GCv5Magics {
    static {
        System.loadLibrary("gcv5.dll");
    }
    // ... the rest of magics for GC v5
}

Regards,
    Pavel.

P.S. <clinit> is not called for such classes now, but magics are all
something new to add to VM.

On 10/20/06, Mikhail Fursov <mike.fursov@gmail.com> wrote:
>
> All,
> AFAIK today I can't add JNI method to a component (em library, gc library,
> jit library) and call the method from Java.
> Is there any reason why do we have this limitation?
>
> I have only the one, but IMO very serious reason why to allow it: a part
> of
> a component could be written in Java.
>
> The example is EMThreadSupport.java class. This class is a part of the
> kernel classes but this is wrong.
> I can't extend its functionality without modification of VM-EM native
> interface.
> ?
>
> --
> Mikhail Fursov
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message