changeset 1396:c0bc44f5c981

Merge
author prr
date Tue, 17 Mar 2015 12:30:37 -0700
parents dc3a27524b39 a96ae43b3b22
children 5ca3176f8c39 5c624e587f07
files
diffstat 14 files changed, 171 insertions(+), 159 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Mar 11 08:30:21 2015 -0700
+++ b/.hgtags	Tue Mar 17 12:30:37 2015 -0700
@@ -296,3 +296,4 @@
 6207b4b8731ca75c51b031c47daa813ab92ef558 jdk9-b51
 1822e59f17121b09e7899cf338cfb6e37fe5fceb jdk9-b52
 d6ed47125a76cd1cf8a100568507bfb5e9669d9f jdk9-b53
+cb7367141e910e265b8344a8facee740bd1e5467 jdk9-b54
--- a/make/CompileJavaModules.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/CompileJavaModules.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
@@ -42,6 +42,7 @@
 
 ################################################################################
 
+java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
 java.base_COPY := .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
 java.base_CLEAN := intrinsic.properties
 
@@ -89,10 +90,16 @@
 
 ################################################################################
 
+java.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
+
+################################################################################
+
+java.datatransfer_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
 java.datatransfer_COPY := flavormap.properties
 
 ################################################################################
 
+java.desktop_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-missing,-reference '-Xdoclint/package:java.*,javax.*'
 java.desktop_COPY := .gif .png .wav .txt .xml .css .pf
 java.desktop_CLEAN := iio-plugin.properties cursors.properties
 
@@ -239,15 +246,18 @@
 
 ################################################################################
 
+java.scripting_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.scripting_COPY := .js
 java.scripting_CLEAN := .properties
 
 ################################################################################
 
+java.sql_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
 
 ################################################################################
 
