harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Archie Cobbs <arc...@dellroad.org>
Subject Re: [jchevm] porting harmony classlib to JCHEVM
Date Fri, 10 Feb 2006 22:58:01 GMT
Weldon Washburn wrote:
> Do you know if anyone is working on a port of Harmony Classlib to
> JCHEVM?  If false, I would like to start this port.  I can't guarantee
> I have time to finish the port but intend to at least sketch out what
> needs to be done so that others can join the effort.

I don't know of anyone working on it yet. That would be great
to do some exploration.

Since JCHEVM already works with the VM interface defined by Classpath,
as much re-use of that API as possible makes a lot of sense. If we
can't import Classpath files directly (which itself is stupid and
highly ironic imho, but that's another discussion) then we can write
new files that provide the same API (doing that should not have any
copyright problems).

 From my initial glances the Classpath API is often "lower level"
than the Classlib API, so all that would be needed in theory is to
fill the resulting gap with some Java code glue.

> I have started looking at JCHEVM to figure out how to glue the Harmony
> Classlibrary kernel classes (see
> …modules/kernel/src/main/java/java/lang/*.java) to the native entry
> points listed in jchevm/libjc/native_lib.c.  The goal is to make only
> absolutely essential mods to JCHEVM code.  Ideally, there would be
> zero changes to JCHEVM.  All the "glue" would reside in JCHEVM's
> private copy of Classlib's kernel classes.

The "overlay" approach, which works well.

> Because the wrapper is adding a layer of identically named methods and
> thus potentially really confusing the name space, I renamed
> java_lang_VMClass_isArray() to java_lang_VMClass_wrapperIsArray(). 
> All the enties in _jc_ilib_table[ ] would also be "decorated" with
> "wrapper".

Is that really necessary? It seems to me that the existing JCHEVM
native API can remain intact.

There are great advantages in being able to run JCHEVM with both
Classlib and Classpath at the same time for debugging purposes
(not to mention Classlib on J9). The more combinations you can
try, the easier it is to hone in on a bug's source. So I'd strongly
prefer that the Java/VM API remain the same as much as possible.
Certainly this can be done with the right "overlay" classes.


Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

View raw message