comparison src/share/vm/oops/instanceKlass.cpp @ 14378:48314d596a04

8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on Summary: Remove search in system dictionary and hacks, replace with verifying in CLD::_klasses list. Reviewed-by: dcubed, acorn
author coleenp
date Sat, 15 Feb 2014 13:03:38 -0500
parents 2353011244bd
children e6195383bcaf b8413a9cbb84 752ba2e5f6d0
comparison
equal deleted inserted replaced
14377:cbdbdd6577f6 14378:48314d596a04
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
3178 public: 3178 public:
3179 virtual void do_oop(oop* p) { VerifyFieldClosure::do_oop_work(p); } 3179 virtual void do_oop(oop* p) { VerifyFieldClosure::do_oop_work(p); }
3180 virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); } 3180 virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); }
3181 }; 3181 };
3182 3182
3183 void InstanceKlass::verify_on(outputStream* st, bool check_dictionary) { 3183 void InstanceKlass::verify_on(outputStream* st) {
3184 #ifndef PRODUCT 3184 #ifndef PRODUCT
3185 // Avoid redundant verifies, this really should be in product. 3185 // Avoid redundant verifies, this really should be in product.
3186 if (_verify_count == Universe::verify_count()) return; 3186 if (_verify_count == Universe::verify_count()) return;
3187 _verify_count = Universe::verify_count(); 3187 _verify_count = Universe::verify_count();
3188 #endif 3188 #endif
3189 3189
3190 // Verify Klass 3190 // Verify Klass
3191 Klass::verify_on(st, check_dictionary); 3191 Klass::verify_on(st);
3192 3192
3193 // Verify that klass is present in SystemDictionary if not already 3193 // Verify that klass is present in ClassLoaderData
3194 // verifying the SystemDictionary. 3194 guarantee(class_loader_data()->contains_klass(this),
3195 if (is_loaded() && !is_anonymous() && check_dictionary) { 3195 "this class isn't found in class loader data");
3196 Symbol* h_name = name();
3197 SystemDictionary::verify_obj_klass_present(h_name, class_loader_data());
3198 }
3199 3196
3200 // Verify vtables 3197 // Verify vtables
3201 if (is_linked()) { 3198 if (is_linked()) {
3202 ResourceMark rm; 3199 ResourceMark rm;
3203 // $$$ This used to be done only for m/s collections. Doing it 3200 // $$$ This used to be done only for m/s collections. Doing it