author | simonis |
Tue, 19 Jun 2018 09:43:53 +0200 | |
changeset 50625 | d9753e3db0c6 |
parent 49818 | e57e6addb978 |
child 51610 | cdef4df6b0e7 |
permissions | -rw-r--r-- |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
1 |
/* |
48781
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
4 |
* |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
8 |
* |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
13 |
* accompanied this code). |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
14 |
* |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
18 |
* |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
21 |
* questions. |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
22 |
* |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
23 |
*/ |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
24 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
26 |
#include "classfile/protectionDomainCache.hpp" |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
27 |
#include "classfile/systemDictionary.hpp" |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46475
diff
changeset
|
28 |
#include "logging/log.hpp" |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46475
diff
changeset
|
29 |
#include "logging/logStream.hpp" |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
30 |
#include "memory/iterator.hpp" |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
31 |
#include "memory/resourceArea.hpp" |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
32 |
#include "oops/oop.inline.hpp" |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
33 |
#include "oops/weakHandle.inline.hpp" |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
34 |
#include "utilities/hashtable.inline.hpp" |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
35 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
36 |
unsigned int ProtectionDomainCacheTable::compute_hash(Handle protection_domain) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
37 |
// Identity hash can safepoint, so keep protection domain in a Handle. |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
38 |
return (unsigned int)(protection_domain->identity_hash()); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
39 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
40 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
41 |
int ProtectionDomainCacheTable::index_for(Handle protection_domain) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
42 |
return hash_to_index(compute_hash(protection_domain)); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
43 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
44 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
45 |
ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size) |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
46 |
: Hashtable<ClassLoaderWeakHandle, mtClass>(table_size, sizeof(ProtectionDomainCacheEntry)) |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
47 |
{ |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
48 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
49 |
|
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
50 |
void ProtectionDomainCacheTable::unlink() { |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
51 |
assert(SafepointSynchronize::is_at_safepoint(), "must be"); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
52 |
for (int i = 0; i < table_size(); ++i) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
53 |
ProtectionDomainCacheEntry** p = bucket_addr(i); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
54 |
ProtectionDomainCacheEntry* entry = bucket(i); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
55 |
while (entry != NULL) { |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
56 |
oop pd = entry->object_no_keepalive(); |
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
57 |
if (pd != NULL) { |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
58 |
p = entry->next_addr(); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
59 |
} else { |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46475
diff
changeset
|
60 |
LogTarget(Debug, protectiondomain) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46475
diff
changeset
|
61 |
if (lt.is_enabled()) { |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46475
diff
changeset
|
62 |
LogStream ls(lt); |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
63 |
ls.print_cr("protection domain unlinked at %d", i); |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
64 |
} |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
65 |
entry->literal().release(); |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
66 |
*p = entry->next(); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
67 |
free_entry(entry); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
68 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
69 |
entry = *p; |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
70 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
71 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
72 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
73 |
|
46742 | 74 |
void ProtectionDomainCacheTable::print_on(outputStream* st) const { |
75 |
st->print_cr("Protection domain cache table (table_size=%d, classes=%d)", |
|
76 |
table_size(), number_of_entries()); |
|
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
77 |
for (int index = 0; index < table_size(); index++) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
78 |
for (ProtectionDomainCacheEntry* probe = bucket(index); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
79 |
probe != NULL; |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
80 |
probe = probe->next()) { |
48781
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
81 |
st->print_cr("%4d: protection_domain: " PTR_FORMAT, index, p2i(probe->object_no_keepalive())); |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
82 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
83 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
84 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
85 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
86 |
void ProtectionDomainCacheTable::verify() { |
46475
75902cea18af
8166848: Performance bug: SystemDictionary - optimization
coleenp
parents:
46382
diff
changeset
|
87 |
verify_table<ProtectionDomainCacheEntry>("Protection Domain Table"); |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
88 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
89 |
|
48781
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
90 |
oop ProtectionDomainCacheEntry::object() { |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
91 |
return literal().resolve(); |
48781
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
92 |
} |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
93 |
|
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
94 |
oop ProtectionDomainEntry::object() { |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
95 |
return _pd_cache->object(); |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
96 |
} |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
97 |
|
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
98 |
// The object_no_keepalive() call peeks at the phantomly reachable oop without |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
99 |
// keeping it alive. This is okay to do in the VM thread state if it is not |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
100 |
// leaked out to become strongly reachable. |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
101 |
oop ProtectionDomainCacheEntry::object_no_keepalive() { |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
102 |
return literal().peek(); |
48781
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
103 |
} |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
104 |
|
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
105 |
oop ProtectionDomainEntry::object_no_keepalive() { |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
106 |
return _pd_cache->object_no_keepalive(); |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
107 |
} |
6ebef5cd0c8d
8194736: Refactor weak oops in ProtectionDomain table to use the Access API
eosterlund
parents:
47216
diff
changeset
|
108 |
|
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
109 |
void ProtectionDomainCacheEntry::verify() { |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
110 |
guarantee(object_no_keepalive() == NULL || oopDesc::is_oop(object_no_keepalive()), "must be an oop"); |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
111 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
112 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
113 |
ProtectionDomainCacheEntry* ProtectionDomainCacheTable::get(Handle protection_domain) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
114 |
unsigned int hash = compute_hash(protection_domain); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
115 |
int index = hash_to_index(hash); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
116 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
117 |
ProtectionDomainCacheEntry* entry = find_entry(index, protection_domain); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
118 |
if (entry == NULL) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
119 |
entry = add_entry(index, hash, protection_domain); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
120 |
} |
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
121 |
// keep entry alive |
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
122 |
(void)entry->object(); |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
123 |
return entry; |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
124 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
125 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
126 |
ProtectionDomainCacheEntry* ProtectionDomainCacheTable::find_entry(int index, Handle protection_domain) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
127 |
for (ProtectionDomainCacheEntry* e = bucket(index); e != NULL; e = e->next()) { |
49658 | 128 |
if (oopDesc::equals(e->object_no_keepalive(), protection_domain())) { |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
129 |
return e; |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
130 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
131 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
132 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
133 |
return NULL; |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
134 |
} |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
135 |
|
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
136 |
ProtectionDomainCacheEntry* ProtectionDomainCacheTable::add_entry(int index, unsigned int hash, Handle protection_domain) { |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
137 |
assert_locked_or_safepoint(SystemDictionary_lock); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
138 |
assert(index == index_for(protection_domain), "incorrect index?"); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
139 |
assert(find_entry(index, protection_domain) == NULL, "no double entry"); |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
140 |
|
49818
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
141 |
ClassLoaderWeakHandle w = ClassLoaderWeakHandle::create(protection_domain); |
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
142 |
ProtectionDomainCacheEntry* p = new_entry(hash, w); |
e57e6addb978
8201505: Use WeakHandle for ProtectionDomainCacheTable and ResolvedMethodTable
coleenp
parents:
49658
diff
changeset
|
143 |
Hashtable<ClassLoaderWeakHandle, mtClass>::add_entry(index, p); |
46382
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
144 |
return p; |
5520c435279b
8178336: Unnecessary SystemDictionary walk for Protection domain liveness
coleenp
parents:
diff
changeset
|
145 |
} |