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 return _bottom <= p && p < _orig_end;
438 }
439
440 // Makes the current region be a "starts humongous" region, i.e.,
441 // the first region in a series of one or more contiguous regions
442 // that will contain a single "humongous" object. The two parameters
443 // are as follows:
444 //
445 // new_top : The new value of the top field of this region which
446 // points to the end of the humongous object that's being
447 // allocated. If there is more than one region in the series, top
448 // will lie beyond this region's original end field and on the last
449 // region in the series.
450 //
451 // new_end : The new value of the end field of this region which
452 // points to the end of the last region in the series. If there is
453 // one region in the series (namely: this one) end will be the same
454 // as the original end of this region.
455 //
456 // Updating top and end as described above makes this region look as
457 // if it spans the entire space taken up by all the regions in the
458 // series and an single allocation moved its top to new_top. This
459 // ensures that the space (capacity / allocated) taken up by all
|