1149 char* subset_list = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal);
1150 strncpy(subset_list, VerifySubSet, length + 1);
1151
1152 char* token = strtok(subset_list, delimiter);
1153 while (token != NULL) {
1154 if (strcmp(token, "threads") == 0) {
1155 verify_flags |= Verify_Threads;
1156 } else if (strcmp(token, "heap") == 0) {
1157 verify_flags |= Verify_Heap;
1158 } else if (strcmp(token, "symbol_table") == 0) {
1159 verify_flags |= Verify_SymbolTable;
1160 } else if (strcmp(token, "string_table") == 0) {
1161 verify_flags |= Verify_StringTable;
1162 } else if (strcmp(token, "codecache") == 0) {
1163 verify_flags |= Verify_CodeCache;
1164 } else if (strcmp(token, "dictionary") == 0) {
1165 verify_flags |= Verify_SystemDictionary;
1166 } else if (strcmp(token, "classloader_data_graph") == 0) {
1167 verify_flags |= Verify_ClassLoaderDataGraph;
1168 } else if (strcmp(token, "metaspace") == 0) {
1169 verify_flags |= Verify_MetaspaceAux;
1170 } else if (strcmp(token, "jni_handles") == 0) {
1171 verify_flags |= Verify_JNIHandles;
1172 } else if (strcmp(token, "codecache_oops") == 0) {
1173 verify_flags |= Verify_CodeCacheOops;
1174 } else {
1175 vm_exit_during_initialization(err_msg("VerifySubSet: \'%s\' memory sub-system is unknown, please correct it", token));
1176 }
1177 token = strtok(NULL, delimiter);
1178 }
1179 FREE_C_HEAP_ARRAY(char, subset_list);
1180 }
1181
1182 bool Universe::should_verify_subset(uint subset) {
1183 if (verify_flags & subset) {
1184 return true;
1185 }
1186 return false;
1187 }
1188
1189 void Universe::verify(VerifyOption option, const char* prefix) {
1221 log_debug(gc, verify)("StringTable");
1222 StringTable::verify();
1223 }
1224 if (should_verify_subset(Verify_CodeCache)) {
1225 {
1226 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1227 log_debug(gc, verify)("CodeCache");
1228 CodeCache::verify();
1229 }
1230 }
1231 if (should_verify_subset(Verify_SystemDictionary)) {
1232 log_debug(gc, verify)("SystemDictionary");
1233 SystemDictionary::verify();
1234 }
1235 #ifndef PRODUCT
1236 if (should_verify_subset(Verify_ClassLoaderDataGraph)) {
1237 log_debug(gc, verify)("ClassLoaderDataGraph");
1238 ClassLoaderDataGraph::verify();
1239 }
1240 #endif
1241 if (should_verify_subset(Verify_MetaspaceAux)) {
1242 log_debug(gc, verify)("MetaspaceAux");
1243 MetaspaceAux::verify_free_chunks();
1244 }
1245 if (should_verify_subset(Verify_JNIHandles)) {
1246 log_debug(gc, verify)("JNIHandles");
1247 JNIHandles::verify();
1248 }
1249 if (should_verify_subset(Verify_CodeCacheOops)) {
1250 log_debug(gc, verify)("CodeCache Oops");
1251 CodeCache::verify_oops();
1252 }
1253
1254 _verify_in_progress = false;
1255 }
1256
1257
1258 #ifndef PRODUCT
1259 void Universe::calculate_verify_data(HeapWord* low_boundary, HeapWord* high_boundary) {
1260 assert(low_boundary < high_boundary, "bad interval");
1261
1262 // decide which low-order bits we require to be clear:
1263 size_t alignSize = MinObjAlignmentInBytes;
|
1149 char* subset_list = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal);
1150 strncpy(subset_list, VerifySubSet, length + 1);
1151
1152 char* token = strtok(subset_list, delimiter);
1153 while (token != NULL) {
1154 if (strcmp(token, "threads") == 0) {
1155 verify_flags |= Verify_Threads;
1156 } else if (strcmp(token, "heap") == 0) {
1157 verify_flags |= Verify_Heap;
1158 } else if (strcmp(token, "symbol_table") == 0) {
1159 verify_flags |= Verify_SymbolTable;
1160 } else if (strcmp(token, "string_table") == 0) {
1161 verify_flags |= Verify_StringTable;
1162 } else if (strcmp(token, "codecache") == 0) {
1163 verify_flags |= Verify_CodeCache;
1164 } else if (strcmp(token, "dictionary") == 0) {
1165 verify_flags |= Verify_SystemDictionary;
1166 } else if (strcmp(token, "classloader_data_graph") == 0) {
1167 verify_flags |= Verify_ClassLoaderDataGraph;
1168 } else if (strcmp(token, "metaspace") == 0) {
1169 verify_flags |= Verify_MetaspaceUtils;
1170 } else if (strcmp(token, "jni_handles") == 0) {
1171 verify_flags |= Verify_JNIHandles;
1172 } else if (strcmp(token, "codecache_oops") == 0) {
1173 verify_flags |= Verify_CodeCacheOops;
1174 } else {
1175 vm_exit_during_initialization(err_msg("VerifySubSet: \'%s\' memory sub-system is unknown, please correct it", token));
1176 }
1177 token = strtok(NULL, delimiter);
1178 }
1179 FREE_C_HEAP_ARRAY(char, subset_list);
1180 }
1181
1182 bool Universe::should_verify_subset(uint subset) {
1183 if (verify_flags & subset) {
1184 return true;
1185 }
1186 return false;
1187 }
1188
1189 void Universe::verify(VerifyOption option, const char* prefix) {
1221 log_debug(gc, verify)("StringTable");
1222 StringTable::verify();
1223 }
1224 if (should_verify_subset(Verify_CodeCache)) {
1225 {
1226 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1227 log_debug(gc, verify)("CodeCache");
1228 CodeCache::verify();
1229 }
1230 }
1231 if (should_verify_subset(Verify_SystemDictionary)) {
1232 log_debug(gc, verify)("SystemDictionary");
1233 SystemDictionary::verify();
1234 }
1235 #ifndef PRODUCT
1236 if (should_verify_subset(Verify_ClassLoaderDataGraph)) {
1237 log_debug(gc, verify)("ClassLoaderDataGraph");
1238 ClassLoaderDataGraph::verify();
1239 }
1240 #endif
1241 if (should_verify_subset(Verify_MetaspaceUtils)) {
1242 log_debug(gc, verify)("MetaspaceUtils");
1243 MetaspaceUtils::verify_free_chunks();
1244 }
1245 if (should_verify_subset(Verify_JNIHandles)) {
1246 log_debug(gc, verify)("JNIHandles");
1247 JNIHandles::verify();
1248 }
1249 if (should_verify_subset(Verify_CodeCacheOops)) {
1250 log_debug(gc, verify)("CodeCache Oops");
1251 CodeCache::verify_oops();
1252 }
1253
1254 _verify_in_progress = false;
1255 }
1256
1257
1258 #ifndef PRODUCT
1259 void Universe::calculate_verify_data(HeapWord* low_boundary, HeapWord* high_boundary) {
1260 assert(low_boundary < high_boundary, "bad interval");
1261
1262 // decide which low-order bits we require to be clear:
1263 size_t alignSize = MinObjAlignmentInBytes;
|