classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Classpath build process and VM-specific issues


From: Archie Cobbs
Subject: Re: Classpath build process and VM-specific issues
Date: Sun, 28 Mar 2004 20:28:34 -0600
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040312

David Holmes wrote:
- I avoid VMFoo instances (i.e, shadow objects). It seems to me that
  storing VM specific info in a shadow object serves no (runtime) purpose:
  if it can be represented in Java, store it in the original object,
  if it can't store it in a native C structure or whatever.

But just because it can be doesn't mean it will be. Having VMFoo classes
allows the VM to choose whether to implement in Java or natively. If you end
up using native then sure you have one extra level of indirection. But when
you don't use native then a native method forces an extra level of
indirection to "un-natify" it. We have very few native methods in OVM, at
the "application" level.

This doesn't apply to JC (albeit a special case) because "JCNI" native
methods and normal Java methods are exactly equivalent.. they're both
compiled C code.

I prefer to see a VMFoo class with native methods, than a Foo class with
native methods.

I'm not really arguing one way or the other, just pointing out that there
is an inherent tension between goals. Obviously the VMFoo split is better
for readability and ease of understanding, which counts for a lot.

-Archie

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]