public inbox for
 help / color / mirror / Atom feed
From: Tom Tromey <>
Subject: Re: Implementation Q
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

>>>>> "Colin" == Colin McCormack <> writes:

Colin> What's the reason rtti has to be off in CNI?

The C++ compiler knows that the Java compiler is responsible for
generating the vtable for every "Java" object.  The Java compiler
doesn't know how to generate rtti information.  So, if you compile CNI
code with rtti enabled, you get link errors -- the g++-compiled .o
files refer to nonexisting rtti objects.

Colin> Is Java doing some mapping via the vtbl, and the extra vtbl
Colin> pointer for rtti messes this up?

Nope.  We just leave the rtti slot empty.  Actually, we have
experimental code to use the rtti slot to store some information for
the GC (this would let us speed up the marking process).  However, we
could move that information to vtable[-1] if we had to.

Colin> If so, how hard would it be to trick up a version which used
Colin> rtti across the board?

Semi-hard.  I think you either have to copy a big chunk of
gcc/cp/rtti.c into gcc/java, or you have to solve the g++/java
infrastructure problem (i.e., making it possible for them to share
code).  The latter problem would be good to solve, and is probably
necessary to solve in the medium term (with the new ABI work).  I
won't have time to look at it for quite a while (unless it suddenly
becomes critical somehow).  I don't know if anybody else is planning
to address the problem.

Also, you have to be prepared to generate rtti information at runtime.
At runtime we construct array classes as well as interpreted classes.

Having the rtti information would let us clean up some hacks related
to exception handling.

Why do you want rtti in your CNI code?


       reply	other threads:[~2000-04-01  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2000-04-01  0:00 ` Tom Tromey [this message]
2000-04-01  0:00   ` Colin McCormack
     [not found]   ` <>
2000-04-01  0:00     ` Tom Tromey
     [not found]       ` <>
2000-04-01  0:00         ` Tom Tromey
2000-04-01  0:00       ` Colin McCormack
2000-04-01  0:00       ` Colin McCormack
2000-04-01  0:00 Colin McCormack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).