Re: SableVM and Harmony Class library
Tim Ellison wrote: 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. If you take a look in the classlib/trunk/native-src/shared/vmls/ directory (at repo revision = 390442) you will now find a reference implementation of the VM local storage functions defined in the VMI. Any questions just shout. Regards, Tim -- Tim Ellison ([EMAIL PROTECTED]) IBM Java technology centre, UK. - Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SableVM and Harmony Class library
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
Re: SableVM and Harmony Class library
Up to now, SableVM has managed not to implement any class in C. Of course, one could question the efficiency of doing so, but hardly question the maintainability of it. :-) So, I do not think that step 2 is a hard requirement. (Methods, of course, can be native). Etienne Enrico Migliore wrote: 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: -- Etienne M. Gagnon, Ph.D.http://www.info2.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ signature.asc Description: OpenPGP digital signature
Re: SableVM and Harmony Class library
That's right, there is no hard requirement that these classes be written in any particular language. Of course they have to provide Java method interfaces to the rest of the class library so... In the IBM VM they are written as Java classes with some native methods. Harmony has compile-against stubs for these types in the 'kernel' module so we can build the remainder of the class library. Some of those stubs have parts of implementations that may be useful if people don't have a start of these types already. Weldon has been writing code to bridge the harmony kernel classes to the Classpath VM interface. Regards, Tim Etienne Gagnon wrote: Up to now, SableVM has managed not to implement any class in C. Of course, one could question the efficiency of doing so, but hardly question the maintainability of it. :-) So, I do not think that step 2 is a hard requirement. (Methods, of course, can be native). Etienne Enrico Migliore wrote: 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: -- Tim Ellison ([EMAIL PROTECTED]) IBM Java technology centre, UK.
Re: SableVM and Harmony Class library
On 3/29/06, Enrico Migliore [EMAIL PROTECTED] wrote: 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 Perhaps you have already found the empty java stubs at: modules/kernel/src/main/java/java/lang. To get an idea how much of the kernel class code need to be written in C vs. Java, take a look at the filled in kernel classes I did for hello world on JCMEVM. You can find it on JIRA at HARMONY-192. Note that I wrote almost zero C code. Most of the mods were in Java. 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 -- Weldon Washburn Intel Middleware Products Division
Re: SableVM and Harmony Class library
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 ([EMAIL PROTECTED]) IBM Java technology centre, UK.
Re: SableVM and Harmony Class library
Enrico Personally I think only step 1 and 2 is enough to make SableVM run Harmony classlib, then the sample launcher in SVN should can launch the SableVM. The step 3 is better have so that the VM can be more easily ported to other platform by leveraging the portlib's interface. 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 -- Paulex Yang China Software Development Lab IBM