comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 3986:65a8ff39a6da

7095194: G1: HeapRegion::GrainBytes, GrainWords, and CardsPerRegion should be size_t Summary: Declare GrainBytes, GrainWords, and CardsPerRegion as size_t. Reviewed-by: jcoomes, tonyp, jmasa
author johnc
date Wed, 05 Oct 2011 08:44:10 -0700
parents 811ec3d0833b
children 074f0252cc13
comparison
equal deleted inserted replaced
3985:c63b928b212b 3986:65a8ff39a6da
550 } 550 }
551 return NULL; 551 return NULL;
552 } 552 }
553 553
554 HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool do_expand) { 554 HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool do_expand) {
555 assert(!isHumongous(word_size) || 555 assert(!isHumongous(word_size) || word_size <= HeapRegion::GrainWords,
556 word_size <= (size_t) HeapRegion::GrainWords,
557 "the only time we use this to allocate a humongous region is " 556 "the only time we use this to allocate a humongous region is "
558 "when we are allocating a single humongous region"); 557 "when we are allocating a single humongous region");
559 558
560 HeapRegion* res; 559 HeapRegion* res;
561 if (G1StressConcRegionFreeing) { 560 if (G1StressConcRegionFreeing) {
1168 // We only generate output for non-empty regions. 1167 // We only generate output for non-empty regions.
1169 if (!hr->is_empty()) { 1168 if (!hr->is_empty()) {
1170 if (!hr->isHumongous()) { 1169 if (!hr->isHumongous()) {
1171 _hr_printer->post_compaction(hr, G1HRPrinter::Old); 1170 _hr_printer->post_compaction(hr, G1HRPrinter::Old);
1172 } else if (hr->startsHumongous()) { 1171 } else if (hr->startsHumongous()) {
1173 if (hr->capacity() == (size_t) HeapRegion::GrainBytes) { 1172 if (hr->capacity() == HeapRegion::GrainBytes) {
1174 // single humongous region 1173 // single humongous region
1175 _hr_printer->post_compaction(hr, G1HRPrinter::SingleHumongous); 1174 _hr_printer->post_compaction(hr, G1HRPrinter::SingleHumongous);
1176 } else { 1175 } else {
1177 _hr_printer->post_compaction(hr, G1HRPrinter::StartsHumongous); 1176 _hr_printer->post_compaction(hr, G1HRPrinter::StartsHumongous);
1178 } 1177 }
1969 const size_t max_region_idx = ((size_t)1 << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1; 1968 const size_t max_region_idx = ((size_t)1 << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1;
1970 guarantee((max_regions() - 1) <= max_region_idx, "too many regions"); 1969 guarantee((max_regions() - 1) <= max_region_idx, "too many regions");
1971 1970
1972 size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1; 1971 size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
1973 guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized"); 1972 guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized");
1974 guarantee((size_t) HeapRegion::CardsPerRegion < max_cards_per_region, 1973 guarantee(HeapRegion::CardsPerRegion < max_cards_per_region,
1975 "too many cards per region"); 1974 "too many cards per region");
1976 1975
1977 HeapRegionSet::set_unrealistically_long_length(max_regions() + 1); 1976 HeapRegionSet::set_unrealistically_long_length(max_regions() + 1);
1978 1977
1979 _bot_shared = new G1BlockOffsetSharedArray(_reserved, 1978 _bot_shared = new G1BlockOffsetSharedArray(_reserved,
3049 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", 3048 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
3050 _g1_storage.low_boundary(), 3049 _g1_storage.low_boundary(),
3051 _g1_storage.high(), 3050 _g1_storage.high(),
3052 _g1_storage.high_boundary()); 3051 _g1_storage.high_boundary());
3053 st->cr(); 3052 st->cr();
3054 st->print(" region size " SIZE_FORMAT "K, ", 3053 st->print(" region size " SIZE_FORMAT "K, ", HeapRegion::GrainBytes / K);
3055 HeapRegion::GrainBytes/K);
3056 size_t young_regions = _young_list->length(); 3054 size_t young_regions = _young_list->length();
3057 st->print(SIZE_FORMAT " young (" SIZE_FORMAT "K), ", 3055 st->print(SIZE_FORMAT " young (" SIZE_FORMAT "K), ",
3058 young_regions, young_regions * HeapRegion::GrainBytes / K); 3056 young_regions, young_regions * HeapRegion::GrainBytes / K);
3059 size_t survivor_regions = g1_policy()->recorded_survivor_regions(); 3057 size_t survivor_regions = g1_policy()->recorded_survivor_regions();
3060 st->print(SIZE_FORMAT " survivors (" SIZE_FORMAT "K)", 3058 st->print(SIZE_FORMAT " survivors (" SIZE_FORMAT "K)",