151 int constantPoolCacheKlass::oop_adjust_pointers(oop obj) {
152 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
153 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
154 // Get size before changing pointers.
155 // Don't call size() or oop_size() since that is a virtual call.
156 int size = cache->object_size();
157 // Performance tweak: We skip iterating over the klass pointer since we
158 // know that Universe::constantPoolCacheKlassObj never moves.
159 // Iteration over constant pool cache instance variables
160 MarkSweep::adjust_pointer((oop*)cache->constant_pool_addr());
161 // iteration over constant pool cache entries
162 for (int i = 0; i < cache->length(); i++)
163 cache->entry_at(i)->adjust_pointers();
164 return size;
165 }
166
167 #ifndef SERIALGC
168 void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
169 oop obj) {
170 assert(obj->is_constantPoolCache(), "should be constant pool");
171 if (EnableInvokeDynamic) {
172 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
173 // during a scavenge, it is safe to inspect my pool, since it is perm
174 constantPoolOop pool = cache->constant_pool();
175 assert(pool->is_constantPool(), "should be constant pool");
176 if (pool->has_invokedynamic()) {
177 for (int i = 0; i < cache->length(); i++) {
178 ConstantPoolCacheEntry* e = cache->entry_at(i);
179 oop* p = (oop*)&e->_f1;
180 if (e->is_secondary_entry()) {
181 if (PSScavenge::should_scavenge(p))
182 pm->claim_or_forward_depth(p);
183 assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
184 "no live oops here");
185 }
186 }
187 }
188 }
189 }
190
191 int
192 constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
193 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
194 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
195
196 // Iteration over constant pool cache instance variables
197 PSParallelCompact::adjust_pointer((oop*)cache->constant_pool_addr());
198
199 // iteration over constant pool cache entries
200 for (int i = 0; i < cache->length(); ++i) {
201 cache->entry_at(i)->update_pointers();
202 }
203
204 return cache->object_size();
205 }
206 #endif // SERIALGC
207
208 void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) {
|
151 int constantPoolCacheKlass::oop_adjust_pointers(oop obj) {
152 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
153 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
154 // Get size before changing pointers.
155 // Don't call size() or oop_size() since that is a virtual call.
156 int size = cache->object_size();
157 // Performance tweak: We skip iterating over the klass pointer since we
158 // know that Universe::constantPoolCacheKlassObj never moves.
159 // Iteration over constant pool cache instance variables
160 MarkSweep::adjust_pointer((oop*)cache->constant_pool_addr());
161 // iteration over constant pool cache entries
162 for (int i = 0; i < cache->length(); i++)
163 cache->entry_at(i)->adjust_pointers();
164 return size;
165 }
166
167 #ifndef SERIALGC
168 void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
169 oop obj) {
170 assert(obj->is_constantPoolCache(), "should be constant pool");
171 if (ScavengeRootsInCode) {
172 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
173 // during a scavenge, it is safe to inspect my pool, since it is perm
174 constantPoolOop pool = cache->constant_pool();
175 assert(pool->is_constantPool(), "should be constant pool");
176 for (int i = 0; i < cache->length(); i++) {
177 ConstantPoolCacheEntry* e = cache->entry_at(i);
178 oop* p = (oop*)&e->_f1;
179 if (PSScavenge::should_scavenge(p))
180 pm->claim_or_forward_depth(p);
181 assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
182 "no live oops here");
183 }
184 }
185 }
186
187 int
188 constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
189 assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
190 constantPoolCacheOop cache = (constantPoolCacheOop)obj;
191
192 // Iteration over constant pool cache instance variables
193 PSParallelCompact::adjust_pointer((oop*)cache->constant_pool_addr());
194
195 // iteration over constant pool cache entries
196 for (int i = 0; i < cache->length(); ++i) {
197 cache->entry_at(i)->update_pointers();
198 }
199
200 return cache->object_size();
201 }
202 #endif // SERIALGC
203
204 void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) {
|