This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: VerifyError jdk1.3
- From: Eric Blake <ebb9 at email dot byu dot edu>
- To: Per Bothner <per at bothner dot com>
- Cc: Rum Pel <rum_pel at hotmail dot com>, java at gcc dot gnu dot org
- Date: Sun, 16 Jun 2002 21:33:13 -0600
- Subject: Re: VerifyError jdk1.3
- Organization: BYU Student
- References: <OE59VLc6HJYATwxAHP50000df51@hotmail.com><3CFE1717.9070307@bothner.com>
Sun has a buggy VM in 1.3, which does not allow initialization of fields
before the superconstructor is called. This behavior is necessary,
however, for the correct implementation of nested classes, with regards
to the this$0 and other synthetic fields.
Javac 1.4 (and the soon-to-be-released jikes 1.16) handles this by two
different compilation modes. By default (no -source command-line
option, or with `-source 1.3'), the this$0 field is initialized after
the superconstructor, producing code that will verify with java 1.3, but
which runs the risk of a NullPointerException if the superconstructor
invokes any polymorphic methods that refer to this$0. Using the
`-source 1.4' command-line option initializes the field before the
superconstructor, and which never fails with a 1.4 VM but causes
VerifyErrors on earlier VMs.
Per Bothner wrote:
>
> Rum Pel wrote:
> > Refering to
> > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
> > r=6163
> > VerifyError with Sun's interpreter seems to be not a bug, and it works with
> > 1.4 interpreter.
> > Does this mean the classes cant be made to run with jdk1.3 java interpreter?
>
> Hm. It would be best if we generated (or-or-less) the same bytecode as
> jdk 1.4 here. If Sun can generate bytecode that works on jdk1.3 we
> should too.
--
This signature intentionally left boring.
Eric Blake ebb9@email.byu.edu
BYU student, free software programmer