4024
4025 workers()->run_task(&g1_par_task);
4026 end_par_time_sec = os::elapsedTime();
4027
4028 // Closing the inner scope will execute the destructor
4029 // for the G1RootProcessor object. We record the current
4030 // elapsed time before closing the scope so that time
4031 // taken for the destructor is NOT included in the
4032 // reported parallel time.
4033 }
4034
4035 double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
4036 phase_times->record_par_time(par_time_ms);
4037
4038 double code_root_fixup_time_ms =
4039 (os::elapsedTime() - end_par_time_sec) * 1000.0;
4040 phase_times->record_code_root_fixup_time(code_root_fixup_time_ms);
4041 }
4042
4043 void G1CollectedHeap::post_evacuate_collection_set(EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* per_thread_states) {
4044 // Process any discovered reference objects - we have
4045 // to do this _before_ we retire the GC alloc regions
4046 // as we may have to copy some 'reachable' referent
4047 // objects (and their reachable sub-graphs) that were
4048 // not copied during the pause.
4049 process_discovered_references(per_thread_states);
4050
4051 G1STWIsAliveClosure is_alive(this);
4052 G1KeepAliveClosure keep_alive(this);
4053
4054 {
4055 double start = os::elapsedTime();
4056
4057 WeakProcessor::weak_oops_do(&is_alive, &keep_alive);
4058
4059 double time_ms = (os::elapsedTime() - start) * 1000.0;
4060 g1_policy()->phase_times()->record_weak_ref_proc_time(time_ms);
4061 }
4062
4063 if (G1StringDedup::is_enabled()) {
4064 double fixup_start = os::elapsedTime();
4065
4066 G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, g1_policy()->phase_times());
4067
4068 double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
4069 g1_policy()->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
4070 }
4071
4072 g1_rem_set()->cleanup_after_oops_into_collection_set_do();
4073
4074 if (evacuation_failed()) {
4075 restore_after_evac_failure();
4076
4077 // Reset the G1EvacuationFailureALot counters and flags
4078 // Note: the values are reset only when an actual
4079 // evacuation failure occurs.
4080 NOT_PRODUCT(reset_evacuation_should_fail();)
4081 }
4082
4083 _preserved_marks_set.assert_empty();
4084
4085 // Enqueue any remaining references remaining on the STW
4086 // reference processor's discovered lists. We need to do
4087 // this after the card table is cleaned (and verified) as
4088 // the act of enqueueing entries on to the pending list
4089 // will log these updates (and dirty their associated
4090 // cards). We need these updates logged to update any
4091 // RSets.
4092 enqueue_discovered_references(per_thread_states);
4093
4094 _allocator->release_gc_alloc_regions(evacuation_info);
4095
4096 merge_per_thread_state_info(per_thread_states);
4097
4098 // Reset and re-enable the hot card cache.
4099 // Note the counts for the cards in the regions in the
4100 // collection set are reset when the collection set is freed.
4101 _hot_card_cache->reset_hot_cache();
4102 _hot_card_cache->set_use_cache(true);
4103
4104 purge_code_root_memory();
4105
4106 redirty_logged_cards();
4107 #if COMPILER2_OR_JVMCI
4108 double start = os::elapsedTime();
4109 DerivedPointerTable::update_pointers();
4110 g1_policy()->phase_times()->record_derived_pointer_table_update_time((os::elapsedTime() - start) * 1000.0);
4111 #endif
4112 g1_policy()->print_age_table();
|
4024
4025 workers()->run_task(&g1_par_task);
4026 end_par_time_sec = os::elapsedTime();
4027
4028 // Closing the inner scope will execute the destructor
4029 // for the G1RootProcessor object. We record the current
4030 // elapsed time before closing the scope so that time
4031 // taken for the destructor is NOT included in the
4032 // reported parallel time.
4033 }
4034
4035 double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
4036 phase_times->record_par_time(par_time_ms);
4037
4038 double code_root_fixup_time_ms =
4039 (os::elapsedTime() - end_par_time_sec) * 1000.0;
4040 phase_times->record_code_root_fixup_time(code_root_fixup_time_ms);
4041 }
4042
4043 void G1CollectedHeap::post_evacuate_collection_set(EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* per_thread_states) {
4044 // Also cleans the card table from temporary duplicate detection information used
4045 // during UpdateRS/ScanRS.
4046 g1_rem_set()->cleanup_after_oops_into_collection_set_do();
4047
4048 // Process any discovered reference objects - we have
4049 // to do this _before_ we retire the GC alloc regions
4050 // as we may have to copy some 'reachable' referent
4051 // objects (and their reachable sub-graphs) that were
4052 // not copied during the pause.
4053 process_discovered_references(per_thread_states);
4054 enqueue_discovered_references(per_thread_states);
4055
4056 G1STWIsAliveClosure is_alive(this);
4057 G1KeepAliveClosure keep_alive(this);
4058
4059 {
4060 double start = os::elapsedTime();
4061
4062 WeakProcessor::weak_oops_do(&is_alive, &keep_alive);
4063
4064 double time_ms = (os::elapsedTime() - start) * 1000.0;
4065 g1_policy()->phase_times()->record_weak_ref_proc_time(time_ms);
4066 }
4067
4068 if (G1StringDedup::is_enabled()) {
4069 double fixup_start = os::elapsedTime();
4070
4071 G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, g1_policy()->phase_times());
4072
4073 double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
4074 g1_policy()->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
4075 }
4076
4077 if (evacuation_failed()) {
4078 restore_after_evac_failure();
4079
4080 // Reset the G1EvacuationFailureALot counters and flags
4081 // Note: the values are reset only when an actual
4082 // evacuation failure occurs.
4083 NOT_PRODUCT(reset_evacuation_should_fail();)
4084 }
4085
4086 _preserved_marks_set.assert_empty();
4087
4088 _allocator->release_gc_alloc_regions(evacuation_info);
4089
4090 merge_per_thread_state_info(per_thread_states);
4091
4092 // Reset and re-enable the hot card cache.
4093 // Note the counts for the cards in the regions in the
4094 // collection set are reset when the collection set is freed.
4095 _hot_card_cache->reset_hot_cache();
4096 _hot_card_cache->set_use_cache(true);
4097
4098 purge_code_root_memory();
4099
4100 redirty_logged_cards();
4101 #if COMPILER2_OR_JVMCI
4102 double start = os::elapsedTime();
4103 DerivedPointerTable::update_pointers();
4104 g1_policy()->phase_times()->record_derived_pointer_table_update_time((os::elapsedTime() - start) * 1000.0);
4105 #endif
4106 g1_policy()->print_age_table();
|