src/share/vm/gc/parallel/psParallelCompact.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc/parallel

src/share/vm/gc/parallel/psParallelCompact.cpp

Print this page




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"

  26 #include "classfile/stringTable.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "code/codeCache.hpp"
  30 #include "gc/parallel/gcTaskManager.hpp"
  31 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
  32 #include "gc/parallel/pcTasks.hpp"
  33 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
  34 #include "gc/parallel/psCompactionManager.inline.hpp"
  35 #include "gc/parallel/psMarkSweep.hpp"
  36 #include "gc/parallel/psMarkSweepDecorator.hpp"
  37 #include "gc/parallel/psOldGen.hpp"
  38 #include "gc/parallel/psParallelCompact.inline.hpp"
  39 #include "gc/parallel/psPromotionManager.inline.hpp"
  40 #include "gc/parallel/psScavenge.hpp"
  41 #include "gc/parallel/psYoungGen.hpp"
  42 #include "gc/shared/gcCause.hpp"
  43 #include "gc/shared/gcHeapSummary.hpp"
  44 #include "gc/shared/gcId.hpp"
  45 #include "gc/shared/gcLocker.inline.hpp"


2166   PSParallelCompact::AdjustKlassClosure klass_closure(cm);
2167 
2168   // General strong roots.
2169   Universe::oops_do(&oop_closure);
2170   JNIHandles::oops_do(&oop_closure);   // Global (strong) JNI handles
2171   Threads::oops_do(&oop_closure, NULL);
2172   ObjectSynchronizer::oops_do(&oop_closure);
2173   FlatProfiler::oops_do(&oop_closure);
2174   Management::oops_do(&oop_closure);
2175   JvmtiExport::oops_do(&oop_closure);
2176   SystemDictionary::oops_do(&oop_closure);
2177   ClassLoaderDataGraph::oops_do(&oop_closure, &klass_closure, true);
2178 
2179   // Now adjust pointers in remaining weak roots.  (All of which should
2180   // have been cleared if they pointed to non-surviving objects.)
2181   // Global (weak) JNI handles
2182   JNIHandles::weak_oops_do(&oop_closure);
2183 
2184   CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations);
2185   CodeCache::blobs_do(&adjust_from_blobs);

2186   StringTable::oops_do(&oop_closure);
2187   ref_processor()->weak_oops_do(&oop_closure);
2188   // Roots were visited so references into the young gen in roots
2189   // may have been scanned.  Process them also.
2190   // Should the reference processor have a span that excludes
2191   // young gen objects?
2192   PSScavenge::reference_processor()->weak_oops_do(&oop_closure);
2193 }
2194 
2195 // Helper class to print 8 region numbers per line and then print the total at the end.
2196 class FillableRegionLogger : public StackObj {
2197 private:
2198   Log(gc, compaction) log;
2199   static const int LineLength = 8;
2200   size_t _regions[LineLength];
2201   int _next_index;
2202   bool _enabled;
2203   size_t _total_regions;
2204 public:
2205   FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)) { }




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "aot/aotLoader.hpp"
  27 #include "classfile/stringTable.hpp"
  28 #include "classfile/symbolTable.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "code/codeCache.hpp"
  31 #include "gc/parallel/gcTaskManager.hpp"
  32 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
  33 #include "gc/parallel/pcTasks.hpp"
  34 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
  35 #include "gc/parallel/psCompactionManager.inline.hpp"
  36 #include "gc/parallel/psMarkSweep.hpp"
  37 #include "gc/parallel/psMarkSweepDecorator.hpp"
  38 #include "gc/parallel/psOldGen.hpp"
  39 #include "gc/parallel/psParallelCompact.inline.hpp"
  40 #include "gc/parallel/psPromotionManager.inline.hpp"
  41 #include "gc/parallel/psScavenge.hpp"
  42 #include "gc/parallel/psYoungGen.hpp"
  43 #include "gc/shared/gcCause.hpp"
  44 #include "gc/shared/gcHeapSummary.hpp"
  45 #include "gc/shared/gcId.hpp"
  46 #include "gc/shared/gcLocker.inline.hpp"


2167   PSParallelCompact::AdjustKlassClosure klass_closure(cm);
2168 
2169   // General strong roots.
2170   Universe::oops_do(&oop_closure);
2171   JNIHandles::oops_do(&oop_closure);   // Global (strong) JNI handles
2172   Threads::oops_do(&oop_closure, NULL);
2173   ObjectSynchronizer::oops_do(&oop_closure);
2174   FlatProfiler::oops_do(&oop_closure);
2175   Management::oops_do(&oop_closure);
2176   JvmtiExport::oops_do(&oop_closure);
2177   SystemDictionary::oops_do(&oop_closure);
2178   ClassLoaderDataGraph::oops_do(&oop_closure, &klass_closure, true);
2179 
2180   // Now adjust pointers in remaining weak roots.  (All of which should
2181   // have been cleared if they pointed to non-surviving objects.)
2182   // Global (weak) JNI handles
2183   JNIHandles::weak_oops_do(&oop_closure);
2184 
2185   CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations);
2186   CodeCache::blobs_do(&adjust_from_blobs);
2187   AOTLoader::oops_do(&oop_closure);
2188   StringTable::oops_do(&oop_closure);
2189   ref_processor()->weak_oops_do(&oop_closure);
2190   // Roots were visited so references into the young gen in roots
2191   // may have been scanned.  Process them also.
2192   // Should the reference processor have a span that excludes
2193   // young gen objects?
2194   PSScavenge::reference_processor()->weak_oops_do(&oop_closure);
2195 }
2196 
2197 // Helper class to print 8 region numbers per line and then print the total at the end.
2198 class FillableRegionLogger : public StackObj {
2199 private:
2200   Log(gc, compaction) log;
2201   static const int LineLength = 8;
2202   size_t _regions[LineLength];
2203   int _next_index;
2204   bool _enabled;
2205   size_t _total_regions;
2206 public:
2207   FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)) { }


src/share/vm/gc/parallel/psParallelCompact.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File