Mercurial > hg > graal-compiler
diff src/share/vm/gc_interface/collectedHeap.hpp @ 1833:8b10f48633dc
6984287: Regularize how GC parallel workers are specified.
Summary: Associate number of GC workers with the workgang as opposed to the task.
Reviewed-by: johnc, ysr
author | jmasa |
---|---|
date | Mon, 20 Sep 2010 14:38:38 -0700 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
line wrap: on
line diff
--- a/src/share/vm/gc_interface/collectedHeap.hpp Thu Sep 16 13:45:55 2010 -0700 +++ b/src/share/vm/gc_interface/collectedHeap.hpp Mon Sep 20 14:38:38 2010 -0700 @@ -59,6 +59,8 @@ MemRegion _reserved; BarrierSet* _barrier_set; bool _is_gc_active; + int _n_par_threads; + unsigned int _total_collections; // ... started unsigned int _total_full_collections; // ... started NOT_PRODUCT(volatile size_t _promotion_failure_alot_count;) @@ -293,6 +295,12 @@ } GCCause::Cause gc_cause() { return _gc_cause; } + // Number of threads currently working on GC tasks. + int n_par_threads() { return _n_par_threads; } + + // May be overridden to set additional parallelism. + virtual void set_par_threads(int t) { _n_par_threads = t; }; + // Preload classes into the shared portion of the heap, and then dump // that data to a file so that it can be loaded directly by another // VM (then terminate). @@ -606,6 +614,14 @@ return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt); } #endif + + public: + // This is a convenience method that is used in cases where + // the actual number of GC worker threads is not pertinent but + // only whether there more than 0. Use of this method helps + // reduce the occurrence of ParallelGCThreads to uses where the + // actual number may be germane. + static bool use_parallel_gc_threads() { return ParallelGCThreads > 0; } }; // Class to set and reset the GC cause for a CollectedHeap.