comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @ 362:f8199438385b

Merge
author apetrusenko
date Wed, 17 Sep 2008 16:49:18 +0400
parents 5d254928c888
children e9be0e04635a
comparison
equal deleted inserted replaced
316:5fa96a5a7e76 362:f8199438385b
788 } 788 }
789 return NULL; 789 return NULL;
790 } 790 }
791 791
792 792
793 HeapWord* CompactibleFreeListSpace::block_start(const void* p) const { 793 HeapWord* CompactibleFreeListSpace::block_start_const(const void* p) const {
794 NOT_PRODUCT(verify_objects_initialized()); 794 NOT_PRODUCT(verify_objects_initialized());
795 return _bt.block_start(p); 795 return _bt.block_start(p);
796 } 796 }
797 797
798 HeapWord* CompactibleFreeListSpace::block_start_careful(const void* p) const { 798 HeapWord* CompactibleFreeListSpace::block_start_careful(const void* p) const {
2284 verifyIndexedFreeList(i); 2284 verifyIndexedFreeList(i);
2285 } 2285 }
2286 } 2286 }
2287 2287
2288 void CompactibleFreeListSpace::verifyIndexedFreeList(size_t size) const { 2288 void CompactibleFreeListSpace::verifyIndexedFreeList(size_t size) const {
2289 guarantee(size % 2 == 0, "Odd slots should be empty"); 2289 FreeChunk* fc = _indexedFreeList[size].head();
2290 for (FreeChunk* fc = _indexedFreeList[size].head(); fc != NULL; 2290 guarantee((size % 2 == 0) || fc == NULL, "Odd slots should be empty");
2291 fc = fc->next()) { 2291 for (; fc != NULL; fc = fc->next()) {
2292 guarantee(fc->size() == size, "Size inconsistency"); 2292 guarantee(fc->size() == size, "Size inconsistency");
2293 guarantee(fc->isFree(), "!free?"); 2293 guarantee(fc->isFree(), "!free?");
2294 guarantee(fc->next() == NULL || fc->next()->prev() == fc, "Broken list"); 2294 guarantee(fc->next() == NULL || fc->next()->prev() == fc, "Broken list");
2295 } 2295 }
2296 } 2296 }
2788 initialize_sequential_subtasks_for_rescan(int n_threads) { 2788 initialize_sequential_subtasks_for_rescan(int n_threads) {
2789 // The "size" of each task is fixed according to rescan_task_size. 2789 // The "size" of each task is fixed according to rescan_task_size.
2790 assert(n_threads > 0, "Unexpected n_threads argument"); 2790 assert(n_threads > 0, "Unexpected n_threads argument");
2791 const size_t task_size = rescan_task_size(); 2791 const size_t task_size = rescan_task_size();
2792 size_t n_tasks = (used_region().word_size() + task_size - 1)/task_size; 2792 size_t n_tasks = (used_region().word_size() + task_size - 1)/task_size;
2793 assert((used_region().start() + (n_tasks - 1)*task_size < 2793 assert((n_tasks == 0) == used_region().is_empty(), "n_tasks incorrect");
2794 used_region().end()) && 2794 assert(n_tasks == 0 ||
2795 (used_region().start() + n_tasks*task_size >= 2795 ((used_region().start() + (n_tasks - 1)*task_size < used_region().end()) &&
2796 used_region().end()), "n_task calculation incorrect"); 2796 (used_region().start() + n_tasks*task_size >= used_region().end())),
2797 "n_tasks calculation incorrect");
2797 SequentialSubTasksDone* pst = conc_par_seq_tasks(); 2798 SequentialSubTasksDone* pst = conc_par_seq_tasks();
2798 assert(!pst->valid(), "Clobbering existing data?"); 2799 assert(!pst->valid(), "Clobbering existing data?");
2799 pst->set_par_threads(n_threads); 2800 pst->set_par_threads(n_threads);
2800 pst->set_n_tasks((int)n_tasks); 2801 pst->set_n_tasks((int)n_tasks);
2801 } 2802 }
2831 size_t n_tasks = (span.word_size() + task_size - 1)/task_size; 2832 size_t n_tasks = (span.word_size() + task_size - 1)/task_size;
2832 assert((n_tasks == 0) == span.is_empty(), "Inconsistency"); 2833 assert((n_tasks == 0) == span.is_empty(), "Inconsistency");
2833 assert(n_tasks == 0 || 2834 assert(n_tasks == 0 ||
2834 ((span.start() + (n_tasks - 1)*task_size < span.end()) && 2835 ((span.start() + (n_tasks - 1)*task_size < span.end()) &&
2835 (span.start() + n_tasks*task_size >= span.end())), 2836 (span.start() + n_tasks*task_size >= span.end())),
2836 "n_task calculation incorrect"); 2837 "n_tasks calculation incorrect");
2837 SequentialSubTasksDone* pst = conc_par_seq_tasks(); 2838 SequentialSubTasksDone* pst = conc_par_seq_tasks();
2838 assert(!pst->valid(), "Clobbering existing data?"); 2839 assert(!pst->valid(), "Clobbering existing data?");
2839 pst->set_par_threads(n_threads); 2840 pst->set_par_threads(n_threads);
2840 pst->set_n_tasks((int)n_tasks); 2841 pst->set_n_tasks((int)n_tasks);
2841 } 2842 }