changeset 1943:c760f78e0a53

7003125: precompiled.hpp is included when precompiled headers are not used Summary: Added an ifndef DONT_USE_PRECOMPILED_HEADER to precompiled.hpp. Set up DONT_USE_PRECOMPILED_HEADER when compiling with Sun Studio or when the user specifies USE_PRECOMPILED_HEADER=0. Fixed broken include dependencies. Reviewed-by: coleenp, kvn
author stefank
date Wed, 01 Dec 2010 15:04:06 +0100
parents 6a2d73358ff7
children 2968675b413e
files make/linux/makefiles/gcc.make make/linux/makefiles/sparcWorks.make make/solaris/makefiles/gcc.make make/solaris/makefiles/sparcWorks.make make/windows/makefiles/debug.make make/windows/makefiles/fastdebug.make make/windows/makefiles/product.make make/windows/makefiles/vm.make src/share/vm/ci/ciCallProfile.hpp src/share/vm/ci/ciMethodHandle.hpp src/share/vm/classfile/placeholders.hpp src/share/vm/code/vtableStubs.hpp src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp src/share/vm/interpreter/oopMapCache.hpp src/share/vm/libadt/vectset.cpp src/share/vm/memory/threadLocalAllocBuffer.inline.hpp src/share/vm/precompiled.hpp src/share/vm/prims/jvmtiExport.hpp src/share/vm/prims/jvmtiImpl.hpp src/share/vm/runtime/objectMonitor.hpp
diffstat 22 files changed, 85 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/make/linux/makefiles/gcc.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/linux/makefiles/gcc.make	Wed Dec 01 15:04:06 2010 +0100
@@ -42,11 +42,14 @@
 
 # check for precompiled headers support
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
 USE_PRECOMPILED_HEADER=1
 PRECOMPILED_HEADER_DIR=.
 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
 endif
+endif
 
 
 #------------------------------------------------------------------------
@@ -150,6 +153,11 @@
 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
 endif
 
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/make/linux/makefiles/sparcWorks.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/linux/makefiles/sparcWorks.make	Wed Dec 01 15:04:06 2010 +0100
@@ -79,6 +79,9 @@
 DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
 endif
 
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/make/solaris/makefiles/gcc.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/solaris/makefiles/gcc.make	Wed Dec 01 15:04:06 2010 +0100
@@ -47,11 +47,14 @@
 
 # check for precompiled headers support
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
 USE_PRECOMPILED_HEADER=1
 PRECOMPILED_HEADER_DIR=.
 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
 endif
+endif
 
 
 #------------------------------------------------------------------------
@@ -138,6 +141,11 @@
 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
 endif
 
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/make/solaris/makefiles/sparcWorks.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/solaris/makefiles/sparcWorks.make	Wed Dec 01 15:04:06 2010 +0100
@@ -150,6 +150,9 @@
 DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
 endif
 
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
 ################################################
 # Begin current (>=5.9) Forte compiler options #
 #################################################
--- a/make/windows/makefiles/debug.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/windows/makefiles/debug.make	Wed Dec 01 15:04:06 2010 +0100
@@ -28,7 +28,12 @@
 SAWINDBG=sawindbg.dll
 GENERATED=../generated
 
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
 
 !include ../local.make
 !include compile.make
--- a/make/windows/makefiles/fastdebug.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/windows/makefiles/fastdebug.make	Wed Dec 01 15:04:06 2010 +0100
@@ -28,7 +28,12 @@
 SAWINDBG=sawindbg.dll
 GENERATED=../generated
 
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
 
 !include ../local.make
 !include compile.make
--- a/make/windows/makefiles/product.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/windows/makefiles/product.make	Wed Dec 01 15:04:06 2010 +0100
@@ -27,7 +27,12 @@
 AOUT=$(HS_FNAME)
 GENERATED=../generated
 
-default:: _build_pch_file.obj $(AOUT) checkAndBuildSA
+# Allow the user to turn off precompiled headers from the command line.
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
+BUILD_PCH_FILE=_build_pch_file.obj
+!endif
+
+default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
 
 !include ../local.make
 !include compile.make
