aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp
diff options
context:
space:
mode:
authorysr <none@none>2008-06-05 15:57:56 -0700
committerysr <none@none>2008-06-05 15:57:56 -0700
commitb53f4585b771d688e2f269d9b3519547830f4902 (patch)
treecc8dda38b4363cb49c893c5ea1490a1dc19a47fc /src/share/vm/gc_implementation/g1/concurrentZFThread.hpp
parent6d2741606b58bab731e99eaecc3680d8ecb895b2 (diff)
downloadjdk8u_hotspot-b53f4585b771d688e2f269d9b3519547830f4902.tar.gz
6711316: Open source the Garbage-First garbage collector
Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
Diffstat (limited to 'src/share/vm/gc_implementation/g1/concurrentZFThread.hpp')
-rw-r--r--src/share/vm/gc_implementation/g1/concurrentZFThread.hpp85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp b/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp
new file mode 100644
index 000000000..9a483dbce
--- /dev/null
+++ b/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ */
+
+// The Concurrent ZF Thread. Performs concurrent zero-filling.
+
+class ConcurrentZFThread: public ConcurrentGCThread {
+ friend class VMStructs;
+ friend class ZeroFillRegionClosure;
+
+ private:
+
+ // Zero fill the heap region.
+ void processHeapRegion(HeapRegion* r);
+
+ // Stats
+ // Allocation (protected by heap lock).
+ static int _region_allocs; // Number of regions allocated
+ static int _sync_zfs; // Synchronous zero-fills +
+ static int _zf_waits; // Wait for conc zero-fill completion.
+
+ // Number of regions CFZ thread fills.
+ static int _regions_filled;
+
+ COTracker _co_tracker;
+
+ double _vtime_start; // Initial virtual time.
+
+ // These are static because the "print_summary_info" method is, and
+ // it currently assumes there is only one ZF thread. We'll change when
+ // we need to.
+ static double _vtime_accum; // Initial virtual time.
+ static double vtime_accum() { return _vtime_accum; }
+
+ // Offer yield for GC. Returns true if yield occurred.
+ bool offer_yield();
+
+ public:
+ // Constructor
+ ConcurrentZFThread();
+
+ // Main loop.
+ virtual void run();
+
+ // Printing
+ void print();
+
+ // Waits until "r" has been zero-filled. Requires caller to hold the
+ // ZF_mon.
+ static void wait_for_ZF_completed(HeapRegion* r);
+
+ // Get or clear the current unclean region. Should be done
+ // while holding the ZF_needed_mon lock.
+
+ // shutdown
+ static void stop();
+
+ // Stats
+ static void note_region_alloc() {_region_allocs++; }
+ static void note_sync_zfs() { _sync_zfs++; }
+ static void note_zf_wait() { _zf_waits++; }
+ static void note_region_filled() { _regions_filled++; }
+
+ static void print_summary_info();
+};