hotspot/src/share/vm/gc/g1/g1CodeCacheRemSet.cpp
changeset 31592 43f48e165466
parent 30764 fec48bf5a827
child 33093 5aa0f908f8cd
equal deleted inserted replaced
31401:1514c0a798d2 31592:43f48e165466
   348     {
   348     {
   349       G1CodeRootSet set1;
   349       G1CodeRootSet set1;
   350       assert(set1.is_empty(), "Code root set must be initially empty but is not.");
   350       assert(set1.is_empty(), "Code root set must be initially empty but is not.");
   351 
   351 
   352       assert(G1CodeRootSet::static_mem_size() == sizeof(void*),
   352       assert(G1CodeRootSet::static_mem_size() == sizeof(void*),
   353           err_msg("The code root set's static memory usage is incorrect, "SIZE_FORMAT" bytes", G1CodeRootSet::static_mem_size()));
   353           err_msg("The code root set's static memory usage is incorrect, " SIZE_FORMAT " bytes", G1CodeRootSet::static_mem_size()));
   354 
   354 
   355       set1.add((nmethod*)1);
   355       set1.add((nmethod*)1);
   356       assert(set1.length() == 1, err_msg("Added exactly one element, but set contains "
   356       assert(set1.length() == 1, err_msg("Added exactly one element, but set contains "
   357           SIZE_FORMAT" elements", set1.length()));
   357           SIZE_FORMAT " elements", set1.length()));
   358 
   358 
   359       const size_t num_to_add = (size_t)G1CodeRootSet::Threshold + 1;
   359       const size_t num_to_add = (size_t)G1CodeRootSet::Threshold + 1;
   360 
   360 
   361       for (size_t i = 1; i <= num_to_add; i++) {
   361       for (size_t i = 1; i <= num_to_add; i++) {
   362         set1.add((nmethod*)1);
   362         set1.add((nmethod*)1);
   363       }
   363       }
   364       assert(set1.length() == 1,
   364       assert(set1.length() == 1,
   365           err_msg("Duplicate detection should not have increased the set size but "
   365           err_msg("Duplicate detection should not have increased the set size but "
   366               "is "SIZE_FORMAT, set1.length()));
   366               "is " SIZE_FORMAT, set1.length()));
   367 
   367 
   368       for (size_t i = 2; i <= num_to_add; i++) {
   368       for (size_t i = 2; i <= num_to_add; i++) {
   369         set1.add((nmethod*)(uintptr_t)(i));
   369         set1.add((nmethod*)(uintptr_t)(i));
   370       }
   370       }
   371       assert(set1.length() == num_to_add,
   371       assert(set1.length() == num_to_add,
   372           err_msg("After adding in total "SIZE_FORMAT" distinct code roots, they "
   372           err_msg("After adding in total " SIZE_FORMAT " distinct code roots, they "
   373               "need to be in the set, but there are only "SIZE_FORMAT,
   373               "need to be in the set, but there are only " SIZE_FORMAT,
   374               num_to_add, set1.length()));
   374               num_to_add, set1.length()));
   375 
   375 
   376       assert(CodeRootSetTable::_purge_list != NULL, "should have grown to large hashtable");
   376       assert(CodeRootSetTable::_purge_list != NULL, "should have grown to large hashtable");
   377 
   377 
   378       size_t num_popped = 0;
   378       size_t num_popped = 0;
   383         } else {
   383         } else {
   384           break;
   384           break;
   385         }
   385         }
   386       }
   386       }
   387       assert(num_popped == num_to_add,
   387       assert(num_popped == num_to_add,
   388           err_msg("Managed to pop "SIZE_FORMAT" code roots, but only "SIZE_FORMAT" "
   388           err_msg("Managed to pop " SIZE_FORMAT " code roots, but only " SIZE_FORMAT " "
   389               "were added", num_popped, num_to_add));
   389               "were added", num_popped, num_to_add));
   390       assert(CodeRootSetTable::_purge_list != NULL, "should have grown to large hashtable");
   390       assert(CodeRootSetTable::_purge_list != NULL, "should have grown to large hashtable");
   391 
   391 
   392       G1CodeRootSet::purge();
   392       G1CodeRootSet::purge();
   393 
   393