changeset 51794:4129f43607cb

8210753: Make ThreadLocalAllocBuffer::resize() public Reviewed-by: eosterlund, jcbeyler
author pliden
date Tue, 18 Sep 2018 22:46:35 +0200
parents 6cd1ee2b4fa1
children feb4c9e03aed
files src/hotspot/share/gc/shared/collectedHeap.cpp src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp
diffstat 3 files changed, 9 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Sep 18 16:11:36 2018 -0400
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Sep 18 22:46:35 2018 +0200
@@ -506,12 +506,13 @@
 }
 
 void CollectedHeap::resize_all_tlabs() {
-  if (UseTLAB) {
-    assert(SafepointSynchronize::is_at_safepoint() ||
-         !is_init_completed(),
-         "should only resize tlabs at safepoint");
+  assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(),
+         "Should only resize tlabs at safepoint");
 
-    ThreadLocalAllocBuffer::resize_all_tlabs();
+  if (UseTLAB && ResizeTLAB) {
+    for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
+      thread->tlab().resize();
+    }
   }
 }
 
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Tue Sep 18 16:11:36 2018 -0400
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp	Tue Sep 18 22:46:35 2018 +0200
@@ -138,14 +138,6 @@
          "TLAB must be reset");
 }
 
-void ThreadLocalAllocBuffer::resize_all_tlabs() {
-  if (ResizeTLAB) {
-    for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
-      thread->tlab().resize();
-    }
-  }
-}
-
 void ThreadLocalAllocBuffer::resize() {
   // Compute the next tlab size using expected allocation amount
   assert(ResizeTLAB, "Should not call this otherwise");
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp	Tue Sep 18 16:11:36 2018 -0400
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp	Tue Sep 18 22:46:35 2018 +0200
@@ -92,9 +92,6 @@
   // Make parsable and release it.
   void reset();
 
-  // Resize based on amount of allocation, etc.
-  void resize();
-
   void invariants() const { assert(top() >= start() && top() <= end(), "invalid tlab"); }
 
   void initialize(HeapWord* start, HeapWord* top, HeapWord* end);
@@ -168,12 +165,12 @@
   // Retire in-use tlab before allocation of a new tlab
   void clear_before_allocation();
 
+  // Resize based on amount of allocation, etc.
+  void resize();
+
   // Accumulate statistics across all tlabs before gc
   static void accumulate_statistics_before_gc();
 
-  // Resize tlabs for all threads
-  static void resize_all_tlabs();
-
   void fill(HeapWord* start, HeapWord* top, size_t new_size);
   void initialize();