# HG changeset patch # User andrew # Date 1329325699 0 # Node ID c628aeb3d72ff30915032ef6d365b89fa1540477 # Parent a4c1348efa0807023deb0235c477b7ef0de093fa# Parent bdc37f3c09b6008667aff77432bb6d31cbae945e Merge diff -r a4c1348efa08 -r c628aeb3d72f .hgtags --- a/.hgtags Mon Feb 13 16:31:42 2012 +0000 +++ b/.hgtags Wed Feb 15 17:08:19 2012 +0000 @@ -146,3 +146,14 @@ 456ff1f14b14ef8cfe47cef95c8094f8443fa092 jdk7u2-b13 62b846b0c3259cae732e75df50a1b180a2541178 jdk7u2-b21 ecb9fc90dea4720f5c1ba1354364ed610f463e41 icedtea-2.1-branchpoint +1ba1205119dc3df49bd85360a579fdb895a2fb46 jdk7u4-b200 +de83741c8ba0c01c8ac515daaad3318dd96b57bf jdk7u4-b04 +6dd348fb709145bb005acf8533fd6b5444daaba2 jdk7u4-b02 +1a7656c7a8b9d0572ac75c2c325429a7dd5e1a97 jdk7u4-b05 +185304fa54224229db578f81f4021fc4ec0f6c13 jdk7u4-b06 +48ac2f190ad1e12eb5092e6f2b1bb1e7c10b88c2 jdk7u4-b225 +352a72e872ea016347f304413ac2ac27c20b8931 jdk7u4-b07 +b86e44b7ad7b1a45dde93a376d99c934de359f1b jdk7u4-b08 +0e8770ade63caf7464a6281cb4697d7ed1bd68df jdk7u4-b227 +f83e6ff13e4be5aedd7edc0d11228ea29200fbb3 jdk7u4-b09 +23777178e7eb61859be3f7240561aa1034ff9221 jdk7u4-b10 diff -r a4c1348efa08 -r c628aeb3d72f make/common/Defs-bsd.gmk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/common/Defs-bsd.gmk Wed Feb 15 17:08:19 2012 +0000 @@ -0,0 +1,46 @@ +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Makefile to specify compiler flags for programs and libraries +# targeted to BSD. Should not contain any rules. +# + +# Warning: the following variables are overriden by Defs.gmk. Set +# values will be silently ignored: +# CFLAGS (set $(OTHER_CFLAGS) instead) +# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) +# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) +# LDFLAGS (set $(OTHER_LDFAGS) instead) +# LDLIBS (set $(EXTRA_LIBS) instead) +# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) + +# Get shared JDK settings +include $(BUILDDIR)/common/shared/Defs.gmk + +ifndef PLATFORM_SRC + PLATFORM_SRC = $(TOPDIR)/src/solaris +endif # PLATFORM_SRC + diff -r a4c1348efa08 -r c628aeb3d72f make/common/Defs.gmk --- a/make/common/Defs.gmk Mon Feb 13 16:31:42 2012 +0000 +++ b/make/common/Defs.gmk Wed Feb 15 17:08:19 2012 +0000 @@ -53,6 +53,28 @@ _OUTPUTDIR=$(TOPDIR)/build/$(PLATFORM)-$(ARCH) +ifneq ($(PLATFORM), windows) + ifdef ALT_X11_PATH + X11_PATH = $(ALT_X11_PATH) + else + X11_PATH = /usr/X11R6 + endif + + ifdef ALT_PACKAGE_PATH + PACKAGE_PATH = $(ALT_PACKAGE_PATH) + else + ifeq ($(PLATFORM), linux) + PACKAGE_PATH = /usr + else + ifeq ($(OS_VENDOR), Apple) + PACKAGE_PATH = /opt/local + else + PACKAGE_PATH = /usr/local + endif + endif + endif +endif + # # Get platform definitions # @@ -101,10 +123,10 @@ # An attempt is made to generate unique enough directories for the # generated files to not have name collisisons. Most build units -# defines PRODUCT (except Release.gmk), but then they may or may -# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and -# LIBRARY. This code chunk attempts to generate a unique -# OBJDIR/CLASSHDRDIR for each build unit based on which of those +# defines PRODUCT (except Release.gmk), but then they may or may +# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and +# LIBRARY. This code chunk attempts to generate a unique +# OBJDIR/CLASSHDRDIR for each build unit based on which of those # values are set within each build unit. UNIQUE_LOCATION_STRING = tmp @@ -133,7 +155,7 @@ UNIQUE_LOCATION_STRING += /$(THREADDIR) endif -# the use of += above makes a space separated list which we need to +# the use of += above makes a space separated list which we need to # remove for filespecs. # NULLSTRING := @@ -176,9 +198,9 @@ # Classpath seen by javac (different from the one seen by the VM # running javac), and useful variables. # -SOURCEPATH = $(VPATH.java) -PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)') -PKGDIR = $(subst .,/,$(PACKAGE)) +SOURCEPATH = $(VPATH.java) +PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)') +PKGDIR = $(subst .,/,$(PACKAGE)) # # The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.) diff -r a4c1348efa08 -r c628aeb3d72f make/common/shared/Defs-bsd.gmk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/common/shared/Defs-bsd.gmk Wed Feb 15 17:08:19 2012 +0000 @@ -0,0 +1,131 @@ +# +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Definitions for Bsd. +# + +# Default for COMPILER_WARNINGS_FATAL on Bsd (C & C++ compiler warnings) +ifndef COMPILER_WARNINGS_FATAL + COMPILER_WARNINGS_FATAL=false +endif + +# Bsd should use parallel compilation for best build times +ifndef COMPILE_APPROACH + COMPILE_APPROACH = parallel +endif + +# Indication that we are doing an incremental build. +# This may trigger the creation of make depend files. +ifndef INCREMENTAL_BUILD + INCREMENTAL_BUILD = false +endif + +# FullPath just makes sure it never ends with a / and no duplicates +define FullPath +$(shell cd $1 2> $(DEV_NULL) && pwd) +endef + +# OptFullPath: Absolute path name of a dir that might not initially exist. +define OptFullPath +$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi) +endef + +# Location on system where jdk installs might be +USRJDKINSTANCES_PATH =$(PACKAGE_PATH) + +# UNIXCOMMAND_PATH: path to where the most common Unix commands are. +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_UNIXCOMMAND_PATH)" "undefined" + UNIXCOMMAND_PATH :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH)) +else + UNIXCOMMAND_PATH = /bin/ +endif + +# USRBIN_PATH: path to where the most common Unix commands are. +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_USRBIN_PATH)" "undefined" + USRBIN_PATH :=$(call PrefixPath,$(ALT_USRBIN_PATH)) +else + USRBIN_PATH = /usr/bin/ +endif + +# UNIXCCS_PATH: path to where the Solaris ported UNIX commands can be found +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_UNIXCCS_PATH)" "undefined" + UNIXCCS_PATH :=$(call PrefixPath,$(ALT_UNIXCCS_PATH)) +else + UNIXCCS_PATH = /usr/ccs/bin/ +endif + +# SLASH_JAVA: location of all network accessable files +ifdef ALT_SLASH_JAVA + SLASH_JAVA :=$(ALT_SLASH_JAVA) +else + SLASH_JAVA := $(call DirExists,/java,/java,/NOT-SET) +endif + +# JDK_DEVTOOLS_DIR: common path for all the java devtools +ifdef ALT_JDK_DEVTOOLS_DIR + JDK_DEVTOOLS_DIR =$(ALT_JDK_DEVTOOLS_DIR) +else + JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools +endif + +# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.) +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined" + DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH)) +else + DEVTOOLS_PATH =$(PACKAGE_PATH)/bin/ +endif + +# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK. +# _BOOTDIR2: Second choice +ifndef ALT_BOOTDIR + _BOOTDIR1 =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH) + _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION) +endif + +# Import JDK images allow for partial builds, components not built are +# imported (or copied from) these import areas when needed. + +# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for +# multiple platforms, e.g. windows-i586, solaris-sparc, bsd-586, etc. +ifdef ALT_BUILD_JDK_IMPORT_PATH + BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH)) +else + BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES) +endif +BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH) + +# JDK_IMPORT_PATH: location of JDK install tree (this version) to import +ifdef ALT_JDK_IMPORT_PATH + JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH)) +else + JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT) +endif +JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH) + diff -r a4c1348efa08 -r c628aeb3d72f make/common/shared/Defs-utils.gmk --- a/make/common/shared/Defs-utils.gmk Mon Feb 13 16:31:42 2012 +0000 +++ b/make/common/shared/Defs-utils.gmk Wed Feb 15 17:08:19 2012 +0000 @@ -31,7 +31,7 @@ # These input UTILS_* variables can be defined at anytime, ideally once. # Unix Commands: Normally /bin/, /usr/bin/. or C:/mksnt/mksnt/ # UTILS_COMMAND_PATH -# /usr/bin/ +# /usr/bin/ # UTILS_USR_BIN_PATH # /usr/ccs/bin/ (sccs, m4, lex, yacc, as, ar, strip, mcs) # UTILS_CCS_BIN_PATH @@ -53,6 +53,13 @@ UTILS_DEVTOOL_PATH=$(USRBIN_PATH) endif +ifeq ($(PLATFORM),bsd) + UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) + UTILS_USR_BIN_PATH=$(USRBIN_PATH) + UTILS_CCS_BIN_PATH=$(USRBIN_PATH) + UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH) +endif + ifeq ($(PLATFORM),solaris) UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH) @@ -166,15 +173,15 @@ # Also, some distribution (Ubuntu, Debian, others?) place the rpm command # itself in /usr/bin rather than it's traditional home in /bin. RPM=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpm) \ - $(wildcard $(UTILS_USR_BIN_PATH)rpm)) + $(wildcard $(UTILS_USR_BIN_PATH)rpm)) RPMBUILD=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpmbuild) \ - $(wildcard $(UTILS_USR_BIN_PATH)rpmbuild) \ - $(wildcard $(UTILS_COMMAND_PATH)rpm) \ - $(wildcard $(UTILS_USR_BIN_PATH)rpm)) + $(wildcard $(UTILS_USR_BIN_PATH)rpmbuild) \ + $(wildcard $(UTILS_COMMAND_PATH)rpm) \ + $(wildcard $(UTILS_USR_BIN_PATH)rpm)) # Most Linux distros have "sort" in /bin. Ubuntu, Debian and perhaps # others have it in /usr/bin. SORT=$(firstword $(wildcard $(UTILS_COMMAND_PATH)sort) \ - $(wildcard $(UTILS_USR_BIN_PATH)sort)) + $(wildcard $(UTILS_USR_BIN_PATH)sort)) NAWK = $(USRBIN_PATH)gawk # Intrinsic unix command, with backslash-escaped character interpretation ECHO = /bin/echo -e @@ -198,3 +205,34 @@ ECHO = /usr/bin/echo endif +# BSD specific +ifeq ($(PLATFORM),bsd) + BASENAME = $(UTILS_USR_BIN_PATH)basename + EGREP = $(UTILS_USR_BIN_PATH)egrep + EXPR = $(UTILS_COMMAND_PATH)expr + FMT = $(UTILS_USR_BIN_PATH)fmt + GREP = $(UTILS_USR_BIN_PATH)grep + GUNZIP = $(UTILS_USR_BIN_PATH)gunzip + ID = $(UTILS_USR_BIN_PATH)id + MSGFMT = $(UTILS_DEVTOOL_PATH)msgfmt + SED = $(UTILS_USR_BIN_PATH)sed + SORT = $(UTILS_USR_BIN_PATH)sort + TEST = $(UTILS_COMMAND_PATH)test + TOUCH = $(UTILS_USR_BIN_PATH)touch + TRUE = $(UTILS_USR_BIN_PATH)true + UNAME = $(UTILS_USR_BIN_PATH)uname + # BSD OS_VENDOR specific + ifeq ($(OS_VENDOR), Apple) + NAWK = $(UTILS_USR_BIN_PATH)awk + UNZIPSFX = $(UTILS_USR_BIN_PATH)unzipsfx + ZIPEXE = $(UTILS_USR_BIN_PATH)zip + else + UNZIP = $(UTILS_DEVTOOL_PATH)unzip + endif + ifeq ($(OS_VENDOR), OpenBSD) + NAWK = $(UTILS_USR_BIN_PATH)awk + else + CPIO = $(UTILS_USR_BIN_PATH)cpio + TAR = $(UTILS_USR_BIN_PATH)tar + endif +endif diff -r a4c1348efa08 -r c628aeb3d72f make/common/shared/Platform.gmk --- a/make/common/shared/Platform.gmk Mon Feb 13 16:31:42 2012 +0000 +++ b/make/common/shared/Platform.gmk Wed Feb 15 17:08:19 2012 +0000 @@ -62,8 +62,8 @@ # CLASSPATH_SEPARATOR separator in classpath, ; or : # BUNDLE_FILE_SUFFIX suffix for bundles: .tar or .tar.gz # ISA_DIR solaris only: /sparcv9 or /amd64 -# REQUIRED_WINDOWS_NAME windows only: basic name of windows -# REQUIRED_WINDOWS_VERSION windows only: specific version of windows +# REQUIRED_WINDOWS_NAME windows only: basic name of windows +# REQUIRED_WINDOWS_VERSION windows only: specific version of windows # USING_CYGWIN windows only: true or false # WINDOWS_NT_VERSION_STRING windows only: long version name # REQUIRED_OS_VERSION required OS version, e.g. 5.10, 2.4 @@ -135,7 +135,7 @@ BUNDLE_FILE_SUFFIX=.tar # Required Solaris version REQUIRED_OS_VERSION = 5.10 - # Minimum disk space needed as determined by running 'du -sk' on + # Minimum disk space needed as determined by running 'du -sk' on # a fully built workspace. ifeq ($(ARCH_FAMILY), sparc) REQUIRED_FREE_SPACE=1300000 @@ -216,7 +216,7 @@ # Suffix for file bundles used in previous release BUNDLE_FILE_SUFFIX=.tar.gz - # Minimum disk space needed as determined by running 'du -sk' on + # Minimum disk space needed as determined by running 'du -sk' on # a fully built workspace. REQUIRED_FREE_SPACE=1460000 LINUX_VERSION_INFO = /etc/redhat-release @@ -240,6 +240,98 @@ MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2) endif +ifeq ($(SYSTEM_UNAME), FreeBSD) + PLATFORM = bsd + OS_NAME = freebsd + OS_VENDOR = FreeBSD + REQUIRED_OS_VERSION = 6.0 +endif + +ifeq ($(SYSTEM_UNAME), Darwin) + PLATFORM = bsd + OS_NAME = darwin + OS_VENDOR = Apple + REQUIRED_OS_VERSION = 8.0 +endif + +ifeq ($(SYSTEM_UNAME), NetBSD) + PLATFORM = bsd + OS_NAME = netbsd + OS_VENDOR = NetBSD + REQUIRED_OS_VERSION = 3.0 +endif + +ifeq ($(SYSTEM_UNAME), OpenBSD) + PLATFORM = bsd + OS_NAME = openbsd + OS_VENDOR = OpenBSD + REQUIRED_OS_VERSION = 4.9 +endif + +# Platform settings specific to BSD +ifeq ($(PLATFORM), bsd) + OS_VERSION := $(shell uname -r) + # Arch and OS name/version + mach := $(shell uname -m) + archExpr = case "$(mach)" in \ + i[3-9]86) \ + echo i586 \ + ;; \ + sparc64) \ + echo sparcv9 \ + ;; \ + sparc*) \ + echo sparc \ + ;; \ + x86_64) \ + echo amd64 \ + ;; \ + "Power Macintosh") \ + echo ppc \ + ;; \ + *) \ + echo $(mach) \ + ;; \ + esac + ARCH := $(shell $(archExpr) ) + ARCH_FAMILY := $(ARCH) + + # Darwin x86 builds are i386/amd64 universal. + ifeq ($(SYSTEM_UNAME), Darwin) + ifneq ($(ARCH), ppc) + ARCH=universal + endif + endif + + # i586, sparc, and ppc are 32 bit, amd64 and sparc64 are 64 + ifneq (,$(findstring $(ARCH), i586 sparc ppc universal)) + ARCH_DATA_MODEL=32 + else + ARCH_DATA_MODEL=64 + endif + + ifeq ($(ARCH), i586) + LIBARCH = i386 + else + LIBARCH = $(ARCH) + endif + + # Value of Java os.arch property + ARCHPROP = $(LIBARCH) + + # Suffix for file bundles used in previous release + BUNDLE_FILE_SUFFIX=.tar.gz + # Minimum disk space needed as determined by running 'du -sk' on + # a fully built workspace. + REQUIRED_FREE_SPACE=1500000 + # How much RAM does this machine have: + ifeq ($(OS_VENDOR), OpenBSD) + MB_OF_MEMORY=$(shell sysctl -n hw.physmem | awk '{print int($$NF / 1048576); }' ) + else + MB_OF_MEMORY=$(shell (sysctl -n hw.physmem64 2> /dev/null || sysctl -n hw.physmem) | awk '{print int($$NF / 1048576); }' ) + endif +endif + # Windows with and without CYGWIN will be slightly different ifeq ($(SYSTEM_UNAME), Windows_NT) PLATFORM = windows @@ -336,7 +428,7 @@ endif # Suffix for file bundles used in previous release BUNDLE_FILE_SUFFIX=.tar - # Minimum disk space needed as determined by running 'du -sk' on + # Minimum disk space needed as determined by running 'du -sk' on # a fully built workspace. REQUIRED_FREE_SPACE=500000 # How much RAM does this machine have: @@ -344,8 +436,8 @@ MB_OF_MEMORY := $(shell \ if [ -f "C:/cygwin/bin/free.exe" ] ; then \ ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \ - grep Mem: | \ - sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \ + grep Mem: | \ + sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \ else \ echo "512"; \ fi) @@ -401,7 +493,7 @@ # Where is unwanted output to be delivered? DEV_NULL = /dev/null export DEV_NULL - # Character used between entries in classpath + # Character used between entries in classpath CLASSPATH_SEPARATOR = : # User name determination (set _USER) ifndef USER diff -r a4c1348efa08 -r c628aeb3d72f make/jprt.properties --- a/make/jprt.properties Mon Feb 13 16:31:42 2012 +0000 +++ b/make/jprt.properties Wed Feb 15 17:08:19 2012 +0000 @@ -25,12 +25,24 @@ # Properties for jprt -# Use whatever release that the submitted job requests -jprt.tools.default.release=${jprt.submit.release} +# Locked down to jdk7 +jprt.tools.default.release=jdk7 # The different build flavors we want, we override here so we just get these 2 jprt.build.flavors=product,fastdebug +# Standard list of jprt build targets for this source tree +jprt.build.targets= \ + solaris_sparc_5.10-{product|fastdebug}, \ + solaris_sparcv9_5.10-{product|fastdebug}, \ + solaris_i586_5.10-{product|fastdebug}, \ + solaris_x64_5.10-{product|fastdebug}, \ + linux_i586_2.6-{product|fastdebug}, \ + linux_x64_2.6-{product|fastdebug}, \ + macosx_x64_10.7-{product|fastdebug}, \ + windows_i586_5.1-{product|fastdebug}, \ + windows_x64_5.2-{product|fastdebug} + # Directories to be excluded from the source bundles jprt.bundle.exclude.src.dirs=build dist webrev diff -r a4c1348efa08 -r c628aeb3d72f src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java Mon Feb 13 16:31:42 2012 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java Wed Feb 15 17:08:19 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -423,6 +423,13 @@ impl.setByteBufferWithInfo(bbwi); } + /** + * return true if our ByteBuffer is sharing/equal to bb + */ + protected final boolean isSharing(ByteBuffer bb) { + return (getByteBuffer() == bb); + } + public final int getBufferLength() { return impl.getBufferLength(); } diff -r a4c1348efa08 -r c628aeb3d72f src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Mon Feb 13 16:31:42 2012 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Wed Feb 15 17:08:19 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2412,7 +2412,6 @@ if (bbwi != null && getByteBuffer() != null) { - int bbHash = System.identityHashCode(bbwi.byteBuffer); MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { @@ -2420,19 +2419,12 @@ (CDROutputObject)messageMediator.getOutputObject(); if (outputObj != null) { - ByteBuffer outputBb = outputObj.getByteBuffer(); - - int oBbHash = 0; - if (outputBb != null) + if (outputObj.isSharing(getByteBuffer())) { - oBbHash = System.identityHashCode(outputBb); - if (bbHash == oBbHash) // shared? - { - // Set OutputStream's ByteBuffer and bbwi to null - // so its ByteBuffer cannot be released to the pool - outputObj.setByteBuffer(null); - outputObj.setByteBufferWithInfo(null); - } + // Set OutputStream's ByteBuffer and bbwi to null + // so its ByteBuffer cannot be released to the pool + outputObj.setByteBuffer(null); + outputObj.setByteBufferWithInfo(null); } } } diff -r a4c1348efa08 -r c628aeb3d72f src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java Mon Feb 13 16:31:42 2012 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java Wed Feb 15 17:08:19 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -357,6 +357,13 @@ impl.setByteBuffer(byteBuffer); } + /** + * return true if our ByteBuffer is sharing/equal to bb + */ + protected final boolean isSharing(ByteBuffer bb) { + return (getByteBuffer() == bb); + } + public final boolean isLittleEndian() { return impl.isLittleEndian(); } diff -r a4c1348efa08 -r c628aeb3d72f src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Mon Feb 13 16:31:42 2012 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Wed Feb 15 17:08:19 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1902,7 +1902,6 @@ if (getByteBufferWithInfo() != null && getByteBuffer() != null) { - int bbHash = System.identityHashCode(bbwi.byteBuffer); MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { @@ -1910,19 +1909,12 @@ (CDRInputObject)messageMediator.getInputObject(); if (inputObj != null) { - ByteBuffer inputBb = inputObj.getByteBuffer(); - - int iBbHash = 0; - if (inputBb != null) + if (inputObj.isSharing(getByteBuffer())) { - iBbHash = System.identityHashCode(inputBb); - if (bbHash == iBbHash) // shared? - { - // Set InputStream's ByteBuffer and bbwi to null - // so its ByteBuffer cannot be released to the pool - inputObj.setByteBuffer(null); - inputObj.setByteBufferWithInfo(null); - } + // Set InputStream's ByteBuffer and bbwi to null + // so its ByteBuffer cannot be released to the pool + inputObj.setByteBuffer(null); + inputObj.setByteBufferWithInfo(null); } } } diff -r a4c1348efa08 -r c628aeb3d72f src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java --- a/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Mon Feb 13 16:31:42 2012 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Wed Feb 15 17:08:19 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,6 +113,9 @@ import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; import com.sun.corba.se.impl.util.JDKBridge; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentHashMap; + /** * ClientDelegate is the RMI client-side subcontract or representation * It implements RMI delegate as well as our internal ClientRequestDispatcher @@ -122,6 +125,9 @@ implements ClientRequestDispatcher { + private ConcurrentMap locks = + new ConcurrentHashMap(); + public OutputObject beginRequest(Object self, String opName, boolean isOneWay, ContactInfo contactInfo) { @@ -148,8 +154,21 @@ // This locking is done so that multiple connections are not created // for the same endpoint - //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints - synchronized (contactInfo) { + // 7046238 - Synchronization on a single monitor for contactInfo parameters + // with identical hashCode(), so we lock on same monitor for equal parameters + // (which can refer to equal (in terms of equals()) but not the same objects) + + Object lock = locks.get(contactInfo); + + if (lock == null) { + Object newLock = new Object(); + lock = locks.putIfAbsent(contactInfo, newLock); + if (lock == null) { + lock = newLock; + } + } + + synchronized (lock) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { connection = (CorbaConnection) @@ -254,7 +273,7 @@ registerWaiter(messageMediator); // Do connection reclaim now - synchronized (contactInfo) { + synchronized (lock) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { OutboundConnectionCache connectionCache =