hotspot/src/share/vm/oops/cpCacheKlass.cpp
changeset 2570 ecc7862946d4
parent 2105 347008ce7984
child 4584 e2a449e8cc6f
equal deleted inserted replaced
2569:9e8daec25638 2570:ecc7862946d4
   167 
   167 
   168 #ifndef SERIALGC
   168 #ifndef SERIALGC
   169 void constantPoolCacheKlass::oop_copy_contents(PSPromotionManager* pm,
   169 void constantPoolCacheKlass::oop_copy_contents(PSPromotionManager* pm,
   170                                                oop obj) {
   170                                                oop obj) {
   171   assert(obj->is_constantPoolCache(), "should be constant pool");
   171   assert(obj->is_constantPoolCache(), "should be constant pool");
       
   172   if (EnableInvokeDynamic) {
       
   173     constantPoolCacheOop cache = (constantPoolCacheOop)obj;
       
   174     // during a scavenge, it is safe to inspect my pool, since it is perm
       
   175     constantPoolOop pool = cache->constant_pool();
       
   176     assert(pool->is_constantPool(), "should be constant pool");
       
   177     if (pool->has_invokedynamic()) {
       
   178       for (int i = 0; i < cache->length(); i++) {
       
   179         ConstantPoolCacheEntry* e = cache->entry_at(i);
       
   180         oop* p = (oop*)&e->_f1;
       
   181         if (e->is_secondary_entry()) {
       
   182           if (PSScavenge::should_scavenge(p))
       
   183             pm->claim_or_forward_breadth(p);
       
   184           assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
       
   185                  "no live oops here");
       
   186         }
       
   187       }
       
   188     }
       
   189   }
   172 }
   190 }
   173 
   191 
   174 void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
   192 void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
   175                                                oop obj) {
   193                                                oop obj) {
   176   assert(obj->is_constantPoolCache(), "should be constant pool");
   194   assert(obj->is_constantPoolCache(), "should be constant pool");
       
   195   if (EnableInvokeDynamic) {
       
   196     constantPoolCacheOop cache = (constantPoolCacheOop)obj;
       
   197     // during a scavenge, it is safe to inspect my pool, since it is perm
       
   198     constantPoolOop pool = cache->constant_pool();
       
   199     assert(pool->is_constantPool(), "should be constant pool");
       
   200     if (pool->has_invokedynamic()) {
       
   201       for (int i = 0; i < cache->length(); i++) {
       
   202         ConstantPoolCacheEntry* e = cache->entry_at(i);
       
   203         oop* p = (oop*)&e->_f1;
       
   204         if (e->is_secondary_entry()) {
       
   205           if (PSScavenge::should_scavenge(p))
       
   206             pm->claim_or_forward_depth(p);
       
   207           assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
       
   208                  "no live oops here");
       
   209         }
       
   210       }
       
   211     }
       
   212   }
   177 }
   213 }
   178 
   214 
   179 int
   215 int
   180 constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
   216 constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
   181   assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
   217   assert(obj->is_constantPoolCache(), "obj must be constant pool cache");