Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | a2f7274eb6ef |
children | 859cd1a76f8a |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
313 f->do_oop(&_base[i]); | 313 f->do_oop(&_base[i]); |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
317 bool ConcurrentMark::not_yet_marked(oop obj) const { | 317 bool ConcurrentMark::not_yet_marked(oop obj) const { |
318 return (_g1h->is_obj_ill(obj) | 318 return _g1h->is_obj_ill(obj); |
319 || (_g1h->is_in_permanent(obj) | |
320 && !nextMarkBitMap()->isMarked((HeapWord*)obj))); | |
321 } | 319 } |
322 | 320 |
323 CMRootRegions::CMRootRegions() : | 321 CMRootRegions::CMRootRegions() : |
324 _young_list(NULL), _cm(NULL), _scan_in_progress(false), | 322 _young_list(NULL), _cm(NULL), _scan_in_progress(false), |
325 _should_abort(false), _next_survivor(NULL) { } | 323 _should_abort(false), _next_survivor(NULL) { } |
1205 _card_bm->par_set_bit(i); | 1203 _card_bm->par_set_bit(i); |
1206 } | 1204 } |
1207 } else { | 1205 } else { |
1208 assert(last_idx < _card_bm->size(), "sanity"); | 1206 assert(last_idx < _card_bm->size(), "sanity"); |
1209 // Note BitMap::par_at_put_range() is exclusive. | 1207 // Note BitMap::par_at_put_range() is exclusive. |
1210 _card_bm->par_at_put_range(start_idx, last_idx+1, true); | 1208 BitMap::idx_t max_idx = MAX2(last_idx+1, _card_bm->size()); |
1209 _card_bm->par_at_put_range(start_idx, max_idx, true); | |
1211 } | 1210 } |
1212 } | 1211 } |
1213 | 1212 |
1214 // It takes a region that's not empty (i.e., it has at least one | 1213 // It takes a region that's not empty (i.e., it has at least one |
1215 // live object in it and sets its corresponding bit on the region | 1214 // live object in it and sets its corresponding bit on the region |
1551 set_bit_for_region(hr); | 1550 set_bit_for_region(hr); |
1552 } | 1551 } |
1553 | 1552 |
1554 // Now set the bits for [ntams, top] | 1553 // Now set the bits for [ntams, top] |
1555 BitMap::idx_t start_idx = _cm->card_bitmap_index_for(ntams); | 1554 BitMap::idx_t start_idx = _cm->card_bitmap_index_for(ntams); |
1556 BitMap::idx_t last_idx = _cm->card_bitmap_index_for(top); | 1555 // set_card_bitmap_range() expects the last_idx to be with |
1556 // the range of the bit map (see assertion in set_card_bitmap_range()), | |
1557 // so limit it to that range with this application of MIN2. | |
1558 BitMap::idx_t last_idx = MIN2(_cm->card_bitmap_index_for(top), | |
1559 _card_bm->size()-1); | |
1560 if (start_idx < _card_bm->size()) { | |
1557 set_card_bitmap_range(start_idx, last_idx); | 1561 set_card_bitmap_range(start_idx, last_idx); |
1562 } else { | |
1563 // To reach here start_idx must be beyond the end of | |
1564 // the bit map and last_idx must have been limited by | |
1565 // the MIN2(). | |
1566 assert(start_idx == last_idx + 1, | |
1567 err_msg("Not beyond end start_idx " SIZE_FORMAT " last_idx " | |
1568 SIZE_FORMAT, start_idx, last_idx)); | |
1569 } | |
1558 | 1570 |
1559 // Set the bit for the region if it contains live data | 1571 // Set the bit for the region if it contains live data |
1560 if (hr->next_marked_bytes() > 0) { | 1572 if (hr->next_marked_bytes() > 0) { |
1561 set_bit_for_region(hr); | 1573 set_bit_for_region(hr); |
1562 } | 1574 } |
2009 HeapWord* addr = (HeapWord*)obj; | 2021 HeapWord* addr = (HeapWord*)obj; |
2010 return addr != NULL && | 2022 return addr != NULL && |
2011 (!_g1->is_in_g1_reserved(addr) || !_g1->is_obj_ill(obj)); | 2023 (!_g1->is_in_g1_reserved(addr) || !_g1->is_obj_ill(obj)); |
2012 } | 2024 } |
2013 | 2025 |
2014 class G1CMKeepAliveClosure: public OopClosure { | 2026 class G1CMKeepAliveClosure: public ExtendedOopClosure { |
2015 G1CollectedHeap* _g1; | 2027 G1CollectedHeap* _g1; |
2016 ConcurrentMark* _cm; | 2028 ConcurrentMark* _cm; |
2017 public: | 2029 public: |
2018 G1CMKeepAliveClosure(G1CollectedHeap* g1, ConcurrentMark* cm) : | 2030 G1CMKeepAliveClosure(G1CollectedHeap* g1, ConcurrentMark* cm) : |
2019 _g1(g1), _cm(cm) { | 2031 _g1(g1), _cm(cm) { |
2050 _cm(cm), | 2062 _cm(cm), |
2051 _markStack(markStack), | 2063 _markStack(markStack), |
2052 _oopClosure(oopClosure) { } | 2064 _oopClosure(oopClosure) { } |
2053 | 2065 |
2054 void do_void() { | 2066 void do_void() { |
2055 _markStack->drain((OopClosure*)_oopClosure, _cm->nextMarkBitMap(), false); | 2067 _markStack->drain(_oopClosure, _cm->nextMarkBitMap(), false); |
2056 } | 2068 } |
2057 }; | 2069 }; |
2058 | 2070 |
2059 // 'Keep Alive' closure used by parallel reference processing. | 2071 // 'Keep Alive' closure used by parallel reference processing. |
2060 // An instance of this closure is used in the parallel reference processing | 2072 // An instance of this closure is used in the parallel reference processing |
2492 | 2504 |
2493 if (print_it) { | 2505 if (print_it) { |
2494 _out->print_cr(" "PTR_FORMAT"%s", | 2506 _out->print_cr(" "PTR_FORMAT"%s", |
2495 o, (over_tams) ? " >" : (marked) ? " M" : ""); | 2507 o, (over_tams) ? " >" : (marked) ? " M" : ""); |
2496 PrintReachableOopClosure oopCl(_out, _vo, _all); | 2508 PrintReachableOopClosure oopCl(_out, _vo, _all); |
2497 o->oop_iterate(&oopCl); | 2509 o->oop_iterate_no_header(&oopCl); |
2498 } | 2510 } |
2499 } | 2511 } |
2500 }; | 2512 }; |
2501 | 2513 |
2502 class PrintReachableRegionClosure : public HeapRegionClosure { | 2514 class PrintReachableRegionClosure : public HeapRegionClosure { |