Merge
authorlana
Fri, 18 Sep 2015 14:19:53 -0700
changeset 32570 ea59f7a74aa4
parent 32552 679aab5942f1 (current diff)
parent 32569 a63d10163947 (diff)
child 32631 84ef20472474
Merge
test/lib/Makefile
--- a/common/autoconf/generated-configure.sh	Fri Sep 18 10:46:33 2015 -0700
+++ b/common/autoconf/generated-configure.sh	Fri Sep 18 14:19:53 2015 -0700
@@ -841,7 +841,6 @@
 JDK_MAJOR_VERSION
 USER_RELEASE_SUFFIX
 COMPRESS_JARS
-RMICONNECTOR_IIOP
 UNLIMITED_CRYPTO
 CACERTS_FILE
 TEST_IN_BUILD
@@ -1060,7 +1059,6 @@
 enable_hotspot_test_in_build
 with_cacerts_file
 enable_unlimited_crypto
-enable_rmiconnector_iiop
 with_milestone
 with_update_version
 with_user_release_suffix
@@ -1848,9 +1846,6 @@
                           run the Queens test after Hotspot build [disabled]
   --enable-unlimited-crypto
                           Enable unlimited crypto policy [disabled]
-  --enable-rmiconnector-iiop
-                          enable the JMX RMIConnector iiop transport
-                          [disabled]
   --disable-warnings-as-errors
                           do not consider native warnings to be an error
                           [enabled]
@@ -3951,7 +3946,7 @@
 
 
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -20100,22 +20095,6 @@
 
   ###############################################################################
   #
-  # --enable-rmiconnector-iiop
-  #
-  # Check whether --enable-rmiconnector-iiop was given.
-if test "${enable_rmiconnector_iiop+set}" = set; then :
-  enableval=$enable_rmiconnector_iiop;
-fi
-
-  if test "x$enable_rmiconnector_iiop" = "xyes"; then
-    RMICONNECTOR_IIOP=true
-  else
-    RMICONNECTOR_IIOP=false
-  fi
-
-
-  ###############################################################################
-  #
   # Compress jars
   #
   COMPRESS_JARS=false
--- a/common/autoconf/jdk-options.m4	Fri Sep 18 10:46:33 2015 -0700
+++ b/common/autoconf/jdk-options.m4	Fri Sep 18 14:19:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -455,19 +455,6 @@
 
   ###############################################################################
   #
-  # --enable-rmiconnector-iiop
-  #
-  AC_ARG_ENABLE(rmiconnector-iiop, [AS_HELP_STRING([--enable-rmiconnector-iiop],
-      [enable the JMX RMIConnector iiop transport  @<:@disabled@:>@])])
-  if test "x$enable_rmiconnector_iiop" = "xyes"; then
-    RMICONNECTOR_IIOP=true
-  else
-    RMICONNECTOR_IIOP=false
-  fi
-  AC_SUBST(RMICONNECTOR_IIOP)
-
-  ###############################################################################
-  #
   # Compress jars
   #
   COMPRESS_JARS=false
--- a/common/autoconf/spec.gmk.in	Fri Sep 18 10:46:33 2015 -0700
+++ b/common/autoconf/spec.gmk.in	Fri Sep 18 14:19:53 2015 -0700
@@ -262,9 +262,6 @@
 # Enable unlimited crypto policy
 UNLIMITED_CRYPTO=@UNLIMITED_CRYPTO@
 