--- a/make/windows/makefiles/vm.make	Thu Dec 02 14:00:03 2010 -0500
+++ b/make/windows/makefiles/vm.make	Wed Dec 01 15:04:06 2010 +0100
@@ -128,7 +128,13 @@
   /I "$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm" \
   /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
 
+CPP_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER
+
+!if "$(USE_PRECOMPILED_HEADER)" != "0"
 CPP_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp"
+!else
+CPP_USE_PCH=$(CPP_DONT_USE_PCH)
+!endif
 
 # Where to find the source code for the virtual machine
 VM_PATH=../generated
@@ -164,31 +170,31 @@
 # Special case files not using precompiled header files.
 
 c1_RInfo_$(Platform_arch).obj: $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp 
-	 $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp
+	 $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\cpu\$(Platform_arch)\vm\c1_RInfo_$(Platform_arch).cpp
 
 os_windows.obj: $(WorkSpace)\src\os\windows\vm\os_windows.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\os_windows.cpp
 
 os_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\os_windows_$(Platform_arch).cpp
 
 osThread_windows.obj: $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\osThread_windows.cpp
 
 conditionVar_windows.obj: $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os\windows\vm\conditionVar_windows.cpp
 
 getThread_windows_$(Platform_arch).obj: $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm\getThread_windows_$(Platform_arch).cpp
 
 opcodes.obj: $(WorkSpace)\src\share\vm\opto\opcodes.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\opto\opcodes.cpp
 
 bytecodeInterpreter.obj: $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
-        $(CPP) $(CPP_FLAGS) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c $(WorkSpace)\src\share\vm\interpreter\bytecodeInterpreter.cpp
 
 bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
-        $(CPP) $(CPP_FLAGS) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
+        $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
 
 # Default rules for the Virtual Machine
 {$(WorkSpace)\src\share\vm\c1}.cpp.obj::
--- a/src/share/vm/ci/ciCallProfile.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/ci/ciCallProfile.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_CI_CICALLPROFILE_HPP
 
 #include "ci/ciClassList.hpp"
+#include "memory/allocation.hpp"
 
 // ciCallProfile
 //
--- a/src/share/vm/ci/ciMethodHandle.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/ci/ciMethodHandle.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_CI_CIMETHODHANDLE_HPP
 #define SHARE_VM_CI_CIMETHODHANDLE_HPP
 
+#include "ci/ciInstance.hpp"
 #include "prims/methodHandles.hpp"
 
 // ciMethodHandle
--- a/src/share/vm/classfile/placeholders.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/classfile/placeholders.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
 #define SHARE_VM_CLASSFILE_PLACEHOLDERS_HPP
 
+#include "runtime/thread.hpp"
 #include "utilities/hashtable.hpp"
 
 class PlaceholderEntry;
--- a/src/share/vm/code/vtableStubs.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/code/vtableStubs.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_CODE_VTABLESTUBS_HPP
 #define SHARE_VM_CODE_VTABLESTUBS_HPP
 
+#include "code/vmreg.hpp"
 #include "memory/allocation.hpp"
 
 // A VtableStub holds an individual code stub for a pair (vtable index, #args) for either itables or vtables
--- a/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
 
 #include "memory/allocation.hpp"
+#include "memory/blockOffsetTable.hpp"
 #include "memory/threadLocalAllocBuffer.hpp"
 #include "utilities/globalDefinitions.hpp"
 
--- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_HPP
 
+#include "memory/memRegion.hpp"
 #include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
 #include "utilities/bitMap.inline.hpp"
 
--- a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -25,6 +25,8 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARMARKBITMAP_INLINE_HPP
 
