Mercurial > hg > truffle
comparison src/share/vm/memory/cardTableModRefBS.cpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | 8a9bb7821e28 |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14520:f84115370178 | 14521:29ccc4cbabca |
---|---|
52 } | 52 } |
53 | 53 |
54 size_t CardTableModRefBS::compute_byte_map_size() | 54 size_t CardTableModRefBS::compute_byte_map_size() |
55 { | 55 { |
56 assert(_guard_index == cards_required(_whole_heap.word_size()) - 1, | 56 assert(_guard_index == cards_required(_whole_heap.word_size()) - 1, |
57 "unitialized, check declaration order"); | 57 "uninitialized, check declaration order"); |
58 assert(_page_size != 0, "unitialized, check declaration order"); | 58 assert(_page_size != 0, "uninitialized, check declaration order"); |
59 const size_t granularity = os::vm_allocation_granularity(); | 59 const size_t granularity = os::vm_allocation_granularity(); |
60 return align_size_up(_guard_index + 1, MAX2(_page_size, granularity)); | 60 return align_size_up(_guard_index + 1, MAX2(_page_size, granularity)); |
61 } | 61 } |
62 | 62 |
63 CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, | 63 CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, |
96 if (!heap_rs.is_reserved()) { | 96 if (!heap_rs.is_reserved()) { |
97 vm_exit_during_initialization("Could not reserve enough space for the " | 97 vm_exit_during_initialization("Could not reserve enough space for the " |
98 "card marking array"); | 98 "card marking array"); |
99 } | 99 } |
100 | 100 |
101 // The assember store_check code will do an unsigned shift of the oop, | 101 // The assembler store_check code will do an unsigned shift of the oop, |
102 // then add it to byte_map_base, i.e. | 102 // then add it to byte_map_base, i.e. |
103 // | 103 // |
104 // _byte_map = byte_map_base + (uintptr_t(low_bound) >> card_shift) | 104 // _byte_map = byte_map_base + (uintptr_t(low_bound) >> card_shift) |
105 _byte_map = (jbyte*) heap_rs.base(); | 105 _byte_map = (jbyte*) heap_rs.base(); |
106 byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift); | 106 byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift); |
241 MemRegion const old_region = _covered[ind]; | 241 MemRegion const old_region = _covered[ind]; |
242 assert(old_region.start() == new_region.start(), "just checking"); | 242 assert(old_region.start() == new_region.start(), "just checking"); |
243 if (new_region.word_size() != old_region.word_size()) { | 243 if (new_region.word_size() != old_region.word_size()) { |
244 // Commit new or uncommit old pages, if necessary. | 244 // Commit new or uncommit old pages, if necessary. |
245 MemRegion cur_committed = _committed[ind]; | 245 MemRegion cur_committed = _committed[ind]; |
246 // Extend the end of this _commited region | 246 // Extend the end of this _committed region |
247 // to cover the end of any lower _committed regions. | 247 // to cover the end of any lower _committed regions. |
248 // This forms overlapping regions, but never interior regions. | 248 // This forms overlapping regions, but never interior regions. |
249 HeapWord* const max_prev_end = largest_prev_committed_end(ind); | 249 HeapWord* const max_prev_end = largest_prev_committed_end(ind); |
250 if (max_prev_end > cur_committed.end()) { | 250 if (max_prev_end > cur_committed.end()) { |
251 cur_committed.set_end(max_prev_end); | 251 cur_committed.set_end(max_prev_end); |
417 } | 417 } |
418 | 418 |
419 // Note that these versions are precise! The scanning code has to handle the | 419 // Note that these versions are precise! The scanning code has to handle the |
420 // fact that the write barrier may be either precise or imprecise. | 420 // fact that the write barrier may be either precise or imprecise. |
421 | 421 |
422 void CardTableModRefBS::write_ref_field_work(void* field, oop newVal) { | 422 void CardTableModRefBS::write_ref_field_work(void* field, oop newVal, bool release) { |
423 inline_write_ref_field(field, newVal); | 423 inline_write_ref_field(field, newVal, release); |
424 } | 424 } |
425 | 425 |
426 | 426 |
427 void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp, | 427 void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp, |
428 MemRegion mr, | 428 MemRegion mr, |
446 // setting n_par_threads to 0, then n_par_threads should be | 446 // setting n_par_threads to 0, then n_par_threads should be |
447 // equal to active_workers. When a different mechanism for shutting | 447 // equal to active_workers. When a different mechanism for shutting |
448 // off parallelism is used, then active_workers can be used in | 448 // off parallelism is used, then active_workers can be used in |
449 // place of n_par_threads. | 449 // place of n_par_threads. |
450 // This is an example of a path where n_par_threads is | 450 // This is an example of a path where n_par_threads is |
451 // set to 0 to turn off parallism. | 451 // set to 0 to turn off parallelism. |
452 // [7] CardTableModRefBS::non_clean_card_iterate() | 452 // [7] CardTableModRefBS::non_clean_card_iterate() |
453 // [8] CardTableRS::younger_refs_in_space_iterate() | 453 // [8] CardTableRS::younger_refs_in_space_iterate() |
454 // [9] Generation::younger_refs_in_space_iterate() | 454 // [9] Generation::younger_refs_in_space_iterate() |
455 // [10] OneContigSpaceCardGeneration::younger_refs_iterate() | 455 // [10] OneContigSpaceCardGeneration::younger_refs_iterate() |
456 // [11] CompactingPermGenGen::younger_refs_iterate() | 456 // [11] CompactingPermGenGen::younger_refs_iterate() |