This is the mail archive of the java-patches@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: PR java/19870: Generate Synthetic Accessors For Static Private FieldAccesses Across Nested Classes


Ranjit Mathew writes:
 > Hi,
 > 
 >   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.

Andrew.


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