+java.sql.rowset_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.sql.rowset_CLEAN_FILES := $(wildcard \
     $(JDK_TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \
     $(JDK_TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
@@ -261,6 +271,7 @@
 
 ################################################################################
 
+java.rmi_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.rmi_CLEAN_FILES := $(wildcard \
     $(JDK_TOPDIR)/src/java.rmi/share/classes/sun/rmi/registry/resources/*.properties \
     $(JDK_TOPDIR)/src/java.rmi/share/classes/sun/rmi/server/resources/*.properties)
@@ -309,14 +320,17 @@
 
 ################################################################################
 
+java.naming_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.naming_CLEAN := jndiprovider.properties
 
 ################################################################################
 
+java.security.saaj_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.security.saaj_CLEAN := .properties
 
 ################################################################################
 
+java.xml.crypto_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 java.xml.crypto_COPY := .dtd .xml
 java.xml.crypto_CLEAN := .properties
 
@@ -326,6 +340,7 @@
 
 ################################################################################
 
+jdk.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:-com.sun.tools.*'
 jdk.compiler_COPY := javax.tools.JavaCompilerTool
 jdk.compiler_CLEAN_FILES := $(wildcard \
     $(patsubst %, $(JDK_TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \
@@ -485,7 +500,7 @@
     $1_CLASSPATH := $$($1_CLASSPATH) $$(addprefix $(JDK_OUTPUTDIR)/modules/,jdk.hotspot.agent)
   endif
   $1_CLASSPATH := $$(subst $$(SPACE),$$(PATH_SEP),$$($1_CLASSPATH))
-  $1_JAVAC_FLAGS := -bootclasspath "$$($1_CLASSPATH)"
+  $1_JAVAC_FLAGS := -bootclasspath "$$($1_CLASSPATH)" $$($1_ADD_JAVAC_FLAGS)
 
   $$(eval $$(call SetupJavaCompilation,$1, \
       SETUP := $$(if $$($1_SETUP), $$($1_SETUP), GENERATE_JDKBYTECODE), \
--- a/make/Images.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/Images.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -494,29 +494,16 @@
 
   GCOV_FIND_EXPR := -type f -name "*.gcno"
 
-  ifeq ($(JVM_VARIANT_CLIENT), true)
-    $(eval $(call SetupCopyFiles,COPY_HOTSPOT_CLIENT_GCOV_GCNO, \
-        SRC := $(HOTSPOT_OUTPUTDIR), \
-        DEST := $(SYMBOLS_IMAGE_DIR)/gcov/hotspot/client, \
-        FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR)/*compiler1/ $(GCOV_FIND_EXPR)), \
-        FLATTEN := true))
+  $(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
+      SRC := $(OUTPUT_ROOT), \
+      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
+      FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
 
-    SYMBOLS_TARGETS += $(COPY_HOTSPOT_CLIENT_GCOV_GCNO)
-  endif
-
-  ifeq ($(JVM_VARIANT_SERVER), true)
-    $(eval $(call SetupCopyFiles,COPY_HOTSPOT_SERVER_GCOV_GCNO, \
-        SRC := $(HOTSPOT_OUTPUTDIR), \
-        DEST := $(SYMBOLS_IMAGE_DIR)/gcov/hotspot/server, \
-        FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR)/*compiler2/ $(GCOV_FIND_EXPR)), \
-        FLATTEN := true))
-
-    SYMBOLS_TARGETS += $(COPY_HOTSPOT_SERVER_GCOV_GCNO)
-  endif
+  SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
 
   $(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
-      SRC := $(SUPPORT_OUTPUTDIR)/native, \
-      DEST := $(SYMBOLS_IMAGE_DIR)/gcov/jdk, \
+      SRC := $(OUTPUT_ROOT), \
+      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
       FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
 
   SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
--- a/make/common/IdlCompilation.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/IdlCompilation.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -88,15 +88,8 @@
 #   EXCLUDES
 #   OLDIMPLBASES
 #   DELETES
-define SetupIdlCompilation
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupIdlCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupIdlCompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
+SetupIdlCompilation = $(NamedParamsMacroTemplate)
+define SetupIdlCompilationBody
 
   # Find all existing java files and existing class files.
   $$(call MakeDir,$$($1_BIN))
--- a/make/common/JavaCompilation.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/JavaCompilation.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -59,16 +59,8 @@
 #   FLAGS:=Flags to be supplied to javac
 #   SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here
 #   SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above.
-define SetupJavaCompiler
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupJavaCompilerInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupJavaCompilerInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
-
+SetupJavaCompiler = $(NamedParamsMacroTemplate)
+define SetupJavaCompilerBody
   # The port file contains the tcp/ip on which the server listens
   # and the cookie necessary to talk to the server.
   $1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port
@@ -84,10 +76,11 @@
 # Parameter 1 is the name of the rule. This name is used as variable prefix,
 # and the targets generated are listed in a variable by that name.
 #
-# Parameter 2 is a list of dependencies for the jar target. If left empty,
-# dependencies are searched using SRCS, which should not be empty.
-#
 # Remaining parameters are named arguments. These include:
+#   DEPENDENCIES:=List of dependencies for the jar target. If left empty,
+#       dependencies are calculated automatically from the source files found.
+#       For this to work, the source files must exist when the makefile is
+#       parsed.
 #   SRCS:=List of directories in where to find files to add to archive
 #   SUFFIXES:=File suffixes to include in jar
 #   INCLUDES:=List of directories/packages in SRCS that should be included
@@ -102,17 +95,8 @@
 #       added to the archive.
 #   EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
 #   CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable
-define SetupArchive
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupArchiveInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupArchiveInner
-  # NOTE: $2 is dependencies, not a named argument!
-  $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupArchive($1),<dependencies>,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
-  $(if $(findstring $(LOG_LEVEL),trace), $(info *[2] <dependencies> = $(strip $2)))
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
+SetupArchive = $(NamedParamsMacroTemplate)
+define SetupArchiveBody
 
   $1_JARMAIN:=$(strip $$($1_JARMAIN))
   $1_JARNAME:=$$(notdir $$($1_JAR))
@@ -171,29 +155,27 @@
   # When this macro is run in the same makefile as the java compilation, dependencies are
   # transfered in make variables. When the macro is run in a different makefile than the
   # java compilation, the dependencies need to be found in the filesystem.
-  ifneq (,$2)
-    $1_DEPS:=$2
-  else
+  ifeq ($$($1_DEPENDENCIES), )
     # Add all source roots to the find cache since we are likely going to run find
     # on these more than once. The cache will only be updated if necessary.
     $$(eval $$(call FillCacheFind, $$($1_FIND_LIST)))
-    $1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
+    $1_DEPENDENCIES:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
         $$(call CacheFind,$$($1_SRCS)))
     ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
-      $1_DEPS:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPS))
+      $1_DEPENDENCIES:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
     endif
     ifneq (,$$($1_GREP_EXCLUDE_PATTERNS))
-      $1_DEPS:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPS))
+      $1_DEPENDENCIES:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
     endif
     # Look for EXTRA_FILES in all SRCS dirs and as absolute paths.
-    $1_DEPS+=$$(wildcard $$(foreach src, $$($1_SRCS), \
+    $1_DEPENDENCIES+=$$(wildcard $$(foreach src, $$($1_SRCS), \
         $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))
     ifeq (,$$($1_SKIP_METAINF))
-      $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
+      $1_DEPENDENCIES+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
     endif
   endif
   # The dependency list should never be empty
-  ifeq ($$(strip $$($1_DEPS)), )
+  ifeq ($$(strip $$($1_DEPENDENCIES)), )
     $$(warning No dependencies found for $1)
   endif
 
@@ -288,7 +270,7 @@
   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
 
   # Here is the rule that creates/updates the jar file.
-  $$($1_JAR) : $$($1_DEPS) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
+  $$($1_JAR) : $$($1_DEPENDENCIES) $$($1_MANIFEST) $$($1_VARDEPS_FILE)
 	$(MKDIR) -p $$($1_BIN)
 	$$($1_GREP_INCLUDE_OUTPUT)
 	$$($1_GREP_EXCLUDE_OUTPUT)
@@ -387,7 +369,7 @@
 	$(MKDIR) -p $$(@D)
 	export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \
 	    | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
-	        -e 's/\([^\\]\)!/\1\\!/g' -e 's/#.*/#/g' \
+	        -e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ 	]*#.*/#/g' \
 	    | $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \
 	    | $(SED) -e '/^#/d' -e '/^$$$$/d' \
 	        -e :a -e '/\\$$$$/N; s/\\\n//; ta' \
@@ -429,15 +411,8 @@
 #   HEADERS:=path to directory where all generated c-headers are written.
 #   DEPENDS:=Extra dependecy
 #   DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
-define SetupJavaCompilation
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupJavaCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupJavaCompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
+SetupJavaCompilation = $(NamedParamsMacroTemplate)
+define SetupJavaCompilationBody
 
   # Verify arguments
   ifeq ($$($1_BIN),)
@@ -653,7 +628,8 @@
       $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
     endif
 
-    $$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1), \
+    $$(eval $$(call SetupArchive,ARCHIVE_$1, \
+        DEPENDENCIES:=$$($1), \
         SRCS:=$$($1_BIN), \
         SUFFIXES:=$$($1_SUFFIXES), \
         EXCLUDE:=$$($1_EXCLUDES), \
--- a/make/common/MakeBase.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/MakeBase.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -374,28 +374,70 @@
 # Make sure logging is setup for everyone that includes MakeBase.gmk.
 $(eval $(call SetupLogging))
 
-# This is to be called by all SetupFoo macros
-define LogSetupMacroEntry
-  $(if $(30),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
-  $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29,$(if $(strip $($i)),$(NEWLINE) $(strip [$i] $($i))))))
+################################################################################
+# Creates a sequence of increasing numbers (inclusive).
+# Param 1 - starting number
+# Param 2 - ending number
+sequence = \
+    $(wordlist $1, $2, $(strip \
+        $(eval SEQUENCE_COUNT :=) \
+        $(call _sequence-do,$(strip $2))))
+
+_sequence-do = \
+    $(if $(word $1, $(SEQUENCE_COUNT)),, \
+      $(eval SEQUENCE_COUNT += .) \
+      $(words $(SEQUENCE_COUNT)) \
+      $(call _sequence-do,$1))
+
+################################################################################
+
+MAX_PARAMS := 30
+PARAM_SEQUENCE := $(call sequence, 2, $(MAX_PARAMS))
+
+# Template for creating a macro taking named parameters. To use it, assign the
+# template to a variable with the name you want for your macro, using '='
+# assignment. Then define a macro body with the suffix "Body". The Body macro
+# should take 1 parameter which should be a unique string for that invocation
+# of the macro.
+# Ex:
+# SetupFoo = $(NamedParamsMacroTemplate)
+# define SetupFooBody
+#   # do something
+#   # access parameters as $$($1_BAR)
+# endef
+# Call it like this
+# $(eval $(call SetupFoo, BUILD_SOMETHING, \
+#     BAR := some parameter value, \
+# ))
+define NamedParamsMacroTemplate
+  $(if $($(MAX_PARAMS)),$(error Internal makefile error: \
+      Too many named arguments to macro, please update MAX_PARAMS in MakeBase.gmk))
+  # Iterate over 2 3 4... and evaluate the named parameters with $1_ as prefix
+  $(foreach i,$(PARAM_SEQUENCE), $(if $(strip $($i)),\
+    $(strip $1)_$(strip $($i)))$(NEWLINE))
+  # Debug print all named parameter names and values
+  $(if $(findstring $(LOG_LEVEL),debug trace), \
+    $(info $0 $(strip $1) $(foreach i,$(PARAM_SEQUENCE), \
+      $(if $(strip $($i)),$(NEWLINE) $(strip [$i] $(if $(filter $(LOG_LEVEL), trace), \
+        $($i), $(wordlist 1, 20, $($(i))) $(if $(word 21, $($(i))), ...)))))))
+
+  $(if $(DEBUG_$(strip $1)),
+    $(info -------- <<< Begin expansion of $(strip $1)) \
+    $(info $(call $(0)Body,$(strip $1))) \
+    $(info -------- >>> End expansion of $(strip $1)) \
+  )
+
+  $(call $(0)Body,$(strip $1))
 endef
 
-# Support macro for all SetupFoo macros.
-define EvalDebugWrapper
-  $(if $(DEBUG_$1),
-    $(info -------- <<< Begin expansion of $1)
-    $(info $2)
-    $(info -------- >>> End expansion of $1)
-  )
-
-  $2
-endef
-
+################################################################################
 # Make directory without forking mkdir if not needed
 MakeDir = \
     $(strip $(if $(subst $(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),,$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)),\
       $(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9)))
 
+################################################################################
+
 ifeq ($(OPENJDK_TARGET_OS),solaris)
   # On Solaris, if the target is a symlink and exists, cp won't overwrite.
   # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
@@ -437,6 +479,7 @@
   endef
 endif
 
+################################################################################
 # Convenience functions for working around make's limitations with $(filter ).
 containing = \
     $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))
