Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 356:1ee8caae33af
Merge
author | tonyp |
---|---|
date | Thu, 21 Aug 2008 23:36:31 -0400 |
parents | 0edda524b58c |
children | ad8c8ca4ab0f |
comparison
equal
deleted
inserted
replaced
355:0edda524b58c | 356:1ee8caae33af |
---|---|
250 // treat all objects as being inside the unmarked area. | 250 // treat all objects as being inside the unmarked area. |
251 zero_marked_bytes(); | 251 zero_marked_bytes(); |
252 init_top_at_mark_start(); | 252 init_top_at_mark_start(); |
253 } | 253 } |
254 | 254 |
255 | |
256 | |
257 DirtyCardToOopClosure* | 255 DirtyCardToOopClosure* |
258 HeapRegion::new_dcto_closure(OopClosure* cl, | 256 HeapRegion::new_dcto_closure(OopClosure* cl, |
259 CardTableModRefBS::PrecisionStyle precision, | 257 CardTableModRefBS::PrecisionStyle precision, |
260 HeapRegionDCTOC::FilterKind fk) { | 258 HeapRegionDCTOC::FilterKind fk) { |
261 return new HeapRegionDCTOC(G1CollectedHeap::heap(), | 259 return new HeapRegionDCTOC(G1CollectedHeap::heap(), |
290 if ((uintptr_t)bottom() >= (uintptr_t)g1h->popular_object_boundary()) | 288 if ((uintptr_t)bottom() >= (uintptr_t)g1h->popular_object_boundary()) |
291 set_popular(false); | 289 set_popular(false); |
292 | 290 |
293 _offsets.resize(HeapRegion::GrainWords); | 291 _offsets.resize(HeapRegion::GrainWords); |
294 init_top_at_mark_start(); | 292 init_top_at_mark_start(); |
295 if (clear_space) clear(); | 293 if (clear_space) clear(SpaceDecorator::Mangle); |
296 } | 294 } |
297 | 295 |
298 // <PREDICTION> | 296 // <PREDICTION> |
299 void HeapRegion::calc_gc_efficiency() { | 297 void HeapRegion::calc_gc_efficiency() { |
300 G1CollectedHeap* g1h = G1CollectedHeap::heap(); | 298 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
350 | 348 |
351 void HeapRegion::set_on_unclean_list(bool b) { | 349 void HeapRegion::set_on_unclean_list(bool b) { |
352 _is_on_unclean_list = b; | 350 _is_on_unclean_list = b; |
353 } | 351 } |
354 | 352 |
355 void HeapRegion::initialize(MemRegion mr, bool clear_space) { | 353 void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) { |
356 G1OffsetTableContigSpace::initialize(mr, false); | 354 G1OffsetTableContigSpace::initialize(mr, false, mangle_space); |
357 hr_clear(false/*par*/, clear_space); | 355 hr_clear(false/*par*/, clear_space); |
358 } | 356 } |
359 #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away | 357 #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away |
360 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list | 358 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list |
361 #endif // _MSC_VER | 359 #endif // _MSC_VER |
379 _rem_set(NULL), _zfs(NotZeroFilled) | 377 _rem_set(NULL), _zfs(NotZeroFilled) |
380 { | 378 { |
381 _orig_end = mr.end(); | 379 _orig_end = mr.end(); |
382 // Note that initialize() will set the start of the unmarked area of the | 380 // Note that initialize() will set the start of the unmarked area of the |
383 // region. | 381 // region. |
384 this->initialize(mr, !is_zeroed); | 382 this->initialize(mr, !is_zeroed, SpaceDecorator::Mangle); |
383 set_top(bottom()); | |
384 set_saved_mark(); | |
385 | 385 |
386 _rem_set = new HeapRegionRemSet(sharedOffsetArray, this); | 386 _rem_set = new HeapRegionRemSet(sharedOffsetArray, this); |
387 | 387 |
388 assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant."); | 388 assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant."); |
389 // In case the region is allocated during a pause, note the top. | 389 // In case the region is allocated during a pause, note the top. |
727 } | 727 } |
728 | 728 |
729 // G1OffsetTableContigSpace code; copied from space.cpp. Hope this can go | 729 // G1OffsetTableContigSpace code; copied from space.cpp. Hope this can go |
730 // away eventually. | 730 // away eventually. |
731 | 731 |
732 void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space) { | 732 void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) { |
733 // false ==> we'll do the clearing if there's clearing to be done. | 733 // false ==> we'll do the clearing if there's clearing to be done. |
734 ContiguousSpace::initialize(mr, false); | 734 ContiguousSpace::initialize(mr, false, mangle_space); |
735 _offsets.zero_bottom_entry(); | 735 _offsets.zero_bottom_entry(); |
736 _offsets.initialize_threshold(); | 736 _offsets.initialize_threshold(); |
737 if (clear_space) clear(); | 737 if (clear_space) clear(mangle_space); |
738 } | 738 } |
739 | 739 |
740 void G1OffsetTableContigSpace::clear() { | 740 void G1OffsetTableContigSpace::clear(bool mangle_space) { |
741 ContiguousSpace::clear(); | 741 ContiguousSpace::clear(mangle_space); |
742 _offsets.zero_bottom_entry(); | 742 _offsets.zero_bottom_entry(); |
743 _offsets.initialize_threshold(); | 743 _offsets.initialize_threshold(); |
744 } | 744 } |
745 | 745 |
746 void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) { | 746 void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) { |
803 _offsets(sharedOffsetArray, mr), | 803 _offsets(sharedOffsetArray, mr), |
804 _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true), | 804 _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true), |
805 _gc_time_stamp(0) | 805 _gc_time_stamp(0) |
806 { | 806 { |
807 _offsets.set_space(this); | 807 _offsets.set_space(this); |
808 initialize(mr, !is_zeroed); | 808 initialize(mr, !is_zeroed, SpaceDecorator::Mangle); |
809 } | 809 } |
810 | 810 |
811 size_t RegionList::length() { | 811 size_t RegionList::length() { |
812 size_t len = 0; | 812 size_t len = 0; |
813 HeapRegion* cur = hd(); | 813 HeapRegion* cur = hd(); |