annotate src/share/vm/oops/cpCacheKlass.cpp @ 1972:f95d63e2154a

6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
author stefank
date Tue, 23 Nov 2010 13:22:55 -0800
parents 7fcd5f39bd7a
children c5a923563727
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
26 #include "classfile/javaClasses.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
27 #include "gc_implementation/shared/markSweep.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
28 #include "gc_interface/collectedHeap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
29 #include "interpreter/bytecodes.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
30 #include "memory/genOopClosures.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
31 #include "memory/permGen.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
32 #include "oops/constantPoolOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
33 #include "oops/cpCacheKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
34 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
35 #include "runtime/handles.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
36 #ifndef SERIALGC
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
37 #include "gc_implementation/parNew/parOopClosures.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
38 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
39 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
40 #include "memory/cardTableRS.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
41 #include "oops/oop.pcgc.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
42 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 int constantPoolCacheKlass::oop_size(oop obj) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
46 assert(obj->is_constantPoolCache(), "must be constantPool");
a61af66fc99e Initial load
duke
parents:
diff changeset
47 return constantPoolCacheOop(obj)->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
48 }
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50
542
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
51 constantPoolCacheOop constantPoolCacheKlass::allocate(int length,
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
52 bool is_conc_safe,
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
53 TRAPS) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // allocate memory
a61af66fc99e Initial load
duke
parents:
diff changeset
55 int size = constantPoolCacheOopDesc::object_size(length);
542
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
56
0
a61af66fc99e Initial load
duke
parents:
diff changeset
57 KlassHandle klass (THREAD, as_klassOop());
542
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
58
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
59 // This is the original code. The code from permanent_obj_allocate()
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
60 // was in-lined to allow the setting of is_conc_safe before the klass
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
61 // is installed.
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
62 // constantPoolCacheOop cache = (constantPoolCacheOop)
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
63 // CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL);
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
64
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
65 oop obj = CollectedHeap::permanent_obj_allocate_no_klass_install(klass, size, CHECK_NULL);
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
66 constantPoolCacheOop cache = (constantPoolCacheOop) obj;
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
67 cache->set_is_conc_safe(is_conc_safe);
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
68 // The store to is_conc_safe must be visible before the klass
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
69 // is set. This should be done safely because _is_conc_safe has
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
70 // been declared volatile. If there are any problems, consider adding
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
71 // OrderAccess::storestore();
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
72 CollectedHeap::post_allocation_install_obj_klass(klass, obj, size);
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
73 NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value((HeapWord*) obj,
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
74 size));
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
75
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
76 // The length field affects the size of the object. The allocation
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
77 // above allocates the correct size (see calculation of "size") but
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
78 // the size() method of the constant pool cache oop will not reflect
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
79 // that size until the correct length is set.
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
80 cache->set_length(length);
542
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
81
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
82 // The store of the length must be visible before is_conc_safe is
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
83 // set to a safe state.
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
84 // This should be done safely because _is_conc_safe has
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
85 // been declared volatile. If there are any problems, consider adding
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
86 // OrderAccess::storestore();
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
87 cache->set_is_conc_safe(methodOopDesc::IsSafeConc);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
88 cache->set_constant_pool(NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
89 return cache;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 }
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 klassOop constantPoolCacheKlass::create_klass(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
93 constantPoolCacheKlass o;
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
94 KlassHandle h_this_klass(THREAD, Universe::klassKlassObj());
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
95 KlassHandle k = base_create_klass(h_this_klass, header_size(), o.vtbl_value(), CHECK_NULL);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
96 // Make sure size calculation is right
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
97 assert(k()->size() == align_object_size(header_size()), "wrong size for object");
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
98 java_lang_Class::create_mirror(k, CHECK_NULL); // Allocate mirror
0
a61af66fc99e Initial load
duke
parents:
diff changeset
99 return k();
a61af66fc99e Initial load
duke
parents:
diff changeset
100 }
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 void constantPoolCacheKlass::oop_follow_contents(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
104 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
105 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // Performance tweak: We skip iterating over the klass pointer since we
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // know that Universe::constantPoolCacheKlassObj never moves.
a61af66fc99e Initial load
duke
parents:
diff changeset
108 // gc of constant pool cache instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
109 MarkSweep::mark_and_push((oop*)cache->constant_pool_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // gc of constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
111 int i = cache->length();
a61af66fc99e Initial load
duke
parents:
diff changeset
112 while (i-- > 0) cache->entry_at(i)->follow_contents();
a61af66fc99e Initial load
duke
parents:
diff changeset
113 }
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
116 void constantPoolCacheKlass::oop_follow_contents(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
117 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
118 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
119 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 // Performance tweak: We skip iterating over the klass pointer since we
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // know that Universe::constantPoolCacheKlassObj never moves.
a61af66fc99e Initial load
duke
parents:
diff changeset
122 // gc of constant pool cache instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
123 PSParallelCompact::mark_and_push(cm, (oop*)cache->constant_pool_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // gc of constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
125 int i = cache->length();
a61af66fc99e Initial load
duke
parents:
diff changeset
126 while (i-- > 0) cache->entry_at(i)->follow_contents(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 }
a61af66fc99e Initial load
duke
parents:
diff changeset
128 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 int constantPoolCacheKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
a61af66fc99e Initial load
duke
parents:
diff changeset
132 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
133 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
135 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
136 int size = cache->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
137 // Performance tweak: We skip iterating over the klass pointer since we
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // know that Universe::constantPoolCacheKlassObj never moves.
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // iteration over constant pool cache instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
140 blk->do_oop((oop*)cache->constant_pool_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // iteration over constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
142 for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->oop_iterate(blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
143 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
144 }
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 int constantPoolCacheKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
148 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
149 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
150 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
151 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
152 int size = cache->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
153 // Performance tweak: We skip iterating over the klass pointer since we
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // know that Universe::constantPoolCacheKlassObj never moves.
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // iteration over constant pool cache instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
156 oop* addr = (oop*)cache->constant_pool_addr();
a61af66fc99e Initial load
duke
parents:
diff changeset
157 if (mr.contains(addr)) blk->do_oop(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
158 // iteration over constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
159 for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->oop_iterate_m(blk, mr);
a61af66fc99e Initial load
duke
parents:
diff changeset
160 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 int constantPoolCacheKlass::oop_adjust_pointers(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
165 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
166 // Get size before changing pointers.
a61af66fc99e Initial load
duke
parents:
diff changeset
167 // Don't call size() or oop_size() since that is a virtual call.
a61af66fc99e Initial load
duke
parents:
diff changeset
168 int size = cache->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
169 // Performance tweak: We skip iterating over the klass pointer since we
a61af66fc99e Initial load
duke
parents:
diff changeset
170 // know that Universe::constantPoolCacheKlassObj never moves.
a61af66fc99e Initial load
duke
parents:
diff changeset
171 // Iteration over constant pool cache instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
172 MarkSweep::adjust_pointer((oop*)cache->constant_pool_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
173 // iteration over constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
174 for (int i = 0; i < cache->length(); i++)
a61af66fc99e Initial load
duke
parents:
diff changeset
175 cache->entry_at(i)->adjust_pointers();
a61af66fc99e Initial load
duke
parents:
diff changeset
176 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
177 }
a61af66fc99e Initial load
duke
parents:
diff changeset
178
542
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
179 bool constantPoolCacheKlass::oop_is_conc_safe(oop obj) const {
546
05c6d52fa7a9 6690928: Use spinning in combination with yields for workstealing termination.
jmasa
parents: 542
diff changeset
180 assert(obj->is_constantPoolCache(), "should be constant pool");
542
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
181 return constantPoolCacheOop(obj)->is_conc_safe();
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
182 }
9a25e0c45327 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 196
diff changeset
183
0
a61af66fc99e Initial load
duke
parents:
diff changeset
184 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
185 void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
a61af66fc99e Initial load
duke
parents:
diff changeset
186 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 assert(obj->is_constantPoolCache(), "should be constant pool");
726
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
188 if (EnableInvokeDynamic) {
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
189 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
190 // during a scavenge, it is safe to inspect my pool, since it is perm
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
191 constantPoolOop pool = cache->constant_pool();
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
192 assert(pool->is_constantPool(), "should be constant pool");
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
193 if (pool->has_invokedynamic()) {
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
194 for (int i = 0; i < cache->length(); i++) {
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
195 ConstantPoolCacheEntry* e = cache->entry_at(i);
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
196 oop* p = (oop*)&e->_f1;
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
197 if (e->is_secondary_entry()) {
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
198 if (PSScavenge::should_scavenge(p))
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
199 pm->claim_or_forward_depth(p);
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
200 assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
201 "no live oops here");
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
202 }
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
203 }
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
204 }
be93aad57795 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 579
diff changeset
205 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
206 }
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208 int
a61af66fc99e Initial load
duke
parents:
diff changeset
209 constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
210 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
211 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 // Iteration over constant pool cache instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
214 PSParallelCompact::adjust_pointer((oop*)cache->constant_pool_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 // iteration over constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
217 for (int i = 0; i < cache->length(); ++i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
218 cache->entry_at(i)->update_pointers();
a61af66fc99e Initial load
duke
parents:
diff changeset
219 }
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 return cache->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
222 }
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 int
a61af66fc99e Initial load
duke
parents:
diff changeset
225 constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
226 HeapWord* beg_addr,
a61af66fc99e Initial load
duke
parents:
diff changeset
227 HeapWord* end_addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
229 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 // Iteration over constant pool cache instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
232 oop* p;
a61af66fc99e Initial load
duke
parents:
diff changeset
233 p = (oop*)cache->constant_pool_addr();
a61af66fc99e Initial load
duke
parents:
diff changeset
234 PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
235
a61af66fc99e Initial load
duke
parents:
diff changeset
236 // Iteration over constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
237 for (int i = 0; i < cache->length(); ++i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
238 cache->entry_at(i)->update_pointers(beg_addr, end_addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
a61af66fc99e Initial load
duke
parents:
diff changeset
240 return cache->object_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
245 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
246 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
247 // super print
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
248 Klass::oop_print_on(obj, st);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
249 // print constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
250 for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->print(st, i);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 }
a61af66fc99e Initial load
duke
parents:
diff changeset
252
1155
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
253 void constantPoolCacheKlass::oop_print_value_on(oop obj, outputStream* st) {
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
254 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
255 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
256 st->print("cache [%d]", cache->length());
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
257 cache->print_address_on(st);
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
258 st->print(" for ");
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
259 cache->constant_pool()->print_value_on(st);
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
260 }
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 726
diff changeset
261
0
a61af66fc99e Initial load
duke
parents:
diff changeset
262 void constantPoolCacheKlass::oop_verify_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 guarantee(obj->is_constantPoolCache(), "obj must be constant pool cache");
a61af66fc99e Initial load
duke
parents:
diff changeset
264 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
265 // super verify
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
266 Klass::oop_verify_on(obj, st);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
267 // print constant pool cache entries
a61af66fc99e Initial load
duke
parents:
diff changeset
268 for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->verify(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
269 }
a61af66fc99e Initial load
duke
parents:
diff changeset
270
a61af66fc99e Initial load
duke
parents:
diff changeset
271
a61af66fc99e Initial load
duke
parents:
diff changeset
272 const char* constantPoolCacheKlass::internal_name() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
273 return "{constant pool cache}";
a61af66fc99e Initial load
duke
parents:
diff changeset
274 }