src/share/vm/gc_implementation/g1/heapRegion.hpp

Print this page
rev 2755 : 7097516: G1: assert(0<= from_card && from_card<HeapRegion::CardsPerRegion) failed: Must be in range.
Summary: Introduced a version of is_in_reserved() that looks at _orig_end as opposed to _end.
Reviewed-by: duke


 414   // An upper bound on the number of live bytes in the region.
 415   size_t max_live_bytes() { return used() - garbage_bytes(); }
 416 
 417   void add_to_marked_bytes(size_t incr_bytes) {
 418     _next_marked_bytes = _next_marked_bytes + incr_bytes;
 419     guarantee( _next_marked_bytes <= used(), "invariant" );
 420   }
 421 
 422   void zero_marked_bytes()      {
 423     _prev_marked_bytes = _next_marked_bytes = 0;
 424   }
 425 
 426   bool isHumongous() const { return _humongous_type != NotHumongous; }
 427   bool startsHumongous() const { return _humongous_type == StartsHumongous; }
 428   bool continuesHumongous() const { return _humongous_type == ContinuesHumongous; }
 429   // For a humongous region, region in which it starts.
 430   HeapRegion* humongous_start_region() const {
 431     return _humongous_start_region;
 432   }
 433 










 434   // Makes the current region be a "starts humongous" region, i.e.,
 435   // the first region in a series of one or more contiguous regions
 436   // that will contain a single "humongous" object. The two parameters
 437   // are as follows:
 438   //
 439   // new_top : The new value of the top field of this region which
 440   // points to the end of the humongous object that's being
 441   // allocated. If there is more than one region in the series, top
 442   // will lie beyond this region's original end field and on the last
 443   // region in the series.
 444   //
 445   // new_end : The new value of the end field of this region which
 446   // points to the end of the last region in the series. If there is
 447   // one region in the series (namely: this one) end will be the same
 448   // as the original end of this region.
 449   //
 450   // Updating top and end as described above makes this region look as
 451   // if it spans the entire space taken up by all the regions in the
 452   // series and an single allocation moved its top to new_top. This
 453   // ensures that the space (capacity / allocated) taken up by all




 414   // An upper bound on the number of live bytes in the region.
 415   size_t max_live_bytes() { return used() - garbage_bytes(); }
 416 
 417   void add_to_marked_bytes(size_t incr_bytes) {
 418     _next_marked_bytes = _next_marked_bytes + incr_bytes;
 419     guarantee( _next_marked_bytes <= used(), "invariant" );
 420   }
 421 
 422   void zero_marked_bytes()      {
 423     _prev_marked_bytes = _next_marked_bytes = 0;
 424   }
 425 
 426   bool isHumongous() const { return _humongous_type != NotHumongous; }
 427   bool startsHumongous() const { return _humongous_type == StartsHumongous; }
 428   bool continuesHumongous() const { return _humongous_type == ContinuesHumongous; }
 429   // For a humongous region, region in which it starts.
 430   HeapRegion* humongous_start_region() const {
 431     return _humongous_start_region;
 432   }
 433 
 434   // Same as Space::is_in_reserved, but will use the actual size of a humongous start
 435   // region rather than the end of the humongous object.
 436   bool is_in_reserved_raw(const void* p) const {
 437     if (startsHumongous()) {
 438       return _bottom <= p && p < _orig_end;
 439     } else {
 440       return Space::is_in_reserved(p);
 441     }
 442   }
 443 
 444   // Makes the current region be a "starts humongous" region, i.e.,
 445   // the first region in a series of one or more contiguous regions
 446   // that will contain a single "humongous" object. The two parameters
 447   // are as follows:
 448   //
 449   // new_top : The new value of the top field of this region which
 450   // points to the end of the humongous object that's being
 451   // allocated. If there is more than one region in the series, top
 452   // will lie beyond this region's original end field and on the last
 453   // region in the series.
 454   //
 455   // new_end : The new value of the end field of this region which
 456   // points to the end of the last region in the series. If there is
 457   // one region in the series (namely: this one) end will be the same
 458   // as the original end of this region.
 459   //
 460   // Updating top and end as described above makes this region look as
 461   // if it spans the entire space taken up by all the regions in the
 462   // series and an single allocation moved its top to new_top. This
 463   // ensures that the space (capacity / allocated) taken up by all