@@ -457,8 +500,9 @@
     $(and $(findstring $(strip $1),$(strip $2)),\
         $(findstring $(strip $2),$(strip $1)))
 
+################################################################################
+
 ifneq ($(DISABLE_CACHE_FIND), true)
-  ################################################################################
   # In Cygwin, finds are very costly, both because of expensive forks and because
   # of bad file system caching. Find is used extensively in $(shell) commands to
   # find source files. This makes rerunning make with no or few changes rather
@@ -544,16 +588,8 @@
 #   FLATTEN : Set to flatten the directory structure in the DEST dir.
 #   MACRO   : Optionally override the default macro used for making the copy.
 #             Default is 'install-file'
-
-define SetupCopyFiles
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupCopyFiles, please update MakeBase.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupCopyFilesInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupCopyFilesInner
-  $(foreach i,2 3 4 5 6, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupCopyFiles($1),$2,$3,$4,$5,$6)
-  $(if $(7),$(error Internal makefile error: Too many arguments to SetupCopyFiles, please update MakeBase.gmk))
+SetupCopyFiles = $(NamedParamsMacroTemplate)
+define SetupCopyFilesBody
 
   ifeq ($$($1_MACRO), )
     $1_MACRO := install-file
--- a/make/common/NativeCompilation.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/NativeCompilation.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -60,7 +60,7 @@
     -e 's|Note: including file: *||' \
     -e 's|\\|/|g' \
     -e 's|^\([a-zA-Z]\):|$(UNIX_PATH_PREFIX)/\1|g' \
