This is the mail archive of the java@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: GCC Release Status (2003-10-03)


On Sat, 2003-10-04 at 04:53, Andrew Haley wrote:
> So, what else must be in 3.4?

It would be nice to fix a class init optimization problem.  The compiler
should recognize that calls to constructors and calls to static methods
always initialize the called class, so we can force our
class-init-tracking local flag to `true' whenever we do these.  

public class A
{
  // This method should never call _Jv_InitClass on B.
  public int foo ()
  {
    B b = new B();
    return B.bar;
  }

  // Neither should this.
  public int foo2 ()
  {
    B.plus6(5);
    return B.bar;
  }
}

public class B
{
  public static int plus6(int x) { return x + 6; }
  public static int bar = 555;
}


I don't think the fix is very difficult (I hope!).
Is it too late to put this kind of change in for 3.4?

AG

-- 
Anthony Green <green@redhat.com>
Red Hat, Inc.


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