src/share/vm/oops/instanceKlass.cpp

Print this page
rev 4136 : 7153771: array bound check elimination for c1
Summary: when possible optimize out array bound checks, inserting predicates when needed.
Reviewed-by:


2162 }
2163 
2164 #endif // INCLUDE_ALL_GCS
2165 
2166 void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) {
2167   assert(is_loader_alive(is_alive), "this klass should be live");
2168   if (is_interface()) {
2169     if (ClassUnloading) {
2170       Klass* impl = implementor();
2171       if (impl != NULL) {
2172         if (!impl->is_loader_alive(is_alive)) {
2173           // remove this guy
2174           *adr_implementor() = NULL;
2175         }
2176       }
2177     }
2178   }
2179 }
2180 
2181 void InstanceKlass::clean_method_data(BoolObjectClosure* is_alive) {
2182 #ifdef COMPILER2
2183   // Currently only used by C2.
2184   for (int m = 0; m < methods()->length(); m++) {
2185     MethodData* mdo = methods()->at(m)->method_data();
2186     if (mdo != NULL) {
2187       for (ProfileData* data = mdo->first_data();
2188            mdo->is_valid(data);
2189            data = mdo->next_data(data)) {
2190         data->clean_weak_klass_links(is_alive);
2191       }
2192     }
2193   }
2194 #else
2195 #ifdef ASSERT
2196   // Verify that we haven't started to use MDOs for C1.
2197   for (int m = 0; m < methods()->length(); m++) {
2198     MethodData* mdo = methods()->at(m)->method_data();
2199     assert(mdo == NULL, "Didn't expect C1 to use MDOs");
2200   }
2201 #endif // ASSERT
2202 #endif // !COMPILER2
2203 }
2204 
2205 
2206 static void remove_unshareable_in_class(Klass* k) {
2207   // remove klass's unshareable info
2208   k->remove_unshareable_info();
2209 }
2210 
2211 void InstanceKlass::remove_unshareable_info() {
2212   Klass::remove_unshareable_info();
2213   // Unlink the class
2214   if (is_linked()) {
2215     unlink_class();
2216   }
2217   init_implementor();
2218 
2219   constants()->remove_unshareable_info();
2220 
2221   for (int i = 0; i < methods()->length(); i++) {
2222     Method* m = methods()->at(i);




2162 }
2163 
2164 #endif // INCLUDE_ALL_GCS
2165 
2166 void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) {
2167   assert(is_loader_alive(is_alive), "this klass should be live");
2168   if (is_interface()) {
2169     if (ClassUnloading) {
2170       Klass* impl = implementor();
2171       if (impl != NULL) {
2172         if (!impl->is_loader_alive(is_alive)) {
2173           // remove this guy
2174           *adr_implementor() = NULL;
2175         }
2176       }
2177     }
2178   }
2179 }
2180 
2181 void InstanceKlass::clean_method_data(BoolObjectClosure* is_alive) {


2182   for (int m = 0; m < methods()->length(); m++) {
2183     MethodData* mdo = methods()->at(m)->method_data();
2184     if (mdo != NULL) {
2185       for (ProfileData* data = mdo->first_data();
2186            mdo->is_valid(data);
2187            data = mdo->next_data(data)) {
2188         data->clean_weak_klass_links(is_alive);
2189       }
2190     }
2191   }









2192 }
2193 
2194 
2195 static void remove_unshareable_in_class(Klass* k) {
2196   // remove klass's unshareable info
2197   k->remove_unshareable_info();
2198 }
2199 
2200 void InstanceKlass::remove_unshareable_info() {
2201   Klass::remove_unshareable_info();
2202   // Unlink the class
2203   if (is_linked()) {
2204     unlink_class();
2205   }
2206   init_implementor();
2207 
2208   constants()->remove_unshareable_info();
2209 
2210   for (int i = 0; i < methods()->length(); i++) {
2211     Method* m = methods()->at(i);