This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Eager vs Lazy resolution of classes


Bryce McKinlay writes:
 > The following test case creates a class on the fly in the classpath and 
 > then tries to call into that class statically, as opposed to via 
 > Class.forName() or some other classloader based mechanism.
 > 
 > On Sun's 1.5 beta JVM, I get:
 > 
 > $ rm Bar.class
 > $ java Resolve
 > start
 > 99
 > hello!!

Thanks, this is a fascinating bit of code.  I would have guessed that
class verification of Resolve would fail, but now I see that access to
static fields in a class doesn't require that class to be loaded -- if
there is no field of that type, it will not be found.

As to whether we need to be compatible with this: IMO even if we don't
implement lazy linkage this kind around, we should at least design the
ABI so that it's possible.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]