--- a/.hgtags Wed May 19 10:22:39 2010 -0700
+++ b/.hgtags Thu May 20 01:34:22 2010 -0700
@@ -66,3 +66,4 @@
44158f6d3b94c0fa020e33632532473d92d1ea96 jdk7-b89
1d1927f9ec097b62c913921e2dfa5dbaf5dc325b jdk7-b90
308ad8f68b8dd68e22d73dd490e110059b732422 jdk7-b91
+ff9031a745d9cc52318f2148e43ca3b07ee08098 jdk7-b92
--- a/.hgtags-top-repo Wed May 19 10:22:39 2010 -0700
+++ b/.hgtags-top-repo Thu May 20 01:34:22 2010 -0700
@@ -66,3 +66,4 @@
7f1ba4459972bf84b8201dc1cc4f62b1fe1c74f4 jdk7-b89
425ba3efabbfe0b188105c10aaf7c3c8fa8d1a38 jdk7-b90
97d8b6c659c29c8493a8b2b72c2796a021a8cf79 jdk7-b91
+5f5c33d417f3a14706b09a4a95e65fa7b6fa54d6 jdk7-b92
--- a/README-builds.html Wed May 19 10:22:39 2010 -0700
+++ b/README-builds.html Thu May 20 01:34:22 2010 -0700
@@ -183,13 +183,13 @@
<tr>
<td>Windows X86 (32-bit)</td>
<td>Windows XP</td>
- <td>Microsoft Visual Studio C++ 2008 Standard Edition</td>
+ <td>Microsoft Visual Studio C++ 2010 Professional Edition</td>
<td>JDK 6u14 FCS </td>
</tr>
<tr>
<td>Windows X64 (64-bit)</td>
<td>Windows Server 2003 - Enterprise x64 Edition</td>
- <td>Microsoft Platform SDK - April 2005</td>
+ <td>Microsoft Visual Studio C++ 2010 Professional Edition</td>
<td>JDK 6u14 FCS </td>
</tr>
</tbody>
@@ -789,11 +789,7 @@
</li>
<li>
Install the
- <a href="#msvc">Microsoft Visual Studio Compilers</a> (32-bit).
- </li>
- <li>
- Install the
- <a href="#mssdk">Microsoft Platform SDK</a>.
+ <a href="#msvc">Microsoft Visual Studio Compilers</a>).
</li>
<li>
Setup all environment variables for compilers
@@ -964,13 +960,28 @@
</blockquote>
<strong><a name="msvc">Windows i586: Microsoft Visual Studio Compilers</a></strong>
<blockquote>
+<p>
+<b>BEGIN WARNING</b>: At this time (Spring/Summer 2010) JDK 7 is starting a transition to
+use the newest VS2010 Microsoft compilers. These build instructions are updated
+to show where we are going. We have a QA process to go through before
+official builds actually use VS2010. So for now, official builds are
+still using VS2003. No other compilers are known to build the entire JDK,
+including non-open portions.
+So for now you should be able to build with either VS2003 or VS2010.
+We do not guarantee that VS2008 will work, although there is sufficient
+makefile support to make at least basic JDK builds plausible.
+Visual Studio 2010 Express compilers are likely to be able to build all the
+"open" sources, with only small adjustments, but this has yet to be made
+to work. Also we have not yet seen the 7.1 Windows SDK with the 64 bit
+compilers. <b>END WARNING.</b>
+<p>
The 32-bit OpenJDK Windows build
requires
- Microsoft Visual Studio C++ 2008 (VS2008) Standard
+ Microsoft Visual Studio C++ 2010 (VS2010) Professional
Edition compiler.
The compiler and other tools are expected to reside
in the location defined by the variable
- <tt>VS90COMNTOOLS</tt> which
+ <tt>VS100COMNTOOLS</tt> which
is set by the Microsoft Visual Studio installer.
<p>
Once the compiler is installed,
@@ -982,36 +993,21 @@
prior to building the
OpenJDK.
The above environment variables <b>MUST</b> be set.
+ This compiler also contains the Windows SDK v 7.0a,
+ which is an update to the Windows 7 SDK.
<p>
<b>WARNING:</b> Make sure you check out the
<a href="#cygwin">CYGWIN link.exe WARNING</a>.
The path <tt>/usr/bin</tt> must be after the path to the
Visual Studio product.
</blockquote>
- <strong><a name="mssdk">Windows: Microsoft Platform SDK</a></strong>
+ <strong><a name="mssdk">Windows x64: Microsoft Visual Studio Compilers</a></strong>
<blockquote>
- On <b>X64</b>, the Microsoft Platform Software
- Development Kit (SDK), April 2005 Edition compiler,
- is required for building the OpenJDK
- because it contains the C/C++ compiler.
- You will need to minimally install the Core SDK and
- the MDAC SDK features of this compiler.
- <p>
- Once the Platform SDK is installed,
- it is recommended that you run <tt>SetEnv.Cmd /X64</tt>
- to set the compiler environment variables
- <tt>MSSDK</tt>,
- <tt>MSTOOLS</tt>,
- <tt>INCLUDE</tt>,
- <tt>LIB</tt>, and
- <tt>PATH</tt>
- prior to building the
- OpenJDK.
- The above environment variables <b>MUST</b> be set.
- <p>
- This Platform SDK compiler is only used on X64 builds
- but other parts of the Platform SDK may be used
- for the X86 builds.
+ On <b>X64</b>, the set up is much the same in VS2010
+ except that you run <tt>amd64\VCVARS64.BAT</tt>
+ to set the compiler environment variables.
+ Previously 64 builds had used the 64 bit compiler in
+ an unbundled Windows SDK but this is no longer necessary.
</blockquote>
</blockquote>
<!-- ------------------------------------------------------ -->
@@ -1314,40 +1310,16 @@
but it's normally found via the DirectX environment variable
<tt>DXSDK_DIR</tt>.
</blockquote>
- <strong><a name="msvcrt"><tt>MSVCRT.DLL</tt></a></strong>
+ <strong><a name="msvcrt"><tt>MSVCR100.DLL</tt></a></strong>
<blockquote>
- <strong>i586 only:</strong>
- The OpenJDK 32-bit build requires access to a redistributable
- <tt>MSVCRT.DLL</tt>.
- If the <tt>MSVCRT.DLL</tt> is not installed in
- the system32 directory set the
+ The OpenJDK build requires access to a redistributable
+ <tt>MSVCR100.DLL</tt>.
+ This is usually picked up automatically from the redist
+ directories of Visual Studio 2010.
+ If this cannot be found set the
<a href="#ALT_MSVCRT_DLL_PATH"><tt>ALT_MSVCRT_DLL_PATH</tt></a>
variable to the location of this file.
<p>
- <strong>X64 only:</strong>
- The OpenJDK 64-bit build requires access to a redistributable
- <tt>MSVCRT.DLL</tt>, which is
- usually supplied by the
- <a href="#mssdk">Platform SDK</a>.
- If it is not available from the Platform SDK,
- set the
- <a href="#ALT_MSVCRT_DLL_PATH"><tt>ALT_MSVCRT_DLL_PATH</tt></a>
- variable to the location of this file.
- </blockquote>
- <strong><tt><a name="msvcr90">MSVCR90.DLL</a></tt></strong>
- <blockquote>
- <strong>i586 only:</strong>
- The
- OpenJDK
- build requires access to a redistributable
- <tt>MSVCR90.DLL</tt> which should be
- supplied by the
- <a href="#msvc">Visual Studio product</a>.
- If the <tt>MSVCR90.DLL</tt> is not available from the
- Visual Studio product
- set the
- <a href="#ALT_MSVCR90_DLL_PATH"><tt>ALT_MSVCR90_DLL_PATH</tt></a>
- variable to the location of this file.
</blockquote>
</blockquote>
<!-- ------------------------------------------------------ -->
@@ -1623,11 +1595,10 @@
The location of the
<a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>.
</dd>
- <dt><tt><a name="ALT_MSVCR90_DLL_PATH">ALT_MSVCR90_DLL_PATH</a></tt> </dt>
+ <dt><tt><a name="ALT_MSVCRNN_DLL_PATH">ALT_MSVCRNN_DLL_PATH</a></tt> </dt>
<dd>
- <strong>i586 only:</strong>
The location of the
- <a href="#msvcr90"><tt>MSVCR90.DLL</tt></a>.
+ <a href="#msvcrt"><tt>MSVCR100.DLL</tt></a>.
</dd>
</dl>
</dd>
--- a/corba/.hgtags Wed May 19 10:22:39 2010 -0700
+++ b/corba/.hgtags Thu May 20 01:34:22 2010 -0700
@@ -66,3 +66,4 @@
bb4424c5e778b842c064a8b1aa902b35f4397654 jdk7-b89
56ce07b0eb47b93a98a72adef0f21e602c460623 jdk7-b90
bcd2fc089227559ac5be927923609fac29f067fa jdk7-b91
+930582f667a13391cd0b3e41e8cb760f55e3a5c0 jdk7-b92
--- a/corba/make/common/Defs-windows.gmk Wed May 19 10:22:39 2010 -0700
+++ b/corba/make/common/Defs-windows.gmk Thu May 20 01:34:22 2010 -0700
@@ -77,6 +77,11 @@
MSVCPNN_DLL = msvcp90.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
endif
+ ifeq ($(COMPILER_VERSION), VS2010)
+ MSVCRNN_DLL = msvcr100.dll
+ MSVCPNN_DLL = msvcp100.dll
+ MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
+ endif
endif
# C Compiler flag definitions
@@ -175,6 +180,20 @@
CC_LOWER_OPT = -O1
endif
endif
+ ifeq ($(COMPILER_VERSION), VS2010)
+ # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
+ AUTOMATIC_PCH_OPTION =
+ GX_OPTION = -EHsc
+ ifeq ($(ARCH_DATA_MODEL), 32)
+ CC_HIGHEST_OPT = -O2
+ CC_HIGHER_OPT = -O1
+ CC_LOWER_OPT = -O1
+ else
+ CC_HIGHEST_OPT = -O2
+ CC_HIGHER_OPT = -O1
+ CC_LOWER_OPT = -O1
+ endif
+ endif
CC_NO_OPT = -Od
else # CC_VERSION
# GCC not supported, but left for historical reference...
--- a/corba/make/common/shared/Compiler-msvc.gmk Wed May 19 10:22:39 2010 -0700
+++ b/corba/make/common/shared/Compiler-msvc.gmk Thu May 20 01:34:22 2010 -0700
@@ -97,6 +97,19 @@
COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
endif
endif
+ ifeq ($(CC_MAJORVER), 16)
+ # This should be: CC_VER=16.00.30319.01 LINK_VER=10.00.30319.01
+ REQUIRED_CC_VER = 16.00.30319.01
+ REQUIRED_LINK_VER = 10.00.30319.01
+ COMPILER_NAME=Visual Studio 10
+ COMPILER_VERSION=VS2010
+ #rebase and midl moved out of Visual Studio into the SDK:
+ REBASE = $(MSDEVTOOLS_PATH)/rebase
+ MTL = $(MSDEVTOOLS_PATH)/midl.exe
+ ifndef COMPILER_PATH
+ COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
+ endif
+ endif
else
# else ARCH_DATA_MODEL is 64
ifndef LINK_VER
@@ -144,11 +157,21 @@
COMPILER_NAME=Windows SDK 6.1 Visual Studio 9
COMPILER_VERSION=VS2008
RC = $(MSSDK61)/bin/x64/rc
- REBASE = $(MSSDK61/bin/x64/rebase
+ REBASE = $(MSSDK61)/bin/x64/rebase
else
- # This will cause problems if ALT_COMPILER_PATH is defined to ""
- # which is a directive to use the PATH.
- REBASE = $(COMPILER_PATH)../REBASE
+ ifeq ($(CC_MAJORVER), 16)
+ # This should be: CC_VER=16.00.30319.01 LINK_VER=9.00.30319.01
+ REQUIRED_CC_VER = 16.00.30319.01
+ REQUIRED_LINK_VER = 10.00.30319.01
+ COMPILER_NAME=Microsoft Visual Studio 10
+ COMPILER_VERSION=VS2010
+ RC = $(MSSDK7)/bin/x64/rc
+ REBASE = $(MSSDK7)/bin/x64/rebase
+ else
+ # This will cause problems if ALT_COMPILER_PATH is defined to ""
+ # which is a directive to use the PATH.
+ REBASE = $(COMPILER_PATH)../REBASE
+ endif
endif
ifndef COMPILER_PATH
COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
--- a/corba/make/common/shared/Defs-windows.gmk Wed May 19 10:22:39 2010 -0700
+++ b/corba/make/common/shared/Defs-windows.gmk Thu May 20 01:34:22 2010 -0700
@@ -222,6 +222,17 @@
ifneq ($(subst MSDev98,OLDOLDOLD,$(SHORTMSVCDIR)),$(SHORTMSVCDIR))
SHORTMSVCDIR :=
endif
+ # If we still don't have it, look for VS100COMNTOOLS, setup by installer?
+ ifeq ($(SHORTMSVCDIR),)
+ ifdef VS100COMNTOOLS # /Common/Tools directory, use ../../Vc
+ xVS100COMNTOOLS :="$(subst \,/,$(VS100COMNTOOLS))"
+ _vs100tools :=$(call FullPath,$(xVS100COMNTOOLS))
+ endif
+ ifneq ($(_vs100tools),)
+ SHORTMSVCDIR :=$(_vs100tools)/../../Vc
+ endif
+ endif
+ export SHORTMSVCDIR
# If we still don't have it, look for VS71COMNTOOLS, setup by installer?
ifeq ($(SHORTMSVCDIR),)
ifdef VS71COMNTOOLS # /Common/Tools directory, use ../../Vc7
@@ -272,24 +283,35 @@
# Compilers for 64bit are from SDK
ifeq ($(ARCH_DATA_MODEL), 64)
ifndef SHORTCOMPILERBIN
- xMSSDK61 :="C:/Program Files/Microsoft SDKs/Windows/v6.1/"
- MSSDK61 :=$(call FullPath,$(xMSSDK61))
- xVS2008 :="C:/Program Files (x86)/Microsoft Visual Studio 9.0/"
- _vs2008 :=$(call FullPath,$(xVS2008))
- ifneq ($(_vs2008),)
- ifeq ($(ARCH), ia64)
- SHORTCOMPILERBIN :=$(_vs2008)/VC/Bin/x86_ia64
- endif
- ifeq ($(ARCH), amd64)
- SHORTCOMPILERBIN :=$(_vs2008)/VC/Bin/$(ARCH)
- endif
+ ifdef VS100COMNTOOLS # /Common7/Tools directory, use ../../Vc
+ xVS100COMNTOOLS :="$(subst \,/,$(VS100COMNTOOLS))"
+ _vs100tools :=$(call FullPath,$(xVS100COMNTOOLS))
+ endif
+ ifneq ($(_vs100tools),)
+ SHORTCOMPILERBIN :=$(_vs100tools)/../../Vc/bin/amd64
+ xMSSDK70 :="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/"
+ MSSDK7 :=$(call FullPath,$(xMSSDK70))
+ export MSSDK7
else
- ifneq ($(SHORTPSDK),)
+ xMSSDK61 :="C:/Program Files/Microsoft SDKs/Windows/v6.1/"
+ MSSDK61 :=$(call FullPath,$(xMSSDK61))
+ xVS2008 :="C:/Program Files (x86)/Microsoft Visual Studio 9.0/"
+ _vs2008 :=$(call FullPath,$(xVS2008))
+ ifneq ($(_vs2008),)
ifeq ($(ARCH), ia64)
- SHORTCOMPILERBIN :=$(SHORTPSDK)/Bin/Win64
+ SHORTCOMPILERBIN :=$(_vs2008)/VC/Bin/x86_ia64
endif
ifeq ($(ARCH), amd64)
- SHORTCOMPILERBIN :=$(SHORTPSDK)/Bin/Win64/x86/$(ARCH)
+ SHORTCOMPILERBIN :=$(_vs2008)/VC/Bin/$(ARCH)
+ endif
+ else
+ ifneq ($(SHORTPSDK),)
+ ifeq ($(ARCH), ia64)
+ SHORTCOMPILERBIN :=$(SHORTPSDK)/Bin/Win64
+ endif
+ ifeq ($(ARCH), amd64)
+ SHORTCOMPILERBIN :=$(SHORTPSDK)/Bin/Win64/x86/$(ARCH)
+ endif
endif
endif
endif
--- a/corba/make/common/shared/Platform.gmk Wed May 19 10:22:39 2010 -0700
+++ b/corba/make/common/shared/Platform.gmk Thu May 20 01:34:22 2010 -0700
@@ -333,7 +333,11 @@
endif
ARCH_FAMILY = $(ARCH)
# Where is unwanted output to be delivered?
- DEV_NULL = NUL
+ ifeq ($(USING_CYGWIN),true)
+ DEV_NULL = /dev/null
+ else
+ DEV_NULL = NUL
+ endif
export DEV_NULL
# Classpath separator
CLASSPATH_SEPARATOR = ;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSBitMap.java Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CMSBitMap.java Thu May 20 01:34:22 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2007-2010 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
@@ -78,9 +78,8 @@
}
public BitMap bm() {
- BitMap bitMap = new BitMap((int) (bmWordSize() >> (shifter() + 3) ));
+ BitMap bitMap = new BitMap((int) (bmWordSize() >> shifter() ));
VirtualSpace vs = virtualSpace();
- //bitMap.set_size((int)vs.committedSize());
bitMap.set_map(vs.low());
return bitMap;
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java Thu May 20 01:34:22 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2000-2010 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
@@ -326,7 +326,13 @@
/** Gets the Java-side thread object for this JavaThread */
public Oop getThreadObj() {
- return VM.getVM().getObjectHeap().newOop(threadObjField.getValue(addr));
+ Oop obj = null;
+ try {
+ obj = VM.getVM().getObjectHeap().newOop(threadObjField.getValue(addr));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return obj;
}
/** Get the Java-side name of this thread */
--- a/hotspot/make/hotspot_version Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/make/hotspot_version Thu May 20 01:34:22 2010 -0700
@@ -33,9 +33,9 @@
# Don't put quotes (fail windows build).
HOTSPOT_VM_COPYRIGHT=Copyright 2010
-HS_MAJOR_VER=18
+HS_MAJOR_VER=19
HS_MINOR_VER=0
-HS_BUILD_NUMBER=04
+HS_BUILD_NUMBER=01
JDK_MAJOR_VER=1
JDK_MINOR_VER=7
--- a/hotspot/make/windows/build_vm_def.sh Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/make/windows/build_vm_def.sh Thu May 20 01:34:22 2010 -0700
@@ -58,11 +58,11 @@
fi
if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" ]; then
-$DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def
+$DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def
else
# Can't use pipes when calling cl.exe or link.exe from IDE. Using transit file vm3.def
$DUMPBIN /OUT:vm3.def /symbols *.obj
-"$CAT" vm3.def | "$GREP" "??_7.*@@6B@" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def
+"$CAT" vm3.def | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def
"$RM" -f vm3.def
fi
--- a/hotspot/make/windows/makefiles/compile.make Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/make/windows/makefiles/compile.make Thu May 20 01:34:22 2010 -0700
@@ -92,6 +92,7 @@
# 1399 is our fake number for the VS2005 compiler that really isn't 1400
# 1400 is for VS2005
# 1500 is for VS2008
+# 1600 is for VS2010
# Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
# compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
# Normally they are the same, but a pre-release of the VS2005 compilers
@@ -121,6 +122,9 @@
!if "$(MSC_VER)" == "1500"
COMPILER_NAME=VS2008
!endif
+!if "$(MSC_VER)" == "1600"
+COMPILER_NAME=VS2010
+!endif
!endif
# Add what version of the compiler we think this is to the compile line
@@ -183,6 +187,17 @@
MT=mt.exe
!endif
+!if "$(COMPILER_NAME)" == "VS2010"
+PRODUCT_OPT_OPTION = /O2 /Oy-
+FASTDEBUG_OPT_OPTION = /O2 /Oy-
+DEBUG_OPT_OPTION = /Od
+GX_OPTION = /EHsc
+LINK_FLAGS = /manifest $(LINK_FLAGS)
+# Manifest Tool - used in VS2005 and later to adjust manifests stored
+# as resources inside build artifacts.
+MT=mt.exe
+!endif
+
# Compile for space above time.
!if "$(Variant)" == "kernel"
PRODUCT_OPT_OPTION = /O1 /Oy-
--- a/hotspot/make/windows/makefiles/defs.make Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/make/windows/makefiles/defs.make Thu May 20 01:34:22 2010 -0700
@@ -55,6 +55,8 @@
MAKE_ARGS += Platform_arch_model=ia64
endif
+# http://support.microsoft.com/kb/888731 : this can be either
+# AMD64 for AMD, or EM64T for Intel chips.
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
ARCH_DATA_MODEL=64
PLATFORM=windows-amd64
@@ -67,6 +69,19 @@
MAKE_ARGS += Platform_arch_model=x86_64
endif
+# NB later OS versions than 2003 may report "Intel64"
+ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) "EM64T\|Intel64"),)
+ ARCH_DATA_MODEL=64
+ PLATFORM=windows-amd64
+ VM_PLATFORM=windows_amd64
+ HS_ARCH=x86
+ MAKE_ARGS += LP64=1
+ MAKE_ARGS += ARCH=x86
+ MAKE_ARGS += BUILDARCH=amd64
+ MAKE_ARGS += Platform_arch=x86
+ MAKE_ARGS += Platform_arch_model=x86_64
+endif
+
JDK_INCLUDE_SUBDIR=win32
# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
--- a/hotspot/make/windows/makefiles/sanity.make Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/make/windows/makefiles/sanity.make Thu May 20 01:34:22 2010 -0700
@@ -27,9 +27,9 @@
all: checkCL checkLink
checkCL:
- @ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" \
+ @ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" \
echo *** WARNING *** unrecognized cl.exe version $(MSC_VER) ($(RAW_MSC_VER)). Use FORCE_MSC_VER to override automatic detection.
checkLink:
- @ if "$(LINK_VER)" NEQ "710" if "$(LINK_VER)" NEQ "800" if "$(LINK_VER)" NEQ "900" \
+ @ if "$(LINK_VER)" NEQ "710" if "$(LINK_VER)" NEQ "800" if "$(LINK_VER)" NEQ "900" if "$(LINK_VER)" NEQ "1000" \
echo *** WARNING *** unrecognized link.exe version $(LINK_VER) ($(RAW_LINK_VER)). Use FORCE_LINK_VER to override automatic detection.
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Thu May 20 01:34:22 2010 -0700
@@ -104,6 +104,12 @@
if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
}
+ // When using CMS, we cannot use memset() in BOT updates because
+ // the sun4v/CMT version in libc_psr uses BIS which exposes
+ // "phantom zeros" to concurrent readers. See 6948537.
+ if (FLAG_IS_DEFAULT(UseMemSetInBOT) && UseConcMarkSweepGC) {
+ FLAG_SET_DEFAULT(UseMemSetInBOT, false);
+ }
}
// Use hardware population count instruction if available.
--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Thu May 20 01:34:22 2010 -0700
@@ -288,7 +288,7 @@
vm_exit_out_of_memory(0, "pthread_getattr_np");
}
else {
- fatal1("pthread_getattr_np failed with errno = %d", res);
+ fatal(err_msg("pthread_getattr_np failed with errno = %d", res));
}
}
@@ -296,7 +296,7 @@
size_t stack_bytes;
res = pthread_attr_getstack(&attr, (void **) &stack_bottom, &stack_bytes);
if (res != 0) {
- fatal1("pthread_attr_getstack failed with errno = %d", res);
+ fatal(err_msg("pthread_attr_getstack failed with errno = %d", res));
}
address stack_top = stack_bottom + stack_bytes;
@@ -308,7 +308,7 @@
size_t guard_bytes;
res = pthread_attr_getguardsize(&attr, &guard_bytes);
if (res != 0) {
- fatal1("pthread_attr_getguardsize failed with errno = %d", res);
+ fatal(err_msg("pthread_attr_getguardsize failed with errno = %d", res));
}
int guard_pages = align_size_up(guard_bytes, page_bytes) / page_bytes;
assert(guard_bytes == guard_pages * page_bytes, "unaligned guard");
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu May 20 01:34:22 2010 -0700
@@ -1926,59 +1926,6 @@
ALL_SINCE_SAVE_MARKS_CLOSURES(CFLS_OOP_SINCE_SAVE_MARKS_DEFN)
-//////////////////////////////////////////////////////////////////////////////
-// We go over the list of promoted objects, removing each from the list,
-// and applying the closure (this may, in turn, add more elements to
-// the tail of the promoted list, and these newly added objects will
-// also be processed) until the list is empty.
-// To aid verification and debugging, in the non-product builds
-// we actually forward _promoHead each time we process a promoted oop.
-// Note that this is not necessary in general (i.e. when we don't need to
-// call PromotionInfo::verify()) because oop_iterate can only add to the
-// end of _promoTail, and never needs to look at _promoHead.
-
-#define PROMOTED_OOPS_ITERATE_DEFN(OopClosureType, nv_suffix) \
- \
-void PromotionInfo::promoted_oops_iterate##nv_suffix(OopClosureType* cl) { \
- NOT_PRODUCT(verify()); \
- PromotedObject *curObj, *nextObj; \
- for (curObj = _promoHead; curObj != NULL; curObj = nextObj) { \
- if ((nextObj = curObj->next()) == NULL) { \
- /* protect ourselves against additions due to closure application \
- below by resetting the list. */ \
- assert(_promoTail == curObj, "Should have been the tail"); \
- _promoHead = _promoTail = NULL; \
- } \
- if (curObj->hasDisplacedMark()) { \
- /* restore displaced header */ \
- oop(curObj)->set_mark(nextDisplacedHeader()); \
- } else { \
- /* restore prototypical header */ \
- oop(curObj)->init_mark(); \
- } \
- /* The "promoted_mark" should now not be set */ \
- assert(!curObj->hasPromotedMark(), \
- "Should have been cleared by restoring displaced mark-word"); \
- NOT_PRODUCT(_promoHead = nextObj); \
- if (cl != NULL) oop(curObj)->oop_iterate(cl); \
- if (nextObj == NULL) { /* start at head of list reset above */ \
- nextObj = _promoHead; \
- } \
- } \
- assert(noPromotions(), "post-condition violation"); \
- assert(_promoHead == NULL && _promoTail == NULL, "emptied promoted list");\
- assert(_spoolHead == _spoolTail, "emptied spooling buffers"); \
- assert(_firstIndex == _nextIndex, "empty buffer"); \
-}
-
-// This should have been ALL_SINCE_...() just like the others,
-// but, because the body of the method above is somehwat longer,
-// the MSVC compiler cannot cope; as a workaround, we split the
-// macro into its 3 constituent parts below (see original macro
-// definition in specializedOopClosures.hpp).
-SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(PROMOTED_OOPS_ITERATE_DEFN)
-PROMOTED_OOPS_ITERATE_DEFN(OopsInGenClosure,_v)
-
void CompactibleFreeListSpace::object_iterate_since_last_GC(ObjectClosure* cl) {
// ugghh... how would one do this efficiently for a non-contiguous space?
@@ -2506,281 +2453,6 @@
_dictionary->printDictCensus();
}
-// Return the next displaced header, incrementing the pointer and
-// recycling spool area as necessary.
-markOop PromotionInfo::nextDisplacedHeader() {
- assert(_spoolHead != NULL, "promotionInfo inconsistency");
- assert(_spoolHead != _spoolTail || _firstIndex < _nextIndex,
- "Empty spool space: no displaced header can be fetched");
- assert(_spoolHead->bufferSize > _firstIndex, "Off by one error at head?");
- markOop hdr = _spoolHead->displacedHdr[_firstIndex];
- // Spool forward
- if (++_firstIndex == _spoolHead->bufferSize) { // last location in this block
- // forward to next block, recycling this block into spare spool buffer
- SpoolBlock* tmp = _spoolHead->nextSpoolBlock;
- assert(_spoolHead != _spoolTail, "Spooling storage mix-up");
- _spoolHead->nextSpoolBlock = _spareSpool;
- _spareSpool = _spoolHead;
- _spoolHead = tmp;
- _firstIndex = 1;
- NOT_PRODUCT(
- if (_spoolHead == NULL) { // all buffers fully consumed
- assert(_spoolTail == NULL && _nextIndex == 1,
- "spool buffers processing inconsistency");
- }
- )
- }
- return hdr;
-}
-
-void PromotionInfo::track(PromotedObject* trackOop) {
- track(trackOop, oop(trackOop)->klass());
-}
-
-void PromotionInfo::track(PromotedObject* trackOop, klassOop klassOfOop) {
- // make a copy of header as it may need to be spooled
- markOop mark = oop(trackOop)->mark();
- trackOop->clearNext();
- if (mark->must_be_preserved_for_cms_scavenge(klassOfOop)) {
- // save non-prototypical header, and mark oop
- saveDisplacedHeader(mark);
- trackOop->setDisplacedMark();
- } else {
- // we'd like to assert something like the following:
- // assert(mark == markOopDesc::prototype(), "consistency check");
- // ... but the above won't work because the age bits have not (yet) been
- // cleared. The remainder of the check would be identical to the
- // condition checked in must_be_preserved() above, so we don't really
- // have anything useful to check here!
- }
- if (_promoTail != NULL) {
- assert(_promoHead != NULL, "List consistency");
- _promoTail->setNext(trackOop);
- _promoTail = trackOop;
- } else {
- assert(_promoHead == NULL, "List consistency");
- _promoHead = _promoTail = trackOop;
- }
- // Mask as newly promoted, so we can skip over such objects
- // when scanning dirty cards
- assert(!trackOop->hasPromotedMark(), "Should not have been marked");
- trackOop->setPromotedMark();
-}
-
-// Save the given displaced header, incrementing the pointer and
-// obtaining more spool area as necessary.
-void PromotionInfo::saveDisplacedHeader(markOop hdr) {
- assert(_spoolHead != NULL && _spoolTail != NULL,
- "promotionInfo inconsistency");
- assert(_spoolTail->bufferSize > _nextIndex, "Off by one error at tail?");
- _spoolTail->displacedHdr[_nextIndex] = hdr;
- // Spool forward
- if (++_nextIndex == _spoolTail->bufferSize) { // last location in this block
- // get a new spooling block
- assert(_spoolTail->nextSpoolBlock == NULL, "tail should terminate spool list");
- _splice_point = _spoolTail; // save for splicing
- _spoolTail->nextSpoolBlock = getSpoolBlock(); // might fail
- _spoolTail = _spoolTail->nextSpoolBlock; // might become NULL ...
- // ... but will attempt filling before next promotion attempt
- _nextIndex = 1;
- }
-}
-
-// Ensure that spooling space exists. Return false if spooling space
-// could not be obtained.
-bool PromotionInfo::ensure_spooling_space_work() {
- assert(!has_spooling_space(), "Only call when there is no spooling space");
- // Try and obtain more spooling space
- SpoolBlock* newSpool = getSpoolBlock();
- assert(newSpool == NULL ||
- (newSpool->bufferSize != 0 && newSpool->nextSpoolBlock == NULL),
- "getSpoolBlock() sanity check");
- if (newSpool == NULL) {
- return false;
- }
- _nextIndex = 1;
- if (_spoolTail == NULL) {
- _spoolTail = newSpool;
- if (_spoolHead == NULL) {
- _spoolHead = newSpool;
- _firstIndex = 1;
- } else {
- assert(_splice_point != NULL && _splice_point->nextSpoolBlock == NULL,
- "Splice point invariant");
- // Extra check that _splice_point is connected to list
- #ifdef ASSERT
- {
- SpoolBlock* blk = _spoolHead;
- for (; blk->nextSpoolBlock != NULL;
- blk = blk->nextSpoolBlock);
- assert(blk != NULL && blk == _splice_point,
- "Splice point incorrect");
- }
- #endif // ASSERT
- _splice_point->nextSpoolBlock = newSpool;
- }
- } else {
- assert(_spoolHead != NULL, "spool list consistency");
- _spoolTail->nextSpoolBlock = newSpool;
- _spoolTail = newSpool;
- }
- return true;
-}
-
-// Get a free spool buffer from the free pool, getting a new block
-// from the heap if necessary.
-SpoolBlock* PromotionInfo::getSpoolBlock() {
- SpoolBlock* res;
- if ((res = _spareSpool) != NULL) {
- _spareSpool = _spareSpool->nextSpoolBlock;
- res->nextSpoolBlock = NULL;
- } else { // spare spool exhausted, get some from heap
- res = (SpoolBlock*)(space()->allocateScratch(refillSize()));
- if (res != NULL) {
- res->init();
- }
- }
- assert(res == NULL || res->nextSpoolBlock == NULL, "postcondition");
- return res;
-}
-
-void PromotionInfo::startTrackingPromotions() {
- assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
- "spooling inconsistency?");
- _firstIndex = _nextIndex = 1;
- _tracking = true;
-}
-
-#define CMSPrintPromoBlockInfo 1
-
-void PromotionInfo::stopTrackingPromotions(uint worker_id) {
- assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
- "spooling inconsistency?");
- _firstIndex = _nextIndex = 1;
- _tracking = false;
- if (CMSPrintPromoBlockInfo > 1) {
- print_statistics(worker_id);
- }
-}
-
-void PromotionInfo::print_statistics(uint worker_id) const {
- assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
- "Else will undercount");
- assert(CMSPrintPromoBlockInfo > 0, "Else unnecessary call");
- // Count the number of blocks and slots in the free pool
- size_t slots = 0;
- size_t blocks = 0;
- for (SpoolBlock* cur_spool = _spareSpool;
- cur_spool != NULL;
- cur_spool = cur_spool->nextSpoolBlock) {
- // the first entry is just a self-pointer; indices 1 through
- // bufferSize - 1 are occupied (thus, bufferSize - 1 slots).
- guarantee((void*)cur_spool->displacedHdr == (void*)&cur_spool->displacedHdr,
- "first entry of displacedHdr should be self-referential");
- slots += cur_spool->bufferSize - 1;
- blocks++;
- }
- if (_spoolHead != NULL) {
- slots += _spoolHead->bufferSize - 1;
- blocks++;
- }
- gclog_or_tty->print_cr(" [worker %d] promo_blocks = %d, promo_slots = %d ",
- worker_id, blocks, slots);
-}
-
-// When _spoolTail is not NULL, then the slot <_spoolTail, _nextIndex>
-// points to the next slot available for filling.
-// The set of slots holding displaced headers are then all those in the
-// right-open interval denoted by:
-//
-// [ <_spoolHead, _firstIndex>, <_spoolTail, _nextIndex> )
-//
-// When _spoolTail is NULL, then the set of slots with displaced headers
-// is all those starting at the slot <_spoolHead, _firstIndex> and
-// going up to the last slot of last block in the linked list.
-// In this lartter case, _splice_point points to the tail block of
-// this linked list of blocks holding displaced headers.
-void PromotionInfo::verify() const {
- // Verify the following:
- // 1. the number of displaced headers matches the number of promoted
- // objects that have displaced headers
- // 2. each promoted object lies in this space
- debug_only(
- PromotedObject* junk = NULL;
- assert(junk->next_addr() == (void*)(oop(junk)->mark_addr()),
- "Offset of PromotedObject::_next is expected to align with "
- " the OopDesc::_mark within OopDesc");
- )
- // FIXME: guarantee????
- guarantee(_spoolHead == NULL || _spoolTail != NULL ||
- _splice_point != NULL, "list consistency");
- guarantee(_promoHead == NULL || _promoTail != NULL, "list consistency");
- // count the number of objects with displaced headers
- size_t numObjsWithDisplacedHdrs = 0;
- for (PromotedObject* curObj = _promoHead; curObj != NULL; curObj = curObj->next()) {
- guarantee(space()->is_in_reserved((HeapWord*)curObj), "Containment");
- // the last promoted object may fail the mark() != NULL test of is_oop().
- guarantee(curObj->next() == NULL || oop(curObj)->is_oop(), "must be an oop");
- if (curObj->hasDisplacedMark()) {
- numObjsWithDisplacedHdrs++;
- }
- }
- // Count the number of displaced headers
- size_t numDisplacedHdrs = 0;
- for (SpoolBlock* curSpool = _spoolHead;
- curSpool != _spoolTail && curSpool != NULL;
- curSpool = curSpool->nextSpoolBlock) {
- // the first entry is just a self-pointer; indices 1 through
- // bufferSize - 1 are occupied (thus, bufferSize - 1 slots).
- guarantee((void*)curSpool->displacedHdr == (void*)&curSpool->displacedHdr,
- "first entry of displacedHdr should be self-referential");
- numDisplacedHdrs += curSpool->bufferSize - 1;
- }
- guarantee((_spoolHead == _spoolTail) == (numDisplacedHdrs == 0),
- "internal consistency");
- guarantee(_spoolTail != NULL || _nextIndex == 1,
- "Inconsistency between _spoolTail and _nextIndex");
- // We overcounted (_firstIndex-1) worth of slots in block
- // _spoolHead and we undercounted (_nextIndex-1) worth of
- // slots in block _spoolTail. We make an appropriate
- // adjustment by subtracting the first and adding the
- // second: - (_firstIndex - 1) + (_nextIndex - 1)
- numDisplacedHdrs += (_nextIndex - _firstIndex);
- guarantee(numDisplacedHdrs == numObjsWithDisplacedHdrs, "Displaced hdr count");
-}
-
-void PromotionInfo::print_on(outputStream* st) const {
- SpoolBlock* curSpool = NULL;
- size_t i = 0;
- st->print_cr("start & end indices: [" SIZE_FORMAT ", " SIZE_FORMAT ")",
- _firstIndex, _nextIndex);
- for (curSpool = _spoolHead; curSpool != _spoolTail && curSpool != NULL;
- curSpool = curSpool->nextSpoolBlock) {
- curSpool->print_on(st);
- st->print_cr(" active ");
- i++;
- }
- for (curSpool = _spoolTail; curSpool != NULL;
- curSpool = curSpool->nextSpoolBlock) {
- curSpool->print_on(st);
- st->print_cr(" inactive ");
- i++;
- }
- for (curSpool = _spareSpool; curSpool != NULL;
- curSpool = curSpool->nextSpoolBlock) {
- curSpool->print_on(st);
- st->print_cr(" free ");
- i++;
- }
- st->print_cr(SIZE_FORMAT " header spooling blocks", i);
-}
-
-void SpoolBlock::print_on(outputStream* st) const {
- st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT,
- this, (HeapWord*)displacedHdr + bufferSize,
- bufferSize, nextSpoolBlock);
-}
-
///////////////////////////////////////////////////////////////////////////
// CFLS_LAB
///////////////////////////////////////////////////////////////////////////
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Thu May 20 01:34:22 2010 -0700
@@ -33,140 +33,6 @@
class ObjectClosureCareful;
class Klass;
-class PromotedObject VALUE_OBJ_CLASS_SPEC {
- private:
- enum {
- promoted_mask = right_n_bits(2), // i.e. 0x3
- displaced_mark = nth_bit(2), // i.e. 0x4
- next_mask = ~(right_n_bits(3)) // i.e. ~(0x7)
- };
- intptr_t _next;
- public:
- inline PromotedObject* next() const {
- return (PromotedObject*)(_next & next_mask);
- }
- inline void setNext(PromotedObject* x) {
- assert(((intptr_t)x & ~next_mask) == 0,
- "Conflict in bit usage, "
- " or insufficient alignment of objects");
- _next |= (intptr_t)x;
- }
- inline void setPromotedMark() {
- _next |= promoted_mask;
- }
- inline bool hasPromotedMark() const {
- return (_next & promoted_mask) == promoted_mask;
- }
- inline void setDisplacedMark() {
- _next |= displaced_mark;
- }
- inline bool hasDisplacedMark() const {
- return (_next & displaced_mark) != 0;
- }
- inline void clearNext() { _next = 0; }
- debug_only(void *next_addr() { return (void *) &_next; })
-};
-
-class SpoolBlock: public FreeChunk {
- friend class PromotionInfo;
- protected:
- SpoolBlock* nextSpoolBlock;
- size_t bufferSize; // number of usable words in this block
- markOop* displacedHdr; // the displaced headers start here
-
- // Note about bufferSize: it denotes the number of entries available plus 1;
- // legal indices range from 1 through BufferSize - 1. See the verification
- // code verify() that counts the number of displaced headers spooled.
- size_t computeBufferSize() {
- return (size() * sizeof(HeapWord) - sizeof(*this)) / sizeof(markOop);
- }
-
- public:
- void init() {
- bufferSize = computeBufferSize();
- displacedHdr = (markOop*)&displacedHdr;
- nextSpoolBlock = NULL;
- }
-
- void print_on(outputStream* st) const;
- void print() const { print_on(gclog_or_tty); }
-};
-
-class PromotionInfo VALUE_OBJ_CLASS_SPEC {
- bool _tracking; // set if tracking
- CompactibleFreeListSpace* _space; // the space to which this belongs
- PromotedObject* _promoHead; // head of list of promoted objects
- PromotedObject* _promoTail; // tail of list of promoted objects
- SpoolBlock* _spoolHead; // first spooling block
- SpoolBlock* _spoolTail; // last non-full spooling block or null
- SpoolBlock* _splice_point; // when _spoolTail is null, holds list tail
- SpoolBlock* _spareSpool; // free spool buffer
- size_t _firstIndex; // first active index in
- // first spooling block (_spoolHead)
- size_t _nextIndex; // last active index + 1 in last
- // spooling block (_spoolTail)
- private:
- // ensure that spooling space exists; return true if there is spooling space
- bool ensure_spooling_space_work();
-
- public:
- PromotionInfo() :
- _tracking(0), _space(NULL),
- _promoHead(NULL), _promoTail(NULL),
- _spoolHead(NULL), _spoolTail(NULL),
- _spareSpool(NULL), _firstIndex(1),
- _nextIndex(1) {}
-
- bool noPromotions() const {
- assert(_promoHead != NULL || _promoTail == NULL, "list inconsistency");
- return _promoHead == NULL;
- }
- void startTrackingPromotions();
- void stopTrackingPromotions(uint worker_id = 0);
- bool tracking() const { return _tracking; }
- void track(PromotedObject* trackOop); // keep track of a promoted oop
- // The following variant must be used when trackOop is not fully
- // initialized and has a NULL klass:
- void track(PromotedObject* trackOop, klassOop klassOfOop); // keep track of a promoted oop
- void setSpace(CompactibleFreeListSpace* sp) { _space = sp; }
- CompactibleFreeListSpace* space() const { return _space; }
- markOop nextDisplacedHeader(); // get next header & forward spool pointer
- void saveDisplacedHeader(markOop hdr);
- // save header and forward spool
-
- inline size_t refillSize() const;
-
- SpoolBlock* getSpoolBlock(); // return a free spooling block
- inline bool has_spooling_space() {
- return _spoolTail != NULL && _spoolTail->bufferSize > _nextIndex;
- }
- // ensure that spooling space exists
- bool ensure_spooling_space() {
- return has_spooling_space() || ensure_spooling_space_work();
- }
- #define PROMOTED_OOPS_ITERATE_DECL(OopClosureType, nv_suffix) \
- void promoted_oops_iterate##nv_suffix(OopClosureType* cl);
- ALL_SINCE_SAVE_MARKS_CLOSURES(PROMOTED_OOPS_ITERATE_DECL)
- #undef PROMOTED_OOPS_ITERATE_DECL
- void promoted_oops_iterate(OopsInGenClosure* cl) {
- promoted_oops_iterate_v(cl);
- }
- void verify() const;
- void reset() {
- _promoHead = NULL;
- _promoTail = NULL;
- _spoolHead = NULL;
- _spoolTail = NULL;
- _spareSpool = NULL;
- _firstIndex = 0;
- _nextIndex = 0;
-
- }
-
- void print_on(outputStream* st) const;
- void print_statistics(uint worker_id) const;
-};
-
class LinearAllocBlock VALUE_OBJ_CLASS_SPEC {
public:
LinearAllocBlock() : _ptr(0), _word_size(0), _refillSize(0),
@@ -557,6 +423,12 @@
// promoted since the most recent call to save_marks() on
// this generation and has not subsequently been iterated
// over (using oop_since_save_marks_iterate() above).
+ // This property holds only for single-threaded collections,
+ // and is typically used for Cheney scans; for MT scavenges,
+ // the property holds for all objects promoted during that
+ // scavenge for the duration of the scavenge and is used
+ // by card-scanning to avoid scanning objects (being) promoted
+ // during that scavenge.
bool obj_allocated_since_save_marks(const oop obj) const {
assert(is_in_reserved(obj), "Wrong space?");
return ((PromotedObject*)obj)->hasPromotedMark();
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Thu May 20 01:34:22 2010 -0700
@@ -789,6 +789,14 @@
_gc_counters = new CollectorCounters("CMS", 1);
_completed_initialization = true;
_inter_sweep_timer.start(); // start of time
+#ifdef SPARC
+ // Issue a stern warning, but allow use for experimentation and debugging.
+ if (VM_Version::is_sun4v() && UseMemSetInBOT) {
+ assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
+ warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
+ " on sun4v; please understand that you are using at your own risk!");
+ }
+#endif
}
const char* ConcurrentMarkSweepGeneration::name() const {
@@ -1356,7 +1364,7 @@
obj->set_mark(m);
// Now we can track the promoted object, if necessary. We take care
- // To delay the transition from uninitialized to full object
+ // to delay the transition from uninitialized to full object
// (i.e., insertion of klass pointer) until after, so that it
// atomically becomes a promoted object.
if (promoInfo->tracking()) {
@@ -1416,10 +1424,9 @@
bool CMSCollector::shouldConcurrentCollect() {
if (_full_gc_requested) {
- assert(ExplicitGCInvokesConcurrent, "Unexpected state");
if (Verbose && PrintGCDetails) {
gclog_or_tty->print_cr("CMSCollector: collect because of explicit "
- " gc request");
+ " gc request (or gc_locker)");
}
return true;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp Thu May 20 01:34:22 2010 -0700
@@ -0,0 +1,360 @@
+/*
+ * Copyright 2001-2009 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.
+ *
+ */
+
+# include "incls/_precompiled.incl"
+# include "incls/_promotionInfo.cpp.incl"
+
+/////////////////////////////////////////////////////////////////////////
+//// PromotionInfo
+/////////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////////
+// We go over the list of promoted objects, removing each from the list,
+// and applying the closure (this may, in turn, add more elements to
+// the tail of the promoted list, and these newly added objects will
+// also be processed) until the list is empty.
+// To aid verification and debugging, in the non-product builds
+// we actually forward _promoHead each time we process a promoted oop.
+// Note that this is not necessary in general (i.e. when we don't need to
+// call PromotionInfo::verify()) because oop_iterate can only add to the
+// end of _promoTail, and never needs to look at _promoHead.
+
+#define PROMOTED_OOPS_ITERATE_DEFN(OopClosureType, nv_suffix) \
+ \
+void PromotionInfo::promoted_oops_iterate##nv_suffix(OopClosureType* cl) { \
+ NOT_PRODUCT(verify()); \
+ PromotedObject *curObj, *nextObj; \
+ for (curObj = _promoHead; curObj != NULL; curObj = nextObj) { \
+ if ((nextObj = curObj->next()) == NULL) { \
+ /* protect ourselves against additions due to closure application \
+ below by resetting the list. */ \
+ assert(_promoTail == curObj, "Should have been the tail"); \
+ _promoHead = _promoTail = NULL; \
+ } \
+ if (curObj->hasDisplacedMark()) { \
+ /* restore displaced header */ \
+ oop(curObj)->set_mark(nextDisplacedHeader()); \
+ } else { \
+ /* restore prototypical header */ \
+ oop(curObj)->init_mark(); \
+ } \
+ /* The "promoted_mark" should now not be set */ \
+ assert(!curObj->hasPromotedMark(), \
+ "Should have been cleared by restoring displaced mark-word"); \
+ NOT_PRODUCT(_promoHead = nextObj); \
+ if (cl != NULL) oop(curObj)->oop_iterate(cl); \
+ if (nextObj == NULL) { /* start at head of list reset above */ \
+ nextObj = _promoHead; \
+ } \
+ } \
+ assert(noPromotions(), "post-condition violation"); \
+ assert(_promoHead == NULL && _promoTail == NULL, "emptied promoted list");\
+ assert(_spoolHead == _spoolTail, "emptied spooling buffers"); \
+ assert(_firstIndex == _nextIndex, "empty buffer"); \
+}
+
+// This should have been ALL_SINCE_...() just like the others,
+// but, because the body of the method above is somehwat longer,
+// the MSVC compiler cannot cope; as a workaround, we split the
+// macro into its 3 constituent parts below (see original macro
+// definition in specializedOopClosures.hpp).
+SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(PROMOTED_OOPS_ITERATE_DEFN)
+PROMOTED_OOPS_ITERATE_DEFN(OopsInGenClosure,_v)
+
+
+// Return the next displaced header, incrementing the pointer and
+// recycling spool area as necessary.
+markOop PromotionInfo::nextDisplacedHeader() {
+ assert(_spoolHead != NULL, "promotionInfo inconsistency");
+ assert(_spoolHead != _spoolTail || _firstIndex < _nextIndex,
+ "Empty spool space: no displaced header can be fetched");
+ assert(_spoolHead->bufferSize > _firstIndex, "Off by one error at head?");
+ markOop hdr = _spoolHead->displacedHdr[_firstIndex];
+ // Spool forward
+ if (++_firstIndex == _spoolHead->bufferSize) { // last location in this block
+ // forward to next block, recycling this block into spare spool buffer
+ SpoolBlock* tmp = _spoolHead->nextSpoolBlock;
+ assert(_spoolHead != _spoolTail, "Spooling storage mix-up");
+ _spoolHead->nextSpoolBlock = _spareSpool;
+ _spareSpool = _spoolHead;
+ _spoolHead = tmp;
+ _firstIndex = 1;
+ NOT_PRODUCT(
+ if (_spoolHead == NULL) { // all buffers fully consumed
+ assert(_spoolTail == NULL && _nextIndex == 1,
+ "spool buffers processing inconsistency");
+ }
+ )
+ }
+ return hdr;
+}
+
+void PromotionInfo::track(PromotedObject* trackOop) {
+ track(trackOop, oop(trackOop)->klass());
+}
+
+void PromotionInfo::track(PromotedObject* trackOop, klassOop klassOfOop) {
+ // make a copy of header as it may need to be spooled
+ markOop mark = oop(trackOop)->mark();
+ trackOop->clearNext();
+ if (mark->must_be_preserved_for_cms_scavenge(klassOfOop)) {
+ // save non-prototypical header, and mark oop
+ saveDisplacedHeader(mark);
+ trackOop->setDisplacedMark();
+ } else {
+ // we'd like to assert something like the following:
+ // assert(mark == markOopDesc::prototype(), "consistency check");
+ // ... but the above won't work because the age bits have not (yet) been
+ // cleared. The remainder of the check would be identical to the
+ // condition checked in must_be_preserved() above, so we don't really
+ // have anything useful to check here!
+ }
+ if (_promoTail != NULL) {
+ assert(_promoHead != NULL, "List consistency");
+ _promoTail->setNext(trackOop);
+ _promoTail = trackOop;
+ } else {
+ assert(_promoHead == NULL, "List consistency");
+ _promoHead = _promoTail = trackOop;
+ }
+ // Mask as newly promoted, so we can skip over such objects
+ // when scanning dirty cards
+ assert(!trackOop->hasPromotedMark(), "Should not have been marked");
+ trackOop->setPromotedMark();
+}
+
+// Save the given displaced header, incrementing the pointer and
+// obtaining more spool area as necessary.
+void PromotionInfo::saveDisplacedHeader(markOop hdr) {
+ assert(_spoolHead != NULL && _spoolTail != NULL,
+ "promotionInfo inconsistency");
+ assert(_spoolTail->bufferSize > _nextIndex, "Off by one error at tail?");
+ _spoolTail->displacedHdr[_nextIndex] = hdr;
+ // Spool forward
+ if (++_nextIndex == _spoolTail->bufferSize) { // last location in this block
+ // get a new spooling block
+ assert(_spoolTail->nextSpoolBlock == NULL, "tail should terminate spool list");
+ _splice_point = _spoolTail; // save for splicing
+ _spoolTail->nextSpoolBlock = getSpoolBlock(); // might fail
+ _spoolTail = _spoolTail->nextSpoolBlock; // might become NULL ...
+ // ... but will attempt filling before next promotion attempt
+ _nextIndex = 1;
+ }
+}
+
+// Ensure that spooling space exists. Return false if spooling space
+// could not be obtained.
+bool PromotionInfo::ensure_spooling_space_work() {
+ assert(!has_spooling_space(), "Only call when there is no spooling space");
+ // Try and obtain more spooling space
+ SpoolBlock* newSpool = getSpoolBlock();
+ assert(newSpool == NULL ||
+ (newSpool->bufferSize != 0 && newSpool->nextSpoolBlock == NULL),
+ "getSpoolBlock() sanity check");
+ if (newSpool == NULL) {
+ return false;
+ }
+ _nextIndex = 1;
+ if (_spoolTail == NULL) {
+ _spoolTail = newSpool;
+ if (_spoolHead == NULL) {
+ _spoolHead = newSpool;
+ _firstIndex = 1;
+ } else {
+ assert(_splice_point != NULL && _splice_point->nextSpoolBlock == NULL,
+ "Splice point invariant");
+ // Extra check that _splice_point is connected to list
+ #ifdef ASSERT
+ {
+ SpoolBlock* blk = _spoolHead;
+ for (; blk->nextSpoolBlock != NULL;
+ blk = blk->nextSpoolBlock);
+ assert(blk != NULL && blk == _splice_point,
+ "Splice point incorrect");
+ }
+ #endif // ASSERT
+ _splice_point->nextSpoolBlock = newSpool;
+ }
+ } else {
+ assert(_spoolHead != NULL, "spool list consistency");
+ _spoolTail->nextSpoolBlock = newSpool;
+ _spoolTail = newSpool;
+ }
+ return true;
+}
+
+// Get a free spool buffer from the free pool, getting a new block
+// from the heap if necessary.
+SpoolBlock* PromotionInfo::getSpoolBlock() {
+ SpoolBlock* res;
+ if ((res = _spareSpool) != NULL) {
+ _spareSpool = _spareSpool->nextSpoolBlock;
+ res->nextSpoolBlock = NULL;
+ } else { // spare spool exhausted, get some from heap
+ res = (SpoolBlock*)(space()->allocateScratch(refillSize()));
+ if (res != NULL) {
+ res->init();
+ }
+ }
+ assert(res == NULL || res->nextSpoolBlock == NULL, "postcondition");
+ return res;
+}
+
+void PromotionInfo::startTrackingPromotions() {
+ assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
+ "spooling inconsistency?");
+ _firstIndex = _nextIndex = 1;
+ _tracking = true;
+}
+
+#define CMSPrintPromoBlockInfo 1
+
+void PromotionInfo::stopTrackingPromotions(uint worker_id) {
+ assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
+ "spooling inconsistency?");
+ _firstIndex = _nextIndex = 1;
+ _tracking = false;
+ if (CMSPrintPromoBlockInfo > 1) {
+ print_statistics(worker_id);
+ }
+}
+
+void PromotionInfo::print_statistics(uint worker_id) const {
+ assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
+ "Else will undercount");
+ assert(CMSPrintPromoBlockInfo > 0, "Else unnecessary call");
+ // Count the number of blocks and slots in the free pool
+ size_t slots = 0;
+ size_t blocks = 0;
+ for (SpoolBlock* cur_spool = _spareSpool;
+ cur_spool != NULL;
+ cur_spool = cur_spool->nextSpoolBlock) {
+ // the first entry is just a self-pointer; indices 1 through
+ // bufferSize - 1 are occupied (thus, bufferSize - 1 slots).
+ guarantee((void*)cur_spool->displacedHdr == (void*)&cur_spool->displacedHdr,
+ "first entry of displacedHdr should be self-referential");
+ slots += cur_spool->bufferSize - 1;
+ blocks++;
+ }
+ if (_spoolHead != NULL) {
+ slots += _spoolHead->bufferSize - 1;
+ blocks++;
+ }
+ gclog_or_tty->print_cr(" [worker %d] promo_blocks = %d, promo_slots = %d ",
+ worker_id, blocks, slots);
+}
+
+// When _spoolTail is not NULL, then the slot <_spoolTail, _nextIndex>
+// points to the next slot available for filling.
+// The set of slots holding displaced headers are then all those in the
+// right-open interval denoted by:
+//
+// [ <_spoolHead, _firstIndex>, <_spoolTail, _nextIndex> )
+//
+// When _spoolTail is NULL, then the set of slots with displaced headers
+// is all those starting at the slot <_spoolHead, _firstIndex> and
+// going up to the last slot of last block in the linked list.
+// In this lartter case, _splice_point points to the tail block of
+// this linked list of blocks holding displaced headers.
+void PromotionInfo::verify() const {
+ // Verify the following:
+ // 1. the number of displaced headers matches the number of promoted
+ // objects that have displaced headers
+ // 2. each promoted object lies in this space
+ debug_only(
+ PromotedObject* junk = NULL;
+ assert(junk->next_addr() == (void*)(oop(junk)->mark_addr()),
+ "Offset of PromotedObject::_next is expected to align with "
+ " the OopDesc::_mark within OopDesc");
+ )
+ // FIXME: guarantee????
+ guarantee(_spoolHead == NULL || _spoolTail != NULL ||
+ _splice_point != NULL, "list consistency");
+ guarantee(_promoHead == NULL || _promoTail != NULL, "list consistency");
+ // count the number of objects with displaced headers
+ size_t numObjsWithDisplacedHdrs = 0;
+ for (PromotedObject* curObj = _promoHead; curObj != NULL; curObj = curObj->next()) {
+ guarantee(space()->is_in_reserved((HeapWord*)curObj), "Containment");
+ // the last promoted object may fail the mark() != NULL test of is_oop().
+ guarantee(curObj->next() == NULL || oop(curObj)->is_oop(), "must be an oop");
+ if (curObj->hasDisplacedMark()) {
+ numObjsWithDisplacedHdrs++;
+ }
+ }
+ // Count the number of displaced headers
+ size_t numDisplacedHdrs = 0;
+ for (SpoolBlock* curSpool = _spoolHead;
+ curSpool != _spoolTail && curSpool != NULL;
+ curSpool = curSpool->nextSpoolBlock) {
+ // the first entry is just a self-pointer; indices 1 through
+ // bufferSize - 1 are occupied (thus, bufferSize - 1 slots).
+ guarantee((void*)curSpool->displacedHdr == (void*)&curSpool->displacedHdr,
+ "first entry of displacedHdr should be self-referential");
+ numDisplacedHdrs += curSpool->bufferSize - 1;
+ }
+ guarantee((_spoolHead == _spoolTail) == (numDisplacedHdrs == 0),
+ "internal consistency");
+ guarantee(_spoolTail != NULL || _nextIndex == 1,
+ "Inconsistency between _spoolTail and _nextIndex");
+ // We overcounted (_firstIndex-1) worth of slots in block
+ // _spoolHead and we undercounted (_nextIndex-1) worth of
+ // slots in block _spoolTail. We make an appropriate
+ // adjustment by subtracting the first and adding the
+ // second: - (_firstIndex - 1) + (_nextIndex - 1)
+ numDisplacedHdrs += (_nextIndex - _firstIndex);
+ guarantee(numDisplacedHdrs == numObjsWithDisplacedHdrs, "Displaced hdr count");
+}
+
+void PromotionInfo::print_on(outputStream* st) const {
+ SpoolBlock* curSpool = NULL;
+ size_t i = 0;
+ st->print_cr("start & end indices: [" SIZE_FORMAT ", " SIZE_FORMAT ")",
+ _firstIndex, _nextIndex);
+ for (curSpool = _spoolHead; curSpool != _spoolTail && curSpool != NULL;
+ curSpool = curSpool->nextSpoolBlock) {
+ curSpool->print_on(st);
+ st->print_cr(" active ");
+ i++;
+ }
+ for (curSpool = _spoolTail; curSpool != NULL;
+ curSpool = curSpool->nextSpoolBlock) {
+ curSpool->print_on(st);
+ st->print_cr(" inactive ");
+ i++;
+ }
+ for (curSpool = _spareSpool; curSpool != NULL;
+ curSpool = curSpool->nextSpoolBlock) {
+ curSpool->print_on(st);
+ st->print_cr(" free ");
+ i++;
+ }
+ st->print_cr(SIZE_FORMAT " header spooling blocks", i);
+}
+
+void SpoolBlock::print_on(outputStream* st) const {
+ st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT,
+ this, (HeapWord*)displacedHdr + bufferSize,
+ bufferSize, nextSpoolBlock);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp Thu May 20 01:34:22 2010 -0700
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2001-2009 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.
+ *
+ */
+
+// Forward declarations
+class CompactibleFreeListSpace;
+
+class PromotedObject VALUE_OBJ_CLASS_SPEC {
+ private:
+ enum {
+ promoted_mask = right_n_bits(2), // i.e. 0x3
+ displaced_mark = nth_bit(2), // i.e. 0x4
+ next_mask = ~(right_n_bits(3)) // i.e. ~(0x7)
+ };
+ intptr_t _next;
+ public:
+ inline PromotedObject* next() const {
+ return (PromotedObject*)(_next & next_mask);
+ }
+ inline void setNext(PromotedObject* x) {
+ assert(((intptr_t)x & ~next_mask) == 0,
+ "Conflict in bit usage, "
+ " or insufficient alignment of objects");
+ _next |= (intptr_t)x;
+ }
+ inline void setPromotedMark() {
+ _next |= promoted_mask;
+ }
+ inline bool hasPromotedMark() const {
+ return (_next & promoted_mask) == promoted_mask;
+ }
+ inline void setDisplacedMark() {
+ _next |= displaced_mark;
+ }
+ inline bool hasDisplacedMark() const {
+ return (_next & displaced_mark) != 0;
+ }
+ inline void clearNext() { _next = 0; }
+ debug_only(void *next_addr() { return (void *) &_next; })
+};
+
+class SpoolBlock: public FreeChunk {
+ friend class PromotionInfo;
+ protected:
+ SpoolBlock* nextSpoolBlock;
+ size_t bufferSize; // number of usable words in this block
+ markOop* displacedHdr; // the displaced headers start here
+
+ // Note about bufferSize: it denotes the number of entries available plus 1;
+ // legal indices range from 1 through BufferSize - 1. See the verification
+ // code verify() that counts the number of displaced headers spooled.
+ size_t computeBufferSize() {
+ return (size() * sizeof(HeapWord) - sizeof(*this)) / sizeof(markOop);
+ }
+
+ public:
+ void init() {
+ bufferSize = computeBufferSize();
+ displacedHdr = (markOop*)&displacedHdr;
+ nextSpoolBlock = NULL;
+ }
+
+ void print_on(outputStream* st) const;
+ void print() const { print_on(gclog_or_tty); }
+};
+
+class PromotionInfo VALUE_OBJ_CLASS_SPEC {
+ bool _tracking; // set if tracking
+ CompactibleFreeListSpace* _space; // the space to which this belongs
+ PromotedObject* _promoHead; // head of list of promoted objects
+ PromotedObject* _promoTail; // tail of list of promoted objects
+ SpoolBlock* _spoolHead; // first spooling block
+ SpoolBlock* _spoolTail; // last non-full spooling block or null
+ SpoolBlock* _splice_point; // when _spoolTail is null, holds list tail
+ SpoolBlock* _spareSpool; // free spool buffer
+ size_t _firstIndex; // first active index in
+ // first spooling block (_spoolHead)
+ size_t _nextIndex; // last active index + 1 in last
+ // spooling block (_spoolTail)
+ private:
+ // ensure that spooling space exists; return true if there is spooling space
+ bool ensure_spooling_space_work();
+
+ public:
+ PromotionInfo() :
+ _tracking(0), _space(NULL),
+ _promoHead(NULL), _promoTail(NULL),
+ _spoolHead(NULL), _spoolTail(NULL),
+ _spareSpool(NULL), _firstIndex(1),
+ _nextIndex(1) {}
+
+ bool noPromotions() const {
+ assert(_promoHead != NULL || _promoTail == NULL, "list inconsistency");
+ return _promoHead == NULL;
+ }
+ void startTrackingPromotions();
+ void stopTrackingPromotions(uint worker_id = 0);
+ bool tracking() const { return _tracking; }
+ void track(PromotedObject* trackOop); // keep track of a promoted oop
+ // The following variant must be used when trackOop is not fully
+ // initialized and has a NULL klass:
+ void track(PromotedObject* trackOop, klassOop klassOfOop); // keep track of a promoted oop
+ void setSpace(CompactibleFreeListSpace* sp) { _space = sp; }
+ CompactibleFreeListSpace* space() const { return _space; }
+ markOop nextDisplacedHeader(); // get next header & forward spool pointer
+ void saveDisplacedHeader(markOop hdr);
+ // save header and forward spool
+
+ inline size_t refillSize() const;
+
+ SpoolBlock* getSpoolBlock(); // return a free spooling block
+ inline bool has_spooling_space() {
+ return _spoolTail != NULL && _spoolTail->bufferSize > _nextIndex;
+ }
+ // ensure that spooling space exists
+ bool ensure_spooling_space() {
+ return has_spooling_space() || ensure_spooling_space_work();
+ }
+ #define PROMOTED_OOPS_ITERATE_DECL(OopClosureType, nv_suffix) \
+ void promoted_oops_iterate##nv_suffix(OopClosureType* cl);
+ ALL_SINCE_SAVE_MARKS_CLOSURES(PROMOTED_OOPS_ITERATE_DECL)
+ #undef PROMOTED_OOPS_ITERATE_DECL
+ void promoted_oops_iterate(OopsInGenClosure* cl) {
+ promoted_oops_iterate_v(cl);
+ }
+ void verify() const;
+ void reset() {
+ _promoHead = NULL;
+ _promoTail = NULL;
+ _spoolHead = NULL;
+ _spoolTail = NULL;
+ _spareSpool = NULL;
+ _firstIndex = 0;
+ _nextIndex = 0;
+
+ }
+
+ void print_on(outputStream* st) const;
+ void print_statistics(uint worker_id) const;
+};
+
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp Thu May 20 01:34:22 2010 -0700
@@ -163,6 +163,7 @@
// GenCollectedHeap heap.
void VM_GenCollectFullConcurrent::doit() {
assert(Thread::current()->is_VM_thread(), "Should be VM thread");
+ assert(GCLockerInvokesConcurrent || ExplicitGCInvokesConcurrent, "Unexpected");
GenCollectedHeap* gch = GenCollectedHeap::heap();
if (_gc_count_before == gch->total_collections()) {
@@ -190,7 +191,7 @@
CMSCollector::disable_icms();
// In case CMS thread was in icms_wait(), wake it up.
CMSCollector::start_icms();
- // Nudge the CMS thread to start a concurrent collection
+ // Nudge the CMS thread to start a concurrent collection.
CMSCollector::request_full_gc(_full_gc_count_before);
} else {
FullGCCount_lock->notify_all(); // Inform the Java thread its work is done
@@ -231,7 +232,9 @@
// e.g. at the rate of 1 full gc per ms, this could
// overflow in about 1000 years.
GenCollectedHeap* gch = GenCollectedHeap::heap();
- if (gch->total_full_collections_completed() <= _full_gc_count_before) {
+ if (_gc_cause != GCCause::_gc_locker &&
+ gch->total_full_collections_completed() <= _full_gc_count_before) {
+ assert(ExplicitGCInvokesConcurrent, "Error");
// Now, wait for witnessing concurrent gc cycle to complete,
// but do so in native mode, because we want to lock the
// FullGCEvent_lock, which may be needed by the VM thread
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp Thu May 20 01:34:22 2010 -0700
@@ -126,8 +126,7 @@
GCCause::Cause gc_cause)
: VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */) {
_gc_cause = gc_cause;
- assert(FullGCCount_lock != NULL && UseConcMarkSweepGC &&
- ExplicitGCInvokesConcurrent, "Otherwise shouldn't be here");
+ assert(FullGCCount_lock != NULL, "Error");
assert(UseAsyncConcMarkSweepGC, "Else will hang caller");
}
~VM_GenCollectFullConcurrent() {}
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu May 20 01:34:22 2010 -0700
@@ -290,7 +290,7 @@
// Recalculate the region size to make sure it's a power of
// 2. This means that region_size is the largest power of 2 that's
// <= what we've calculated so far.
- region_size = 1 << region_size_log;
+ region_size = ((uintx)1 << region_size_log);
// Now make sure that we don't go over or under our limits.
if (region_size < MIN_REGION_SIZE) {
--- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep Thu May 20 01:34:22 2010 -0700
@@ -122,6 +122,7 @@
compactibleFreeListSpace.hpp binaryTreeDictionary.hpp
compactibleFreeListSpace.hpp freeList.hpp
+compactibleFreeListSpace.hpp promotionInfo.hpp
compactibleFreeListSpace.hpp space.hpp
compactingPermGenGen.cpp concurrentMarkSweepGeneration.inline.hpp
@@ -225,6 +226,14 @@
freeList.hpp allocationStats.hpp
+promotionInfo.cpp compactibleFreeListSpace.hpp
+promotionInfo.cpp markOop.inline.hpp
+promotionInfo.cpp oop.inline.hpp
+promotionInfo.cpp promotionInfo.hpp
+
+promotionInfo.hpp allocation.hpp
+promotionInfo.hpp freeChunk.hpp
+
vmCMSOperations.cpp concurrentMarkSweepGeneration.inline.hpp
vmCMSOperations.cpp concurrentMarkSweepThread.hpp
vmCMSOperations.cpp dtrace.hpp
--- a/hotspot/src/share/vm/memory/blockOffsetTable.hpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/memory/blockOffsetTable.hpp Thu May 20 01:34:22 2010 -0700
@@ -140,14 +140,38 @@
"right address out of range");
assert(left < right, "Heap addresses out of order");
size_t num_cards = pointer_delta(right, left) >> LogN_words;
- memset(&_offset_array[index_for(left)], offset, num_cards);
+
+ // Below, we may use an explicit loop instead of memset()
+ // because on certain platforms memset() can give concurrent
+ // readers "out-of-thin-air," phantom zeros; see 6948537.
+ if (UseMemSetInBOT) {
+ memset(&_offset_array[index_for(left)], offset, num_cards);
+ } else {
+ size_t i = index_for(left);
+ const size_t end = i + num_cards;
+ for (; i < end; i++) {
+ _offset_array[i] = offset;
+ }
+ }
}
void set_offset_array(size_t left, size_t right, u_char offset) {
assert(right < _vs.committed_size(), "right address out of range");
assert(left <= right, "indexes out of order");
size_t num_cards = right - left + 1;
- memset(&_offset_array[left], offset, num_cards);
+
+ // Below, we may use an explicit loop instead of memset
+ // because on certain platforms memset() can give concurrent
+ // readers "out-of-thin-air," phantom zeros; see 6948537.
+ if (UseMemSetInBOT) {
+ memset(&_offset_array[left], offset, num_cards);
+ } else {
+ size_t i = left;
+ const size_t end = i + num_cards;
+ for (; i < end; i++) {
+ _offset_array[i] = offset;
+ }
+ }
}
void check_offset_array(size_t index, HeapWord* high, HeapWord* low) const {
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp Thu May 20 01:34:22 2010 -0700
@@ -410,9 +410,9 @@
}
bool GenCollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
- return (cause == GCCause::_java_lang_system_gc ||
- cause == GCCause::_gc_locker) &&
- UseConcMarkSweepGC && ExplicitGCInvokesConcurrent;
+ return UseConcMarkSweepGC &&
+ ((cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) ||
+ (cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent));
}
void GenCollectedHeap::do_collection(bool full,
--- a/hotspot/src/share/vm/runtime/globals.hpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp Thu May 20 01:34:22 2010 -0700
@@ -327,6 +327,10 @@
product(bool, UseMembar, false, \
"(Unstable) Issues membars on thread state transitions") \
\
+ /* Temporary: See 6948537 */ \
+ experimental(bool, UseMemSetInBOT, true, \
+ "(Unstable) uses memset in BOT updates in GC code") \
+ \
diagnostic(bool, UnlockDiagnosticVMOptions, trueInDebug, \
"Enable normal processing of flags relating to field diagnostics")\
\
@@ -1299,6 +1303,10 @@
"also unloads classes during such a concurrent gc cycle " \
"(effective only when UseConcMarkSweepGC)") \
\
+ product(bool, GCLockerInvokesConcurrent, false, \
+ "The exit of a JNI CS necessitating a scavenge also" \
+ " kicks off a bkgrd concurrent collection") \
+ \
develop(bool, UseCMSAdaptiveFreeLists, true, \
"Use Adaptive Free Lists in the CMS generation") \
\
--- a/hotspot/src/share/vm/runtime/jniHandles.hpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/runtime/jniHandles.hpp Thu May 20 01:34:22 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 1998-2010 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
@@ -63,8 +63,14 @@
// refers to NULL (as is the case for any weak reference).
static jmethodID make_jmethod_id(methodHandle mh);
static void destroy_jmethod_id(jmethodID mid);
+ // Use resolve_jmethod_id() in situations where the caller is expected
+ // to provide a valid jmethodID; the only sanity checks are in asserts;
+ // result guaranteed not to be NULL.
inline static methodOop resolve_jmethod_id(jmethodID mid);
- inline static methodOop checked_resolve_jmethod_id(jmethodID mid); // NULL on invalid jmethodID
+ // Use checked_resolve_jmethod_id() in situations where the caller
+ // should provide a valid jmethodID, but might not. NULL is returned
+ // when the jmethodID does not refer to a valid method.
+ inline static methodOop checked_resolve_jmethod_id(jmethodID mid);
static void change_method_associated_with_jmethod_id(jmethodID jmid, methodHandle mh);
// Sentinel marking deleted handles in block. Note that we cannot store NULL as
@@ -200,12 +206,8 @@
};
inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) {
- if (mid == NULL) {
- return (methodOop) NULL;
- }
-
- oop o = resolve_non_null((jobject) mid);
- if (!o->is_method()) {
+ oop o = resolve_external_guard((jobject) mid);
+ if (o == NULL || !o->is_method()) {
return (methodOop) NULL;
}
--- a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp Wed May 19 10:22:39 2010 -0700
+++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp Thu May 20 01:34:22 2010 -0700
@@ -41,6 +41,26 @@
# pragma optimize ( "", off )
#endif
+/* The above workaround now causes more problems with the latest MS compiler.
+ * Visual Studio 2010's /GS option tries to guard against buffer overruns.
+ * /GS is on by default if you specify optimizations, which we do globally
+ * via /W3 /O2. However the above selective turning off of optimizations means
+ * that /GS issues a warning "4748". And since we treat warnings as errors (/WX)
+ * then the compilation fails. There are several possible solutions
+ * (1) Remove that pragma above as obsolete with VS2010 - requires testing.
+ * (2) Stop treating warnings as errors - would be a backward step
+ * (3) Disable /GS - may help performance but you lose the security checks
+ * (4) Disable the warning with "#pragma warning( disable : 4748 )"
+ * (5) Disable planting the code with __declspec(safebuffers)
+ * I've opted for (5) although we should investigate the local performance
+ * benefits of (1) and global performance benefit of (3).
+ */
+#if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1600))
+#define SAFEBUF __declspec(safebuffers)
+#else
+#define SAFEBUF
+#endif
+
#include <math.h>
// VM_LITTLE_ENDIAN is #defined appropriately in the Makefiles
@@ -235,7 +255,7 @@
two24B = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
-static int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int *ipio2) {
+static SAFEBUF int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int *ipio2) {
int jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
double z,fw,f[20],fq[20],q[20];
@@ -451,7 +471,7 @@
pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
-static int __ieee754_rem_pio2(double x, double *y) {
+static SAFEBUF int __ieee754_rem_pio2(double x, double *y) {
double z,w,t,r,fn;
double tx[3];
int e0,i,j,nx,n,ix,hx,i0;
--- a/jaxp/.hgtags Wed May 19 10:22:39 2010 -0700
+++ b/jaxp/.hgtags Thu May 20 01:34:22 2010 -0700
@@ -66,3 +66,4 @@
d2818fd2b036f3b3154a9a7de41afcf4ac679c1b jdk7-b89
c5d932ee326d6f7fd4634b11c7185ea82d184df2 jdk7-b90
b89b2c3044a298d542f84a2e9d957202b7d8cdb9 jdk7-b91
+e6a40e4bb10499fb6ee9db71ab5654e5a17ab75b jdk7-b92
--- a/jaxws/.hgtags Wed May 19 10:22:39 2010 -0700
+++ b/jaxws/.hgtags Thu May 20 01:34:22 2010 -0700
@@ -66,3 +66,4 @@
bf3675aa7f20fc6f241ce95760005aef2a30ff41 jdk7-b89
ead7c4566a0017bcb44b468b3ac03b60dc5333ce jdk7-b90
cf4686bf35abd1e573f09fa43cbec66403160ae9 jdk7-b91
+df7c033f6a11c0973ab0e74701b1248aee9b659f jdk7-b92
--- a/jdk/.hgtags Wed May 19 10:22:39 2010 -0700
+++ b/jdk/.hgtags Thu May 20 01:34:22 2010 -0700
@@ -66,3 +66,4 @@
4a6abb7e224cc8d9a583c23c5782e4668739a119 jdk7-b89
7f90d0b9dbb7ab4c60d0b0233e4e77fb4fac597c jdk7-b90
08a31cab971fcad4695e913d0f3be7bde3a90747 jdk7-b91
+f2dce7210cc00453c23e53edeec7156f112ca382 jdk7-b92
--- a/jdk/make/com/sun/java/pack/Makefile Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/com/sun/java/pack/Makefile Thu May 20 01:34:22 2010 -0700
@@ -152,7 +152,7 @@
$(prep-target)
$(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
ifdef MT
- $(MT) /manifest $(TEMPDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
+ $(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
endif
$(CP) $(TEMPDIR)/unpack200$(EXE_SUFFIX) $(UNPACK_EXE)
$(install-module-file)
--- a/jdk/make/common/Defs-windows.gmk Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/common/Defs-windows.gmk Thu May 20 01:34:22 2010 -0700
@@ -86,6 +86,11 @@
MSVCPNN_DLL = msvcp90.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
endif
+ ifeq ($(COMPILER_VERSION), VS2010)
+ MSVCRNN_DLL = msvcr100.dll
+ MSVCPNN_DLL = msvcp100.dll
+ MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
+ endif
endif
ifeq ($(ARCH_DATA_MODEL), 64)
@@ -94,6 +99,11 @@
MSVCPNN_DLL = msvcp90.dll
MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
endif
+ ifeq ($(COMPILER_VERSION), VS2010)
+ MSVCRNN_DLL = msvcr100.dll
+ MSVCPNN_DLL = msvcp100.dll
+ MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
+ endif
endif
EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
@@ -155,6 +165,7 @@
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
AUTOMATIC_PCH_OPTION =
GX_OPTION = -GX
+ GZ_OPTION = -GZ
ifeq ($(ARCH_DATA_MODEL), 32)
CC_OPT/HIGHEST = -Ox -Gy -Os -GB
CC_OPT/HIGHER = -Ox -Gy -Os -GB
@@ -171,6 +182,7 @@
AUTOMATIC_PCH_OPTION = -YX
# Also known as VC7 compiler
GX_OPTION = -GX
+ GZ_OPTION = -GZ
ifeq ($(ARCH_DATA_MODEL), 32)
# Lowered opt level to try and reduce footprint, dll size especially.
# Was: CC_OPT/HIGHEST = -O2 -G6
@@ -190,6 +202,7 @@
AUTOMATIC_PCH_OPTION =
# VS2005 compiler, only with Platform SDK right now?
GX_OPTION = -EHsc
+ GZ_OPTION = -RTC1
ifeq ($(ARCH_DATA_MODEL), 32)
CC_OPT/HIGHEST = -O2
CC_OPT/HIGHER = -O1
@@ -204,6 +217,23 @@
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
AUTOMATIC_PCH_OPTION =
GX_OPTION = -EHsc
+ GZ_OPTION = -RTC1
+ ifeq ($(ARCH_DATA_MODEL), 32)
+ CC_OPT/HIGHEST = -O2
+ CC_OPT/HIGHER = -O1
+ CC_OPT/LOWER = -O1
+ else
+ CC_OPT/HIGHEST = -O2
+ CC_OPT/HIGHER = -O1
+ CC_OPT/LOWER = -O1
+ endif
+ endif
+
+ ifeq ($(COMPILER_VERSION), VS2010)
+ # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
+ AUTOMATIC_PCH_OPTION =
+ GX_OPTION = -EHsc
+ GZ_OPTION = -RTC1
ifeq ($(ARCH_DATA_MODEL), 32)
CC_OPT/HIGHEST = -O2
CC_OPT/HIGHER = -O1
@@ -282,6 +312,13 @@
CFLAGS_OPT = $(CC_OPT)
CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION)
+ # REMIND: I don't see where CFLAGS_VS2005 is used. I suspect its
+ # pulled in as a combined "CFLAGS_$(COMPILER_VERSION)" string
+ # but the lack of this isn't causing any apparent build problems
+ # with VS 2010 but it could be causing compiler warnings.
+ # For now, I will add it for all cases :
+ CFLAGS_VS2010 += -Zc:wchar_t-
+ #
# Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type
# by default. However, we expect the wchar_t to be a typedef to the
# unsigned short data type. The -Zc:wchar_t- option restores the old
@@ -317,6 +354,7 @@
# VS2008 has bufferoverflow baked in:
LFLAGS_VS2008 =
+ LFLAGS_VS2010 =
# LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
BASELFLAGS = -nologo /opt:REF /incremental:no
--- a/jdk/make/common/Modules.gmk Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/common/Modules.gmk Thu May 20 01:34:22 2010 -0700
@@ -357,6 +357,9 @@
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin
$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
+ ifeq ($(COMPILER_VERSION), VS2010)
+ $(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
+ endif
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(COMPILER_VERSION), VS2003)
$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
--- a/jdk/make/common/Release.gmk Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/common/Release.gmk Thu May 20 01:34:22 2010 -0700
@@ -749,6 +749,8 @@
$(RM) `$(FIND) $(JRE_IMAGE_DIR)/lib -name 'ir.idl'`
# Construct an initial jre image (initial jdk jre) no trimming or stripping
+# See "initial-image-jdk-setup" for an explanation of the rm of
+# drive names like C:
initial-image-jre:: initial-image-jre-setup \
$(JRE_LICENSES) $(JRE_DOCFILES) \
$(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) \
@@ -759,6 +761,10 @@
$(MKDIR) -p $(JRE_IMAGE_DIR)/lib/applet
@# Copy in lib directory
$(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
+ ifeq ($(USING_CYGWIN),true)
+ $(RM) -rf $(JRE_IMAGE_DIR)/[A-Za-z]:
+ $(RM) -rf $(OUTPUTDIR)/[A-Za-z]:
+ endif
@# Make sure all directories are read/execute for everyone
$(CHMOD) a+rx `$(FIND) $(JRE_IMAGE_DIR) -type d`
@# Remove some files from the jre area
@@ -858,11 +864,27 @@
######################################################
# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
+# REMIND: the $(RM) calls for patterns like c:, d: following $(CPIO)
+# are because the 1.7.x versions of cygwin's cpio command drops these
+# in the working directory if the output path begins with that pattern
+# The one for the output jre subdirectory gets there because cpio sees its
+# own dropping in the input jre subdirectory. Need to remove both of these.
+# We can remove these RM's if someone figures out how to stop cpio from
+# leaving these there.
+# Note that its a real problem not because this directory can end up in the
+# bundle (I think it won't since it not in bin or lib and those are the
+# only places from which we copy everything), but because the presence
+# of this file causes cygwin's find to bomb out, thus breaking the build
+# in "install".
initial-image-jdk-setup:
$(RM) -r $(JDK_IMAGE_DIR)
$(MKDIR) -p $(JDK_IMAGE_DIR)/jre
($(CD) $(JRE_IMAGE_DIR) && $(FIND) . -depth -print \
| $(CPIO) -pdum $(JDK_IMAGE_DIR)/jre )
+ ifeq ($(USING_CYGWIN),true)
+ $(RM) -rf $(JRE_IMAGE_DIR)/[A-Za-z]:
+ $(RM) -rf $(JDK_IMAGE_DIR)/jre/[A-Za-z]:
+ endif
$(RM) -rf $(JDK_IMAGE_DIR)/jre/man
$(CHMOD) a+rx `$(FIND) $(JDK_IMAGE_DIR) -type d`
@@ -923,6 +945,9 @@
$(MKDIR) -p $(JDK_IMAGE_DIR)/bin
$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_IMAGE_DIR)/bin
$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
+ ifeq ($(COMPILER_VERSION), VS2010)
+ $(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
+ endif
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(COMPILER_VERSION), VS2003)
$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
--- a/jdk/make/common/shared/Compiler-msvc.gmk Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/common/shared/Compiler-msvc.gmk Thu May 20 01:34:22 2010 -0700
@@ -67,7 +67,7 @@
COMPILER_VERSION=VS2005
REBASE = $(COMPILER_PATH)../../Common8/Tools/Bin/rebase
MTL = $(COMPILER_PATH)../../Common8/Tools/Bin/midl
- MT = $(MSDEVTOOLS_PATH)mt
+ MT = $(MSDEVTOOLS_PATH)/mt
ifndef COMPILER_PATH
COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
endif
@@ -83,6 +83,17 @@
COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
endif
endif
+ ifeq ($(CC_MAJORVER), 16)
+ COMPILER_NAME=Visual Studio 10
+ COMPILER_VERSION=VS2010
+ #rebase and midl moved out of Visual Studio into the SDK:
+ REBASE = $(MSDEVTOOLS_PATH)/rebase
+ MTL = $(MSDEVTOOLS_PATH)/midl.exe
+ MT = $(MSDEVTOOLS_PATH)mt
+ ifndef COMPILER_PATH
+ COMPILER_PATH := $(error COMPILER_PATH cannot be empty here)
+ endif
+ endif
else
# else ARCH_DATA_MODEL is 64
LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
@@ -122,6 +133,15 @@
COMPILER_VERSION=VS2008
RC = $(MSSDK61)/Bin/X64/rc.exe
MT = $(MSSDK61)/Bin/X64/mt.exe
+ MTL = $(MSSDK61)/Bin/X64/midl.exe
+ endif
+ ifeq ($(CC_MAJORVER), 16)
+ COMPILER_NAME=Microsoft Visual Studio 10 (16.00.30319.01)
+ COMPILER_VERSION=VS2010
+ RC = $(MSDEVTOOLS_PATH)/Bin/x64/rc.exe
+ RSC = $(MSDEVTOOLS_PATH)/Bin/x64/rc.exe
+ MT = $(MSDEVTOOLS_PATH)/Bin/x64/mt.exe
+ MTL = $(MSDEVTOOLS_PATH)/Bin/X64/midl.exe
endif
# This will cause problems if ALT_COMPILER_PATH is defined to ""
# which is a directive to use the PATH.
--- a/jdk/make/common/shared/Defs-versions.gmk Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/common/shared/Defs-versions.gmk Thu May 20 01:34:22 2010 -0700
@@ -165,10 +165,10 @@
REQUIRED_DXSDK_VER = 0x0900
ifeq ($(CC_VERSION),msvc)
ifeq ($(ARCH_DATA_MODEL), 32)
- REQUIRED_COMPILER_NAME = Visual Studio 9
- REQUIRED_COMPILER_VERSION = VS2008
- REQUIRED_CC_VER = 15.00.21022.08
- REQUIRED_LINK_VER = 9.00.21022.08
+ REQUIRED_COMPILER_NAME = Visual Studio 10
+ REQUIRED_COMPILER_VERSION = VS2010
+ REQUIRED_CC_VER = 16.00.30319.01
+ REQUIRED_LINK_VER = 10.00.30319.01
else
ifeq ($(ARCH), ia64)
REQUIRED_COMPILER_NAME = Microsoft Platform SDK - November 2001 Edition
@@ -177,10 +177,10 @@
REQUIRED_LINK_VER = 7.00.9337.7
endif
ifeq ($(ARCH), amd64)
- REQUIRED_COMPILER_NAME = Microsoft Windows SDK with Visual Studio 9 (6001.18000.367)
- REQUIRED_COMPILER_VERSION = VS2008
- REQUIRED_CC_VER = 15.00.21022.08
- REQUIRED_LINK_VER = 9.00.21022.08
+ REQUIRED_COMPILER_NAME = Visual Studio 10
+ REQUIRED_COMPILER_VERSION = VS2010
+ REQUIRED_CC_VER = 16.00.30319.01
+ REQUIRED_LINK_VER = 10.00.30319.01
endif
endif
endif
--- a/jdk/make/common/shared/Defs-windows.gmk Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/common/shared/Defs-windows.gmk Thu May 20 01:34:22 2010 -0700
@@ -248,26 +248,34 @@
# If we still don't have it, look for VSnnCOMNTOOLS (newest first),
# set by installer?
ifeq ($(_msvc_dir),)
- ifdef VS90COMNTOOLS # /Common/Tools directory, use ../../Vc
- xVS90COMNTOOLS :="$(subst \,/,$(VS90COMNTOOLS))"
- _vs90tools :=$(call FullPath,$(xVS90COMNTOOLS))
+ ifdef VS100COMNTOOLS # /Common/Tools directory, use ../../Vc
+ xVS100COMNTOOLS :="$(subst \,/,$(VS100COMNTOOLS))"
+ _vs100tools :=$(call FullPath,$(xVS100COMNTOOLS))
endif
- ifneq ($(_vs90tools),)
- _msvc_dir :=$(_vs90tools)/../../Vc
+ ifneq ($(_vs100tools),)
+ _msvc_dir :=$(_vs100tools)/../../Vc
else
- ifdef VS80COMNTOOLS # /Common/Tools directory, use ../../Vc
- xVS80COMNTOOLS :="$(subst \,/,$(VS80COMNTOOLS))"
- _vs80tools :=$(call FullPath,$(xVS80COMNTOOLS))
+ ifdef VS90COMNTOOLS # /Common/Tools directory, use ../../Vc
+ xVS90COMNTOOLS :="$(subst \,/,$(VS90COMNTOOLS))"
+ _vs90tools :=$(call FullPath,$(xVS90COMNTOOLS))
endif
- ifneq ($(_vs80tools),)
- _msvc_dir :=$(_vs80tools)/../../Vc
+ ifneq ($(_vs90tools),)
+ _msvc_dir :=$(_vs90tools)/../../Vc
else
- ifdef VS71COMNTOOLS # /Common/Tools directory, use ../../Vc7
- xVS71COMNTOOLS :="$(subst \,/,$(VS71COMNTOOLS))"
- _vs71tools :=$(call FullPath,$(xVS71COMNTOOLS))
+ ifdef VS80COMNTOOLS # /Common/Tools directory, use ../../Vc
+ xVS80COMNTOOLS :="$(subst \,/,$(VS80COMNTOOLS))"
+ _vs80tools :=$(call FullPath,$(xVS80COMNTOOLS))
endif
- ifneq ($(_vs71tools),)
- _msvc_dir :=$(_vs71tools)/../../Vc7
+ ifneq ($(_vs80tools),)
+ _msvc_dir :=$(_vs80tools)/../../Vc
+ else
+ ifdef VS71COMNTOOLS # /Common/Tools directory, use ../../Vc7
+ xVS71COMNTOOLS :="$(subst \,/,$(VS71COMNTOOLS))"
+ _vs71tools :=$(call FullPath,$(xVS71COMNTOOLS))
+ endif
+ ifneq ($(_vs71tools),)
+ _msvc_dir :=$(_vs71tools)/../../Vc7
+ endif
endif
endif
endif
@@ -276,12 +284,15 @@
_compiler_bin :=$(_msvc_dir)/Bin
# Assume PlatformSDK is in VS71 (will be empty if VS90)
_ms_sdk :=$(call FullPath,$(_msvc_dir)/PlatformSDK)
- # Assume VS90, then VS80, then VS71
- _redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC90.CRT)
+ # Assume VS100, then VS90, then VS80, then VS71
+ _redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC100.CRT)
ifeq ($(_redist_sdk),)
- _redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC80.CRT)
+ _redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC90.CRT)
ifeq ($(_redist_sdk),)
- _redist_sdk :=$(call FullPath,$(_msvc_dir)/../SDK/v1.1/Bin)
+ _redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC80.CRT)
+ ifeq ($(_redist_sdk),)
+ _redist_sdk :=$(call FullPath,$(_msvc_dir)/../SDK/v1.1/Bin)
+ endif
endif
endif
endif
@@ -316,23 +327,40 @@
endif
endif
-# Compilers for 64bit are from SDK
+# Compilers for 64bit may be from SDK. For VS 2010 we use those.
+# The Express compilers don't contain 64 bit compilers, so in
+# that case, you additionally need the SDK. At this time,
+# there's no 64 bit SDK available that has VS 2010.
+# Presumably SDK v7.1 will provide that and we may want to update
+# the logic here to work with that.
+# However official builds will use the Professional version.
ifeq ($(ARCH_DATA_MODEL), 64)
- xVS2008 :="$(_program_files32)/Microsoft Visual Studio 9.0/"
- VS2008 :=$(call FullPath,$(xVS2008))
- ifneq ($(VS2008),)
- _compiler_bin :=$(VS2008)/VC/Bin/$(ARCH)
- xMSSDK61 :="$(_program_files)/Microsoft SDKs/Windows/v6.1/"
- MSSDK61 :=$(call FullPath,$(xMSSDK61))
- _redist_sdk :=$(VS2008)/VC/redist/x86/Microsoft.VC90.CRT
+ ifdef VS100COMNTOOLS # /Common7/Tools directory, use ../../Vc
+ xVS100COMNTOOLS :="$(subst \,/,$(VS100COMNTOOLS))"
+ _vs100tools :=$(call FullPath,$(xVS100COMNTOOLS))
+ endif
+ ifneq ($(_vs100tools),)
+ _compiler_bin :=$(_vs100tools)/../../Vc/bin/amd64
+ _redist_sdk :=$(_vs100tools)/../../Vc/redist/x64/Microsoft.VC100.CRT
+ xMSSDK70 :="$(_program_files32)/Microsoft SDKs/Windows/v7.0a/"
+ MSSDK70 :=$(call FullPath,$(xMSSDK70))
else
- ifneq ($(_ms_sdk),)
- ifeq ($(ARCH), ia64)
- _compiler_bin :=$(_ms_sdk)/Bin/Win64
- endif
- ifeq ($(ARCH), amd64)
- _compiler_bin :=$(_ms_sdk)/Bin/Win64/x86/$(ARCH)
- _redist_sdk :=$(_ms_sdk)/redist/win64/AMD64
+ xVS2008 :="$(_program_files32)/Microsoft Visual Studio 9.0/"
+ VS2008 :=$(call FullPath,$(xVS2008))
+ ifneq ($(VS2008),)
+ _compiler_bin :=$(VS2008)/VC/Bin/$(ARCH)
+ xMSSDK61 :="$(_program_files)/Microsoft SDKs/Windows/v6.1/"
+ MSSDK61 :=$(call FullPath,$(xMSSDK61))
+ _redist_sdk :=$(VS2008)/VC/redist/x86/Microsoft.VC90.CRT
+ else
+ ifneq ($(_ms_sdk),)
+ ifeq ($(ARCH), ia64)
+ _compiler_bin :=$(_ms_sdk)/Bin/Win64
+ endif
+ ifeq ($(ARCH), amd64)
+ _compiler_bin :=$(_ms_sdk)/Bin/Win64/x86/$(ARCH)
+ _redist_sdk :=$(_ms_sdk)/redist/win64/AMD64
+ endif
endif
endif
endif
@@ -454,10 +482,14 @@
ifeq ($(ARCH_DATA_MODEL), 32)
_NEEDS_MSVCRNN = true
else
- ifeq ($(VS2008),)
- _NEEDS_MSVCRNN = false
- else
+ ifneq ($(VS2010),)
_NEEDS_MSVCRNN = true
+ else
+ ifneq ($(VS2008),)
+ _NEEDS_MSVCRNN = true
+ else
+ _NEEDS_MSVCRNN = false
+ endif
endif
endif
@@ -557,6 +589,17 @@
endif
CSCRIPT:=$(call AltCheckSpaces,CSCRIPT)
+# CABARC: path to cabarc.exe (used in creating install bundles)
+ifdef ALT_CABARC
+ xALT_CABARC :="$(subst \,/,$(ALT_CABARC))"
+ CABARC =$(xALT_CABARC)
+else
+ _CABARC1 :=$(_system_root)/system32/cabarc.exe
+ _CABARC2 :=$(DEVTOOLS_PATH)cabarc.exe
+ CABARC :=$(call FileExists,$(_CABARC1),$(_CABARC2))
+endif
+CABARC:=$(call AltCheckSpaces,CABARC)
+
# MSIVAL2: path to msival2.exe (used in validating install msi files)
ifdef ALT_MSIVAL2
xALT_MSIVAL2 :="$(subst \,/,$(ALT_MSIVAL2))"
--- a/jdk/make/common/shared/Platform.gmk Wed May 19 10:22:39 2010 -0700
+++ b/jdk/make/common/shared/Platform.gmk Thu May 20 01:34:22 2010 -0700
@@ -275,7 +275,12 @@
endif
ARCH_FAMILY = $(ARCH)
# Where is unwanted output to be delivered?
- DEV_NULL = NUL
+ # MKS uses the special file "NUL", cygwin uses the customary unix file.
+ ifeq ($(USING_CYGWIN),true)
+ DEV_NULL = /dev/null
+ else
+ DEV_NULL = NUL
+ endif
export DEV_NULL
# Classpath separator
CLASSPATH_SEPARATOR = ;
--- a/jdk/src/share/bin/main.c Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/share/bin/main.c Thu May 20 01:34:22 2010 -0700
@@ -33,14 +33,16 @@
#include "defines.h"
#ifdef _MSC_VER
-#if _MSC_VER > 1400
+#if _MSC_VER > 1400 && _MSC_VER < 1600
/*
* When building for Microsoft Windows, main has a dependency on msvcr??.dll.
*
- * When using Visual Studio 2005 or later, that must be recorded in
+ * When using Visual Studio 2005 or 2008, that must be recorded in
* the [java,javaw].exe.manifest file.
*
+ * As of VS2010 (ver=1600), the runtimes again no longer need manifests.
+ *
* Reference:
* C:/Program Files/Microsoft SDKs/Windows/v6.1/include/crtdefs.h
*/
@@ -67,7 +69,7 @@
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
#endif /* _M_AMD64 */
-#endif /* _MSC_VER > 1400 */
+#endif /* _MSC_VER > 1400 && _MSC_VER < 1600 */
#endif /* _MSC_VER */
/*
--- a/jdk/src/windows/bin/java_md.c Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/windows/bin/java_md.c Thu May 20 01:34:22 2010 -0700
@@ -148,11 +148,18 @@
* assumed to be present in the "JRE path" directory. If it is not found
* there (or "JRE path" fails to resolve), skip the explicit load and let
* nature take its course, which is likely to be a failure to execute.
+ * This is clearly completely specific to the exact compiler version
+ * which isn't very nice, but its hardly the only place.
+ * No attempt to look for compiler versions in between 2003 and 2010
+ * as we aren't supporting building with those.
*/
#ifdef _MSC_VER
#if _MSC_VER < 1400
#define CRT_DLL "msvcr71.dll"
#endif
+#if _MSC_VER >= 1600
+#define CRT_DLL "msvcr100.dll"
+#endif
#ifdef CRT_DLL
if (GetJREPath(crtpath, MAXPATHLEN)) {
(void)JLI_StrCat(crtpath, "\\bin\\" CRT_DLL); /* Add crt dll */
--- a/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp Thu May 20 01:34:22 2010 -0700
@@ -29,7 +29,10 @@
#define STRICT
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
+/* REMIND : 0x500 means Windows 2000 .. seems like we can update
+ * for Windows XP when we move the SDK and build platform
+ */
+#define _WIN32_WINNT 0x0500
#endif
#define _ATL_APARTMENT_THREADED
--- a/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp Thu May 20 01:34:22 2010 -0700
@@ -29,7 +29,10 @@
#define STRICT
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
+/* REMIND : 0x500 means Windows 2000 .. seems like we can update
+ * for Windows XP when we move the SDK and build platform
+ */
+#define _WIN32_WINNT 0x0500
#endif
#define _ATL_APARTMENT_THREADED
--- a/jdk/src/windows/native/sun/jkernel/stdafx.h Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/windows/native/sun/jkernel/stdafx.h Thu May 20 01:34:22 2010 -0700
@@ -36,7 +36,10 @@
#define STRICT
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
+/* REMIND : 0x500 means Windows 2000 .. seems like we can update
+ * for Windows XP when we move the SDK and build platform
+ */
+#define _WIN32_WINNT 0x0500
#endif
#define _ATL_APARTMENT_THREADED
--- a/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp Thu May 20 01:34:22 2010 -0700
@@ -233,7 +233,19 @@
//
NONCLIENTMETRICS ncmetrics;
- ncmetrics.cbSize = sizeof(ncmetrics);
+ // Fix for 6944516: specify correct size for ncmetrics on WIN2K/XP
+ // Microsoft recommend to subtract the size of 'iPaddedBorderWidth' field
+ // when running on XP. However this can't be referenced at compile time
+ // with the older SDK, so there use 'lfMessageFont' plus its size.
+ if (!IS_WINVISTA) {
+#if defined(_MSC_VER) && (_MSC_VER >= 1600) {
+ ncmetrics.cbSize = offsetof(NONCLIENTMETRICS, iPaddedBorderWidth);
+#else
+ ncmetrics.cbSize = offsetof(NONCLIENTMETRICS,lfMessageFont) + sizeof(LOGFONT);
+#endif
+ } else {
+ ncmetrics.cbSize = sizeof(ncmetrics);
+ }
VERIFY( SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncmetrics.cbSize, &ncmetrics, FALSE) );
SetFontProperty( TEXT("win.frame.captionFont"), ncmetrics.lfCaptionFont );
--- a/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp Thu May 20 01:34:22 2010 -0700
@@ -29,21 +29,16 @@
//we need <new> inclusion for STL "new" oprators set.
#define bad_alloc zbad_alloc
#include <new>
+
+#if defined(_DEBUG) || defined(DEBUG)
+extern void * operator new(size_t size, const char * filename, int linenumber);
+void * operator new(size_t size) {return operator new(size, "stl", 1);}
+#endif
+#include <map>
+
#pragma pop_macro("bad_alloc")
//"bad_alloc" is undefined from here
-//we need to include any STL container before <awt.h> inclusion due to
-//"new" re-redefinition that is in conflict with in-place new allocator
-//applied in STL.
-#if defined(_DEBUG) || defined(DEBUG)
- //forward declaration of "new" operator from <awt.h>
- extern void * operator new(size_t size, const char * filename, int linenumber);
- //"new" operator definition that is consistent with re-defined
- //in <awt.h> "delete" operator
- void * operator new(size_t size) {return operator new(size, "stl", 1);}
-#endif
-#include <map>
-
#include <awt.h>
#include <shlobj.h>
--- a/jdk/src/windows/native/sun/windows/awt_TextArea.cpp Wed May 19 10:22:39 2010 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_TextArea.cpp Thu May 20 01:34:22 2010 -0700
@@ -758,7 +758,7 @@
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_POS | SIF_RANGE | SIF_PAGE;
int actualScrollLines =
- abs(platfScrollLines * (*delta_accum / WHEEL_DELTA));
+ abs((int)(platfScrollLines * (*delta_accum / WHEEL_DELTA)));
for (int i = 0; i < actualScrollLines; i++) {
if (::GetScrollInfo(hWnd, sb_type, &si)) {
if ((wm_msg == WM_VSCROLL)
--- a/langtools/.hgtags Wed May 19 10:22:39 2010 -0700
+++ b/langtools/.hgtags Thu May 20 01:34:22 2010 -0700
@@ -66,3 +66,4 @@
6cea9a143208bc1185ced046942c0f4e45dbeba5 jdk7-b89
71c2c23a7c35b2896c87004023b9743b6d1b7758 jdk7-b90
97b6fa97b8ddb3a49394011c2a0ec5d6535e594c jdk7-b91
+98cba5876cb50fa3c58a313ddd668f5014ff14f6 jdk7-b92