16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderDataGraph.hpp"
27 #include "classfile/dictionary.hpp"
28 #include "classfile/protectionDomainCache.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "logging/log.hpp"
31 #include "logging/logStream.hpp"
32 #include "memory/iterator.hpp"
33 #include "memory/resourceArea.hpp"
34 #include "oops/oop.inline.hpp"
35 #include "oops/weakHandle.inline.hpp"
36 #include "utilities/hashtable.inline.hpp"
37
38 unsigned int ProtectionDomainCacheTable::compute_hash(Handle protection_domain) {
39 // Identity hash can safepoint, so keep protection domain in a Handle.
40 return (unsigned int)(protection_domain->identity_hash());
41 }
42
43 int ProtectionDomainCacheTable::index_for(Handle protection_domain) {
44 return hash_to_index(compute_hash(protection_domain));
45 }
46
47 ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size)
48 : Hashtable<WeakHandle<vm_class_loader_data>, mtClass>(table_size, sizeof(ProtectionDomainCacheEntry))
49 { _dead_entries = false;
50 _total_oops_removed = 0;
51 }
52
53 void ProtectionDomainCacheTable::trigger_cleanup() {
54 MutexLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
55 _dead_entries = true;
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderDataGraph.hpp"
27 #include "classfile/dictionary.hpp"
28 #include "classfile/protectionDomainCache.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "logging/log.hpp"
31 #include "logging/logStream.hpp"
32 #include "memory/iterator.hpp"
33 #include "memory/resourceArea.hpp"
34 #include "oops/oop.inline.hpp"
35 #include "oops/weakHandle.inline.hpp"
36 #include "runtime/mutexLocker.inline.hpp"
37 #include "utilities/hashtable.inline.hpp"
38
39 unsigned int ProtectionDomainCacheTable::compute_hash(Handle protection_domain) {
40 // Identity hash can safepoint, so keep protection domain in a Handle.
41 return (unsigned int)(protection_domain->identity_hash());
42 }
43
44 int ProtectionDomainCacheTable::index_for(Handle protection_domain) {
45 return hash_to_index(compute_hash(protection_domain));
46 }
47
48 ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size)
49 : Hashtable<WeakHandle<vm_class_loader_data>, mtClass>(table_size, sizeof(ProtectionDomainCacheEntry))
50 { _dead_entries = false;
51 _total_oops_removed = 0;
52 }
53
54 void ProtectionDomainCacheTable::trigger_cleanup() {
55 MutexLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
56 _dead_entries = true;
|