java aliasing rules
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Wed Mar 27 15:54:00 GMT 2002
Dan Nicolaescu wrote:
>The more general question is if 2 COMPONENT_REFs that refer to classes
>that are in conflicting alias sets (ie alias_sets_conflict_p) alias in
>java. I have a hunch that this might be true, but I don't know enough
>about java to be sure.
>
Right - Aliasing in Java is very simple, because basically there isn't
any ;-). The only case we need to be careful about is with inheritance
when two fields in different classes might actually be the same (ie if
"class second extends first").
I implemented java_get_alias_set() by simply assigning a new alias set
to every unique field, storing it in DECL_POINTER_ALIAS_SET for each
FIELD_DECL. This managed to eliminate some redundant loads in my tests,
but didn't cause any measurable improvements in benchmark scores so I
didn't get too excited about it, and I didn't get around to submitting
the patch yet. I'll try it out later on your test case and see what
happens...
regards
Bryce.
More information about the Java
mailing list