Am Sat, 07 Dec 2013 10:34:53 +0100 schrieb Timon Gehr <timon.g...@gmx.ch>:
> On 12/07/2013 10:03 AM, Walter Bright wrote: > > On 12/7/2013 1:30 AM, Marco Leise wrote: > >> How is that easier in Java? When whole-program analysis finds > >> that there is no class extending C, it could devirtualize all > >> methods of C, but(!) you can load and unload new derived > >> classes at runtime, too. > > > > This can be done by noting what new derived classes are introduced by > > runtime loading, and re-JITing any functions that devirtualized base > > classes of it. > > > > I don't know if this is actually done, but I don't see an obvious > > problem with it. > > It is actually done, eg. by the HotSpot JVM. Nice! I thought that the overhead might be considered excessive in tracking these details for a JIT optimization. -- Marco