8075803: Fix GC includes and forward declarations
authorstefank
Tue, 24 Mar 2015 11:21:21 +0100
changeset 29701 f638fc81a3d0
parent 29700 66239a99ec24
child 29702 9ed339a5e096
8075803: Fix GC includes and forward declarations Reviewed-by: pliden, mgerdin
hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
hotspot/src/share/vm/memory/defNewGeneration.hpp
hotspot/src/share/vm/memory/defNewGeneration.inline.hpp
hotspot/src/share/vm/memory/space.cpp
hotspot/src/share/vm/oops/cpCache.cpp
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. 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
@@ -36,7 +36,9 @@
 // space, in this case a CompactibleFreeListSpace.
 
 // Forward declarations
+class CMSCollector;
 class CompactibleFreeListSpace;
+class ConcurrentMarkSweepGeneration;
 class BlkClosure;
 class BlkClosureCareful;
 class FreeChunk;
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. 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
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
 
+#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
 #include "gc_implementation/shared/gcHeapSummary.hpp"
 #include "gc_implementation/shared/gSpaceCounters.hpp"
 #include "gc_implementation/shared/gcStats.hpp"
@@ -55,6 +56,7 @@
 // means of a sliding mark-compact.
 
 class AdaptiveSizePolicy;
+class CMSCollector;
 class CMSConcMarkingTask;
 class CMSGCAdaptivePolicyCounters;
 class CMSTracer;
@@ -64,6 +66,7 @@
 class ConcurrentMarkSweepThread;
 class CompactibleFreeListSpace;
 class FreeChunk;
+class ParNewGeneration;
 class PromotionInfo;
 class ScanMarkedObjectsAgainCarefullyClosure;
 class TenuredGeneration;
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -34,6 +34,7 @@
 class G1CollectedHeap;
 class CMBitMap;
 class CMTask;
+class ConcurrentMark;
 typedef GenericTaskQueue<oop, mtGC>            CMTaskQueue;
 typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -56,6 +56,7 @@
 class GenerationSpec;
 class OopsInHeapRegionClosure;
 class G1KlassScanClosure;
+class G1ParScanThreadState;
 class ObjectClosure;
 class SpaceClosure;
 class CompactibleSpaceClosure;
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
 
+#include "gc_implementation/parNew/parOopClosures.hpp"
 #include "gc_implementation/shared/gcTrace.hpp"
 #include "gc_implementation/shared/parGCAllocBuffer.hpp"
 #include "gc_implementation/shared/copyFailedInfo.hpp"
--- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. 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
@@ -29,6 +29,7 @@
 #include "gc_implementation/parNew/parOopClosures.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/genCollectedHeap.hpp"
+#include "memory/genOopClosures.inline.hpp"
 
 template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
   assert (!oopDesc::is_null(*p), "null weak reference?");
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. 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
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "code/codeCache.hpp"
+#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 #include "gc_implementation/parallelScavenge/pcTasks.hpp"
 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
 #include "gc_implementation/shared/gcTimer.hpp"
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. 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
@@ -26,7 +26,7 @@
 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
 
 #include "gc_implementation/shared/collectorCounters.hpp"
-#include "gc_implementation/shared/markSweep.inline.hpp"
+#include "gc_implementation/shared/markSweep.hpp"
 #include "utilities/stack.hpp"
 
 class PSAdaptiveSizePolicy;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. 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
@@ -29,7 +29,6 @@
 #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
 #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
 #include "gc_implementation/shared/collectorCounters.hpp"
-#include "gc_implementation/shared/markSweep.hpp"
 #include "gc_implementation/shared/mutableSpace.hpp"
 #include "memory/sharedHeap.hpp"
 #include "oops/oop.hpp"
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. 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
@@ -84,6 +84,14 @@
 
 void MarkSweep::FollowStackClosure::do_void() { follow_stack(); }
 
+void PreservedMark::adjust_pointer() {
+  MarkSweep::adjust_pointer(&_obj);
+}
+
+void PreservedMark::restore() {
+  _obj->set_mark(_mark);
+}
+
 // We preserve the mark which should be replaced at the end and the location
 // that it will go.  Note that the object that this markOop belongs to isn't
 // currently at that address but it will be after phase4
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. 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
@@ -26,7 +26,8 @@
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
 
 #include "gc_interface/collectedHeap.hpp"
-#include "memory/universe.hpp"
+#include "memory/genOopClosures.hpp"
+#include "memory/iterator.hpp"
 #include "oops/markOop.hpp"
 #include "oops/oop.hpp"
 #include "runtime/timer.hpp"
@@ -182,13 +183,8 @@
     _mark = mark;
   }
 
-  void adjust_pointer() {
-    MarkSweep::adjust_pointer(&_obj);
-  }
-
-  void restore() {
-    _obj->set_mark(_mark);
-  }
+  void adjust_pointer();
+  void restore();
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
--- a/hotspot/src/share/vm/memory/defNewGeneration.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/memory/defNewGeneration.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -29,11 +29,14 @@
 #include "gc_implementation/shared/cSpaceCounters.hpp"
 #include "gc_implementation/shared/generationCounters.hpp"
 #include "gc_implementation/shared/copyFailedInfo.hpp"
+#include "memory/generation.hpp"
 #include "utilities/stack.hpp"
 
 class ContiguousSpace;
 class ScanClosure;
 class STWGCTimer;
+class CSpaceCounters;
+class ScanWeakRefClosure;
 
 // DefNewGeneration is a young generation containing eden, from- and
 // to-space.
--- a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp	Tue Mar 24 11:21:21 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. 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
@@ -25,8 +25,10 @@
 #ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
 #define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
 
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/defNewGeneration.hpp"
+#include "memory/genOopClosures.inline.hpp"
 #include "memory/space.hpp"
 
 // Methods of protected closure types
--- a/hotspot/src/share/vm/memory/space.cpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/memory/space.cpp	Tue Mar 24 11:21:21 2015 +0100
@@ -26,7 +26,6 @@
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc_implementation/shared/liveRange.hpp"
-#include "gc_implementation/shared/markSweep.hpp"
 #include "gc_implementation/shared/spaceDecorator.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/blockOffsetTable.inline.hpp"
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Tue Mar 24 13:49:56 2015 +0100
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Tue Mar 24 11:21:21 2015 +0100
@@ -35,9 +35,6 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-# include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
-#endif // INCLUDE_ALL_GCS
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC