GCC Release Status (2003年10月03日)
Anthony Green
green@redhat.com
Mon Oct 6 15:12:00 GMT 2003
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.
More information about the Java
mailing list