This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: RFC: Change C++ ABI so that interface dispatch does not depend on reflection.
- From: Andrew Haley <aph at redhat dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: David Daney <ddaney at avtrex dot com>, java at gcc dot gnu dot org
- Date: Wed, 1 Feb 2006 11:24:48 +0000
- Subject: Re: RFC: Change C++ ABI so that interface dispatch does not depend on reflection.
- References: <43DF0055.3080204@avtrex.com> <43DF0617.2050001@bothner.com> <43DFBE09.5050200@avtrex.com> <43DFC782.4050905@bothner.com> <17375.52158.937522.834445@zapata.pink> <43DFD4FC.8040803@bothner.com>
Per Bothner writes:
> Andrew Haley wrote:
> > Per Bothner writes:
> > >
> > > The direction I'm thinking is to split the Class object into
> > > (one or more) pointer tables, plus a pointer to a pointer-free
> > > descriptor in a separate read-only descriptor segment.
> >
> > We seem to be in danger of colliding!
>
> Hardly. I view my role here as suggesting things for *other* people
> to do ... I don't have time to actually implementing these ideas
> myself. My phrasing was ambiguous.
I see... :-)
> > My idea is to define a structure that that contains everything libgcj
> > needs to create an instance of Class.
>
> This structure is read-only and pointer-free? I'm guessing not,
> but hopefully the goal will be to move as much as possible
> into a separate read-only and pointer-free section.
It can be done in stages. To begin with, this structure will not be
pointer-free, because to do so would make the patch very complicated.
It'll simply be the fields of Class that are initialized by the
compiler.
> > For each class, an instance of
> > this structure is passed to libgcj by a static initializer. In turn,
> > libgcj returns a pointer to a newly created instance of Class. The
> > static initializer writes this to class$.
> >
> > This newly created class isn't initialized, so the creation can be
> > done fairly quickly.
>
> But you still eagerly (i.e. when the shared library is loaded, not
> when the class is accesses) create the Class object?
Yes. I think that's the right thing to do.
> Hopefully, you can (possibly as a follow-on) leave a lot of the data
> unexpanded in the original structure, where it can be accessed from
> the Class when needed.
Yes. We're looking in the same direction.
Andrew.