comparison src/share/vm/oops/klassKlass.cpp @ 1941:79d04223b8a5

Added caching for resolved types and resolved fields. This is crucial, because the local load elimination will lead to wrong results, if field equality (of two RiField objects with the same object and the same RiType) is not given. The caching makes sure that the default equals implementation is sufficient.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Tue, 28 Dec 2010 18:33:26 +0100
parents 7fcd5f39bd7a
children 06f017f7daa7
comparison
equal deleted inserted replaced
1940:e92a9a73324e 1941:79d04223b8a5
48 for (juint i = 0; i < Klass::primary_super_limit(); i++) 48 for (juint i = 0; i < Klass::primary_super_limit(); i++)
49 MarkSweep::mark_and_push(k->adr_primary_supers()+i); 49 MarkSweep::mark_and_push(k->adr_primary_supers()+i);
50 MarkSweep::mark_and_push(k->adr_secondary_super_cache()); 50 MarkSweep::mark_and_push(k->adr_secondary_super_cache());
51 MarkSweep::mark_and_push(k->adr_secondary_supers()); 51 MarkSweep::mark_and_push(k->adr_secondary_supers());
52 MarkSweep::mark_and_push(k->adr_java_mirror()); 52 MarkSweep::mark_and_push(k->adr_java_mirror());
53 MarkSweep::mark_and_push(k->adr_c1x_mirror());
53 MarkSweep::mark_and_push(k->adr_name()); 54 MarkSweep::mark_and_push(k->adr_name());
54 // We follow the subklass and sibling links at the end of the 55 // We follow the subklass and sibling links at the end of the
55 // marking phase, since otherwise following them will prevent 56 // marking phase, since otherwise following them will prevent
56 // class unloading (all classes are transitively linked from 57 // class unloading (all classes are transitively linked from
57 // java.lang.Object). 58 // java.lang.Object).
68 for (juint i = 0; i < Klass::primary_super_limit(); i++) 69 for (juint i = 0; i < Klass::primary_super_limit(); i++)
69 PSParallelCompact::mark_and_push(cm, k->adr_primary_supers()+i); 70 PSParallelCompact::mark_and_push(cm, k->adr_primary_supers()+i);
70 PSParallelCompact::mark_and_push(cm, k->adr_secondary_super_cache()); 71 PSParallelCompact::mark_and_push(cm, k->adr_secondary_super_cache());
71 PSParallelCompact::mark_and_push(cm, k->adr_secondary_supers()); 72 PSParallelCompact::mark_and_push(cm, k->adr_secondary_supers());
72 PSParallelCompact::mark_and_push(cm, k->adr_java_mirror()); 73 PSParallelCompact::mark_and_push(cm, k->adr_java_mirror());
74 PSParallelCompact::mark_and_push(cm, k->adr_c1x_mirror());
73 PSParallelCompact::mark_and_push(cm, k->adr_name()); 75 PSParallelCompact::mark_and_push(cm, k->adr_name());
74 // We follow the subklass and sibling links at the end of the 76 // We follow the subklass and sibling links at the end of the
75 // marking phase, since otherwise following them will prevent 77 // marking phase, since otherwise following them will prevent
76 // class unloading (all classes are transitively linked from 78 // class unloading (all classes are transitively linked from
77 // java.lang.Object). 79 // java.lang.Object).
88 for (juint i = 0; i < Klass::primary_super_limit(); i++) 90 for (juint i = 0; i < Klass::primary_super_limit(); i++)
89 blk->do_oop(k->adr_primary_supers()+i); 91 blk->do_oop(k->adr_primary_supers()+i);
90 blk->do_oop(k->adr_secondary_super_cache()); 92 blk->do_oop(k->adr_secondary_super_cache());
91 blk->do_oop(k->adr_secondary_supers()); 93 blk->do_oop(k->adr_secondary_supers());
92 blk->do_oop(k->adr_java_mirror()); 94 blk->do_oop(k->adr_java_mirror());
95 blk->do_oop(k->adr_c1x_mirror());
93 blk->do_oop(k->adr_name()); 96 blk->do_oop(k->adr_name());
94 // The following are in the perm gen and are treated 97 // The following are in the perm gen and are treated
95 // specially in a later phase of a perm gen collection; ... 98 // specially in a later phase of a perm gen collection; ...
96 assert(oop(k)->is_perm(), "should be in perm"); 99 assert(oop(k)->is_perm(), "should be in perm");
97 assert(oop(k->subklass())->is_perm_or_null(), "should be in perm"); 100 assert(oop(k->subklass())->is_perm_or_null(), "should be in perm");
122 if (mr.contains(adr)) blk->do_oop(adr); 125 if (mr.contains(adr)) blk->do_oop(adr);
123 adr = k->adr_secondary_supers(); 126 adr = k->adr_secondary_supers();
124 if (mr.contains(adr)) blk->do_oop(adr); 127 if (mr.contains(adr)) blk->do_oop(adr);
125 adr = k->adr_java_mirror(); 128 adr = k->adr_java_mirror();
126 if (mr.contains(adr)) blk->do_oop(adr); 129 if (mr.contains(adr)) blk->do_oop(adr);
130 adr = k->adr_c1x_mirror();
131 if (mr.contains(adr)) blk->do_oop(adr);
127 adr = k->adr_name(); 132 adr = k->adr_name();
128 if (mr.contains(adr)) blk->do_oop(adr); 133 if (mr.contains(adr)) blk->do_oop(adr);
129 // The following are "weak links" in the perm gen and are 134 // The following are "weak links" in the perm gen and are
130 // treated specially in a later phase of a perm gen collection. 135 // treated specially in a later phase of a perm gen collection.
131 assert(oop(k)->is_perm(), "should be in perm"); 136 assert(oop(k)->is_perm(), "should be in perm");
152 for (juint i = 0; i < Klass::primary_super_limit(); i++) 157 for (juint i = 0; i < Klass::primary_super_limit(); i++)
153 MarkSweep::adjust_pointer(k->adr_primary_supers()+i); 158 MarkSweep::adjust_pointer(k->adr_primary_supers()+i);
154 MarkSweep::adjust_pointer(k->adr_secondary_super_cache()); 159 MarkSweep::adjust_pointer(k->adr_secondary_super_cache());
155 MarkSweep::adjust_pointer(k->adr_secondary_supers()); 160 MarkSweep::adjust_pointer(k->adr_secondary_supers());
156 MarkSweep::adjust_pointer(k->adr_java_mirror()); 161 MarkSweep::adjust_pointer(k->adr_java_mirror());
162 MarkSweep::adjust_pointer(k->adr_c1x_mirror());
157 MarkSweep::adjust_pointer(k->adr_name()); 163 MarkSweep::adjust_pointer(k->adr_name());
158 MarkSweep::adjust_pointer(k->adr_subklass()); 164 MarkSweep::adjust_pointer(k->adr_subklass());
159 MarkSweep::adjust_pointer(k->adr_next_sibling()); 165 MarkSweep::adjust_pointer(k->adr_next_sibling());
160 return size; 166 return size;
161 } 167 }