comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 12116:1624a68007bd

Merge
author jmasa
date Tue, 27 Aug 2013 18:55:33 -0700
parents 4c84d351cca9 f7d3b4387a16
children f175e3678be2
comparison
equal deleted inserted replaced
12111:21ffbaa691b5 12116:1624a68007bd
979 } 979 }
980 } 980 }
981 981
982 if (should_try_gc) { 982 if (should_try_gc) {
983 bool succeeded; 983 bool succeeded;
984 result = do_collection_pause(word_size, gc_count_before, &succeeded); 984 result = do_collection_pause(word_size, gc_count_before, &succeeded,
985 GCCause::_g1_inc_collection_pause);
985 if (result != NULL) { 986 if (result != NULL) {
986 assert(succeeded, "only way to get back a non-NULL result"); 987 assert(succeeded, "only way to get back a non-NULL result");
987 return result; 988 return result;
988 } 989 }
989 990
1104 // If we failed to allocate the humongous object, we should try to 1105 // If we failed to allocate the humongous object, we should try to
1105 // do a collection pause (if we're allowed) in case it reclaims 1106 // do a collection pause (if we're allowed) in case it reclaims
1106 // enough space for the allocation to succeed after the pause. 1107 // enough space for the allocation to succeed after the pause.
1107 1108
1108 bool succeeded; 1109 bool succeeded;
1109 result = do_collection_pause(word_size, gc_count_before, &succeeded); 1110 result = do_collection_pause(word_size, gc_count_before, &succeeded,
1111 GCCause::_g1_humongous_allocation);
1110 if (result != NULL) { 1112 if (result != NULL) {
1111 assert(succeeded, "only way to get back a non-NULL result"); 1113 assert(succeeded, "only way to get back a non-NULL result");
1112 return result; 1114 return result;
1113 } 1115 }
1114 1116
3696 Universe::update_heap_info_at_gc(); 3698 Universe::update_heap_info_at_gc();
3697 } 3699 }
3698 3700
3699 HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size, 3701 HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size,
3700 unsigned int gc_count_before, 3702 unsigned int gc_count_before,
3701 bool* succeeded) { 3703 bool* succeeded,
3704 GCCause::Cause gc_cause) {
3702 assert_heap_not_locked_and_not_at_safepoint(); 3705 assert_heap_not_locked_and_not_at_safepoint();
3703 g1_policy()->record_stop_world_start(); 3706 g1_policy()->record_stop_world_start();
3704 VM_G1IncCollectionPause op(gc_count_before, 3707 VM_G1IncCollectionPause op(gc_count_before,
3705 word_size, 3708 word_size,
3706 false, /* should_initiate_conc_mark */ 3709 false, /* should_initiate_conc_mark */
3707 g1_policy()->max_pause_time_ms(), 3710 g1_policy()->max_pause_time_ms(),
3708 GCCause::_g1_inc_collection_pause); 3711 gc_cause);
3709 VMThread::execute(&op); 3712 VMThread::execute(&op);
3710 3713
3711 HeapWord* result = op.result(); 3714 HeapWord* result = op.result();
3712 bool ret_succeeded = op.prologue_succeeded() && op.pause_succeeded(); 3715 bool ret_succeeded = op.prologue_succeeded() && op.pause_succeeded();
3713 assert(result == NULL || ret_succeeded, 3716 assert(result == NULL || ret_succeeded,