Bug 31365 - private methods given vtable slots
Summary: private methods given vtable slots
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.3.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: missed-optimization
Depends on:
Reported: 2007-03-26 17:06 UTC by Tom Tromey
Modified: 2016-09-30 22:51 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2007-03-26 17:06:27 UTC
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.
Comment 1 Andrew Pinski 2016-09-30 22:51:01 UTC
Closing as won't fix as the Java front-end has been removed from the trunk.