21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHPACER_INLINE_HPP
26 #define SHARE_GC_SHENANDOAH_SHENANDOAHPACER_INLINE_HPP
27
28 #include "gc/shenandoah/shenandoahPacer.hpp"
29
30 #include "runtime/atomic.hpp"
31
32 inline void ShenandoahPacer::report_mark(size_t words) {
33 report_internal(words);
34 report_progress_internal(words);
35 }
36
37 inline void ShenandoahPacer::report_evac(size_t words) {
38 report_internal(words);
39 }
40
41 inline void ShenandoahPacer::report_updaterefs(size_t words) {
42 report_internal(words);
43 }
44
45 inline void ShenandoahPacer::report_alloc(size_t words) {
46 report_internal(words);
47 }
48
49 inline void ShenandoahPacer::report_internal(size_t words) {
50 assert(ShenandoahPacing, "Only be here when pacing is enabled");
51 add_budget(words);
52 }
53
54 inline void ShenandoahPacer::report_progress_internal(size_t words) {
55 assert(ShenandoahPacing, "Only be here when pacing is enabled");
56 STATIC_ASSERT(sizeof(size_t) <= sizeof(intptr_t));
57 Atomic::add(&_progress, (intptr_t)words, memory_order_relaxed);
58 }
59
60 inline void ShenandoahPacer::add_budget(size_t words) {
61 STATIC_ASSERT(sizeof(size_t) <= sizeof(intptr_t));
|
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHPACER_INLINE_HPP
26 #define SHARE_GC_SHENANDOAH_SHENANDOAHPACER_INLINE_HPP
27
28 #include "gc/shenandoah/shenandoahPacer.hpp"
29
30 #include "runtime/atomic.hpp"
31
32 inline void ShenandoahPacer::report_mark(size_t words) {
33 report_internal(words);
34 report_progress_internal(words);
35 }
36
37 inline void ShenandoahPacer::report_evac(size_t words) {
38 report_internal(words);
39 }
40
41 inline void ShenandoahPacer::report_update_refs(size_t words) {
42 report_internal(words);
43 }
44
45 inline void ShenandoahPacer::report_alloc(size_t words) {
46 report_internal(words);
47 }
48
49 inline void ShenandoahPacer::report_internal(size_t words) {
50 assert(ShenandoahPacing, "Only be here when pacing is enabled");
51 add_budget(words);
52 }
53
54 inline void ShenandoahPacer::report_progress_internal(size_t words) {
55 assert(ShenandoahPacing, "Only be here when pacing is enabled");
56 STATIC_ASSERT(sizeof(size_t) <= sizeof(intptr_t));
57 Atomic::add(&_progress, (intptr_t)words, memory_order_relaxed);
58 }
59
60 inline void ShenandoahPacer::add_budget(size_t words) {
61 STATIC_ASSERT(sizeof(size_t) <= sizeof(intptr_t));
|