-    -e '/$(subst /,\/,$(TOPDIR))/!d' \
+    -e '\|$(TOPDIR)|I !d' \
     -e 's|$$$$| \\|g' \
     #
 
@@ -153,7 +153,7 @@
 	      exit `cat $$($1_$2_DEP).exitvalue`
 	  $(RM) $$($1_$2_DEP).exitvalue
 	  ($(ECHO) $$@: \\ \
-	  && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) > $$($1_$2_DEP)
+	  && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) | $(SORT) -u > $$($1_$2_DEP)
         endif
         # Create a dependency target file from the dependency file.
         # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
@@ -195,15 +195,8 @@
 #   LDEXE the linker to use for linking executables, default is $(LDEXE)
 #   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
 #   DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
-define SetupNativeCompilation
-  $(if $(30),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupNativeCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26),$(27),$(28),$(29)))
-endef
-
-define SetupNativeCompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26),$(27),$(28),$(29))
-  $(if $(30),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
+SetupNativeCompilation = $(NamedParamsMacroTemplate)
+define SetupNativeCompilationBody
 
   ifneq (,$$($1_BIN))
     $$(error BIN has been replaced with OBJECT_DIR)
@@ -399,12 +392,6 @@
     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
   endif
 
-  # Pick up disabled warnings, if possible on this platform.
-  ifneq ($(DISABLE_WARNING_PREFIX),)
-    $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
-    $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
-  endif
-
   ifeq ($$($1_DEBUG_SYMBOLS), true)
     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
       ifdef OPENJDK
@@ -422,6 +409,9 @@
     endif
   endif
 
+  # If no C++ flags are explicitly set, default to using the C flags.
+  # After that, we can set additional C++ flags that should not interfere
+  # with the mechanism for copying the C flags by default.
   ifeq ($$($1_CXXFLAGS),)
     $1_CXXFLAGS:=$$($1_CFLAGS)
   endif
@@ -434,6 +424,12 @@
     $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
   endif
 
+  # Pick up disabled warnings, if possible on this platform.
+  ifneq ($(DISABLE_WARNING_PREFIX),)
+    $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
+    $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
+  endif
+
   ifeq (NONE, $$($1_OPTIMIZATION))
     $1_EXTRA_CFLAGS += $(C_O_FLAG_NONE)
     $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NONE)
