1378 |
1378 |
1379 // A CollectedHeap will contain some number of spaces. This finds the |
1379 // A CollectedHeap will contain some number of spaces. This finds the |
1380 // space containing a given address, or else returns NULL. |
1380 // space containing a given address, or else returns NULL. |
1381 virtual Space* space_containing(const void* addr) const; |
1381 virtual Space* space_containing(const void* addr) const; |
1382 |
1382 |
1383 // A G1CollectedHeap will contain some number of heap regions. This |
1383 // Returns the HeapRegion that contains addr. addr must not be NULL. |
1384 // finds the region containing a given address, or else returns NULL. |
1384 template <class T> |
|
1385 inline HeapRegion* heap_region_containing_raw(const T addr) const; |
|
1386 |
|
1387 // Returns the HeapRegion that contains addr. addr must not be NULL. |
|
1388 // If addr is within a humongous continues region, it returns its humongous start region. |
1385 template <class T> |
1389 template <class T> |
1386 inline HeapRegion* heap_region_containing(const T addr) const; |
1390 inline HeapRegion* heap_region_containing(const T addr) const; |
1387 |
|
1388 // Like the above, but requires "addr" to be in the heap (to avoid a |
|
1389 // null-check), and unlike the above, may return an continuing humongous |
|
1390 // region. |
|
1391 template <class T> |
|
1392 inline HeapRegion* heap_region_containing_raw(const T addr) const; |
|
1393 |
1391 |
1394 // A CollectedHeap is divided into a dense sequence of "blocks"; that is, |
1392 // A CollectedHeap is divided into a dense sequence of "blocks"; that is, |
1395 // each address in the (reserved) heap is a member of exactly |
1393 // each address in the (reserved) heap is a member of exactly |
1396 // one block. The defining characteristic of a block is that it is |
1394 // one block. The defining characteristic of a block is that it is |
1397 // possible to find its size, and thus to progress forward to the next |
1395 // possible to find its size, and thus to progress forward to the next |
1530 |
1528 |
1531 // Determine if an object is dead, given the object and also |
1529 // Determine if an object is dead, given the object and also |
1532 // the region to which the object belongs. An object is dead |
1530 // the region to which the object belongs. An object is dead |
1533 // iff a) it was not allocated since the last mark and b) it |
1531 // iff a) it was not allocated since the last mark and b) it |
1534 // is not marked. |
1532 // is not marked. |
1535 |
|
1536 bool is_obj_dead(const oop obj, const HeapRegion* hr) const { |
1533 bool is_obj_dead(const oop obj, const HeapRegion* hr) const { |
1537 return |
1534 return |
1538 !hr->obj_allocated_since_prev_marking(obj) && |
1535 !hr->obj_allocated_since_prev_marking(obj) && |
1539 !isMarkedPrev(obj); |
1536 !isMarkedPrev(obj); |
1540 } |
1537 } |
1541 |
1538 |
1542 // This function returns true when an object has been |
1539 // This function returns true when an object has been |
1543 // around since the previous marking and hasn't yet |
1540 // around since the previous marking and hasn't yet |
1544 // been marked during this marking. |
1541 // been marked during this marking. |
1545 |
|
1546 bool is_obj_ill(const oop obj, const HeapRegion* hr) const { |
1542 bool is_obj_ill(const oop obj, const HeapRegion* hr) const { |
1547 return |
1543 return |
1548 !hr->obj_allocated_since_next_marking(obj) && |
1544 !hr->obj_allocated_since_next_marking(obj) && |
1549 !isMarkedNext(obj); |
1545 !isMarkedNext(obj); |
1550 } |
1546 } |