Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @ 12088:cb9da55b1990
8021809: Partitioning based on eden sampling during allocation not reset correctly
Reviewed-by: ysr, hiroshi
author | jmasa |
---|---|
date | Wed, 14 Aug 2013 19:52:16 -0700 |
parents | 9766f73e770d |
children | 1bb10d3170fa |
comparison
equal
deleted
inserted
replaced
12087:61521bd65100 | 12088:cb9da55b1990 |
---|---|
5476 | 5476 |
5477 ResourceMark rm; | 5477 ResourceMark rm; |
5478 HandleMark hm; | 5478 HandleMark hm; |
5479 | 5479 |
5480 SequentialSubTasksDone* pst = space->par_seq_tasks(); | 5480 SequentialSubTasksDone* pst = space->par_seq_tasks(); |
5481 assert(pst->valid(), "Uninitialized use?"); | |
5482 | 5481 |
5483 uint nth_task = 0; | 5482 uint nth_task = 0; |
5484 uint n_tasks = pst->n_tasks(); | 5483 uint n_tasks = pst->n_tasks(); |
5485 | 5484 |
5486 HeapWord *start, *end; | 5485 if (n_tasks > 0) { |
5487 while (!pst->is_task_claimed(/* reference */ nth_task)) { | 5486 assert(pst->valid(), "Uninitialized use?"); |
5488 // We claimed task # nth_task; compute its boundaries. | 5487 HeapWord *start, *end; |
5489 if (chunk_top == 0) { // no samples were taken | 5488 while (!pst->is_task_claimed(/* reference */ nth_task)) { |
5490 assert(nth_task == 0 && n_tasks == 1, "Can have only 1 EdenSpace task"); | 5489 // We claimed task # nth_task; compute its boundaries. |
5491 start = space->bottom(); | 5490 if (chunk_top == 0) { // no samples were taken |
5492 end = space->top(); | 5491 assert(nth_task == 0 && n_tasks == 1, "Can have only 1 EdenSpace task"); |
5493 } else if (nth_task == 0) { | 5492 start = space->bottom(); |
5494 start = space->bottom(); | 5493 end = space->top(); |
5495 end = chunk_array[nth_task]; | 5494 } else if (nth_task == 0) { |
5496 } else if (nth_task < (uint)chunk_top) { | 5495 start = space->bottom(); |
5497 assert(nth_task >= 1, "Control point invariant"); | 5496 end = chunk_array[nth_task]; |
5498 start = chunk_array[nth_task - 1]; | 5497 } else if (nth_task < (uint)chunk_top) { |
5499 end = chunk_array[nth_task]; | 5498 assert(nth_task >= 1, "Control point invariant"); |
5500 } else { | 5499 start = chunk_array[nth_task - 1]; |
5501 assert(nth_task == (uint)chunk_top, "Control point invariant"); | 5500 end = chunk_array[nth_task]; |
5502 start = chunk_array[chunk_top - 1]; | 5501 } else { |
5503 end = space->top(); | 5502 assert(nth_task == (uint)chunk_top, "Control point invariant"); |
5504 } | 5503 start = chunk_array[chunk_top - 1]; |
5505 MemRegion mr(start, end); | 5504 end = space->top(); |
5506 // Verify that mr is in space | 5505 } |
5507 assert(mr.is_empty() || space->used_region().contains(mr), | 5506 MemRegion mr(start, end); |
5508 "Should be in space"); | 5507 // Verify that mr is in space |
5509 // Verify that "start" is an object boundary | 5508 assert(mr.is_empty() || space->used_region().contains(mr), |
5510 assert(mr.is_empty() || oop(mr.start())->is_oop(), | 5509 "Should be in space"); |
5511 "Should be an oop"); | 5510 // Verify that "start" is an object boundary |
5512 space->par_oop_iterate(mr, cl); | 5511 assert(mr.is_empty() || oop(mr.start())->is_oop(), |
5513 } | 5512 "Should be an oop"); |
5514 pst->all_tasks_completed(); | 5513 space->par_oop_iterate(mr, cl); |
5514 } | |
5515 pst->all_tasks_completed(); | |
5516 } | |
5515 } | 5517 } |
5516 | 5518 |
5517 void | 5519 void |
5518 CMSParRemarkTask::do_dirty_card_rescan_tasks( | 5520 CMSParRemarkTask::do_dirty_card_rescan_tasks( |
5519 CompactibleFreeListSpace* sp, int i, | 5521 CompactibleFreeListSpace* sp, int i, |
5786 initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) { | 5788 initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) { |
5787 assert(n_threads > 0, "Unexpected n_threads argument"); | 5789 assert(n_threads > 0, "Unexpected n_threads argument"); |
5788 DefNewGeneration* dng = (DefNewGeneration*)_young_gen; | 5790 DefNewGeneration* dng = (DefNewGeneration*)_young_gen; |
5789 | 5791 |
5790 // Eden space | 5792 // Eden space |
5791 { | 5793 if (!dng->eden()->is_empty()) { |
5792 SequentialSubTasksDone* pst = dng->eden()->par_seq_tasks(); | 5794 SequentialSubTasksDone* pst = dng->eden()->par_seq_tasks(); |
5793 assert(!pst->valid(), "Clobbering existing data?"); | 5795 assert(!pst->valid(), "Clobbering existing data?"); |
5794 // Each valid entry in [0, _eden_chunk_index) represents a task. | 5796 // Each valid entry in [0, _eden_chunk_index) represents a task. |
5795 size_t n_tasks = _eden_chunk_index + 1; | 5797 size_t n_tasks = _eden_chunk_index + 1; |
5796 assert(n_tasks == 1 || _eden_chunk_array != NULL, "Error"); | 5798 assert(n_tasks == 1 || _eden_chunk_array != NULL, "Error"); |