hotspot/src/share/vm/oops/constantPool.cpp
changeset 18439 725ce18186b3
parent 17858 c292f8791cca
child 20017 81eba62e9048
child 20063 8965b97fcbb2
equal deleted inserted replaced
18438:9ea6bbfe0b83 18439:725ce18186b3
  2093   for (int i = 0; i< length();  i++) {
  2093   for (int i = 0; i< length();  i++) {
  2094     constantTag tag = tag_at(i);
  2094     constantTag tag = tag_at(i);
  2095     CPSlot entry = slot_at(i);
  2095     CPSlot entry = slot_at(i);
  2096     if (tag.is_klass()) {
  2096     if (tag.is_klass()) {
  2097       if (entry.is_resolved()) {
  2097       if (entry.is_resolved()) {
  2098         guarantee(entry.get_klass()->is_metadata(), "should be metadata");
       
  2099         guarantee(entry.get_klass()->is_klass(),    "should be klass");
  2098         guarantee(entry.get_klass()->is_klass(),    "should be klass");
  2100       }
  2099       }
  2101     } else if (tag.is_unresolved_klass()) {
  2100     } else if (tag.is_unresolved_klass()) {
  2102       if (entry.is_resolved()) {
  2101       if (entry.is_resolved()) {
  2103         guarantee(entry.get_klass()->is_metadata(), "should be metadata");
       
  2104         guarantee(entry.get_klass()->is_klass(),    "should be klass");
  2102         guarantee(entry.get_klass()->is_klass(),    "should be klass");
  2105       }
  2103       }
  2106     } else if (tag.is_symbol()) {
  2104     } else if (tag.is_symbol()) {
  2107       guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count");
  2105       guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count");
  2108     } else if (tag.is_string()) {
  2106     } else if (tag.is_string()) {
  2110     }
  2108     }
  2111   }
  2109   }
  2112   if (cache() != NULL) {
  2110   if (cache() != NULL) {
  2113     // Note: cache() can be NULL before a class is completely setup or
  2111     // Note: cache() can be NULL before a class is completely setup or
  2114     // in temporary constant pools used during constant pool merging
  2112     // in temporary constant pools used during constant pool merging
  2115     guarantee(cache()->is_metadata(),          "should be metadata");
       
  2116     guarantee(cache()->is_constantPoolCache(), "should be constant pool cache");
  2113     guarantee(cache()->is_constantPoolCache(), "should be constant pool cache");
  2117   }
  2114   }
  2118   if (pool_holder() != NULL) {
  2115   if (pool_holder() != NULL) {
  2119     // Note: pool_holder() can be NULL in temporary constant pools
  2116     // Note: pool_holder() can be NULL in temporary constant pools
  2120     // used during constant pool merging
  2117     // used during constant pool merging
  2121     guarantee(pool_holder()->is_metadata(), "should be metadata");
       
  2122     guarantee(pool_holder()->is_klass(),    "should be klass");
  2118     guarantee(pool_holder()->is_klass(),    "should be klass");
  2123   }
  2119   }
  2124 }
  2120 }
  2125 
  2121 
  2126 
  2122