This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: need to focus on java performance?
Andrew Haley wrote:
That would be nice. It's fairly easy to patch call sites (that's what
ld.so does) to remove all the Jv_initClass calls but hard to do it
portable because of problems with locking.
ld.so doesn't patch call sites themselves, just the PLT entries.
It should to be possible for libgcj's linker to make atable entries
initially point to trampolines. The trampoline would call _Jv_InitClass,
and _Jv_InitClass would update all the atable entries for that class,
substituting the trampolines for real functions. Because class
initialization acquires the class lock, there shouldn't be any locking
issues except perhaps on arch's with very weak memory ordering. It
wouldn't be harmful if another thread invoked a trampoline, even if the
class were already initialized.
This would eliminate the vast majority of InitClass calls, at the cost
of some additional startup overhead and memory consumption - might be
worth some experimentation here.
Bryce