--- a/make/common/RMICompilation.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/RMICompilation.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -37,15 +37,8 @@
 #   RUN_IIOP:=Set to run rmic with -iiop
 #   RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage
 #   KEEP_GENERATED:=Set to keep generated sources around
-define SetupRMICompilation
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupRMICompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupRMICompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
+SetupRMICompilation = $(NamedParamsMacroTemplate)
+define SetupRMICompilationBody
 
   $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated
 
--- a/make/common/TestFilesCompilation.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/TestFilesCompilation.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -46,15 +46,8 @@
 #   TYPE Must be either PROGRAM or LIBRARY.
 #   SOURCE_DIRS A list of source directories to search
 #   OUTPUT_DIR Where to put the resulting files
-define SetupTestFilesCompilation
-  $(if $(27),$(error Internal makefile error: Too many arguments to SetupTestFilesCompilation, please update BuildJTRegNative.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupTestFilesCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)))
-endef
-
-define SetupTestFilesCompilationInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupTestFileCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))
-  $(if $(27),$(error Internal makefile error: Too many arguments to SetupTestFilesCompilation, please update BuildJTRegNative.gmk))
+SetupTestFilesCompilation = $(NamedParamsMacroTemplate)
+define SetupTestFilesCompilationBody
 
   # Check for duplicate base file names. That would have failed later anyhow, but
   # this gives a better error message.
--- a/make/common/TextFileProcessing.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/TextFileProcessing.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -77,15 +77,8 @@
 #   processed first, and replacements will be done on the included fragments as well.
 #   If neither is present, the files will just be copied without modifications.
 #
-define SetupTextFileProcessing
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupTextFileProcessingInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupTextFileProcessingInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupTextFileProcessing($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk))
+SetupTextFileProcessing = $(NamedParamsMacroTemplate)
+define SetupTextFileProcessingBody
 
   ifneq ($$($1_SOURCE_FILES),)
     ifneq ($$($1_SOURCE_DIRS),)
--- a/make/common/ZipArchive.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/make/common/ZipArchive.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -45,15 +45,8 @@
 #   SUFFIXES
 #   EXTRA_DEPS
 #   ZIP_OPTIONS extra options to pass to zip
