This is the mail archive of the java-patches@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]

Re: Patch: FYI: don't call getSystemClassLoader()


Tom Tromey wrote:

I'm checking this in on the trunk and the 4.0 branch.

Andrew pointed out that calling getSystemClassLoader is expensive, as
we do a security check. I think there is no reason to call this
method from our native code; instead it is always safe to simply refer
to the field itself. Note that we don't rely on the class
initialization semantics of the method call in these places.


Good idea. Note that there's already a "getSystemClassLoaderInternal()" in Class.h. We should probably try to standardize on one or the other (the field or the inlined accessor method).

Bryce


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