+#include "oops/oop.hpp"
+
 inline bool
 ParMarkBitMap::mark_obj(oop obj)
 {
--- a/src/share/vm/interpreter/oopMapCache.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/interpreter/oopMapCache.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_INTERPRETER_OOPMAPCACHE_HPP
 
 #include "oops/generateOopMap.hpp"
+#include "runtime/mutex.hpp"
 
 // A Cache for storing (method, bci) -> oopMap.
 // The memory management system uses the cache when locating object
--- a/src/share/vm/libadt/vectset.cpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/libadt/vectset.cpp	Wed Dec 01 15:04:06 2010 +0100
@@ -249,13 +249,13 @@
   const VectorSet &s = *(set.asVectorSet());
 
   // NOTE: The intersection is never any larger than the smallest set.
-  register uint small = ((size<s.size)?size:s.size);
-  register uint32 *u1 = data;   // Pointer to the destination data
-  register uint32 *u2 = s.data; // Pointer to the source data
-  for( uint i=0; i<small; i++)  // For data in set
-    if( *u1++ & *u2++ )         // If any elements in common
-      return 0;                 // Then not disjoint
-  return 1;                     // Else disjoint
+  register uint small_size = ((size<s.size)?size:s.size);
+  register uint32 *u1 = data;        // Pointer to the destination data
+  register uint32 *u2 = s.data;      // Pointer to the source data
+  for( uint i=0; i<small_size; i++)  // For data in set
+    if( *u1++ & *u2++ )              // If any elements in common
+      return 0;                      // Then not disjoint
+  return 1;                          // Else disjoint
 }
 
 //------------------------------operator<--------------------------------------
--- a/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -28,6 +28,7 @@
 #include "gc_interface/collectedHeap.hpp"
 #include "memory/threadLocalAllocBuffer.hpp"
 #include "runtime/atomic.hpp"
+#include "runtime/thread.hpp"
 #include "utilities/copy.hpp"
 
 inline HeapWord* ThreadLocalAllocBuffer::allocate(size_t size) {
--- a/src/share/vm/precompiled.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/precompiled.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -22,6 +22,10 @@
  *
  */
 
+// Precompiled headers are turned off for Sun Studion,
+// or if the user passes USE_PRECOMPILED_HEADER=0 to the makefiles.
+#ifndef DONT_USE_PRECOMPILED_HEADER
+
 # include "asm/assembler.hpp"
 # include "asm/assembler.inline.hpp"
 # include "asm/codeBuffer.hpp"
@@ -323,3 +327,5 @@
 # include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
 # include "gc_implementation/shared/gcPolicyCounters.hpp"
 #endif // SERIALGC
+
+#endif // !DONT_USE_PRECOMPILED_HEADER
--- a/src/share/vm/prims/jvmtiExport.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/prims/jvmtiExport.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -25,7 +25,6 @@
 #ifndef SHARE_VM_PRIMS_JVMTIEXPORT_HPP
 #define SHARE_VM_PRIMS_JVMTIEXPORT_HPP
 
-#include "code/jvmticmlr.h"
 #include "jvmtifiles/jvmti.h"
 #include "memory/allocation.hpp"
 #include "memory/iterator.hpp"
@@ -36,6 +35,9 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/growableArray.hpp"
 
+// Must be included after jvmti.h.
+#include "code/jvmticmlr.h"
+
 // Forward declarations
 
 class JvmtiEventControllerPrivate;
--- a/src/share/vm/prims/jvmtiImpl.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/prims/jvmtiImpl.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_PRIMS_JVMTIIMPL_HPP
 
 #ifndef JVMTI_KERNEL
+
 #include "classfile/systemDictionary.hpp"
 #include "jvmtifiles/jvmti.h"
 #include "oops/objArrayOop.hpp"
@@ -35,7 +36,6 @@
 #include "prims/jvmtiUtil.hpp"
 #include "runtime/stackValueCollection.hpp"
 #include "runtime/vm_operations.hpp"
-#endif
 
 //
 // Forward Declarations
@@ -417,6 +417,8 @@
   static void print();
 };
 
+#endif // !JVMTI_KERNEL
+
 // Utility macro that checks for NULL pointers:
 #define NULL_CHECK(X, Y) if ((X) == NULL) { return (Y); }
 
--- a/src/share/vm/runtime/objectMonitor.hpp	Thu Dec 02 14:00:03 2010 -0500
+++ b/src/share/vm/runtime/objectMonitor.hpp	Wed Dec 01 15:04:06 2010 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
 
 #include "runtime/os.hpp"
+#include "runtime/park.hpp"
 #include "runtime/perfData.hpp"