hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
changeset 23451 ed2b8bb28fed
parent 23450 c7c6202fc7e2
child 23453 09cfb0164acf
equal deleted inserted replaced
23450:c7c6202fc7e2 23451:ed2b8bb28fed
  5896   // the collection set. Ideally we would like to do this
  5896   // the collection set. Ideally we would like to do this
  5897   // after we have finished the scanning/evacuation of the
  5897   // after we have finished the scanning/evacuation of the
  5898   // strong code roots for a particular heap region.
  5898   // strong code roots for a particular heap region.
  5899   migrate_strong_code_roots();
  5899   migrate_strong_code_roots();
  5900 
  5900 
       
  5901   purge_code_root_memory();
       
  5902 
  5901   if (g1_policy()->during_initial_mark_pause()) {
  5903   if (g1_policy()->during_initial_mark_pause()) {
  5902     // Reset the claim values set during marking the strong code roots
  5904     // Reset the claim values set during marking the strong code roots
  5903     reset_heap_region_claim_values();
  5905     reset_heap_region_claim_values();
  5904   }
  5906   }
  5905 
  5907 
  6772   collection_set_iterate(&cl);
  6774   collection_set_iterate(&cl);
  6773   double migration_time_ms = (os::elapsedTime() - migrate_start) * 1000.0;
  6775   double migration_time_ms = (os::elapsedTime() - migrate_start) * 1000.0;
  6774   g1_policy()->phase_times()->record_strong_code_root_migration_time(migration_time_ms);
  6776   g1_policy()->phase_times()->record_strong_code_root_migration_time(migration_time_ms);
  6775 }
  6777 }
  6776 
  6778 
       
  6779 void G1CollectedHeap::purge_code_root_memory() {
       
  6780   double purge_start = os::elapsedTime();
       
  6781   G1CodeRootSet::purge_chunks(G1CodeRootsChunkCacheKeepPercent);
       
  6782   double purge_time_ms = (os::elapsedTime() - purge_start) * 1000.0;
       
  6783   g1_policy()->phase_times()->record_strong_code_root_purge_time(purge_time_ms);
       
  6784 }
       
  6785 
  6777 // Mark all the code roots that point into regions *not* in the
  6786 // Mark all the code roots that point into regions *not* in the
  6778 // collection set.
  6787 // collection set.
  6779 //
  6788 //
  6780 // Note we do not want to use a "marking" CodeBlobToOopClosure while
  6789 // Note we do not want to use a "marking" CodeBlobToOopClosure while
  6781 // walking the the code roots lists of regions not in the collection
  6790 // walking the the code roots lists of regions not in the collection
  6842     HeapRegionRemSet* hrrs = hr->rem_set();
  6851     HeapRegionRemSet* hrrs = hr->rem_set();
  6843     if (hr->continuesHumongous()) {
  6852     if (hr->continuesHumongous()) {
  6844       // Code roots should never be attached to a continuation of a humongous region
  6853       // Code roots should never be attached to a continuation of a humongous region
  6845       assert(hrrs->strong_code_roots_list_length() == 0,
  6854       assert(hrrs->strong_code_roots_list_length() == 0,
  6846              err_msg("code roots should never be attached to continuations of humongous region "HR_FORMAT
  6855              err_msg("code roots should never be attached to continuations of humongous region "HR_FORMAT
  6847                      " starting at "HR_FORMAT", but has "INT32_FORMAT,
  6856                      " starting at "HR_FORMAT", but has "SIZE_FORMAT,
  6848                      HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()),
  6857                      HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()),
  6849                      hrrs->strong_code_roots_list_length()));
  6858                      hrrs->strong_code_roots_list_length()));
  6850       return false;
  6859       return false;
  6851     }
  6860     }
  6852 
  6861