src/hotspot/share/aot/aotCodeHeap.cpp
changeset 54150 5529640c5f67
parent 53688 4c6988db810a
child 54780 f8d182aedc92
equal deleted inserted replaced
54149:c61f09122d3b 54150:5529640c5f67
   929 }
   929 }
   930 
   930 
   931 // Scan only klasses_got cells which should have only Klass*,
   931 // Scan only klasses_got cells which should have only Klass*,
   932 // metadata_got cells are scanned only for alive AOT methods
   932 // metadata_got cells are scanned only for alive AOT methods
   933 // by AOTCompiledMethod::metadata_do().
   933 // by AOTCompiledMethod::metadata_do().
   934 void AOTCodeHeap::got_metadata_do(void f(Metadata*)) {
   934 void AOTCodeHeap::got_metadata_do(MetadataClosure* f) {
   935   for (int i = 1; i < _klasses_got_size; i++) {
   935   for (int i = 1; i < _klasses_got_size; i++) {
   936     Metadata** p = &_klasses_got[i];
   936     Metadata** p = &_klasses_got[i];
   937     Metadata* md = *p;
   937     Metadata* md = *p;
   938     if (md == NULL)  continue;  // skip non-oops
   938     if (md == NULL)  continue;  // skip non-oops
   939     if (Metaspace::contains(md)) {
   939     if (Metaspace::contains(md)) {
   940       f(md);
   940       f->do_metadata(md);
   941     } else {
   941     } else {
   942       intptr_t meta = (intptr_t)md;
   942       intptr_t meta = (intptr_t)md;
   943       fatal("Invalid value in _klasses_got[%d] = " INTPTR_FORMAT, i, meta);
   943       fatal("Invalid value in _klasses_got[%d] = " INTPTR_FORMAT, i, meta);
   944     }
   944     }
   945   }
   945   }
   967   }
   967   }
   968   return count;
   968   return count;
   969 }
   969 }
   970 #endif
   970 #endif
   971 
   971 
   972 void AOTCodeHeap::metadata_do(void f(Metadata*)) {
   972 void AOTCodeHeap::metadata_do(MetadataClosure* f) {
   973   for (int index = 0; index < _method_count; index++) {
   973   for (int index = 0; index < _method_count; index++) {
   974     if (_code_to_aot[index]._state != in_use) {
   974     if (_code_to_aot[index]._state != in_use) {
   975       continue; // Skip uninitialized entries.
   975       continue; // Skip uninitialized entries.
   976     }
   976     }
   977     AOTCompiledMethod* aot = _code_to_aot[index]._aot;
   977     AOTCompiledMethod* aot = _code_to_aot[index]._aot;