Mercurial > hg > graal-compiler
comparison src/share/vm/memory/defNewGeneration.cpp @ 11973:7b06ae405d7b
6990419: CMS Remaining work for 6572569: consistently skewed work distribution in (long) re-mark pauses
Reviewed-by: rasbold, tschatzl, jmasa
Contributed-by: yamauchi@google.com
author | jmasa |
---|---|
date | Tue, 23 Jul 2013 09:49:11 -0700 |
parents | 71180a6e5080 |
children | 330dfb0476f4 |
comparison
equal
deleted
inserted
replaced
11135:2285b4a0a4e6 | 11973:7b06ae405d7b |
---|---|
1031 // We try to allocate from the eden. If that works, we are happy. | 1031 // We try to allocate from the eden. If that works, we are happy. |
1032 // Note that since DefNewGeneration supports lock-free allocation, we | 1032 // Note that since DefNewGeneration supports lock-free allocation, we |
1033 // have to use it here, as well. | 1033 // have to use it here, as well. |
1034 HeapWord* result = eden()->par_allocate(word_size); | 1034 HeapWord* result = eden()->par_allocate(word_size); |
1035 if (result != NULL) { | 1035 if (result != NULL) { |
1036 if (CMSEdenChunksRecordAlways && _next_gen != NULL) { | |
1037 _next_gen->sample_eden_chunk(); | |
1038 } | |
1036 return result; | 1039 return result; |
1037 } | 1040 } |
1038 do { | 1041 do { |
1039 HeapWord* old_limit = eden()->soft_end(); | 1042 HeapWord* old_limit = eden()->soft_end(); |
1040 if (old_limit < eden()->end()) { | 1043 if (old_limit < eden()->end()) { |
1061 // out of heap space, and we try to allocate the from-space, too. | 1064 // out of heap space, and we try to allocate the from-space, too. |
1062 // allocate_from_space can't be inlined because that would introduce a | 1065 // allocate_from_space can't be inlined because that would introduce a |
1063 // circular dependency at compile time. | 1066 // circular dependency at compile time. |
1064 if (result == NULL) { | 1067 if (result == NULL) { |
1065 result = allocate_from_space(word_size); | 1068 result = allocate_from_space(word_size); |
1069 } else if (CMSEdenChunksRecordAlways && _next_gen != NULL) { | |
1070 _next_gen->sample_eden_chunk(); | |
1066 } | 1071 } |
1067 return result; | 1072 return result; |
1068 } | 1073 } |
1069 | 1074 |
1070 HeapWord* DefNewGeneration::par_allocate(size_t word_size, | 1075 HeapWord* DefNewGeneration::par_allocate(size_t word_size, |
1071 bool is_tlab) { | 1076 bool is_tlab) { |
1072 return eden()->par_allocate(word_size); | 1077 HeapWord* res = eden()->par_allocate(word_size); |
1078 if (CMSEdenChunksRecordAlways && _next_gen != NULL) { | |
1079 _next_gen->sample_eden_chunk(); | |
1080 } | |
1081 return res; | |
1073 } | 1082 } |
1074 | 1083 |
1075 void DefNewGeneration::gc_prologue(bool full) { | 1084 void DefNewGeneration::gc_prologue(bool full) { |
1076 // Ensure that _end and _soft_end are the same in eden space. | 1085 // Ensure that _end and _soft_end are the same in eden space. |
1077 eden()->set_soft_end(eden()->end()); | 1086 eden()->set_soft_end(eden()->end()); |