Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 17753:191174b49bec
8035406: Improve data structure for Code Cache remembered sets
Summary: Change the code cache remembered sets data structure from a GrowableArray to a chunked list of nmethods. This makes the data structure more amenable to parallelization, and decreases freeing time.
Reviewed-by: mgerdin, brutisso
author | tschatzl |
---|---|
date | Mon, 24 Mar 2014 15:30:14 +0100 |
parents | b7e42ada4898 |
children | 96b1c2e06e25 |
comparison
equal
deleted
inserted
replaced
17750:f53edbc2b728 | 17753:191174b49bec |
---|---|
5932 // the collection set. Ideally we would like to do this | 5932 // the collection set. Ideally we would like to do this |
5933 // after we have finished the scanning/evacuation of the | 5933 // after we have finished the scanning/evacuation of the |
5934 // strong code roots for a particular heap region. | 5934 // strong code roots for a particular heap region. |
5935 migrate_strong_code_roots(); | 5935 migrate_strong_code_roots(); |
5936 | 5936 |
5937 purge_code_root_memory(); | |
5938 | |
5937 if (g1_policy()->during_initial_mark_pause()) { | 5939 if (g1_policy()->during_initial_mark_pause()) { |
5938 // Reset the claim values set during marking the strong code roots | 5940 // Reset the claim values set during marking the strong code roots |
5939 reset_heap_region_claim_values(); | 5941 reset_heap_region_claim_values(); |
5940 } | 5942 } |
5941 | 5943 |
6808 collection_set_iterate(&cl); | 6810 collection_set_iterate(&cl); |
6809 double migration_time_ms = (os::elapsedTime() - migrate_start) * 1000.0; | 6811 double migration_time_ms = (os::elapsedTime() - migrate_start) * 1000.0; |
6810 g1_policy()->phase_times()->record_strong_code_root_migration_time(migration_time_ms); | 6812 g1_policy()->phase_times()->record_strong_code_root_migration_time(migration_time_ms); |
6811 } | 6813 } |
6812 | 6814 |
6815 void G1CollectedHeap::purge_code_root_memory() { | |
6816 double purge_start = os::elapsedTime(); | |
6817 G1CodeRootSet::purge_chunks(G1CodeRootsChunkCacheKeepPercent); | |
6818 double purge_time_ms = (os::elapsedTime() - purge_start) * 1000.0; | |
6819 g1_policy()->phase_times()->record_strong_code_root_purge_time(purge_time_ms); | |
6820 } | |
6821 | |
6813 // Mark all the code roots that point into regions *not* in the | 6822 // Mark all the code roots that point into regions *not* in the |
6814 // collection set. | 6823 // collection set. |
6815 // | 6824 // |
6816 // Note we do not want to use a "marking" CodeBlobToOopClosure while | 6825 // Note we do not want to use a "marking" CodeBlobToOopClosure while |
6817 // walking the the code roots lists of regions not in the collection | 6826 // walking the the code roots lists of regions not in the collection |
6878 HeapRegionRemSet* hrrs = hr->rem_set(); | 6887 HeapRegionRemSet* hrrs = hr->rem_set(); |
6879 if (hr->continuesHumongous()) { | 6888 if (hr->continuesHumongous()) { |
6880 // Code roots should never be attached to a continuation of a humongous region | 6889 // Code roots should never be attached to a continuation of a humongous region |
6881 assert(hrrs->strong_code_roots_list_length() == 0, | 6890 assert(hrrs->strong_code_roots_list_length() == 0, |
6882 err_msg("code roots should never be attached to continuations of humongous region "HR_FORMAT | 6891 err_msg("code roots should never be attached to continuations of humongous region "HR_FORMAT |
6883 " starting at "HR_FORMAT", but has "INT32_FORMAT, | 6892 " starting at "HR_FORMAT", but has "SIZE_FORMAT, |
6884 HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()), | 6893 HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()), |
6885 hrrs->strong_code_roots_list_length())); | 6894 hrrs->strong_code_roots_list_length())); |
6886 return false; | 6895 return false; |
6887 } | 6896 } |
6888 | 6897 |