This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: class metadata (was Re: GCJ information)
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Cc: Per Bothner <per at bothner dot com>, tromey at redhat dot com, Adam Megacz <gcj at lists dot megacz dot com>, "'java at gcc dot gnu dot org'" <java at gcc dot gnu dot org>
- Date: Fri, 14 Dec 2001 10:27:38 -0500 (EST)
- Subject: Re: class metadata (was Re: GCJ information)
On Fri, 14 Dec 2001, Bryce McKinlay wrote:
> Yeah, thats another thing that will help out towards
> weak-linking/no-assume-compiled. In that case static fields would be
> accessed via a class pointer rather than C++ symbol.
Due to the class initialization test, we always have a class
pointer anyway. Accessing the static fields via a fixed offset from the
class pointer is likely to be cheaper than what we do now (i.e. no
relocation entry or GOT offset required for PIC code).
But how ugly would it be to make the c++ frontend do the right thing, i.e.
transform ::foo::bar::value into ::foo::bar::class$.value?
> It would be interesting to know how long the GC spends scanning static
> roots, and if it would help much if class objects were the only static
> roots.
I considered this back when I hacked up a patch to omit .eh_frame
from static roots. The improvement wasn't worth bothering with, as the
root scan was a small fraction of overall collection times. For smaller,
time-sensitive applications it could be important.
Uninitialized classes shouldn't have to be scanned at all.
> That would place additional restrictions on CNI (dont keep Java
> references in fields not defined in Java) , but I don't think thats a
> big problem.
I agree.
Jeff