question about -fno-optimize-static-class-initialization
Tom Tromey
tromey@redhat.com
Sun Dec 2 15:06:00 GMT 2001
>>>>> "Bryce" == Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:
Bryce> Also, the problem with using a local to keep track of the
Bryce> initialized state of a class is that it potentially doesn't
Bryce> work across inlined calls (ie the inlined function uses a
Bryce> different local, so constant propogation cant eliminate the
Bryce> initialization check/call), so maybe they should be something
Bryce> like:
Bryce> if (__builtin_expect (class->state == JV_STATE_DONE, false))
Bryce> {
Bryce> _Jv_InitClass (class);
Bryce> class-> state == JV_STATE_DONE;
Bryce> }
Instead of actually emitting the assignment could we somehow tell the
compiler that we know the value after _Jv_InitClass returns?
Bryce> Or, perhaps once we get tree based inlining, we can run a
Bryce> rudundant class initialization elimination pass after the
Bryce> inlining is done and avoid this issue.
Do you mean by doing some kind of flow analysis to see for ourselves
when the call is redundant? Or do you mean continuing to use a local
state variable but then unifying this variable with the inlined code?
The latter problem could be solved by using a higher-level
representation for class init calls and then lowering it after
inlining.
Tom
More information about the Java
mailing list