-define SetupZipArchive
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update ZipArchive.gmk))
-  $(call EvalDebugWrapper,$(strip $1),$(call SetupZipArchiveInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
-endef
-
-define SetupZipArchiveInner
-  $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
-  $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
-  $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk))
+SetupZipArchive = $(NamedParamsMacroTemplate)
+define SetupZipArchiveBody
 
   # To avoid running find over too large sets of files, which causes make to crash
   # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set
--- a/test/lib/sun/hotspot/WhiteBox.java	Wed Mar 11 08:30:21 2015 -0700
+++ b/test/lib/sun/hotspot/WhiteBox.java	Tue Mar 17 12:30:37 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -27,6 +27,7 @@
 import java.lang.reflect.Executable;
 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;
@@ -250,6 +251,23 @@
     }
     return offset;
   }
+  public native Boolean getMethodBooleanOption(Executable method, String name);
+  public native Long    getMethodIntxOption(Executable method, String name);
+  public native Long    getMethodUintxOption(Executable method, String name);
+  public native Double  getMethodDoubleOption(Executable method, String name);
+  public native String  getMethodStringOption(Executable method, String name);
+  private final List<BiFunction<Executable,String,Object>> methodOptionGetters
+      = Arrays.asList(this::getMethodBooleanOption, this::getMethodIntxOption,
+          this::getMethodUintxOption, this::getMethodDoubleOption,
+          this::getMethodStringOption);
+
+  public Object getMethodOption(Executable method, String name) {
+    return methodOptionGetters.stream()
+                              .map(f -> f.apply(method, name))
+                              .filter(x -> x != null)
+                              .findAny()
+                              .orElse(null);
+  }
 
   // Safepoint Checking
   public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);
--- a/test/make/TestJavaCompilation.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/test/make/TestJavaCompilation.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -67,7 +67,7 @@
 	$(TOUCH) $@
 
 $(eval $(call SetupArchive,BUILD_JAR1, \
-    $(OUTPUT_DIR)/_jar1_created, \
+    DEPENDENCIES := $(OUTPUT_DIR)/_jar1_created, \
     SRCS := $(JAR1_SRC_ROOT), \
     MANIFEST := $(JAR1_MANIFEST), \
     JAR := $(JAR1_FILE)))
@@ -143,7 +143,7 @@
 	$(TOUCH) $@
 
 $(eval $(call SetupArchive,BUILD_JAR2, \
-    $(OUTPUT_DIR)/_jar2_created, \
+    DEPENDENCIES := $(OUTPUT_DIR)/_jar2_created, \
     SRCS := $(JAR2_SRC_ROOT1) $(JAR2_SRC_ROOT2), \
     JAR := $(JAR2_FILE)))
 
@@ -196,7 +196,7 @@
 	$(TOUCH) $@
 
 $(eval $(call SetupArchive,BUILD_JAR3, \
-    $(OUTPUT_DIR)/_jar3_created, \
+    DEPENDENCIES := $(OUTPUT_DIR)/_jar3_created, \
     SRCS := $(JAR3_SRC_ROOT1) $(JAR3_SRC_ROOT2), \
     EXTRA_FILES := extra-file \
         dir2/file$$$$foo.dollar \
--- a/test/make/TestMakeBase.gmk	Wed Mar 11 08:30:21 2015 -0700
+++ b/test/make/TestMakeBase.gmk	Tue Mar 17 12:30:37 2015 -0700
@@ -182,5 +182,23 @@
 TEST_TARGETS += test-vardep
 
 ################################################################################
+# Test sequence
+
+ifneq ($(call sequence, 1, 1), 1)
+  $(error Sequence 1, 1 should be "1", but was $(call sequence, 1, 1))
+endif
+
+ifneq ($(call sequence, 2, 3), 2 3)
+  $(error Sequence 2, 3 should be "2 3", but was $(call sequence, 2, 3))
+endif
+
+ifneq ($(call sequence, 4, 9), 4 5 6 7 8 9)
+  $(error Sequence 4, 9 should be "4 5 6 7 8 9", but was $(call sequence, 4, 9))
+endif
+
+ifneq ($(call sequence, 5, 15), 5 6 7 8 9 10 11 12 13 14 15)
+  $(error Sequence 5, 15 should be "5 6 7 8 9 10 11 12 13 14 15", \
+      but was $(call sequence, 5, 15))
+endif
 
 all: $(TEST_TARGETS)