This is the mail archive of the java@gcc.gnu.org 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]
Other format: [Raw text]

Re: RFC: Change C++ ABI so that interface dispatch does not depend on reflection.


Per Bothner wrote:
David Daney wrote:

I have been looking at removing reflection data from objects compiled with the C++ ABI in the interests of reducing the size of the generated code/data. Currently reflection data is about 15% - 20% of the size (as reported by size) of a 1000 class application linked with libgcj.


This may be a worthwhile option, but even more useful would be figuring
out to compress the reflective data.  We also want to make the
reflective data position-indepenendent and pointer-free, as much as
possible.  This seems likely to make a big difference in start-up
time when using dynamic linking.  It would reduce memory usage, even
when full refletion is available - and for both ABIs.

Here is an idea: Place the method reflection data at a fixed offset from the beginning of each corresponding method (perhaps -8), then the vtable also serves as the reflection table.


For private methods there would have to be a separate faux-vtable so that they could be reflected on as well.

Access from the name from reflection data would be encoded as an offset from the method entry point so that there would be no runtime relocation needed.

You could probably also use a similar technique to embed the reflection data in DWARF data in the .eh_frame section instead of mingling it with the code.

Compressing the name data is a somewhat orthogonal problem and would probably require changes to binutils.

David Daney


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