This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: quick little CNI question


Glenn Chambers <GChambers@provsol.com> writes:

> Has anyone looked at whether the new C++ ABI that is being put together
> will remove the need for any sort of lookup?

It won't require any lookup - but then that has always been the case
for C++.  However, C++ uses (at least used) multiple vtbale pointers
per objects, and "adjustment" of the this pointer.  This violates the
JVM spec.  I believe it is possible for a JVM to work around that,
but it means that the actual data representation differs in
important ways from the JVMs model.  Specifically, you can't use
a simple interpreter without verification.

I mentioned the issue on the gcc mailing list - perhaps C++ could
use teh same data representation as Java in this respect, or at
least people should bear the java needs in mind.  However, I
don't think that is going to happen.  For one thing the expectations
for C++ is different than for Java, so using gcj's constant-time
lookup may not make sense for C++.  In any case, it is not a
critical problem.  We can always (and should someday) fix g++ so
that it knows about Java interfaces (field-less abstract classes that
have the Java property but don't inherit from Object), and can
generate the correct sequence for Java interface calls.  There is
nothing fundamentally difficult with this;  it's just a bit of a
pain, and other things have higher priority.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]