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]

Re: [committed] allow assert in inner class


Eric Blake wrote:

Actually, for inner classes, they should be checking the assertion level of the enclosing class.

That's a simplification. It looks like in JDK 1.4 the assert uses the $assertionsDisabled field in the inner class, but that is this is initialized to the assertion status of the outer class.

There is a whole series of tests for correct semantics in jacks. And does your patch work for asserts inside an
inner class of an interface, since interfaces can't have a static helper?

Probably not. But my patch is still an improvement.


What my client suggested was a flag to disable assertions.  We clearly
need this.  I decided to fix the immediate compiler failure as well;
I'll ask whether he wants to pay for finer-grained control and/or
fixing other problems.

Also, 1.5 compliant VMs support the ldc bytecode with a CONSTANT_Class argument, alleviating the need for emitting the class$ helper method (although you still need this code to allow targeting older VMs).

Since 1.5 hasn't been released yet, I don't think we should implement such changes yet. -- --Per Bothner per@bothner.com http://per.bothner.com/


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