612 void ShenandoahHeap::increase_committed(size_t bytes) {
613 assert_heaplock_or_safepoint();
614 _committed += bytes;
615 }
616
617 void ShenandoahHeap::decrease_committed(size_t bytes) {
618 assert_heaplock_or_safepoint();
619 _committed -= bytes;
620 }
621
622 void ShenandoahHeap::increase_used(size_t bytes) {
623 Atomic::add(&_used, bytes);
624 }
625
626 void ShenandoahHeap::set_used(size_t bytes) {
627 Atomic::release_store_fence(&_used, bytes);
628 }
629
630 void ShenandoahHeap::decrease_used(size_t bytes) {
631 assert(used() >= bytes, "never decrease heap size by more than we've left");
632 Atomic::sub(bytes, &_used);
633 }
634
635 void ShenandoahHeap::increase_allocated(size_t bytes) {
636 Atomic::add(&_bytes_allocated_since_gc_start, bytes);
637 }
638
639 void ShenandoahHeap::notify_mutator_alloc_words(size_t words, bool waste) {
640 size_t bytes = words * HeapWordSize;
641 if (!waste) {
642 increase_used(bytes);
643 }
644 increase_allocated(bytes);
645 if (ShenandoahPacing) {
646 control_thread()->pacing_notify_alloc(words);
647 if (waste) {
648 pacer()->claim_for_alloc(words, true);
649 }
650 }
651 }
652
|
612 void ShenandoahHeap::increase_committed(size_t bytes) {
613 assert_heaplock_or_safepoint();
614 _committed += bytes;
615 }
616
617 void ShenandoahHeap::decrease_committed(size_t bytes) {
618 assert_heaplock_or_safepoint();
619 _committed -= bytes;
620 }
621
622 void ShenandoahHeap::increase_used(size_t bytes) {
623 Atomic::add(&_used, bytes);
624 }
625
626 void ShenandoahHeap::set_used(size_t bytes) {
627 Atomic::release_store_fence(&_used, bytes);
628 }
629
630 void ShenandoahHeap::decrease_used(size_t bytes) {
631 assert(used() >= bytes, "never decrease heap size by more than we've left");
632 Atomic::sub(&_used, bytes);
633 }
634
635 void ShenandoahHeap::increase_allocated(size_t bytes) {
636 Atomic::add(&_bytes_allocated_since_gc_start, bytes);
637 }
638
639 void ShenandoahHeap::notify_mutator_alloc_words(size_t words, bool waste) {
640 size_t bytes = words * HeapWordSize;
641 if (!waste) {
642 increase_used(bytes);
643 }
644 increase_allocated(bytes);
645 if (ShenandoahPacing) {
646 control_thread()->pacing_notify_alloc(words);
647 if (waste) {
648 pacer()->claim_for_alloc(words, true);
649 }
650 }
651 }
652
|