This is the mail archive of the
mailing list for the GCC project.
Re: PR java/19870: Generate Synthetic Accessors For Static Private FieldAccesses Across Nested Classes
- From: Andrew Haley <aph at redhat dot com>
- To: Ranjit Mathew <rmathew at gmail dot com>
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 May 2005 16:45:51 +0100
- Subject: Re: PR java/19870: Generate Synthetic Accessors For Static Private FieldAccesses Across Nested Classes
- References: <42957A5C.email@example.com>
Ranjit Mathew writes:
> Here is a patch for PR java/19870. This patch generalises
> the current synthetic accessor generation support in GCJ for
> private fields in outer classes accessed from nested classes
> to additionally support:
> 1. private *static* fields
> 2. access to private static fields *inside nested classes*
> (the original testcase given in PR19870)
> 3. access from a nested class to a private static field
> in a "sibling" nested class.
> The attached testsuite patch demonstrates what is now
> possible to support in GCJ with this patch.
> For static accessors, the initial "this$" parameter
> is ommitted now.
> Since the accessors work both ways now, I've renamed
> all "*outer_field*" methods and macros to "*nested_field*"
> for lack of a better name and updated their documentation.
> Tested on i686-pc-linux-gnu with Jacks included. The Jacks
> testresults were rather disappointing:
> FAIL: 8.5.2-accessible-static-member-usage-3
> FAIL: 15.8.4-static-2
> The first is a failure to consider "foo" constant
> in "case foo:" for a switch statement, where foo is
> an outer field. The second is a slight corner case
> that used to mistakenly pass earlier. I vote to
> just XFAIL these two for now.
> OK for mainline? Assuming the patch as such is
> OK, is the attached testsuite addition also OK?
Yes, indeed. Thanks very much!
You didn't say that you bootstrapped, but I presume you did.
We should test this throughly with a view to backporting to 4.0 branch
a short time after.
Mainline is still slushy, AFAIK, so it'll have to wait until we thaw.