8076076: Move SharedHeap::print_size_transition() into G1 code
Reviewed-by: tschatzl, mgerdin
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Mar 16 13:28:27 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Fri Mar 27 09:28:47 2015 +0100
@@ -2088,10 +2088,7 @@
_cleanup_times.add((end - start) * 1000.0);
if (G1Log::fine()) {
- g1h->print_size_transition(gclog_or_tty,
- start_used_bytes,
- g1h->used(),
- g1h->capacity());
+ g1h->g1_policy()->print_heap_transition(start_used_bytes);
}
// Clean up will have freed any regions completely full of garbage.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Mon Mar 16 13:28:27 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Fri Mar 27 09:28:47 2015 +0100
@@ -1201,11 +1201,21 @@
}
}
+void G1CollectorPolicy::print_heap_transition(size_t bytes_before) {
+ size_t bytes_after = _g1->used();
+ size_t capacity = _g1->capacity();
+
+ gclog_or_tty->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)",
+ byte_size_in_proper_unit(bytes_before),
+ proper_unit_for_byte_size(bytes_before),
+ byte_size_in_proper_unit(bytes_after),
+ proper_unit_for_byte_size(bytes_after),
+ byte_size_in_proper_unit(capacity),
+ proper_unit_for_byte_size(capacity));
+}
+
void G1CollectorPolicy::print_heap_transition() {
- _g1->print_size_transition(gclog_or_tty,
- _heap_used_bytes_before_gc,
- _g1->used(),
- _g1->capacity());
+ print_heap_transition(_heap_used_bytes_before_gc);
}
void G1CollectorPolicy::print_detailed_heap_transition(bool full) {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Mon Mar 16 13:28:27 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Fri Mar 27 09:28:47 2015 +0100
@@ -700,6 +700,8 @@
void record_heap_size_info_at_start(bool full);
// Print heap sizing transition (with less and more detail).
+
+ void print_heap_transition(size_t bytes_before);
void print_heap_transition();
void print_detailed_heap_transition(bool full = false);
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp Mon Mar 16 13:28:27 2015 +0100
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp Fri Mar 27 09:28:47 2015 +0100
@@ -102,17 +102,3 @@
}
void SharedHeap::ref_processing_init() {}
-
-// Some utilities.
-void SharedHeap::print_size_transition(outputStream* out,
- size_t bytes_before,
- size_t bytes_after,
- size_t capacity) {
- out->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)",
- byte_size_in_proper_unit(bytes_before),
- proper_unit_for_byte_size(bytes_before),
- byte_size_in_proper_unit(bytes_after),
- proper_unit_for_byte_size(bytes_after),
- byte_size_in_proper_unit(capacity),
- proper_unit_for_byte_size(capacity));
-}
--- a/hotspot/src/share/vm/memory/sharedHeap.hpp Mon Mar 16 13:28:27 2015 +0100
+++ b/hotspot/src/share/vm/memory/sharedHeap.hpp Fri Mar 27 09:28:47 2015 +0100
@@ -214,16 +214,6 @@
// Sets the number of parallel threads that will be doing tasks
// (such as process roots) subsequently.
virtual void set_par_threads(uint t);
-
- //
- // New methods from CollectedHeap
- //
-
- // Some utilities.
- void print_size_transition(outputStream* out,
- size_t bytes_before,
- size_t bytes_after,
- size_t capacity);
};
#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP