This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [committed] allow assert in inner class
- From: Per Bothner <per at bothner dot com>
- To: Eric Blake <ebb9 at byu dot net>
- Cc: gcc-patches at gcc dot gnu dot org, java at gcc dot gnu dot org
- Date: Thu, 26 Feb 2004 09:25:53 -0800
- Subject: Re: [committed] allow assert in inner class
- References: <403D85B0.3090101@bothner.com> <403DFFFD.1010201@byu.net>
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/