1488 |
1488 |
1489 // A CollectedHeap will contain some number of spaces. This finds the |
1489 // A CollectedHeap will contain some number of spaces. This finds the |
1490 // space containing a given address, or else returns NULL. |
1490 // space containing a given address, or else returns NULL. |
1491 virtual Space* space_containing(const void* addr) const; |
1491 virtual Space* space_containing(const void* addr) const; |
1492 |
1492 |
1493 // A G1CollectedHeap will contain some number of heap regions. This |
1493 // Returns the HeapRegion that contains addr. addr must not be NULL. |
1494 // finds the region containing a given address, or else returns NULL. |
1494 template <class T> |
|
1495 inline HeapRegion* heap_region_containing_raw(const T addr) const; |
|
1496 |
|
1497 // Returns the HeapRegion that contains addr. addr must not be NULL. |
|
1498 // If addr is within a humongous continues region, it returns its humongous start region. |
1495 template <class T> |
1499 template <class T> |
1496 inline HeapRegion* heap_region_containing(const T addr) const; |
1500 inline HeapRegion* heap_region_containing(const T addr) const; |
1497 |
|
1498 // Like the above, but requires "addr" to be in the heap (to avoid a |
|
1499 // null-check), and unlike the above, may return an continuing humongous |
|
1500 // region. |
|
1501 template <class T> |
|
1502 inline HeapRegion* heap_region_containing_raw(const T addr) const; |
|
1503 |
1501 |
1504 // A CollectedHeap is divided into a dense sequence of "blocks"; that is, |
1502 // A CollectedHeap is divided into a dense sequence of "blocks"; that is, |
1505 // each address in the (reserved) heap is a member of exactly |
1503 // each address in the (reserved) heap is a member of exactly |
1506 // one block. The defining characteristic of a block is that it is |
1504 // one block. The defining characteristic of a block is that it is |
1507 // possible to find its size, and thus to progress forward to the next |
1505 // possible to find its size, and thus to progress forward to the next |
1640 |
1638 |
1641 // Determine if an object is dead, given the object and also |
1639 // Determine if an object is dead, given the object and also |
1642 // the region to which the object belongs. An object is dead |
1640 // the region to which the object belongs. An object is dead |
1643 // iff a) it was not allocated since the last mark and b) it |
1641 // iff a) it was not allocated since the last mark and b) it |
1644 // is not marked. |
1642 // is not marked. |
1645 |
|
1646 bool is_obj_dead(const oop obj, const HeapRegion* hr) const { |
1643 bool is_obj_dead(const oop obj, const HeapRegion* hr) const { |
1647 return |
1644 return |
1648 !hr->obj_allocated_since_prev_marking(obj) && |
1645 !hr->obj_allocated_since_prev_marking(obj) && |
1649 !isMarkedPrev(obj); |
1646 !isMarkedPrev(obj); |
1650 } |
1647 } |
1651 |
1648 |
1652 // This function returns true when an object has been |
1649 // This function returns true when an object has been |
1653 // around since the previous marking and hasn't yet |
1650 // around since the previous marking and hasn't yet |
1654 // been marked during this marking. |
1651 // been marked during this marking. |
1655 |
|
1656 bool is_obj_ill(const oop obj, const HeapRegion* hr) const { |
1652 bool is_obj_ill(const oop obj, const HeapRegion* hr) const { |
1657 return |
1653 return |
1658 !hr->obj_allocated_since_next_marking(obj) && |
1654 !hr->obj_allocated_since_next_marking(obj) && |
1659 !isMarkedNext(obj); |
1655 !isMarkedNext(obj); |
1660 } |
1656 } |