-# Enable RMIConnector IIOP transport
-RMICONNECTOR_IIOP=@RMICONNECTOR_IIOP@
-
 GCOV_ENABLED=@GCOV_ENABLED@
 
 # Necessary additional compiler flags to compile X11
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/bin/blessed-modifier-order.sh	Fri Sep 18 14:19:53 2015 -0700
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Copyright 2015 Google, 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+
+usage() {
+  (
+    echo "$0 DIR ..."
+    echo "Modifies in place all the java source files found"
+    echo "in the given directories so that all java language modifiers"
+    echo "are in the canonical order given by Modifier#toString()."
+    echo "Tries to get it right even within javadoc comments,"
+    echo "and even if the list of modifiers spans 2 lines."
+    echo
+    echo "See:"
+    echo "https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Modifier.html#toString-int-"
+    echo
+    echo "Example:"
+    echo "$0 jdk/src/java.base jdk/test/java/{util,io,lang}"
+  ) >&2
+  exit 1
+}
+
+set -eu
+declare -ar dirs=("$@")
+[[ "${#dirs[@]}" > 0 ]] || usage
+for dir in "${dirs[@]}"; do [[ -d "$dir" ]] || usage; done
+
+declare -ar modifiers=(
+  public protected private
+  abstract static final transient
+  volatile synchronized native strictfp
+)
+declare -r SAVE_IFS="$IFS"
+for ((i = 3; i < "${#modifiers[@]}"; i++)); do
+  IFS='|'; x="${modifiers[*]:0:i}" y="${modifiers[*]:i}"; IFS="$SAVE_IFS"
+  if [[ -n "$x" && -n "$y" ]]; then
+    find "${dirs[@]}" -name '*.java' -type f -print0 | \
+      xargs -0 perl -0777 -p -i -e \
+      "do {} while s/^([A-Za-z@* ]*)\b($y)(\s|(?:\s|\n\s+\*)*\s)($x)\b/\1\4\3\2/mg"
+  fi
+done
--- a/make/CompileJavaModules.gmk	Fri Sep 18 10:46:33 2015 -0700
+++ b/make/CompileJavaModules.gmk	Fri Sep 18 14:19:53 2015 -0700
@@ -275,13 +275,6 @@
     $(JDK_TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
 
 ################################################################################
-# Exclude building of IIOP transport for RMI Connector
-
-ifeq ($(RMICONNECTOR_IIOP), false)
-  java.management_EXCLUDES += com/sun/jmx/remote/protocol/iiop
-endif
-
-################################################################################
 
 java.rmi_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.rmi_CLEAN_FILES := $(wildcard \
--- a/make/Main.gmk	Fri Sep 18 10:46:33 2015 -0700
+++ b/make/Main.gmk	Fri Sep 18 14:19:53 2015 -0700
@@ -285,9 +285,12 @@
 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
 	    test-image-jdk-jtreg-native)
 
+build-test-lib:
+	+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk)
+
 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
-    test-image-jdk-jtreg-native
+    test-image-jdk-jtreg-native build-test-lib
 
 ################################################################################
 # Run tests
@@ -553,7 +556,7 @@
 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
     images make-support test-make bundles
 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
-CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native
+CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
 CLEAN_PHASES := gensrc java native include docs
 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
--- a/make/common/MakeBase.gmk	Fri Sep 18 10:46:33 2015 -0700
+++ b/make/common/MakeBase.gmk	Fri Sep 18 14:19:53 2015 -0700
@@ -567,16 +567,22 @@
 endif
 
 ################################################################################
-# Convenience functions for working around make's limitations with $(filter ).
-containing = \
-    $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))
-not-containing = \
-    $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),,$v)))
-
 # Filter out duplicate sub strings while preserving order. Keeps the first occurance.
 uniq = \
     $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
 
