Right now gcj will make a vtable slot for a non-static private method. We speculate that this is done for CNI. However, there's no point to a private method having a vtable slot, since private methods are never inherited. Ideally both gcj and g++ would emit calls to private methods directly (not via the vtable).
This may mean that private methods will have to check for this==null, or perhaps their callers will (the latter may be preferable since most calls will be on 'this', and thus the check can be removed). link.cc already omits private methods from the constructed vtables. -- Summary: private methods given vtable slots Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tromey at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31365