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

David Daney ddaney@avtrex.com
Tue Jan 31 20:41:00 GMT 2006


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



More information about the Java mailing list