+# Returns all whitespace-separated words in $2 where at least one of the
+# whitespace-separated words in $1 is a substring.
+containing = \
+    $(strip \
+        $(foreach v,$(strip $2),\
+          $(call uniq,$(foreach p,$(strip $1),$(if $(findstring $p,$v),$v)))))
+
+# Returns all whitespace-separated words in $2 where none of the
+# whitespace-separated words in $1 is a substring.
+not-containing = \
+    $(strip $(filter-out $(call containing,$1,$2),$2))
+
 # Return a list of all string elements that are duplicated in $1.
 dups = \
     $(strip $(foreach v, $(sort $1), $(if $(filter-out 1, \
--- a/make/common/NativeCompilation.gmk	Fri Sep 18 10:46:33 2015 -0700
+++ b/make/common/NativeCompilation.gmk	Fri Sep 18 14:19:53 2015 -0700
@@ -102,7 +102,7 @@
 ################################################################################
 
 # Extensions of files handled by this macro.
-NATIVE_SOURCE_EXTENSIONS := %.s %.c %.cpp %.m %.mm
+NATIVE_SOURCE_EXTENSIONS := %.s %.c %.cpp %.cc %.m %.mm
 
 # Replaces native source extensions with the object file extension in a string.
 # Param 1: the string containing source file names with extensions
@@ -167,7 +167,7 @@
     $1_$2_FLAGS=$8 -DTHIS_FILE='"$$(<F)"'
     $1_$2_COMP=$(AS)
     $1_$2_DEP_FLAG:=
-  else ifneq (,$$(filter %.cpp,$2)$$(filter %.mm,$2))
+  else ifneq (,$$(filter %.cpp,$2)$$(filter %.cc,$2)$$(filter %.mm,$2))
     # Compile as a C++ or Objective-C++ file
     $1_$2_FLAGS=$(CFLAGS_CCACHE) $6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
     $1_$2_COMP=$7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/test/BuildTestLib.gmk	Fri Sep 18 14:19:53 2015 -0700
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# 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.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+
+TARGETS :=
+
+TEST_LIB_SOURCE_DIR := $(TOPDIR)/test/lib
+TEST_LIB_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/lib
+
+# Unfortunately, test-lib.jar does not compile properly without warnings.
+$(eval $(call SetupJavaCompiler, BOOT_JAVAC_NOWARNINGS, \
+    JAVAC := $(JAVAC), \
+    FLAGS := -XDignore.symbol.file=true -g, \
+))
+
+$(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \
+    SETUP := BOOT_JAVAC, \
+    SRC := $(TEST_LIB_SOURCE_DIR)/sun, \
+    BIN := $(TEST_LIB_SUPPORT), \
+    JAR := $(TEST_LIB_SUPPORT)/wb.jar, \
+))
+
+TARGETS += $(BUILD_WB_JAR)
+
+# test-lib.jar will contain only hprof classes until JDK-8081381 is resolved
+$(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
+    SETUP := BOOT_JAVAC_NOWARNINGS, \
+    SRC := $(TEST_LIB_SOURCE_DIR)/share/classes/jdk/test/lib/hprof, \
+    BIN := $(TEST_LIB_SUPPORT), \
+    JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
+))
+
+TARGETS += $(BUILD_TEST_LIB_JAR)
+
+##########################################################################################
+
+all: $(TARGETS)
+
+.PHONY: default all
--- a/modules.xml	Fri Sep 18 10:46:33 2015 -0700
+++ b/modules.xml	Fri Sep 18 14:19:53 2015 -0700
@@ -277,6 +277,7 @@
       <to>jdk.jvmstat</to>
       <to>jdk.management.resource</to>
       <to>jdk.pack200</to>
+      <to>jdk.scripting.nashorn</to>
       <to>jdk.security.auth</to>
       <to>jdk.security.jgss</to>
       <to>jdk.snmp</to>
--- a/test/Makefile	Fri Sep 18 10:46:33 2015 -0700
+++ b/test/Makefile	Fri Sep 18 14:19:53 2015 -0700
@@ -57,6 +57,9 @@
 # All testing
 all: jdk_all langtools_all jaxp_all
 
+# Bring in closed test targets if present
+-include $(TOPDIR)/closed/test/Makefile
+
 # Test targets
 langtools_% :
 	@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
--- a/test/lib/Makefile	Fri Sep 18 10:46:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#
-# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# Utility Makefile that creates wb.jar, which is used to simplify using 
-# the Whitebox API outside the jtreg-testbase.
-
-ifneq "x$(ALT_BOOTDIR)" "x"
-	BOOTDIR := $(ALT_BOOTDIR)
-endif
-
-ifeq "x$(BOOTDIR)" "x"
-	JDK_HOME := $(shell dirname $(shell which java))/..
-else
-	JDK_HOME := $(BOOTDIR)
-endif
-
-SRC_DIR = ./
-BUILD_DIR = build
-OUTPUT_DIR = $(BUILD_DIR)/classes
-
-JAVAC = $(JDK_HOME)/bin/javac
-JAR = $(JDK_HOME)/bin/jar
-
-WB_SRC_FILES = $(shell find $(SRC_DIR)/sun/hotspot -name '*.java')
-# test-lib.jar will contain only hprof classes until JDK-8081381 is resolved
-SHARE_SRC_FILES = $(shell find $(SRC_DIR)/share/classes/jdk/test/lib/hprof -name '*.java')
-
-.PHONY: wb.filelist share.filelist clean cleantmp
-
-all: wb.jar test-lib.jar cleantmp
-
-wb.jar: wb.filelist
-	@mkdir -p $(OUTPUT_DIR)
-	$(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @wb.filelist
-	$(JAR) cf wb.jar -C $(OUTPUT_DIR) .
-	@rm -rf $(OUTPUT_DIR)
-
-wb.filelist: $(WB_SRC_FILES)
-	@rm -f $@
-	@echo $(WB_SRC_FILES) > $@
-
-test-lib.jar: share.filelist
-	@mkdir -p $(OUTPUT_DIR)
-	$(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @share.filelist
-	$(JAR) cf test-lib.jar -C $(OUTPUT_DIR) .
-	@rm -rf $(OUTPUT_DIR)
-
-share.filelist: $(SHARE_SRC_FILES)
-	@rm -f $@
-	@echo $(SHARE_SRC_FILES) > $@
-
-clean: cleantmp
-	@rm -rf wb.jar
-	@rm -rf test-list.jar
-
-cleantmp:
-	@rm -rf wb.filelist
-	@rm -rf share.filelist
-	@rm -rf $(BUILD_DIR)
--- a/test/lib/sun/hotspot/WhiteBox.java	Fri Sep 18 10:46:33 2015 -0700
+++ b/test/lib/sun/hotspot/WhiteBox.java	Fri Sep 18 14:19:53 2015 -0700
@@ -26,12 +26,10 @@
 
 import java.lang.management.MemoryUsage;
 import java.lang.reflect.Executable;
-import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.List;
 import java.util.function.BiFunction;
 import java.util.function.Function;
-import java.util.stream.Stream;
 import java.security.BasicPermission;
 import java.util.Objects;
 
@@ -85,6 +83,7 @@
   public native int  getVMPageSize();
   public native long getVMAllocationGranularity();
   public native long getVMLargePageSize();
+  public native long getHeapSpaceAlignment();
 
   private native boolean isObjectInOldGen0(Object o);
   public         boolean isObjectInOldGen(Object o) {
@@ -144,6 +143,10 @@
     return parseCommandLine0(commandline, delim, args);
   }
 
+  // Parallel GC
+  public native long psVirtualSpaceAlignment();
+  public native long psHeapGenerationAlignment();
+
   // NMT
   public native long NMTMalloc(long size);
   public native void NMTFree(long mem);
@@ -386,23 +389,6 @@
                               .orElse(null);
   }
 
-  public native boolean readImageFile(String imagePath);
-  public native long imageOpenImage(String imagePath, boolean bigEndian);
-  public native void imageCloseImage(long id);
-  public native long imageGetIndexAddress(long id);
-  public native long imageGetDataAddress(long id);
-  public native boolean imageReadCompressed(long id, long offset,
-    ByteBuffer compressedBuffer, long compressedSize,
-    ByteBuffer uncompressedBuffer, long uncompressedSize);
-  public native boolean imageRead(long id, long offset,
-    ByteBuffer uncompressedBuffer, long uncompressedSize);
-  public native byte[] imageGetStringBytes(long id, int offset);
-  public native long imageGetStringsSize(long id);
-  public native long[] imageGetAttributes(long id, int offset);
-  public native long[] imageFindAttributes(long id, byte[] path);
-  public native int[] imageAttributeOffsets(long id);
-  public native int imageGetIntAtAddress(long address, int offset, boolean big_endian);
-
   // Safepoint Checking
   public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);
 
--- a/test/make/TestMakeBase.gmk	Fri Sep 18 10:46:33 2015 -0700
+++ b/test/make/TestMakeBase.gmk	Fri Sep 18 14:19:53 2015 -0700
@@ -73,6 +73,37 @@
 TEST_TARGETS += $(ESCAPE_DOLLAR_DIR)/_escape_dollar
 
 ################################################################################
+# Test containing and not-containing
+
+CONT_LIST := foo bar baz foobar foobaz
+
+# Param 1 - string to look for
+# Param 2 - expected result
+define TestContaining
+  value := $$(call containing, $1, $(CONT_LIST))
+  ifneq ($$(value), $2)
+    $$(info (call containing, $1, $(CONT_LIST)))
+    $$(error result >$$(value)<, expected >$2<)
+  endif
+endef
+
+$(eval $(call TestContaining,bar,bar foobar))
+$(eval $(call TestContaining,foo bar,foo bar foobar foobaz))
+
+# Param 1 - string to look for
+# Param 2 - expected result
+define TestNotContaining
+  value := $$(call not-containing, $1, $(CONT_LIST))
+  ifneq ($$(value), $2)
+    $$(info (call not-containing, $1, $(CONT_LIST)))
+    $$(error result >$$(value)<, expected >$2<)
+  endif
+endef
+
+$(eval $(call TestNotContaining,bar,foo baz foobaz))
+$(eval $(call TestNotContaining,foo bar,baz))
+
+################################################################################
 # Test Equals
 
 EQUALS_VALUE1 := value1$(SPACE)