From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32432 invoked by alias); 23 Apr 2012 16:58:33 -0000 Received: (qmail 32417 invoked by uid 22791); 23 Apr 2012 16:58:32 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_GC,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx4-phx2.redhat.com (HELO mx4-phx2.redhat.com) (209.132.183.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Apr 2012 16:58:06 +0000 Received: from zmail17.collab.prod.int.phx2.redhat.com (zmail17.collab.prod.int.phx2.redhat.com [10.5.83.19]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q3NGw6fW004269; Mon, 23 Apr 2012 12:58:06 -0400 Date: Mon, 23 Apr 2012 16:58:00 -0000 From: Andrew Hughes To: Andrew Haley Cc: GCJ-patches Subject: Re: Allow 1.7 class file format Message-ID: In-Reply-To: <4F95596B.5000508@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2012-q2/txt/msg00014.txt.bz2 ----- Original Message ----- > There's no real reason to disallow 1.7 class files. Anyone trying to > use any of the new opcodes or new constants will fail verification, > and most Java programs don't use them. > Seems very sensible to me. I was thinking we'd need something like this for bootstrapping if nothing else. FWIW, I think gcj is the only Classpath VM that checks the range of this at all and it's always seemed fairly incompatible with a FOSS model of working to me i.e. if there's a real issue with not being able to read a class, it's easier to dig into the code and debug it when it hits the unknown bytecode rather than on some arbitrary version check. As you say, in the majority of cases, 1.7 versioned bytecode will only contain bytecodes from <=1.6 anyway. > Andrew. > > > 012-04-23 Andrew Haley > > * defineclass.cc (MAJOR_1_7, MINOR_1_7): New. > (parse): Allow MAJOR_1_7 classfile version. > > Index: defineclass.cc > =================================================================== > --- defineclass.cc (revision 186103) > +++ defineclass.cc (working copy) > @@ -361,6 +361,8 @@ > #define MINOR_1_5 0 > #define MAJOR_1_6 50 > #define MINOR_1_6 0 > +#define MAJOR_1_7 51 > +#define MINOR_1_7 0 > > void > _Jv_ClassReader::parse () > @@ -371,8 +373,8 @@ > > int minor_version = read2u (); > int major_version = read2u (); > - if (major_version < MAJOR_1_1 || major_version > MAJOR_1_6 > - || (major_version == MAJOR_1_6 && minor_version > MINOR_1_6)) > + if (major_version < MAJOR_1_1 || major_version > MAJOR_1_7 > + || (major_version == MAJOR_1_7 && minor_version > MINOR_1_7)) > throw_class_format_error ("unrecognized class file version"); > is_15 = (major_version >= MAJOR_1_5); > > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07