harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: SableVM and Harmony Class library
Date Wed, 29 Mar 2006 20:30:09 GMT
Sounds right (modulo step #2 comment made elsewhere).

In case you missed it: the portlib, VM local storage(VMLS), and
ZipCachePool (that are returned by functions in the VMI function
table[1]) are provided as part of Harmony code base.

The portlib function table is created by the java launcher and (a
pointer) passed through to the VM as a vm_args during JNI_CreateJavaVM as:

#define PORT_LIB_OPTION "_org.apache.harmony.vmi.portlib"


The VMLS functions are designed for VM-global vars.  The class library
natives use VMLS rather than process-global statics so we can have
multiple VM instances co-existing in the same process.  I'll check in an
example of a VMLS implementation you can use.


The ZipCachePool is used to share open zip/jar files between the VM and
classlibrary, you can create it using the functions in the
include/zipsup.h, and stash it like this:

myJavaVM->zipCachePool = zipCachePool_new(portLibrary);


Regards,
Tim

[1]
http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/harmony/enhanced/classlib/trunk/doc/vm_doc/html/structVMInterfaceFunctions__.html#_details

Enrico Migliore wrote:
> Hi,
> 
>> The main document on porting is at:
>>
>> http://tinyurl.com/jfljq
>>
>> The VM Interface is described at:
>>
>> http://tinyurl.com/gtd64
>>
>> and the required kernel classes are described at:
>>
>> http://tinyurl.com/hawkl
>>
>> Regards,
>> Mark.
>>  
>>
> 
> Hi all,
> 
> I'm reading the documentation above and, at first glance, it seems to me
> that interfacing the SableVM to the Harmony Class Library is a task that
> involves the following steps:
> 
> step 1
> ------
> The SableVM /has to/ implement the VM interface, in order for the
> Harmony Class Library to "find" the entry points of a certain number of
> native functions. The entry points are documented here:
> 
> http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/harmony/enhanced/classlib/trunk/doc/vm_doc/html/group__VMInterface.html
> 
> 
> 
> step 2
> ------
> The SableVM has to implement a Java interface, which means that is /has
> to/ implement in C a small set of Java classes, documented in the
> following link:
> 
> http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/harmony/enhanced/classlib/trunk/doc/kernel_doc/html/index.html#KernelJavaClasses
> 
> 
> 
> step 3
> ------
> The SableVM, in terms of native functions, /should/ call only the native
> functions of the port layer, used by the Harmony Class Library:
> 
> http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/harmony/enhanced/classlib/trunk/doc/vm_doc/html/group__Port.html#CreatePortLib
> 
> 
> 
> Comments are welcome :-)
> 
> Enrico
> 
> 
> 
> 
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Mime
View raw message