changeset 14076:bf47af65820f

Merge
author zmajo
date Thu, 24 Mar 2016 16:21:19 +0100
parents c337b8a1e467 c102782d9b33
children 39ddc2279d51
files make/gendata/Gendata-jdk.jdeps.gmk make/gensrc/Gensrc-java.base.gmk make/gensrc/Gensrc-jdk.dev.gmk make/gensrc/Gensrc-jdk.jvmstat.gmk make/launcher/Launcher-jdk.dev.gmk make/scripts/localelist.sh make/src/classes/build/tools/module/GenJdepsModulesXml.java make/src/classes/build/tools/module/GenModulesList.java make/src/classes/build/tools/module/ImageBuilder.java make/src/classes/build/tools/module/ModuleArchive.java make/src/classes/build/tools/module/boot.modules make/src/classes/build/tools/module/ext.modules src/java.base/share/classes/java/lang/invoke/MemberName.java src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java src/java.base/share/classes/java/lang/invoke/MethodHandles.java src/java.base/share/classes/jdk/internal/jimage/Archive.java src/java.base/share/classes/jdk/internal/jimage/BasicImageWriter.java src/java.base/share/classes/jdk/internal/jimage/ExternalFilesWriter.java src/java.base/share/classes/jdk/internal/jimage/ImageFileCreator.java src/java.base/share/classes/jdk/internal/jimage/ImageJavaSubstrate.java src/java.base/share/classes/jdk/internal/jimage/ImageLocationBase.java src/java.base/share/classes/jdk/internal/jimage/ImageLocationWriter.java src/java.base/share/classes/jdk/internal/jimage/ImageModuleData.java src/java.base/share/classes/jdk/internal/jimage/ImageModuleDataWriter.java src/java.base/share/classes/jdk/internal/jimage/ImageNativeSubstrate.java src/java.base/share/classes/jdk/internal/jimage/ImageResourcesTree.java src/java.base/share/classes/jdk/internal/jimage/ImageStringsWriter.java src/java.base/share/classes/jdk/internal/jimage/ImageSubstrate.java src/java.base/share/classes/jdk/internal/jimage/PerfectHashBuilder.java src/java.base/share/classes/jdk/internal/jimage/ResourcePool.java src/java.base/share/classes/jdk/internal/jimage/ResourcePoolImpl.java src/java.base/share/classes/jdk/internal/jimage/StringTable.java src/java.base/share/classes/jdk/internal/jimage/UTF8String.java src/java.base/share/classes/sun/misc/Launcher.java src/java.base/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template src/java.base/share/native/libjava/Package.c src/java.base/share/native/libjava/Proxy.c src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp src/java.desktop/share/classes/META-INF/services/java.net.ContentHandlerFactory src/java.desktop/share/classes/META-INF/services/javax.print.PrintServiceLookup src/java.desktop/share/classes/META-INF/services/javax.print.StreamPrintServiceFactory src/java.desktop/share/classes/META-INF/services/javax.sound.midi.spi.MidiDeviceProvider src/java.desktop/share/classes/META-INF/services/javax.sound.midi.spi.MidiFileReader src/java.desktop/share/classes/META-INF/services/javax.sound.midi.spi.MidiFileWriter src/java.desktop/share/classes/META-INF/services/javax.sound.midi.spi.SoundbankReader src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider src/java.desktop/share/classes/META-INF/services/sun.datatransfer.DesktopDatatransferService src/java.logging/share/classes/META-INF/services/jdk.internal.logger.DefaultLoggerFinder src/java.security.jgss/share/classes/META-INF/services/sun.security.ssl.ClientKeyExchangeService src/jdk.accessibility/windows/classes/META-INF/services/javax.accessibility.AccessibilityProvider src/jdk.attach/share/classes/META-INF/services/com.sun.tools.attach.spi.AttachProvider src/jdk.charsets/share/classes/META-INF/services/java.nio.charset.spi.CharsetProvider src/jdk.dev/share/classes/jdk/tools/jimage/ExtractedImage.java src/jdk.dev/share/classes/jdk/tools/jimage/JImageTask.java src/jdk.dev/share/classes/jdk/tools/jimage/Main.java src/jdk.dev/share/classes/jdk/tools/jimage/TaskHelper.java src/jdk.dev/share/classes/jdk/tools/jimage/resources/jimage.properties src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.spi.TransportService src/jdk.jvmstat.rmi/share/classes/META-INF/services/sun.jvmstat.monitor.MonitoredHostService src/jdk.jvmstat/share/classes/META-INF/services/sun.jvmstat.monitor.MonitoredHostService src/jdk.localedata/share/classes/META-INF/services/sun.util.locale.provider.LocaleDataMetaInfo src/jdk.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider src/jdk.naming.dns/share/classes/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor src/jdk.zipfs/share/classes/META-INF/services/java.nio.file.spi.FileSystemProvider test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh test/java/net/DatagramSocket/SetDatagramSocketImplFactory/java/net/MyDatagramSocketImplFactory.java test/java/net/httpclient/whitebox/TEST.properties test/java/net/httpclient/whitebox/java/net/http/SelectorTest.java test/java/util/stream/bootlib/TEST.properties test/jdk/internal/jimage/ExecutableTest.java test/jdk/internal/jimage/JImageTest.java test/jdk/internal/jimage/VerifyJimage.java test/sun/security/krb5/config/NamingManager.java test/sun/security/krb5/config/dns.sh test/sun/security/mscapi/IsSunMSCAPIAvailable.sh test/sun/security/ssl/StatusStapling/BogusStatusRequest.java test/sun/security/ssl/StatusStapling/CertStatusReqExtensionTests.java test/sun/security/ssl/StatusStapling/CertStatusReqItemV2Tests.java test/sun/security/ssl/StatusStapling/CertStatusReqListV2ExtensionTests.java test/sun/security/ssl/StatusStapling/OCSPStatusRequestTests.java test/sun/security/ssl/StatusStapling/StatusResponseManagerTests.java test/sun/security/ssl/StatusStapling/TestCase.java test/sun/security/ssl/StatusStapling/TestUtils.java
diffstat 1241 files changed, 99887 insertions(+), 17114 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileInterimRmic.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/CompileInterimRmic.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -44,8 +44,9 @@
 $(eval $(call SetupJavaCompilation,BUILD_INTERIM_RMIC, \
     SETUP := GENERATE_OLDBYTECODE, \
     SRC := $(JDK_TOPDIR)/src/jdk.rmic/share/classes, \
+    EXCLUDE_FILES := module-info.java, \
     INCLUDES := $(RMIC_PKGS), \
-    BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_classes, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.rmic, \
     COPY := .properties))
 
 ##########################################################################################
--- a/make/CompileTools.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/CompileTools.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -32,42 +32,12 @@
 
 ################################################################################
 
-JIMAGE_PKGS := \
-    jdk/internal/jimage \
-    jdk/internal/jrtfs \
-    #
-
-$(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \
-    SETUP := GENERATE_OLDBYTECODE, \
-    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
-    INCLUDES := $(JIMAGE_PKGS), \
-    BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes))
-
-TARGETS += $(BUILD_INTERIM_JIMAGE)
-
-# Because of the explicit INCLUDES in the compilation setup above, the service provider
-# file will not be copied unless META-INF/services would also be added to the INCLUDES.
-# Adding META-INF/services would include all files in that directory when only the one
-# is needed, which is why this explicit copy is defined instead.
-$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \
-    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
-    DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \
-    FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
-
-TARGETS += $(COPY_JIMAGE_SERVICE_PROVIDER)
-
-################################################################################
-
 $(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
     SETUP := GENERATE_OLDBYTECODE, \
-    ADD_JAVAC_FLAGS := -Xbootclasspath/p:$(call PathList, \
-        $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
-        $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes), \
     SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \
-    BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
-    COPY := boot.modules ext.modules))
-
-$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER)
+    EXCLUDES := build/tools/deps \
+                build/tools/jigsaw, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes))
 
 TARGETS += $(BUILD_TOOLS_JDK)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/GenerateModuleSummary.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2014, 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 target declared first
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include ModuleTools.gmk
+
+GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs
+TOOLS_MODULE_SRCDIR := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw
+
+$(GENGRAPHS_DIR)/jdk.dot: $(BUILD_JIGSAW_TOOLS)
+	$(MKDIR) -p $(@D)
+	$(TOOL_GENGRAPHS) $(GENGRAPHS_DIR)
+
+$(GENGRAPHS_DIR)/technology-summary.html: $(TOOLS_MODULE_SRCDIR)/technology-summary.html
+	$(install-file)
+
+$(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/technology-summary.html
+	$(MKDIR) -p $(@D)
+	$(TOOL_MODULESUMMARY) -o $@ -mp $(IMAGES_OUTPUTDIR)/jmods
+
+all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/ModuleTools.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2013, 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.
+#
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+
+TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
+
+$(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
+    SETUP := GENERATE_USINGJDKBYTECODE, \
+    SRC := $(JDK_TOPDIR)/make/src/classes, \
+    INCLUDES := build/tools/deps \
+                build/tools/jigsaw, \
+    BIN := $(TOOLS_CLASSES_DIR), \
+    ADD_JAVAC_FLAGS := -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED ))
+
+
+TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
+    build.tools.jigsaw.GenGraphs
+
+TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
+    -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
+    build.tools.jigsaw.ModuleSummary
--- a/make/Tools.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/Tools.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -41,7 +41,12 @@
 TOOL_ADDJSUM = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.addjsum.AddJsum
 
+ifeq ($(BOOT_JDK_MODULAR), true)
+  COMPILEFONTCONFIG_ADD_EXPORTS := -XaddExports:java.desktop/sun.awt=ALL-UNNAMED
+endif
+
 TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
+    $(COMPILEFONTCONFIG_ADD_EXPORTS) \
     build.tools.compilefontconfig.CompileFontConfig
 
 TOOL_COMPILEPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
@@ -106,12 +111,18 @@
 TOOL_CLDRCONVERTER = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
     build.tools.cldrconverter.CLDRConverter
 
-TOOL_GENMODULESXML = $(JAVA_SMALL) -Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR) \
-    -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes $(JDK_OUTPUTDIR)) \
+TOOL_GENMODULESXML = $(JAVA_SMALL) $(INTERIM_LANGTOOLS_BOOTCLASSPATH) \
+    -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes) \
     build.tools.module.GenJdepsModulesXml
 
-TOOL_IMAGEBUILDER = $(JAVA_SMALL) -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
-    -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes $(JDK_OUTPUTDIR)) \
-    build.tools.module.ImageBuilder
+TOOL_GENMODULEINFOSOURCE = $(JAVA_SMALL) $(INTERIM_LANGTOOLS_BOOTCLASSPATH) \
+    -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes) \
+    build.tools.module.GenModuleInfoSource
+
+TOOL_GENCLASSLOADERMAP = $(JAVA_SMALL) $(INTERIM_LANGTOOLS_BOOTCLASSPATH) \
+    -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes) \
+    build.tools.module.GenModuleLoaderMap
+
+##########################################################################################
 
 endif # _TOOLS_GMK
--- a/make/copy/Copy-java.base.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/copy/Copy-java.base.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -172,6 +172,11 @@
   POLICY_SRC_LIST += $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf/security/java.policy
 endif
 
+# Allow imported modules to modify the java.policy
+ifneq ($(IMPORT_MODULES_CONF), )
+  POLICY_SRC_LIST += $(wildcard $(IMPORT_MODULES_CONF)/java.base/security/java.policy.extra)
+endif
+
 POLICY_SRC_LIST += $(POLICY_SRC)
 
 $(POLICY_DST): $(POLICY_SRC_LIST)
--- a/make/data/jdwp/jdwp.spec	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/data/jdwp/jdwp.spec	Thu Mar 24 16:21:19 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, 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
@@ -569,6 +569,21 @@
             (Error VM_DEAD)
         )
     )
+    (Command AllModules=22
+        "Returns all modules in the target VM."
+        "<p>Since JDWP version 9."
+        (Out
+        )
+        (Reply
+            (Repeat modules "The number of the modules that follow."
+                (moduleID module "One of the modules.")
+            )
+        )
+        (ErrorSet
+            (Error NOT_IMPLEMENTED)
+            (Error VM_DEAD)
+        )
+    )
 )
 
 (CommandSet ReferenceType=2
@@ -1029,6 +1044,22 @@
             (Error VM_DEAD)
         )
     )
+    (Command Module=19
+        "Returns the module that this reference type belongs to."
+        "<p>Since JDWP version 9."
+        (Out
+            (referenceType refType "The reference type.")
+        )
+        (Reply
+            (moduleID module "The module this reference type belongs to.")
+        )
+        (ErrorSet
+            (Error INVALID_CLASS   "refType is not the ID of a reference type.")
+            (Error INVALID_OBJECT  "refType is not a known ID.")
+            (Error NOT_IMPLEMENTED)
+            (Error VM_DEAD)
+        )
+    )
 )
 (CommandSet ClassType=3
     (Command Superclass=1
@@ -2647,6 +2678,54 @@
         )
     )
 )
+(CommandSet ModuleReference=18
+    (Command Name=1
+        "Returns the name of this module."
+        "<p>Since JDWP version 9."
+        (Out
+            (moduleID module "This module.")
+        )
+        (Reply
+            (string name  "The module's name.")
+        )
+        (ErrorSet
+            (Error INVALID_MODULE)
+            (Error NOT_IMPLEMENTED)
+            (Error VM_DEAD)
+        )
+    )
+    (Command ClassLoader=2
+        "Returns the class loader of this module."
+        "<p>Since JDWP version 9."
+        (Out
+            (moduleID module "This module.")
+        )
+        (Reply
+            (classLoaderObject classLoader  "The module's class loader.")
+        )
+        (ErrorSet
+            (Error INVALID_MODULE)
+            (Error NOT_IMPLEMENTED)
+            (Error VM_DEAD)
+        )
+    )
+    (Command CanRead=3
+        "Returns true if this module can read the source module; false otherwise."
+        "<p>Since JDWP version 9."
+        (Out
+            (moduleID module "This module.")
+            (moduleID sourceModule "The source module.")
+        )
+        (Reply
+            (boolean canRead  "true if this module can read the source module; false otherwise.")
+        )
+        (ErrorSet
+            (Error INVALID_MODULE  "This module or sourceModule is not the ID of a module.")
+            (Error NOT_IMPLEMENTED)
+            (Error VM_DEAD)
+        )
+    )
+)
 (CommandSet Event=64
     (Command Composite=100
         "Several events may occur at a given time in the target VM. "
@@ -3054,6 +3133,7 @@
     (Constant INVALID_SLOT           =35  "Invalid slot.")
     (Constant DUPLICATE              =40  "Item already set.")
     (Constant NOT_FOUND              =41  "Desired element not found.")
+    (Constant INVALID_MODULE         =42  "Invalid module.")
     (Constant INVALID_MONITOR        =50  "Invalid monitor.")
     (Constant NOT_MONITOR_OWNER      =51  "This thread doesn't own the monitor.")
     (Constant INTERRUPT              =52  "The call has been interrupted before completion.")
--- a/make/gendata/Gendata-jdk.jdeps.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#
-# Copyright (c) 2014, 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.
-#
-
-include GendataCommon.gmk
-
-$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.jdeps.gmk))
-
-JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.jdeps/com/sun/tools/jdeps/resources/jdeps-modules.xml
-MODULES_XML += $(TOPDIR)/modules.xml
-
-#
-# Generate modules.xml for jdeps to use
-# It augments $(TOPDIR)/modules.xml to include module membership
-#
-$(JDEPS_MODULES_XML): $(BUILD_TOOLS_JDK) $(MODULES_XML)
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(TOOL_GENMODULESXML) -o $@ -mp $(JDK_OUTPUTDIR)/modules $(MODULES_XML)
-
-TARGETS += $(JDEPS_MODULES_XML)
--- a/make/gendata/GendataBreakIterator.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/gendata/GendataBreakIterator.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -33,8 +33,6 @@
 # They are used at JDK build phase in order to create $(BIFILES) which
 # are used on runtime instead.
 #
-TEXT_SRCDIR := $(JDK_TOPDIR)/src/java.base/share/classes \
-    $(JDK_TOPDIR)/src/jdk.localedata/share/classes
 TEXT_PKG := sun/text/resources
 TEXT_PKG_LD := $(TEXT_PKG)/ext
 TEXT_SOURCES := $(TEXT_PKG)/BreakIteratorRules.java \
@@ -46,11 +44,35 @@
 BREAK_ITERATOR_CLASSES := $(BUILDTOOLS_OUTPUTDIR)/break_iterator_classes
 
 # These two files should be moved out to a build tool!
-$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR, \
+$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_BASE, \
     SETUP := GENERATE_OLDBYTECODE, \
-    SRC := $(TEXT_SRCDIR), \
-    INCLUDE_FILES := $(TEXT_SOURCES), \
-    BIN := $(BREAK_ITERATOR_CLASSES)))
+    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+    INCLUDE_FILES := \
+        $(TEXT_PKG)/BreakIteratorRules.java \
+        $(TEXT_PKG)/BreakIteratorInfo.java, \
+    BIN := $(BREAK_ITERATOR_CLASSES)/java.base))
+
+$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_LD, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(JDK_TOPDIR)/src/jdk.localedata/share/classes, \
+    INCLUDES := $(TEXT_PKG_LD), \
+    INCLUDE_FILES := \
+        $(TEXT_PKG_LD)/BreakIteratorRules_th.java \
+        $(TEXT_PKG_LD)/BreakIteratorInfo_th.java, \
+    BIN := $(BREAK_ITERATOR_CLASSES)/jdk.localedata))
+
+ifeq ($(BOOT_JDK_MODULAR), true)
+  BREAK_ITERATOR_BOOTCLASSPATH := -Xpatch:$(BREAK_ITERATOR_CLASSES) \
+      -XaddExports:$(subst $(SPACE),$(COMMA),$(strip \
+          java.base/sun.text=ALL-UNNAMED \
+          java.base/sun.text.resources=ALL-UNNAMED \
+          jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \
+      ))
+else
+  BREAK_ITERATOR_BOOTCLASSPATH := -Xbootclasspath/p:$(call PathList, \
+      $(BREAK_ITERATOR_CLASSES)/java.base \
+      $(BREAK_ITERATOR_CLASSES)/jdk.localedata)
+endif
 
 # Generate data resource files.
 # input
@@ -67,8 +89,9 @@
     $(LD_DATA_PKG_DIR)/LineBreakIteratorData_th
 
 $(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles
-$(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
-$(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
+$(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += $(BREAK_ITERATOR_BOOTCLASSPATH)
+$(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) \
+    $(BUILD_BREAKITERATOR_BASE) $(BUILD_BREAKITERATOR_LD)
 	$(call LogInfo, Generating BreakIteratorData)
 	$(call MakeDir, $(@D))
 	$(RM) $(BIFILES)
@@ -78,8 +101,9 @@
 	$(TOUCH) $@
 
 $(BIFILES_TH): $(LD_DATA_PKG_DIR)/_the.bifiles_th
-$(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
-$(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
+$(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += $(BREAK_ITERATOR_BOOTCLASSPATH)
+$(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) \
+    $(BUILD_BREAKITERATOR_BASE) $(BUILD_BREAKITERATOR_LD)
 	$(call LogInfo, Generating BreakIteratorData_th)
 	$(RM) $(BIFILES_TH)
 	$(TOOL_GENERATEBREAKITERATORDATA) \
--- a/make/gensrc/Gensrc-java.base.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/gensrc/Gensrc-java.base.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -34,6 +34,7 @@
 include GensrcBuffer.gmk
 include GensrcExceptions.gmk
 include GensrcVarHandles.gmk
+include GensrcModuleLoaderMap.gmk
 
 ################################################################################
 
--- a/make/gensrc/Gensrc-jdk.dev.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# 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
-# 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.
-#
-
-include GensrcCommon.gmk
-
-################################################################################
-
-include GensrcProperties.gmk
-
-$(eval $(call SetupCompileProperties, COMPILE_PROPERTIES, \
-    SRC_DIRS := $(JDK_TOPDIR)/src/jdk.dev/share/classes/jdk/tools/jimage/resources, \
-    CLASS := ListResourceBundle, \
-))
-
-TARGETS += $(COMPILE_PROPERTIES)
-
-################################################################################
-
-all: $(TARGETS)
-
-.PHONY: all
--- a/make/gensrc/Gensrc-jdk.jdi.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/gensrc/Gensrc-jdk.jdi.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -61,30 +61,6 @@
 
 ################################################################################
 
-define process-provider
-	$(call MakeDir, $(@D))
-	$(CAT) $^ | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $@
-endef
-
-# Filter com.sun.jdi.connect.Connector
-$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \
-    $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector \
-    $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector
-	$(process-provider)
-
-# Copy the same service file into jdk.hotspot.agent so that they are kept the same.
-$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector: \
-    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector
-	$(install-file)
-
-# Some platforms don't have the serviceability agent
-ifeq ($(INCLUDE_SA), true)
-  GENSRC_JDK_JDI += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector \
-      $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector
-endif
-
-################################################################################
-
 include GensrcProperties.gmk
 
 $(eval $(call SetupCompileProperties, COMPILE_PROPERTIES, \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/Gensrc-jdk.jlink.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,54 @@
+#
+# 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
+# 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.
+#
+
+include GensrcCommon.gmk
+
+################################################################################
+
+include GensrcProperties.gmk
+
+$(eval $(call SetupCompileProperties, JLINK_PROPERTIES, \
+    SRC_DIRS := $(JDK_TOPDIR)/src/jdk.jlink/share/classes/jdk/tools/jlink/resources, \
+    CLASS := ListResourceBundle, \
+))
+
+$(eval $(call SetupCompileProperties, JMOD_PROPERTIES, \
+    SRC_DIRS := $(JDK_TOPDIR)/src/jdk.jlink/share/classes/jdk/tools/jmod/resources, \
+    CLASS := ListResourceBundle, \
+))
+
+$(eval $(call SetupCompileProperties, JIMAGE_PROPERTIES, \
+    SRC_DIRS := $(JDK_TOPDIR)/src/jdk.jlink/share/classes/jdk/tools/jimage/resources, \
+    CLASS := ListResourceBundle, \
+))
+
+
+TARGETS += $(JLINK_PROPERTIES) $(JMOD_PROPERTIES) $(JIMAGE_PROPERTIES)
+
+################################################################################
+
+all: $(TARGETS)
+
+.PHONY: all
--- a/make/gensrc/Gensrc-jdk.jvmstat.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# 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.
-#
-
-include GensrcCommon.gmk
-
-################################################################################
-
-define merge-providers
-	$(MKDIR) -p $(@D)
-	$(CAT) $^ > $@
-endef
-
-PROVIDER_FILE := META-INF/services/sun.jvmstat.monitor.MonitoredHostService
-
-# Merge the local and remote sevice providers into jdk.jvmstat/META-INF/services
-$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE): \
-    $(JDK_TOPDIR)/src/jdk.jvmstat/share/classes/$(PROVIDER_FILE) \
-    $(JDK_TOPDIR)/src/jdk.jvmstat.rmi/share/classes/$(PROVIDER_FILE)
-	$(merge-providers)
-
-# Copy the same service file into jdk.jvmstat.rmi so that they are kept the same.
-$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat.rmi/$(PROVIDER_FILE): \
-    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE)
-	$(install-file)
-
-################################################################################
-
-jdk.jvmstat: $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE) \
-    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat.rmi/$(PROVIDER_FILE)
-
-all: jdk.jvmstat
-
-.PHONY: all
\ No newline at end of file
--- a/make/gensrc/GensrcLocaleData.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/gensrc/GensrcLocaleData.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -143,19 +143,6 @@
 GENSRC_BASELOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java
 GENSRC_LOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java
 
-################################################################################
-
-GENSRC_CRBC_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/CoreResourceBundleControl.java
-GENSRC_CRBC_CMD := $(JDK_TOPDIR)/make/scripts/localelist.sh
-
-JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
-
-$(GENSRC_CRBC_DST): $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \
-    $(GENSRC_CRBC_CMD)
-	$(MKDIR) -p $(@D)
-	NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@
-
-GENSRC_BASELOCALEDATA += $(GENSRC_CRBC_DST)
 GENSRC_JAVA_BASE += $(GENSRC_BASELOCALEDATA)
 GENSRC_JDK_LOCALEDATA += $(GENSRC_LOCALEDATA)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/GensrcModuleLoaderMap.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,164 @@
+#
+# 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.
+#
+
+include Modules.gmk
+
+BOOT_MODULES :=
+UPGRADEABLE_MDOULES :=
+AGGREGATOR_MDOULES :=
+OTHER_PLATFORM_MODULES :=
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, gensrc/GensrcModuleLoaderMap.gmk))
+
+BOOT_MODULES += \
+    java.base \
+    java.datatransfer \
+    java.desktop \
+    java.httpclient \
+    java.instrument \
+    java.logging \
+    java.management \
+    java.naming \
+    java.prefs \
+    java.rmi \
+    java.security.jgss \
+    java.security.sasl \
+    java.sql \
+    java.xml \
+    java.xml.crypto \
+    jdk.httpserver \
+    jdk.management \
+    jdk.sctp \
+    jdk.security.auth \
+    jdk.security.jgss \
+    #
+
+# to be deprivileged
+BOOT_MODULES += \
+    java.compiler \
+    java.scripting \
+    java.sql.rowset \
+    java.smartcardio \
+    jdk.charsets \
+    jdk.naming.rmi \
+    #
+
+UPGRADEABLE_MODULES += \
+    java.activation \
+    java.annotations.common \
+    java.corba \
+    java.transaction \
+    java.xml.bind \
+    java.xml.ws \
+    #
+
+AGGREGATOR_MODULES += \
+    java.compact1 \
+    java.compact2 \
+    java.compact3 \
+    java.se \
+    java.se.ee \
+    #
+
+OTHER_PLATFORM_MODULES += \
+    jdk.accessibility \
+    jdk.crypto.ec \
+    jdk.crypto.pkcs11 \
+    jdk.dynalink \
+    jdk.jsobject \
+    jdk.xml.dom \
+    jdk.localedata \
+    jdk.naming.dns \
+    jdk.scripting.nashorn \
+    jdk.zipfs \
+    #
+
+ifeq ($(OPENJDK_TARGET_OS), macsox)
+  BOOT_MODULES += jdk.deploy.osx
+endif
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  OTHER_PLATFORM_MODULES += jdk.crypto.mscapi
+endif
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+  OTHER_PLATFORM_MODULES += jdk.crypto.ucrypto
+endif
+
+# Param 1 - Name of module
+define ReadImportMetaData
+  ifneq ($$(wildcard $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties), )
+    classloader :=
+    include $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties
+    ifeq ($$(classloader), boot)
+      BOOT_MODULES += $1
+    else ifeq ($$(classloader), ext)
+      OTHER_PLATFORM_MODULES += $1
+    endif
+  endif
+endef
+
+IMPORTED_MODULES := $(call FindImportedModules)
+$(foreach m, $(IMPORTED_MODULES), $(eval $(call ReadImportMetaData, $m)))
+
+
+# Replacing double-comma with a single comma is to workaround the issue
+# with some version of make on windows that doesn't substitute spaces
+# with one comma properly as with make 4.0
+define SubstComma
+$(strip \
+  $(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \
+)
+endef
+BOOT_MODULES_LIST := $(call SubstComma, $(BOOT_MODULES))
+PLATFORM_MODULES_LIST := $(call SubstComma, $(UPGRADEABLE_MODULES) $(AGGREGATOR_MODULES) $(OTHER_PLATFORM_MODULES))
+
+VARDEPS_VALUE := $(BOOT_MODULES_LIST) $(PLATFORM_MODULES_LIST)
+VARDEPS_FILE := $(call DependOnVariable, VARDEPS_VALUE)
+
+############################################################################
+
+$(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/module/ModuleLoaderMap.java: \
+    $(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java \
+    $(VARDEPS_FILE) $(BUILD_TOOLS_JDK)
+	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
+	$(TOOL_GENCLASSLOADERMAP) -boot $(BOOT_MODULES_LIST) \
+	     -platform $(PLATFORM_MODULES_LIST) -o $@.tmp $<
+	$(MV) $@.tmp $@
+
+GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/module/ModuleLoaderMap.java
+
+$(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/vm/cds/resources/ModuleLoaderMap.dat: \
+    $(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/vm/cds/resources/ModuleLoaderMap.dat \
+    $(VARDEPS_FILE) $(BUILD_TOOLS_JDK)
+	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
+	$(TOOL_GENCLASSLOADERMAP) -boot $(BOOT_MODULES_LIST) \
+	    -platform $(PLATFORM_MODULES_LIST) -o $@.tmp $<
+	$(MV) $@.tmp $@
+
+GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/vm/cds/resources/ModuleLoaderMap.dat
+
+################################################################################
--- a/make/launcher/Launcher-java.desktop.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/launcher/Launcher-java.desktop.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -31,6 +31,7 @@
 ifndef BUILD_HEADLESS_ONLY
   $(eval $(call SetupBuildLauncher, appletviewer, \
       MAIN_CLASS := sun.applet.Main, \
+      JAVA_ARGS := -addmods ALL-SYSTEM, \
       LIBS_unix := $(X_LIBS), \
   ))
 endif
--- a/make/launcher/Launcher-jdk.dev.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#
-# 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
-# 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.
-#
-
-include LauncherCommon.gmk
-
-$(eval $(call SetupBuildLauncher, jimage,\
-    MAIN_CLASS := jdk.tools.jimage.Main, \
-))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/launcher/Launcher-jdk.jlink.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,45 @@
+#
+# 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.
+#
+
+include LauncherCommon.gmk
+
+$(eval $(call SetupBuildLauncher, jimage,\
+    MAIN_CLASS := jdk.tools.jimage.Main, \
+    CFLAGS := -DENABLE_ARG_FILES, \
+))
+
+$(eval $(call SetupBuildLauncher, jlink,\
+    MAIN_CLASS := jdk.tools.jlink.internal.Main, \
+    CFLAGS := -DENABLE_ARG_FILES \
+        -DEXPAND_CLASSPATH_WILDCARDS \
+        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+))
+
+$(eval $(call SetupBuildLauncher, jmod,\
+    MAIN_CLASS := jdk.tools.jmod.Main, \
+    CFLAGS := -DENABLE_ARG_FILES \
+        -DEXPAND_CLASSPATH_WILDCARDS \
+        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+))
--- a/make/launcher/Launcher-jdk.pack200.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/launcher/Launcher-jdk.pack200.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -26,6 +26,7 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, pack200, \
+    MAIN_MODULE := java.base, \
     MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \
 ))
 
--- a/make/launcher/Launcher-jdk.rmic.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/launcher/Launcher-jdk.rmic.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -26,6 +26,6 @@
 include LauncherCommon.gmk
 
 $(eval $(call SetupBuildLauncher, rmic, \
-    MAIN_CLASS := sun.rmi.rmic.Main, \
+    MAIN_CLASS := jdk.rmi.rmic.Main, \
     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
--- a/make/launcher/LauncherCommon.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/launcher/LauncherCommon.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -63,6 +63,8 @@
 # used as the name of the executable.
 #
 # Remaining parameters are named arguments. These include:
+# MAIN_MODULE  The module of the main class to launch if different from the
+#     current module
 # MAIN_CLASS   The Java main class to launch
 # JAVA_ARGS   Processed into a -DJAVA_ARGS C flag
 # CFLAGS   Additional CFLAGS
@@ -97,9 +99,13 @@
     $1_JAVA_ARGS += -ms8m
   endif
 
+  ifeq ($$($1_MAIN_MODULE), )
+    $1_MAIN_MODULE := $(MODULE)
+  endif
+
   ifneq ($$($1_JAVA_ARGS), )
     $1_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \
-        $$(addprefix -J, $$($1_JAVA_ARGS)) $$($1_MAIN_CLASS), "$$a"$(COMMA) )) }'
+        $$(addprefix -J, $$($1_JAVA_ARGS)) -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS), "$$a"$(COMMA) )) }'
     $1_CFLAGS += -DJAVA_ARGS=$$($1_JAVA_ARGS_STR)
   endif
 
--- a/make/lib/CoreLibraries.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/lib/CoreLibraries.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -146,6 +146,7 @@
         $(LIBJAVA_CFLAGS), \
     System.c_CFLAGS := $(VERSION_CFLAGS), \
     jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
+    DISABLED_WARNINGS_gcc := unused-result, \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
     MAPFILE := $(LIBJAVA_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/make/lib/Lib-java.instrument.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/lib/Lib-java.instrument.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -68,14 +68,14 @@
     LDFLAGS_macosx := -Wl$(COMMA)-all_load, \
     LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
     LIBS := $(JDKLIB_LIBS), \
-    LIBS_unix := -ljava $(LIBZ), \
+    LIBS_unix := -ljava -ljvm $(LIBZ), \
     LIBS_linux := -ljli $(LIBDL), \
     LIBS_solaris := -ljli $(LIBDL), \
     LIBS_aix := -liconv -ljli_static $(LIBDL), \
     LIBS_macosx := -liconv -framework Cocoa -framework Security \
         -framework ApplicationServices \
         $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \
-    LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \
+    LIBS_windows := jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
         $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib, \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
     RC_FLAGS := $(RC_FLAGS) \
--- a/make/mapfiles/libjava/mapfile-vers	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/mapfiles/libjava/mapfile-vers	Thu Mar 24 16:21:19 2016 +0100
@@ -137,7 +137,6 @@
 		Java_java_lang_ClassLoader_registerNatives;
 		Java_java_lang_Double_longBitsToDouble;
 		Java_java_lang_Double_doubleToRawLongBits;
-		Java_java_lang_reflect_Proxy_defineClass0;
 		Java_java_lang_Float_intBitsToFloat;
 		Java_java_lang_Float_floatToRawIntBits;
                 Java_java_lang_StackFrameInfo_fillInStackFrames;
@@ -165,8 +164,6 @@
 		Java_java_lang_StrictMath_expm1;
 		Java_java_lang_Object_getClass;
 		Java_java_lang_Object_registerNatives;
-		Java_java_lang_Package_getSystemPackage0;
-		Java_java_lang_Package_getSystemPackages0;
 		Java_java_lang_ProcessEnvironment_environ;
 		Java_java_lang_ProcessHandleImpl_destroy0;
 		Java_java_lang_ProcessHandleImpl_getCurrentPid0;
@@ -204,11 +201,11 @@
 		Java_java_lang_reflect_Executable_getTypeAnnotationBytes0;
 		Java_java_lang_reflect_Field_getTypeAnnotationBytes0;
 		Java_java_lang_Runtime_freeMemory;
-                Java_java_lang_Runtime_maxMemory;
+		Java_java_lang_Runtime_maxMemory;
 		Java_java_lang_Runtime_gc;
 		Java_java_lang_Runtime_runFinalization0;
 		Java_java_lang_Runtime_totalMemory;
-                Java_java_lang_Runtime_availableProcessors;
+		Java_java_lang_Runtime_availableProcessors;
 		Java_java_lang_SecurityManager_classDepth;
 		Java_java_lang_SecurityManager_classLoaderDepth0;
 		Java_java_lang_SecurityManager_currentClassLoader0;
@@ -274,6 +271,18 @@
                 Java_jdk_internal_misc_VM_getgid;
                 Java_jdk_internal_misc_VM_getegid;
                 Java_jdk_internal_misc_VM_initialize;
+
+                Java_java_lang_reflect_Module_defineModule0;
+                Java_java_lang_reflect_Module_addReads0;
+                Java_java_lang_reflect_Module_addExports0;
+                Java_java_lang_reflect_Module_addExportsToAll0;
+                Java_java_lang_reflect_Module_addExportsToAllUnnamed0;
+                Java_java_lang_reflect_Module_addPackage0;
+
+		Java_jdk_internal_loader_BootLoader_getSystemPackageLocation;
+		Java_jdk_internal_loader_BootLoader_getSystemPackageNames;
+                Java_jdk_internal_loader_BootLoader_setBootLoaderUnnamedModule0;
+
 		Java_sun_misc_VMSupport_initAgentProperties;
 		Java_sun_misc_VMSupport_getVMTemporaryDirectory;
 
--- a/make/mapfiles/libjimage/mapfile-vers	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/mapfiles/libjimage/mapfile-vers	Thu Mar 24 16:21:19 2016 +0100
@@ -27,23 +27,7 @@
 
 SUNWprivate_1.1 {
     global:
-        JNI_OnLoad;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_openImage;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_closeImage;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_getIndexAddress;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_getDataAddress;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_read;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_readCompressed;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_getStringBytes;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_getAttributes;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_findAttributes;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_attributeOffsets;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Open;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Close;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1FindResource;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1GetResource;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1PackageToModule;
-        Java_jdk_internal_jimage_ImageNativeSubstrate_JIMAGE_1Resources;
+        Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap;
         JIMAGE_Open;
         JIMAGE_Close;
         JIMAGE_PackageToModule;
--- a/make/rmic/Rmic-java.management.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/rmic/Rmic-java.management.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -40,7 +40,7 @@
 $(eval $(call SetupRMICompilation,RMI_GEN, \
     CLASSES := $(JMX_RMI_CLASSES), \
     CLASSES_DIR := $(CLASSES_DIR)/java.management, \
-    STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR), \
+    STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR)/java.management, \
     RUN_V12 := true, \
     KEEP_GENERATED := true, \
 ))
@@ -50,7 +50,7 @@
 	$(eval classfiles := $(shell $(FIND) $(RMIC_GENSRC_DIR) -name "*.class"))
 	$(foreach src, $(classfiles), \
 	    $(eval target := $(patsubst $(RMIC_GENSRC_DIR)/%, \
-	        $(STUB_CLASSES_DIR)/java.management/%, $(src))) \
+	        $(STUB_CLASSES_DIR)/%, $(src))) \
 	    $(MKDIR) -p $(dir $(target)) ; \
 	    $(MV) $(src) $(target) $(NEWLINE))
 	$(TOUCH) $@
--- a/make/rmic/RmicCommon.gmk	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/rmic/RmicCommon.gmk	Thu Mar 24 16:21:19 2016 +0100
@@ -31,10 +31,7 @@
 
 ##########################################################################################
 
-BTRMIC_CP := $(call PathList, \
-    $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_classes $(INTERIM_LANGTOOLS_JAR))
-BTRMIC_ARGS := -cp $(BTRMIC_CP)
-RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main
+RMIC := $(JAVA) $(INTERIM_OVERRIDE_MODULES_ARGS) sun.rmi.rmic.Main
 
 CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
 # NOTE: If the smart javac dependency management is reintroduced, these classes risk
--- a/make/scripts/localelist.sh	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2005, 2012, 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.
-#
-
-#
-# This script is to generate the supported locale list string and replace the
-# #LOCALE_LIST# in <ws>/src/share/classes/sun/util/CoreResourceBundleControl.java.
-#
-# NAWK & SED is passed in as environment variables.
-#
-LOCALE_LIST=$1
-INUT_FILE=$2
-OUTPUT_FILE=$3
-
-LOCALES=`(for I in $LOCALE_LIST; do echo $I;done) | sort | uniq`
-JAVA_LOCALES=
-
-toJavaLocale()
-{
-  NewLocale=`echo $1 | $NAWK '
-      BEGIN {
-        # The following values have to be consistent with java.util.Locale.
-        javalocales["en"] = "ENGLISH";
-        javalocales["fr"] = "FRENCH";
-        javalocales["de"] = "GERMAN";
-        javalocales["it"] = "ITALIAN";
-        javalocales["ja"] = "JAPANESE";
-        javalocales["ko"] = "KOREAN";
-        javalocales["zh"] = "CHINESE";
-        javalocales["zh_CN"] = "SIMPLIFIED_CHINESE";
-        javalocales["zh_TW"] = "TRADITIONAL_CHINESE";
-        javalocales["fr_FR"] = "FRANCE";
-        javalocales["de_DE"] = "GERMANY";
-        javalocales["it_IT"] = "ITALY";
-        javalocales["ja_JP"] = "JAPAN";
-        javalocales["ko_KR"] = "KOREA";
-        javalocales["en_GB"] = "UK";
-        javalocales["en_US"] = "US";
-        javalocales["en_CA"] = "CANADA";
-        javalocales["fr_CA"] = "CANADA_FRENCH";
-      }
-      {
-        if ($0 in javalocales) {
-          print "        Locale." javalocales[$0];
-        } else {
-          split($0, a, "_");
-          if (a[3] != "") {
-            print " new Locale(\"" a[1] "\", \"" a[2] "\", \"" a[3] "\")";
-          } else if (a[2] != "") {
-            print " new Locale(\"" a[1] "\", \"" a[2] "\")";
-          } else {
-            print " new Locale(\"" a[1] "\")";
-          }
-        }
-      }'`
-
-  JAVA_LOCALES=$JAVA_LOCALES$NewLocale
-}
-
-# count the number of locales
-counter=0
-for i in $LOCALES
-do
-  counter=`expr $counter + 1`
-done
-
-index=0
-for locale in $LOCALES
-do
-  index=`expr $index + 1`;
-  if [ $index != $counter ]
-  then
-    toJavaLocale $locale
-    JAVA_LOCALES=$JAVA_LOCALES","
-  else
-    toJavaLocale $locale
-  fi
-done
-
-# replace the #LOCALE_LIST# in the precompiled CoreResourceBundleControl.java file.
-
-$SED -e "s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@" \
-    -e "s/#LOCALE_LIST#/$JAVA_LOCALES/g" $2 > $3
--- a/make/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java	Thu Mar 24 16:21:19 2016 +0100
@@ -343,9 +343,7 @@
                 if (!all && CLDRConverter.isBaseModule ^ isBaseLocale(id)) {
                     continue;
                 }
-                if (sb.length() > 0) {
-                    sb.append(' ');
-                }
+                sb.append(' ');
                 sb.append(id);
             }
         }
--- a/make/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java	Thu Mar 24 16:21:19 2016 +0100
@@ -62,25 +62,37 @@
         CharacterCategory.makeCategoryMap(unicodeData);
 
         /* Generate files */
-        generateFiles();
+        try {
+            generateFiles();
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static String localizedBundleName(String pkg, String clazz) {
+        if (language.length() > 0) {
+            return pkg + ".ext." + clazz + '_' + language;
+        } else {
+            return pkg + '.' + clazz;
+        }
     }
 
     /**
      * Generate data files whose names are included in
      * sun.text.resources.BreakIteratorInfo+<localeName>
      */
-    private static void generateFiles() {
+    private static void generateFiles() throws Exception {
         String[] classNames;
         ResourceBundle rules, info;
 
-        String pkgName = "sun.text.resources" + (language.length() > 0 ? ".ext" : "");
+        info = (ResourceBundle) Class.forName(
+            localizedBundleName("sun.text.resources", "BreakIteratorInfo")).newInstance();
 
-        info =  ResourceBundle.getBundle(pkgName + ".BreakIteratorInfo",
-                                         new Locale(language, country, valiant));
         classNames = info.getStringArray("BreakIteratorClasses");
 
-        rules = ResourceBundle.getBundle(pkgName + ".BreakIteratorRules",
-                                         new Locale(language, country, valiant));
+        rules = (ResourceBundle) Class.forName(
+            localizedBundleName("sun.text.resources", "BreakIteratorRules")).newInstance();
 
         if (info.containsKey("CharacterData")) {
             generateDataFile(info.getString("CharacterData"),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/jdwpgen/ModuleTypeNode.java	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016, 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.
+ */
+
+package build.tools.jdwpgen;
+
+import java.util.*;
+import java.io.*;
+
+class ModuleTypeNode extends AbstractSimpleTypeNode {
+
+    String docType() {
+        return "moduleID";
+    }
+
+    String javaType() {
+        return "ModuleReferenceImpl";
+    }
+
+    String debugValue(String label) {
+        return "(" + label + "==null?\"NULL\":\"ref=\"+" + label + ".ref())";
+    }
+
+    public void genJavaWrite(PrintWriter writer, int depth,
+                             String writeLabel) {
+        genJavaDebugWrite(writer, depth, writeLabel,
+                          debugValue(writeLabel));
+        indent(writer, depth);
+        writer.println("ps.writeModuleRef(" + writeLabel + ".ref());");
+    }
+
+    String javaRead() {
+        return "ps.readModule()";
+    }
+}
--- a/make/src/classes/build/tools/jdwpgen/Parse.java	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/src/classes/build/tools/jdwpgen/Parse.java	Thu Mar 24 16:21:19 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, 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
@@ -80,6 +80,7 @@
         kindMap.put("field", new FieldTypeNode());
         kindMap.put("frame", new FrameTypeNode());
         kindMap.put("string", new StringTypeNode());
+        kindMap.put("moduleID", new ModuleTypeNode());
         kindMap.put("value", new ValueTypeNode());
         kindMap.put("byte", new ByteTypeNode());
         kindMap.put("location", new LocationTypeNode());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/jigsaw/GenGraphs.java	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,231 @@
+/*
+ * Copyright (c) 2014, 2016, 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.
+ */
+
+package build.tools.jigsaw;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.lang.module.ResolvedModule;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import static java.lang.module.ModuleDescriptor.Requires.Modifier.PUBLIC;
+
+/**
+ * Generate the DOT file for a module graph for each module in the JDK
+ * after transitive reduction.
+ */
+public class GenGraphs {
+
+    public static void main(String[] args) throws Exception {
+
+        if (args.length != 1) {
+            System.err.println("ERROR: specify the output directory");
+            System.exit(1);
+        }
+        Path dir = Paths.get(args[0]);
+        Files.createDirectories(dir);
+
+        ModuleFinder finder = ModuleFinder.ofSystem();
+
+        Set<ModuleDescriptor> javaSEModules
+            = new TreeSet<>(finder.findAll().stream()
+                                  .map(ModuleReference::descriptor)
+                                  .filter(m -> (m.name().startsWith("java.") &&
+                                               !m.name().equals("java.smartcardio")))
+                                  .collect(Collectors.toSet()));
+        Set<ModuleDescriptor> jdkModules
+            = new TreeSet<>(finder.findAll().stream()
+                                  .map(ModuleReference::descriptor)
+                                  .filter(m -> !javaSEModules.contains(m))
+                                  .collect(Collectors.toSet()));
+
+        GenGraphs genGraphs = new GenGraphs(javaSEModules, jdkModules);
+        Set<String> mods = new HashSet<>();
+        for (ModuleReference mref: finder.findAll()) {
+            ModuleDescriptor descriptor = mref.descriptor();
+            String name = descriptor.name();
+            mods.add(name);
+            Configuration cf = Configuration.empty()
+                    .resolveRequires(finder,
+                                     ModuleFinder.empty(),
+                                     Set.of(name));
+            genGraphs.genDotFile(dir, name, cf);
+        }
+
+        Configuration cf = Configuration.empty()
+                .resolveRequires(finder,
+                                 ModuleFinder.empty(),
+                                 mods);
+        genGraphs.genDotFile(dir, "jdk", cf);
+
+    }
+
+    private final Set<ModuleDescriptor> javaGroup;
+    private final Set<ModuleDescriptor> jdkGroup;
+
+    GenGraphs(Set<ModuleDescriptor> javaGroup, Set<ModuleDescriptor> jdkGroup) {
+        this.javaGroup = Collections.unmodifiableSet(javaGroup);
+        this.jdkGroup = Collections.unmodifiableSet(jdkGroup);
+    }
+
+    private static final String ORANGE = "#e76f00";
+    private static final String BLUE = "#437291";
+    private static final String GRAY = "#dddddd";
+
+    private static final String REEXPORTS = "";
+    private static final String REQUIRES = "style=\"dashed\"";
+    private static final String REQUIRES_BASE = "color=\"" + GRAY + "\"";
+
+    private static final Map<String,Integer> weights = new HashMap<>();
+
+    private static void weight(String s, String t, int w) {
+        weights.put(s + ":" + t, w);
+    }
+
+    private static int weightOf(String s, String t) {
+        int w = weights.getOrDefault(s + ":" + t, 1);
+        if (w != 1)
+            return w;
+        if (s.startsWith("java.") && t.startsWith("java."))
+            return 10;
+        return 1;
+    }
+
+    static {
+        int h = 1000;
+        weight("java.se", "java.compact3", h * 10);
+        weight("jdk.compact3", "java.compact3", h * 10);
+        weight("java.compact3", "java.compact2", h * 10);
+        weight("java.compact2", "java.compact1", h * 10);
+        weight("java.compact1", "java.logging", h * 10);
+        weight("java.logging", "java.base", h * 10);
+    }
+
+    private void genDotFile(Path dir, String name, Configuration cf) throws IOException {
+        try (PrintStream out
+                 = new PrintStream(Files.newOutputStream(dir.resolve(name + ".dot")))) {
+
+            Map<String, ModuleDescriptor> nameToModule = cf.modules().stream()
+                    .map(ResolvedModule::reference)
+                    .map(ModuleReference::descriptor)
+                    .collect(Collectors.toMap(ModuleDescriptor::name, Function.identity()));
+
+            Set<ModuleDescriptor> descriptors = new TreeSet<>(nameToModule.values());
+
+            out.format("digraph \"%s\" {%n", name);
+            out.format("size=\"25,25\";");
+            out.format("nodesep=.5;%n");
+            out.format("ranksep=1.5;%n");
+            out.format("pencolor=transparent;%n");
+            out.format("node [shape=plaintext, fontname=\"DejaVuSans\", fontsize=36, margin=\".2,.2\"];%n");
+            out.format("edge [penwidth=4, color=\"#999999\", arrowhead=open, arrowsize=2];%n");
+
+            out.format("subgraph %sse {%n", name.equals("jdk") ? "cluster_" : "");
+            descriptors.stream()
+                .filter(javaGroup::contains)
+                .map(ModuleDescriptor::name)
+                .forEach(mn -> out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
+                                          mn, ORANGE, "java"));
+            out.format("}%n");
+            descriptors.stream()
+                .filter(jdkGroup::contains)
+                .map(ModuleDescriptor::name)
+                .forEach(mn -> out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
+                                          mn, BLUE, "jdk"));
+
+            // transitive reduction
+            Graph<String> graph = gengraph(cf);
+            descriptors.forEach(md -> {
+                String mn = md.name();
+                Set<String> requiresPublic = md.requires().stream()
+                        .filter(d -> d.modifiers().contains(PUBLIC))
+                        .map(d -> d.name())
+                        .collect(Collectors.toSet());
+
+                graph.adjacentNodes(mn).forEach(dn -> {
+                    String attr = dn.equals("java.base") ? REQUIRES_BASE
+                            : (requiresPublic.contains(dn) ? REEXPORTS : REQUIRES);
+                    int w = weightOf(mn, dn);
+                    if (w > 1)
+                        attr += "weight=" + w;
+                    out.format("  \"%s\" -> \"%s\" [%s];%n", mn, dn, attr);
+                });
+            });
+
+            out.println("}");
+        }
+    }
+
+    /**
+     * Returns a Graph of the given Configuration after transitive reduction.
+     *
+     * Transitive reduction of requires public edge and requires edge have
+     * to be applied separately to prevent the requires public edges
+     * (e.g. U -> V) from being reduced by a path (U -> X -> Y -> V)
+     * in which  V would not be re-exported from U.
+     */
+    private Graph<String> gengraph(Configuration cf) {
+        Graph.Builder<String> builder = new Graph.Builder<>();
+        for (ResolvedModule resolvedModule : cf.modules()) {
+            String mn = resolvedModule.reference().descriptor().name();
+            builder.addNode(mn);
+            resolvedModule.reads().stream()
+                    .map(ResolvedModule::name)
+                    .forEach(target -> builder.addEdge(mn, target));
+        }
+        Graph<String> rpg = requiresPublicGraph(cf);
+        return builder.build().reduce(rpg);
+    }
+
+    /**
+     * Returns a Graph containing only requires public edges
+     * with transitive reduction.
+     */
+    private Graph<String> requiresPublicGraph(Configuration cf) {
+        Graph.Builder<String> builder = new Graph.Builder<>();
+        for (ResolvedModule resolvedModule : cf.modules()) {
+            ModuleDescriptor descriptor = resolvedModule.reference().descriptor();
+            String mn = descriptor.name();
+            descriptor.requires().stream()
+                    .filter(d -> d.modifiers().contains(PUBLIC))
+                    .map(d -> d.name())
+                    .forEach(d -> builder.addEdge(mn, d));
+        }
+        return builder.build().reduce();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/jigsaw/Graph.java	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+package build.tools.jigsaw;
+
+import java.io.PrintStream;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+
+public class Graph<T> {
+    private static boolean traceOn = Boolean.getBoolean("build.tools.module.trace");
+    private final Set<T> nodes;
+    private final Map<T, Set<T>> edges;
+    private Graph(Set<T> nodes, Map<T, Set<T>> edges) {
+        this.nodes = nodes;
+        this.edges = edges;
+    }
+
+    public Set<T> nodes() {
+        return nodes;
+    }
+
+    public Map<T, Set<T>> edges() {
+        return edges;
+    }
+
+    public Set<T> adjacentNodes(T u) {
+        return edges.get(u);
+    }
+
+    /**
+     * Returns a new Graph after transitive reduction
+     */
+    public Graph<T> reduce() {
+        Graph.Builder<T> builder = new Builder<>();
+        nodes.stream()
+             .forEach(u -> {
+                 builder.addNode(u);
+                 edges.get(u).stream()
+                         .filter(v -> !pathExists(u, v, false))
+                         .forEach(v -> builder.addEdge(u, v));
+             });
+        return builder.build();
+    }
+
+    /**
+     * Returns a new Graph after transitive reduction.  All edges in
+     * the given g takes precedence over this graph.
+     *
+     * @throw IllegalArgumentException g must be a subgraph this graph
+     */
+    public Graph<T> reduce(Graph<T> g) {
+        boolean subgraph = nodes.containsAll(g.nodes) && g.edges.keySet().stream()
+               .allMatch(u -> adjacentNodes(u).containsAll(g.adjacentNodes(u)));
+        if (!subgraph) {
+            throw new IllegalArgumentException("the given argument is not a subgraph of this graph");
+        }
+
+        Graph.Builder<T> builder = new Builder<>();
+        nodes.stream()
+             .forEach(u -> {
+                 builder.addNode(u);
+                 // filter the edge if there exists a path from u to v in the given g
+                 // or there exists another path from u to v in this graph
+                 edges.get(u).stream()
+                      .filter(v -> !g.pathExists(u, v) && !pathExists(u, v, false))
+                      .forEach(v -> builder.addEdge(u, v));
+             });
+
+        // add the overlapped edges from this graph and the given g
+        g.edges().keySet().stream()
+                 .forEach(u -> g.adjacentNodes(u).stream()
+                         .filter(v -> isAdjacent(u, v))
+                         .forEach(v -> builder.addEdge(u, v)));
+        return builder.build();
+    }
+
+    private boolean isAdjacent(T u, T v) {
+        return edges.containsKey(u) && edges.get(u).contains(v);
+    }
+
+    private boolean pathExists(T u, T v) {
+        return pathExists(u, v, true);
+    }
+
+    /**
+     * Returns true if there exists a path from u to v in this graph.
+     * If includeAdjacent is false, it returns true if there exists
+     * another path from u to v of distance > 1
+     */
+    private boolean pathExists(T u, T v, boolean includeAdjacent) {
+        if (!nodes.contains(u) || !nodes.contains(v)) {
+            return false;
+        }
+        if (includeAdjacent && isAdjacent(u, v)) {
+            return true;
+        }
+        Deque<T> stack = new LinkedList<>();
+        Set<T> visited = new HashSet<>();
+        stack.push(u);
+        while (!stack.isEmpty()) {
+            T node = stack.pop();
+            if (node.equals(v)) {
+                if (traceOn) {
+                    System.out.format("Edge %s -> %s removed%n", u, v);
+                }
+                return true;
+            }
+            if (!visited.contains(node)) {
+                visited.add(node);
+                edges.get(node).stream()
+                     .filter(e -> includeAdjacent || !node.equals(u) || !e.equals(v))
+                     .forEach(e -> stack.push(e));
+            }
+        }
+        assert !visited.contains(v);
+        return false;
+    }
+
+    void printGraph(PrintStream out) {
+        nodes.stream()
+             .forEach(u -> adjacentNodes(u).stream()
+                     .forEach(v -> out.format("%s -> %s%n", u, v)));
+    }
+
+    public static class Builder<T> {
+        final Set<T> nodes = new HashSet<>();
+        final Map<T, Set<T>> edges = new HashMap<>();
+        public void addNode(T node) {
+            if (nodes.contains(node)) {
+                return;
+            }
+            nodes.add(node);
+            edges.computeIfAbsent(node, _e -> new HashSet<>());
+        }
+        public void addEdge(T u, T v) {
+            addNode(u);
+            addNode(v);
+            edges.get(u).add(v);
+        }
+        public Graph<T> build() {
+            return new Graph<>(nodes, edges);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/jigsaw/ModuleSummary.java	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,766 @@
+/*
+ * Copyright (c) 2014, 2016, 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.
+ */
+
+package build.tools.jigsaw;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.lang.module.ResolvedModule;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import static java.lang.module.ModuleDescriptor.*;
+import static build.tools.jigsaw.ModuleSummary.HtmlDocument.Selector.*;
+import static build.tools.jigsaw.ModuleSummary.HtmlDocument.Division.*;
+
+public class ModuleSummary {
+    private static final String USAGE = "Usage: ModuleSummary -mp <dir> -o <outfile> [-root mn]*";
+
+    public static void main(String[] args) throws Exception {
+        int i=0;
+        Path modpath = null;
+        Path outfile = null;
+        Set<String> roots = new HashSet<>();
+        while (i < args.length && args[i].startsWith("-")) {
+            String arg = args[i++];
+            switch (arg) {
+                case "-mp":
+                    modpath = Paths.get(args[i++]);
+                    break;
+                case "-o":
+                    outfile = Paths.get(args[i++]);
+                    break;
+                case "-root":
+                    roots.add(args[i++]);
+                default:
+                    System.err.println(USAGE);
+                    System.exit(-1);
+            }
+        }
+        if (outfile == null || modpath == null) {
+            System.err.println(USAGE);
+            System.exit(1);
+        }
+        Path dir = outfile.getParent() != null ? outfile.getParent() : Paths.get(".");
+        Files.createDirectories(dir);
+
+        Map<String, ModuleSummary> modules = new HashMap<>();
+        Set<ModuleReference> mrefs = ModuleFinder.ofSystem().findAll();
+        for (ModuleReference mref : mrefs) {
+            String mn = mref.descriptor().name();
+            Path jmod = modpath.resolve(mn + ".jmod");
+            modules.put(mn, new ModuleSummary(mref, jmod));
+        }
+
+        if (roots.isEmpty()) {
+            roots.addAll(modules.keySet());
+        }
+        genReport(outfile, modules, roots, "JDK Module Summary");
+    }
+
+    static void genReport(Path outfile, Map<String, ModuleSummary> modules, Set<String> roots, String title)
+        throws IOException
+    {
+        Configuration cf = resolve(roots);
+        try (PrintStream out = new PrintStream(Files.newOutputStream(outfile))) {
+            HtmlDocument doc = new HtmlDocument(title, modules);
+            Set<ModuleDescriptor> descriptors = cf.modules().stream()
+                    .map(ResolvedModule::reference)
+                    .map(ModuleReference::descriptor)
+                    .collect(Collectors.toSet());
+            doc.writeTo(out, descriptors);
+        }
+    }
+
+    private final String name;
+    private final ModuleDescriptor descriptor;
+    private final JmodInfo jmodInfo;
+    ModuleSummary(ModuleReference mref, Path jmod) throws IOException {
+        this.name = mref.descriptor().name();
+        this.descriptor = mref.descriptor();
+        this.jmodInfo = new JmodInfo(jmod);
+    }
+
+    String name() {
+        return name;
+    }
+
+    long uncompressedSize() {
+        return jmodInfo.size;
+    }
+
+    long jmodFileSize() {
+        return jmodInfo.filesize; // estimated compressed size
+    }
+
+    ModuleDescriptor descriptor() {
+        return descriptor;
+    }
+
+    int numClasses() {
+        return jmodInfo.classCount;
+    }
+
+    long classBytes() {
+        return jmodInfo.classBytes;
+    }
+
+    int numResources() {
+        return jmodInfo.resourceCount;
+    }
+
+    long resourceBytes() {
+        return jmodInfo.resourceBytes;
+    }
+
+    int numConfigs() {
+        return jmodInfo.configCount;
+    }
+    long configBytes() {
+        return jmodInfo.configBytes;
+    }
+    int numCommands() {
+        return jmodInfo.nativeCmds.size();
+    }
+
+    long commandBytes() {
+        return jmodInfo.nativeCmds.values().stream()
+                .mapToLong(l -> l.longValue()).sum() - jmodInfo.debugInfoCmdBytes;
+    }
+    int numCommandsDebug() {
+        return jmodInfo.debugInfoCmdCount;
+    }
+    long commandDebugBytes() {
+        return jmodInfo.debugInfoCmdBytes;
+    }
+    int numNativeLibraries() {
+        return jmodInfo.nativeLibs.size();
+    }
+
+    long nativeLibrariesBytes() {
+        return jmodInfo.nativeLibs.values().stream()
+                .mapToLong(l -> l.longValue()).sum() - jmodInfo.debugInfoLibBytes;
+    }
+    int numNativeLibrariesDebug() {
+        return jmodInfo.debugInfoLibCount;
+    }
+
+    long nativeLibrariesDebugBytes() {
+        return jmodInfo.debugInfoLibBytes;
+    }
+
+    Map<String,Long> commands() {
+        return jmodInfo.nativeCmds;
+    }
+
+    Map<String,Long> nativeLibs() {
+        return jmodInfo.nativeLibs;
+    }
+
+    Map<String,Long> configFiles() {
+        return jmodInfo.configFiles;
+    }
+
+
+    static class JmodInfo {
+        final long size;
+        final long filesize;
+        final int  classCount;
+        final long classBytes;
+        final int  resourceCount;
+        final long resourceBytes;
+        final int  configCount;
+        final long configBytes;
+        final int  debugInfoLibCount;
+        final long debugInfoLibBytes;
+        final int  debugInfoCmdCount;
+        final long debugInfoCmdBytes;
+        final Map<String,Long> configFiles = new HashMap<>();
+        final Map<String,Long> nativeCmds = new HashMap<>();
+        final Map<String,Long> nativeLibs = new HashMap<>();
+
+        JmodInfo(Path jmod) throws IOException {
+            long total = 0;
+            long cBytes = 0, rBytes = 0, cfBytes = 0, dizLibBytes = 0, dizCmdBytes = 0;
+            int  cCount = 0, rCount = 0, cfCount = 0, dizLibCount = 0, dizCmdCount = 0;
+            try (ZipFile zf = new ZipFile(jmod.toFile())) {
+                for (Enumeration<? extends ZipEntry> e = zf.entries(); e.hasMoreElements(); ) {
+                    ZipEntry ze = e.nextElement();
+                    String fn = ze.getName();
+                    int pos = fn.indexOf('/');
+                    String dir = fn.substring(0, pos);
+                    String filename = fn.substring(fn.lastIndexOf('/') + 1);
+                    // name shown in the column
+                    String name = filename;
+
+                    long len = ze.getSize();
+                    total += len;
+                    switch (dir) {
+                        case NATIVE_LIBS:
+                            nativeLibs.put(name, len);
+                            if (filename.endsWith(".diz")) {
+                                dizLibCount++;
+                                dizLibBytes += len;
+                            }
+                            break;
+                        case NATIVE_CMDS:
+                            nativeCmds.put(name, len);
+                            if (filename.endsWith(".diz")) {
+                                dizCmdCount++;
+                                dizCmdBytes += len;
+                            }
+                            break;
+                        case CLASSES:
+                            if (filename.endsWith(".class")) {
+                                cCount++;
+                                cBytes += len;
+                            } else {
+                                rCount++;
+                                rBytes += len;
+                            }
+                            break;
+                        case CONFIG:
+                            configFiles.put(name, len);
+                            cfCount++;
+                            cfBytes += len;
+                            break;
+                        default:
+                            break;
+                    }
+                }
+                this.filesize = jmod.toFile().length();
+                this.classCount = cCount;
+                this.classBytes = cBytes;
+                this.resourceCount = rCount;
+                this.resourceBytes = rBytes;
+                this.configCount = cfCount;
+                this.configBytes = cfBytes;
+                this.size = total;
+                this.debugInfoLibCount = dizLibCount;
+                this.debugInfoLibBytes = dizLibBytes;
+                this.debugInfoCmdCount = dizCmdCount;
+                this.debugInfoCmdBytes = dizCmdBytes;
+            }
+        }
+
+        static final String NATIVE_LIBS = "native";
+        static final String NATIVE_CMDS = "bin";
+        static final String CLASSES     = "classes";
+        static final String CONFIG      = "conf";
+
+        static final String MODULE_ID = "module/id";
+        static final String MODULE_MAIN_CLASS = "module/main-class";
+    }
+
+    static Configuration resolve(Set<String> roots) {
+        return Configuration.empty()
+            .resolveRequires(ModuleFinder.ofSystem(),
+                             ModuleFinder.empty(),
+                             roots);
+    }
+
+    static class HtmlDocument {
+        final String title;
+        final Map<String, ModuleSummary> modules;
+        boolean requiresPublicNote = false;
+        boolean aggregatorNote = false;
+        boolean totalBytesNote = false;
+        HtmlDocument(String title, Map<String, ModuleSummary> modules) {
+            this.title = title;
+            this.modules = modules;
+        }
+
+        void writeTo(PrintStream out, Set<ModuleDescriptor> selectedModules) {
+            out.format("<html><head>%n");
+            out.format("<title>%s</title>%n", title);
+            // stylesheet
+            Arrays.stream(HtmlDocument.STYLES).forEach(out::println);
+            out.format("</head>%n");
+
+            // body begins
+            out.format("<body>%n");
+
+            // title and date
+            out.println(DOCTITLE.toString(title));
+            out.println(VERSION.toString(String.format("%tc", new Date())));
+
+            // total modules and sizes
+            long totalBytes = selectedModules.stream()
+                    .map(ModuleDescriptor::name)
+                    .map(modules::get)
+                    .mapToLong(ModuleSummary::uncompressedSize)
+                    .sum();
+            String[] sections = new String[] {
+                    String.format("%s: %d", "Total modules", selectedModules.size()),
+                    String.format("%s: %,d bytes (%s %s)", "Total size",
+                                  totalBytes,
+                                  System.getProperty("os.name"),
+                                  System.getProperty("os.arch"))
+            };
+            out.println(SECTION.toString(sections));
+
+            // write table and header
+            out.println(String.format("<table class=\"%s\">", MODULES));
+            out.println(header("Module", "Requires", "Exports",
+                    "Services", "Commands/Native Libraries/Configs"));
+
+            // write contents - one row per module
+            selectedModules.stream()
+                    .sorted(Comparator.comparing(ModuleDescriptor::name))
+                    .map(m -> modules.get(m.name()))
+                    .map(ModuleTableRow::new)
+                    .forEach(table -> table.writeTo(out));
+
+            out.format("</table>");  // end table
+            out.format("</body>");
+            out.println("</html>");
+        }
+
+        String header(String... columns) {
+            StringBuilder sb = new StringBuilder();
+            sb.append("<tr>");
+            Arrays.stream(columns)
+                    .forEach(cn -> sb.append("  <th>").append(cn).append("</th>").append("\n"));
+            sb.append("</tr>");
+            return sb.toString();
+        }
+
+        static enum Selector {
+            MODULES("modules"),
+            MODULE("module"),
+            MODULE_DEF("code name def"),
+            AGGREGATOR("code name def agg"),
+            REQUIRES("code"),
+            REQUIRES_PUBLIC("code reexp"),
+            BR("br"),
+            CODE("code"),
+            NUMBER("number"),;
+            final String name;
+            Selector(String name) {
+                this.name = name;
+            }
+            @Override
+            public String toString() {
+                return name;
+            }
+        }
+
+        static enum Division {
+            DOCTITLE("doctitle"),
+            VERSION("versions"),
+            SECTION("section");
+            final String name;
+
+            Division(String name) {
+                this.name = name;
+            }
+
+            public String toString(String... lines) {
+                String value = Arrays.stream(lines).collect(Collectors.joining("<br>\n"));
+                return "<div class=\"" + name + "\">" + value + "</div>";
+            }
+        }
+
+        class ModuleTableRow {
+            private final ModuleSummary ms;
+            private final Set<ModuleDescriptor> deps;
+            private final int maxRows;
+            private final boolean aggregator;
+            ModuleTableRow(ModuleSummary ms) {
+                this.ms = ms;
+                Configuration cf = resolve(Set.of(ms.name()));
+                this.deps = cf.modules().stream()
+                        .map(ResolvedModule::reference)
+                        .map(ModuleReference::descriptor)
+                        .collect(Collectors.toSet());
+                int count = (ms.numClasses() > 0 ? 1 : 0) +
+                            (ms.numResources() > 0 ? 1 : 0) +
+                            (ms.numConfigs() > 0 ? 1 : 0) +
+                            (ms.numNativeLibraries() > 0 ? 1 : 0) +
+                            (ms.numNativeLibrariesDebug() > 0 ? 1 : 0) +
+                            (ms.numCommands() > 0 ? 1 : 0) +
+                            (ms.numCommandsDebug() > 0 ? 1 : 0);
+                this.aggregator = ms.numClasses() == 1 && count == 1; // only module-info.class
+
+                // 5 fixed rows (name + 2 transitive count/size + 2 blank rows)
+                this.maxRows = 5 + count + (aggregator && !aggregatorNote ? 2 : 0);
+            }
+
+            public void writeTo(PrintStream out) {
+                out.println(String.format("<tr id=\"%s\" class=\"%s\">", ms.name(), MODULE));
+                out.println(moduleColumn());
+                out.println(requiresColumn());
+                out.println(exportsColumn());
+                out.println(servicesColumn());
+                out.println(otherSectionColumn());
+                out.println("</td>");
+                out.println("</tr>");
+            }
+
+            public String moduleColumn() {
+                // module name
+                StringBuilder sb = new StringBuilder("  ");
+                sb.append("<td>");
+                sb.append(String.format("<table class=\"%s\">", MODULE)).append("\n");
+                sb.append(moduleName(ms.name()));
+                sb.append(blankRow());
+                // metadata
+                sb.append(toTableRow("class", "classes", ms.numClasses(), ms.classBytes()));
+                sb.append(toTableRow("resource", "resources", ms.numResources(), ms.resourceBytes()));
+                sb.append(toTableRow("config", "configs", ms.numConfigs(), ms.configBytes()));
+                sb.append(toTableRow("native library", "native libraries",
+                                     ms.numNativeLibraries(), ms.nativeLibrariesBytes()));
+                sb.append(toTableRow("native library debug", "native libraries debug",
+                                     ms.numNativeLibrariesDebug(), ms.nativeLibrariesDebugBytes()));
+                sb.append(toTableRow("command", "commands", ms.numCommands(), ms.commandBytes()));
+                sb.append(toTableRow("command debug", "commands debug",
+                                     ms.numCommandsDebug(), ms.commandDebugBytes()));
+                sb.append(blankRow());
+
+                // transitive dependencies
+                long reqBytes = deps.stream()
+                                    .filter(d -> !d.name().equals(ms.name()))
+                                    .mapToLong(d -> modules.get(d.name()).uncompressedSize())
+                                    .sum();
+                long reqJmodFileSize = deps.stream()
+                                            .mapToLong(d -> modules.get(d.name()).jmodFileSize())
+                                            .sum();
+                // size
+                if (totalBytesNote) {
+                    sb.append(toTableRow("Total bytes", ms.uncompressedSize()));
+                    sb.append(toTableRow("Total bytes of dependencies", reqBytes));
+                } else {
+                    // print footnote
+                    sb.append(toTableRow("Total bytes<sup>1</sup>", ms.uncompressedSize()));
+                    sb.append(toTableRow("Total bytes of dependencies<sup>2</sup>", reqBytes));
+                }
+                String files = deps.size() == 1 ? "file" : "files";
+                sb.append(toTableRow(String.format("Total jmod bytes (%d %s)", deps.size(), files), reqJmodFileSize));
+
+                if (aggregator && !aggregatorNote) {
+                    aggregatorNote = true;
+                    sb.append(blankRow());
+                    sb.append(toTableRow("<i>* aggregator is a module with module-info.class only</i>", BR));
+                }
+                if (!totalBytesNote) {
+                    totalBytesNote = true;
+                    sb.append(blankRow());
+                    sb.append(toTableRow("<i><sup>1</sup>sum of all files including debug files</i>", BR));
+                    sb.append(toTableRow("<i><sup>2</sup>sum of direct and indirect dependencies</i>", BR));
+                }
+                sb.append("</table>").append("</td>");
+                return sb.toString();
+            }
+
+            private String moduleName(String mn) {
+                if (aggregator) {
+                    StringBuilder sb = new StringBuilder();
+                    sb.append(String.format("<tr><td colspan=\"2\"><span class=\"%s\">", AGGREGATOR))
+                      .append(mn)
+                      .append("</span>").append("&nbsp;&nbsp;");
+                    if (!aggregatorNote) {
+                        sb.append("(aggregator<sup>*</sup>)");
+                    } else {
+                        sb.append("(aggregator)");
+                    }
+                    sb.append("</td></tr>");
+                    return sb.toString();
+                } else {
+                    return toTableRow(mn, MODULE_DEF);
+                }
+            }
+
+            public String requiresColumn() {
+                StringBuilder sb = new StringBuilder();
+                sb.append(String.format("<td>"));
+                boolean footnote = requiresPublicNote;
+                ms.descriptor().requires().stream()
+                        .sorted(Comparator.comparing(Requires::name))
+                        .forEach(r -> {
+                            boolean requiresPublic = r.modifiers().contains(Requires.Modifier.PUBLIC);
+                            Selector sel = requiresPublic ? REQUIRES_PUBLIC : REQUIRES;
+                            String req = String.format("<a class=\"%s\" href=\"#%s\">%s</a>",
+                                                       sel, r.name(), r.name());
+                            if (!requiresPublicNote && requiresPublic) {
+                                requiresPublicNote = true;
+                                req += "<sup>*</sup>";
+                            }
+                            sb.append(req).append("\n").append("<br>");
+                        });
+
+                if (!ms.name().equals("java.base")) {
+                    int directDeps = ms.descriptor().requires().size();
+                    int indirectDeps = deps.size()-directDeps-1;
+                    for (int i=directDeps; i< (maxRows-1); i++) {
+                        sb.append("<br>");
+                    }
+                    sb.append("<br>");
+                    sb.append("<i>+").append(indirectDeps).append(" transitive dependencies</i>");
+                }
+                if (footnote != requiresPublicNote) {
+                    sb.append("<br><br>").append("<i>* bold denotes requires public</i>");
+                }
+                sb.append("</td>");
+                return sb.toString();
+            }
+
+            public String exportsColumn() {
+                StringBuilder sb = new StringBuilder();
+                sb.append(String.format("  <td class=\"%s\">", CODE));
+                ms.descriptor().exports().stream()
+                        .sorted(Comparator.comparing(Exports::source))
+                        .filter(e -> !e.isQualified())
+                        .forEach(e -> sb.append(e.source()).append("<br>").append("\n"));
+                sb.append("</td>");
+                return sb.toString();
+            }
+
+            public String servicesColumn() {
+                StringBuilder sb = new StringBuilder();
+                sb.append(String.format("  <td class=\"%s\">", CODE));
+                ms.descriptor().uses().stream()
+                        .sorted()
+                        .forEach(s -> sb.append("uses ").append(s).append("<br>").append("\n"));
+                ms.descriptor().provides().entrySet().stream()
+                        .sorted(Map.Entry.comparingByKey())
+                        .flatMap(e -> e.getValue().providers().stream()
+                                .map(p -> String.format("provides %s<br>&nbsp;&nbsp;&nbsp;&nbsp;with %s",
+                                                        e.getKey(), p)))
+                        .forEach(p -> sb.append(p).append("<br>").append("\n"));
+                sb.append("</td>");
+                return sb.toString();
+            }
+
+            public String otherSectionColumn() {
+                StringBuilder sb = new StringBuilder();
+                sb.append("<td>");
+                sb.append(String.format("<table class=\"%s\">", MODULE)).append("\n");
+                // commands
+                if (ms.numCommands() > 0) {
+                    sb.append(toTableRow("bin/", CODE));
+                    ms.commands().entrySet().stream()
+                            .sorted(Map.Entry.comparingByKey())
+                            .forEach(e -> sb.append(toTableRow(e.getKey(), e.getValue(), CODE)));
+                    sb.append(blankRow());
+                }
+
+                // native libraries
+                if (ms.numNativeLibraries() > 0) {
+                    sb.append(toTableRow("lib/", CODE));
+                    ms.nativeLibs().entrySet().stream()
+                            .sorted(Map.Entry.comparingByKey())
+                            .forEach(e -> sb.append(toTableRow(e.getKey(), e.getValue(), CODE)));
+                    sb.append(blankRow());
+                }
+
+                // config files
+                if (ms.numConfigs() > 0) {
+                    sb.append(toTableRow("conf/", CODE));
+                    ms.configFiles().entrySet().stream()
+                            .sorted(Map.Entry.comparingByKey())
+                            .forEach(e -> sb.append(toTableRow(e.getKey(), e.getValue(), CODE)));
+                }
+                // totals
+                sb.append("</table>").append("</td>");
+                return sb.toString();
+            }
+
+            private String blankRow() {
+                return toTableRow("&nbsp;", BR);
+            }
+
+            private String toTableRow(String col, Selector selector) {
+                TableDataBuilder builder = new TableDataBuilder();
+                builder.colspan(selector, 2, col);
+                return builder.build();
+            }
+
+            private String toTableRow(String col1, long col2) {
+                return toTableRow(col1, col2, BR);
+            }
+
+            private String toTableRow(String col1, long col2, Selector selector) {
+                TableDataBuilder builder = new TableDataBuilder();
+                builder.data(selector, col1);
+                builder.data(col2);
+                return builder.build();
+
+            }
+
+            private String toTableRow(String singular, String plural, int count, long bytes) {
+                if (count == 0) {
+                    return "";
+                }
+                TableDataBuilder builder = new TableDataBuilder();
+                if (count == 1) {
+                    builder.data(count + " " + singular);
+                } else {
+                    builder.data(count + " " + plural);
+                }
+                builder.data(bytes);
+                return builder.build();
+            }
+
+            class TableDataBuilder {
+                private final StringBuilder sb;
+                TableDataBuilder() {
+                    this.sb = new StringBuilder("<tr>");
+                }
+                TableDataBuilder data(String s) {
+                    data(BR, s);
+                    return this;
+                }
+                TableDataBuilder data(long num) {
+                    data(NUMBER, String.format("%,d", num));
+                    return this;
+                }
+                TableDataBuilder colspan(Selector selector, int columns, String data) {
+                    sb.append("<td colspan=\"").append(columns).append("\">");
+                    sb.append("<span class=\"").append(selector).append("\">");
+                    sb.append(data).append("</span></td>");
+                    return this;
+                }
+
+                TableDataBuilder data(Selector selector, String data) {
+                    sb.append("<td class=\"").append(selector).append("\">");
+                    sb.append(data).append("</td>");
+                    return this;
+                }
+                String build() {
+                    sb.append("</tr>");
+                    return sb.toString();
+                }
+            }
+        }
+
+        private static final String[] STYLES = new String[]{
+                "<link rel=\"stylesheet\" type=\"text/css\" href=\"/.fonts/dejavu.css\"/>",
+                "<style type=\"text/css\">",
+                "        HTML, BODY, DIV, SPAN, APPLET, OBJECT, IFRAME, H1, H2, H3, H4, H5, H6, P,",
+                "        BLOCKQUOTE, PRE, A, ABBR, ACRONYM, ADDRESS, BIG, CITE, CODE, DEL, DFN, EM,",
+                "        IMG, INS, KBD, Q, S, SAMP, SMALL, STRIKE, STRONG, SUB, SUP, TT, VAR, B, U,",
+                "        I, CENTER, DL, DT, DD, OL, UL, LI, FIELDSET, FORM, LABEL, LEGEND, TABLE,",
+                "        CAPTION, TBODY, TFOOT, THEAD, TR, TH, TD, ARTICLE, ASIDE, CANVAS, DETAILS,",
+                "        EMBED, FIGURE, FIGCAPTION, FOOTER, HEADER, HGROUP, MENU, NAV, OUTPUT, RUBY,",
+                "        SECTION, SUMMARY, TIME, MARK, AUDIO, VIDEO {",
+                "          margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit;",
+                "          vertical-align: baseline; }",
+                "        ARTICLE, ASIDE, DETAILS, FIGCAPTION, FIGURE, ",
+                "        FOOTER, HEADER, HGROUP, MENU, NAV, SECTION { display: block; }",
+                "        BLOCKQUOTE, Q { quotes: none; }",
+                "        BLOCKQUOTE:before, BLOCKQUOTE:after, Q:before, Q:after {",
+                "                content: ''; content: none; }",
+                "        TABLE { border-collapse: collapse; border-spacing: 0; }",
+                "        A { text-decoration: none; }",
+                "        A:link { color: #437291; }",
+                "        A:visited { color: #666666; }",
+                "        A.anchor:link, A.anchor:visited { color: black; }",
+                "        A[href]:hover { color: #e76f00; }",
+                "        A IMG { border-width: 0px; }",
+                "        HTML { font-size: 20px; } /* baseline grid */",
+                "        HTML > BODY { font-size: 14px; }",
+                "        BODY {",
+                "          background: white;",
+                "          margin: 40px;",
+                "          margin-bottom: 150%;",
+                "          line-height: 20px;",
+                "          -webkit-text-size-adjust: 100%; /* iOS */",
+                "          color: #222;",
+                "        }",
+                "        BODY { font-family: \"DejaVu Serif\", \"Lucida Bright\", \"Bookman Old Style\",",
+                "                            Georgia, serif; }",
+                "        CODE, TT, .jref, DIV.spec .open, TABLE.profiles {",
+                "          font-family: \"DejaVu Sans\", \"Lucida Sans\", Helvetica, sans-serif; }",
+                "        PRE, .code { font-family: \"DejaVu Sans Mono\", \"Bitstream Vera Sans Mono\",",
+                "                            Monaco, \"Courier New\", monospace; }",
+                "        H1, H2, H3, H4 { color: green; font-weight: bold; }",
+                "        I { font-style: italic; }",
+                "        TH { font-weight: bold; }",
+                "        P { text-indent: 40px; }",
+                "        P:first-child, UL + P, OL + P, BLOCKQUOTE + P, TABLE + P, P.subsection,",
+                "          P.break, DIV.profiles-table + P { text-indent: 0; }",
+                "        P.break { margin-top: 10px; }",
+                "        P.subsection { margin-top: 20px; }",
+                "        P.subsection SPAN.title { font-weight: bold; padding-right: 20px; }",
+                "        UL, OL { margin: 10px 0; padding-left: 40px; }",
+                "        LI { margin-bottom: 10px; }",
+                "        UL.compact LI { margin-bottom: 0; }",
+                "        PRE { padding: 0; margin: 10px 0 10px 20px; background: #eee; width: 45em; }",
+                "        BLOCKQUOTE { margin: 10px 0; margin-left: 20px; }",
+                "        LI BLOCKQUOTE { margin-left: 0; }",
+                "        UL LI { list-style-type: square; }",
+                "        .todo { color: darkred; text-align: right; }",
+                "        .error { color: red; font-weight: bold; }",
+                "        .warn { color: #ee0000; font-weight: bold; }",
+                "        DIV.doctitle { margin-top: -13px;",
+                "          font-size: 22px; line-height: 40px; font-weight: bold; }",
+                "        DIV.twarn { color: #cc0000; font-weight: bold; margin-bottom: 9px; }",
+                "        DIV.subtitle { margin-top: 2px; font-size: 18px; font-weight: bold; }",
+                "        DIV.authors { margin-top: 10px; margin-bottom: 10px; font-size: 16px; }",
+                "        DIV.author A { font-style: italic; }",
+                "        DIV.version { margin-top: 10px; font-size: 12px; }",
+                "        DIV.version, DIV.legal-notice { font-size: 12px; line-height: 15px; }",
+                "        SPAN.hash { font-size: 9px; }",
+                "        DIV.version SPAN.modified { color: green; font-weight: bold; }",
+                "        DIV.head { margin-bottom: 20px; }",
+                "        DIV.section > DIV.title, DIV.section DIV.number SPAN {",
+                "          font-size: 15px; font-weight: bold; }",
+                "        TABLE { border-collapse: collapse; border: none; }",
+                "        TD.number { text-align: right; }",
+                "        TD, TH { text-align: left; white-space: nowrap; }",
+                "        TD.name, SPAN.name { font-weight: bold; }",
+                "        ",
+                "        TABLE.module { width: 100%; }",
+                "        TABLE.module TD:first-child { padding-right: 10px; }",
+                "        TR.module > TD { padding: 10px 0; border-top: 1px solid black; }",
+                "        TR > TH { padding-bottom: 10px; }",
+                "        TR.br TD { padding-top: 20px; }",
+                "        TABLE.modules { margin-top: 20px; }",
+                "        TABLE.modules > TBODY > TR > TD:nth-child(even) { background: #eee; }",
+                "        TABLE.modules > TBODY > TR > TD, TABLE.modules > TBODY > TR > TH {",
+                "          padding-left: 10px; padding-right: 10px; }",
+                "        .reexp, .def { font-weight: bold; }",
+                "        .agg { font-style: italic; }",
+                "        SUP { height: 0; line-height: 1; position: relative;",
+                "              vertical-align: baseline; bottom: 1ex; font-size: 11px; }",
+                "</style>",
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/jigsaw/technology-summary.html	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,627 @@
+<html>
+<head>
+<title>JDK Technology Summary</title>
+<style type="text/css">
+table { border: 1px solid black; border-collapse: collapse; }
+tr.se-base { background-color: bisque; }
+tr.se-misc { background-color: lavender; }
+tr.se-ee   { background-color: lightgreen; }
+tr.se-ext  { background-color: pink; }
+td { font-family: monospace; padding: 4px; border: 1px solid; }
+</style>
+</head>
+
+<h1>JCP Technologies in the Modular JDK</h1>
+
+<p><em>Last updated 2015-03-06 (Added java.datatransfer. Assumes JNLP is modularized, and StAX joins the Java SE Platform.)</em></p>
+
+<p><a href="module-summary.html">JDK Module Summary</a> | Technologies in the <a href="https://docs.oracle.com/javase/8/docs/">Java SE Documentation</a></p>
+
+<table>
+<tr><th>Legend</th></tr>
+<tr class="se-base"><td><a href="https://jcp.org/en/jsr/platform?listBy=2&listByType=platform">JCP technology in the Java SE Platform only -- in java.base</a></td></tr>
+<tr class="se-misc"><td><a href="https://jcp.org/en/jsr/platform?listBy=2&listByType=platform">JCP technology in the Java SE Platform only -- not in java.base</a></td></tr>
+<tr class="se-ee"><td><a href="https://jcp.org/en/jsr/platform?listBy=3&listByType=platform">JCP technology in the Java SE Platform and the Java EE Platform</a></a></td></tr>
+<tr class="se-ext"><td><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#endorsed-standards-apis">JCP technology in the Java SE Platform based on non-JCP standards</a></a></td></tr>
+<tr><td>JCP technology in neither the Java SE or EE Platforms</td></tr>
+</table>
+
+<p><em>An <strong>upgradeable</strong> module contains JCP technology that is in the Java SE Platform but is not exclusive to the Java SE Platform, i.e., the green and pink technologies. Most upgradeable modules are defined by loaders other than the bootstrap.</em></p>
+
+<br/>
+
+<table>
+<tr>
+<th>Technology</th>
+<th>Original JSR</th>
+<th><a href="https://jcp.org/en/procedures/jcp2#DEF">Original Target</a></th>
+<th>Module</th>
+<th><a href="https://jcp.org/en/procedures/jcp2#2.1.2">Evolved By</a></th>
+<th>History</th>
+<th>Profile/SE</th>
+<th>Loader</th>
+<th>Upg?</th>
+</tr>
+
+<tr class="se-misc">
+<td>JMX</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=3">3</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.management">java.management</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Print Service</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=6">6</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.desktop">java.desktop</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>SE</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Preferences</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=10">10</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.prefs">java.prefs</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Image I/O</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=15">15</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.desktop">java.desktop</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>SE</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>SASL</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=28">28</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.security.sasl"/>java.security.sasl</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Logging</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=47">47</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.logging">java.logging</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>NIO</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=51">51</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr>
+<td>JNLP</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=56">56</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.desktop">java.jnlp</a></td>
+<td>Original JSR</td>
+<td></td>
+<td>N/A</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Beans Persistence</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=57">57</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.desktop">java.desktop</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>SE</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>GSS</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=72">72</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.security.jgss">java.security.jgss</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>XML Digital Signature</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=105">105</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.xml.crypto">java.xml.crypto</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>JDBC Rowset</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=114">114</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.sql.rowset">java.sql.rowset</a></td>
+<td>Original JSR</td>
+<td>Co-evolved with JDBC</td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>JMX Remote</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=160">160</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.management">java.management</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Profiling (Agent)</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=163">163</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.instrument">java.instrument</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Profiling (JMX)</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=163">163</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.management">java.management</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>Concurrency Utilities</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=166">166</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>Annotations</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=175">175</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>StAX</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=173">173</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.xml">java.xml</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td>
+<td>2</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Annotations (Language Model)</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=175">175</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.compiler"/>java.compiler</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Compiler</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=199">199</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.compiler">java.compiler</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>Pack200</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=200">200</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>NIO.2</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=203">203</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>JAXP</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=206">206</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.xml">java.xml</a></td>
+<td>UJSR for Java SE</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td>
+<td>2</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>JDBC</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=221">221</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.sql">java.sql</a></td>
+<td>Original JSR</td>
+<td>Co-evolved with JDBC Rowset</td>
+<td>2</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Scripting</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=223">223</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.scripting">java.scripting</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr>
+<td>Smart Card I/O</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=268">268</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.smartcardio">java.smartcardio</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td>
+<td>N/A</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Annotation Processing</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=269">269</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.compiler">java.compiler</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>InvokeDynamic</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=292">292</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>Type Annotations</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=308">308</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Type Annotations (Language Model)</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=308">308</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.compiler"/>java.compiler</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>Date and Time</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=310">310</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>Streams</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=335">335</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>Collections, Math, I18N, I/O, Net, Reflection</td>
+<td>---</td>
+<td>---</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-base">
+<td>JCA, JAAS, JSSE</td>
+<td>---</td>
+<td>---</td>
+<td><a href="module-summary.html#java.base"/>java.base</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>1</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Applet, AWT, Swing, Java 2D, Beans, A11Y, Sound</td>
+<td>---</td>
+<td>---</td>
+<td><a href="module-summary.html#java.desktop"/>java.desktop</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>SE</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>Data Transfer</td>
+<td>---</td>
+<td>---</td>
+<td><a href="module-summary.html#java.datatransfer"/>java.datatransfer</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>SE</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>JNDI</td>
+<td>---</td>
+<td>---</td>
+<td><a href="module-summary.html#java.naming"/>java.naming</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>3</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>RMI</td>
+<td>---</td>
+<td>---</td>
+<td><a href="module-summary.html#java.rmi"/>java.rmi</a></td>
+<td>UJSR for Java SE</td>
+<td></td>
+<td>2</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-misc">
+<td>JAF</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=925">925</a></td>
+<td>---</td>
+<td><a href="module-summary.html#java.activation">java.activation</a></a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<tr class="se-ext">
+<td>RMI-IIOP, IDL</td>
+<td>(OMG)</td>
+<td>---</td>
+<td><a href="module-summary.html#java.corba"/>java.corba</a></td>
+<td>UJSR for Java SE</td>
+<td>Formerly an <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#endorsed-standards-apis">Endorsed Standard</a></td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<tr class="se-ext">
+<td>DOM, SAX</td>
+<td>(W3C)</td>
+<td>---</td>
+<td><a href="module-summary.html#java.xml">java.xml</a></td>
+<td>UJSR for Java SE</td>
+<td>Formerly an <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#endorsed-standards-apis">Endorsed Standard</a></td>
+<td>2</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+<tr class="se-ee">
+<td>SAAJ</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=67">67</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.xml.ws">java.xml.ws</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (f.k.a. JAXM)</td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<tr class="se-ee">
+<td>Web Services Metadata</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=181">181</a></td>
+<td>Java EE</td>
+<td><a href="module-summary.html#java.xml.ws">java.xml.ws</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<tr class="se-ee">
+<td>JAXB</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=222">222</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.xml.bind">java.xml.bind</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<tr class="se-ee">
+<td>JAXWS</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=224">224</a></td>
+<td>Java SE</td>
+<td><a href="module-summary.html#java.xml.ws">java.xml.ws</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a></td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<!-- Alex: The Java SE Platform incorporates a cutdown version of the javax.annotation package from the Java EE Platform. -->
+<tr class="se-ee">
+<td>Common Annotations</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=250">250</a></td>
+<td>Java SE,EE</td>
+<td><a href="module-summary.html#java.annotations.common">java.annotations.common</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<!-- Alex: The Java SE Platform incorporates a cutdown version of the javax.transaction package from the Java EE Platform. -->
+<tr class="se-ee">
+<td>JTA (non-XA)</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=907">907</a></td>
+<td>---</td>
+<td><a href="module-summary.html#java.transaction">java.transaction</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td>
+<td>SE</td>
+<td>ext</td>
+<td>Yes</td>
+</tr>
+
+<!-- Alex: The Java SE Platform incorporates the same version of the javax.transaction.xa package as the Java EE Platform. -->
+<tr class="se-ee">
+<td>JTA (XA)</td>
+<td><a href="https://jcp.org/en/jsr/detail?id=907">907</a></td>
+<td>---</td>
+<td><a href="module-summary.html#java.sql"/>java.sql</a></td>
+<td>Original JSR</td>
+<td>Formerly a <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/#standalone-technologies">Standalone Technology</a> (unlisted)</td>
+<td>2</td>
+<td>boot</td>
+<td>No</td>
+</tr>
+
+</table>
+
+</html>
--- a/make/src/classes/build/tools/module/GenJdepsModulesXml.java	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- */
-
-package build.tools.module;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.nio.file.Files;
-import java.nio.file.NoSuchFileException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * GenJdepsModulesXml augments the input modules.xml file(s)
- * to include the module membership from the given path to
- * the JDK exploded image.  The output file is used by jdeps
- * to analyze dependencies and enforce module boundaries.
- *
- * The input modules.xml file defines the modular structure of
- * the JDK as described in JEP 200: The Modular JDK
- * (http://openjdk.java.net/jeps/200).
- *
- * $ java build.tools.module.GenJdepsModulesXml \
- *        -o com/sun/tools/jdeps/resources/modules.xml \
- *        -mp $OUTPUTDIR/modules \
- *        top/modules.xml
- */
-public final class GenJdepsModulesXml {
-    private final static String USAGE =
-        "Usage: GenJdepsModulesXml -o <output file> -mp build/modules path-to-modules-xml";
-
-    public static void main(String[] args) throws Exception {
-        Path outfile = null;
-        Path modulepath = null;
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i];
-            if (arg.equals("-o")) {
-                outfile = Paths.get(args[i+1]);
-                i = i+2;
-            } else if (arg.equals("-mp")) {
-                modulepath = Paths.get(args[i+1]);
-                i = i+2;
-                if (!Files.isDirectory(modulepath)) {
-                    System.err.println(modulepath + " is not a directory");
-                    System.exit(1);
-                }
-            } else {
-                break;
-            }
-        }
-        if (outfile == null || modulepath == null || i >= args.length) {
-            System.err.println(USAGE);
-            System.exit(-1);
-        }
-
-        GenJdepsModulesXml gentool = new GenJdepsModulesXml(modulepath);
-        Set<Module> modules = new HashSet<>();
-        for (; i < args.length; i++) {
-            Path p = Paths.get(args[i]);
-            modules.addAll(ModulesXmlReader.readModules(p)
-                    .stream()
-                    .map(gentool::buildIncludes)
-                    .collect(Collectors.toSet()));
-        }
-
-        Files.createDirectories(outfile.getParent());
-        ModulesXmlWriter.writeModules(modules, outfile);
-    }
-
-    final Path modulepath;
-    public GenJdepsModulesXml(Path modulepath) {
-        this.modulepath = modulepath;
-    }
-
-    private static String packageName(Path p) {
-        return packageName(p.toString().replace(File.separatorChar, '/'));
-    }
-    private static String packageName(String name) {
-        int i = name.lastIndexOf('/');
-        return (i > 0) ? name.substring(0, i).replace('/', '.') : "";
-    }
-
-    private static boolean includes(String name) {
-        return name.endsWith(".class");
-    }
-
-    public Module buildIncludes(Module module) {
-        Module.Builder mb = new Module.Builder(module);
-        Path mclasses = modulepath.resolve(module.name());
-        try {
-            Files.find(mclasses, Integer.MAX_VALUE, (Path p, BasicFileAttributes attr)
-                         -> includes(p.getFileName().toString()))
-                 .map(p -> packageName(mclasses.relativize(p)))
-                 .forEach(mb::include);
-        } catch (NoSuchFileException e) {
-            // aggregate module may not have class
-        } catch (IOException ioe) {
-            throw new UncheckedIOException(ioe);
-        }
-        return mb.build();
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/module/GenModuleInfoSource.java	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,134 @@
+/*
+ * 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.
+ */
+package build.tools.module;
+
+import java.io.BufferedWriter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A build tool to extend the module-info.java in the source tree
+ * for platform-specific exports, uses, and provides and write
+ * to the specified output file.
+ *
+ * GenModulesList build tool currently generates the modules.list from
+ * the module-info.java from the source tree that will be used for
+ * the make target and dependences.
+ *
+ * The build currently invokes gensrc-$MODULE.gmk after modules.list
+ * is generated.  Hence, platform-specific requires is not supported.
+ */
+public class GenModuleInfoSource {
+    private final static String USAGE =
+        "Usage: GenModuleInfoSource [option] -o <output file> <module-info-java>\n" +
+        "Options are:\n" +
+        "  -exports  <package-name>\n" +
+        "  -exports  <package-name>/<module-name>\n" +
+        "  -uses     <service>\n" +
+        "  -provides <service>/<provider-impl-classname>\n";
+
+    public static void main(String... args) throws Exception {
+        Path outfile = null;
+        Path moduleInfoJava = null;
+        Map<String, Set<String>> options = new HashMap<>();
+
+        // validate input arguments
+        for (int i = 0; i < args.length; i++){
+            String option = args[i];
+            if (option.startsWith("-")) {
+                String arg = args[++i];
+                if (option.equals("-exports") ||
+                        option.equals("-uses") ||
+                        option.equals("-provides")) {
+                    options.computeIfAbsent(option, _k -> new HashSet<>()).add(arg);
+                } else if (option.equals("-o")) {
+                    outfile = Paths.get(arg);
+                } else {
+                    throw new IllegalArgumentException("invalid option: " + option);
+                }
+            } else if (moduleInfoJava != null) {
+                throw new IllegalArgumentException("more than one module-info.java");
+            } else {
+                moduleInfoJava = Paths.get(option);
+                if (Files.notExists(moduleInfoJava)) {
+                    throw new IllegalArgumentException(option + " not exist");
+                }
+            }
+        }
+
+        if (moduleInfoJava == null || outfile == null) {
+            System.err.println(USAGE);
+            System.exit(-1);
+        }
+        // read module-info.java
+        Module.Builder builder = ModuleInfoReader.builder(moduleInfoJava);
+        augment(builder, options);
+
+        // generate new module-info.java
+        Module module = builder.build();
+        Path parent = outfile.getParent();
+        if (parent != null)
+            Files.createDirectories(parent);
+
+        try (BufferedWriter writer = Files.newBufferedWriter(outfile)) {
+            writer.write(module.toString());
+        }
+    }
+
+    private static void augment(Module.Builder builder, Map<String, Set<String>> options) {
+        for (String opt : options.keySet()) {
+            if (opt.equals("-exports")) {
+                for (String arg : options.get(opt)) {
+                    int index = arg.indexOf('/');
+                    if (index > 0) {
+                        String pn = arg.substring(0, index);
+                        String mn = arg.substring(index + 1, arg.length());
+                        builder.exportTo(pn, mn);
+                    } else {
+                        builder.export(arg);
+                    }
+                }
+            } else if (opt.equals("-uses")) {
+                options.get(opt).stream()
+                        .forEach(builder::use);
+            } else if (opt.equals("-provides")) {
+                for (String arg : options.get(opt)) {
+                    int index = arg.indexOf('/');
+                    if (index <= 0) {
+                        throw new IllegalArgumentException("invalid -provide argument: " + arg);
+                    }
+                    String service = arg.substring(0, index);
+                    String impl = arg.substring(index + 1, arg.length());
+                    builder.provide(service, impl);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/module/GenModuleLoaderMap.java	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ */
+
+package build.tools.module;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class GenModuleLoaderMap {
+    private static final String USAGE =
+        "GenModuleLoaderMap -o <output-file> -boot m1[,m2]* -platform m3[,m4]* <original-source>";
+
+    public static void main(String... args) throws Exception {
+        // default set of boot modules and ext modules
+        Stream<String> bootModules = Stream.empty();
+        Stream<String> platformModules = Stream.empty();
+        Path outfile = null;
+        Path source = null;
+        for (int i=0; i < args.length; i++) {
+            String option = args[i];
+            if (option.startsWith("-")) {
+                String arg = args[++i];
+                if (option.equals("-boot")) {
+                    String[] mns = arg.split(",");
+                    bootModules = Stream.concat(bootModules, Arrays.stream(mns));
+                } else if (option.equals("-platform")) {
+                    String[] mns = arg.split(",");
+                    platformModules = Stream.concat(platformModules, Arrays.stream(mns));
+                } else if (option.equals("-o")) {
+                    outfile = Paths.get(arg);
+                } else {
+                    throw new IllegalArgumentException("invalid option: " + option);
+                }
+            } else {
+                source = Paths.get(option);
+            }
+        }
+
+        if (outfile == null) {
+            throw new IllegalArgumentException("-o must be specified");
+        }
+        if (Files.notExists(source)) {
+            throw new IllegalArgumentException(source + " not exist");
+        }
+
+        boolean needsQuotes = outfile.toString().contains(".java.tmp");
+
+        try (BufferedWriter bw = Files.newBufferedWriter(outfile, StandardCharsets.UTF_8);
+             PrintWriter writer = new PrintWriter(bw)) {
+            for (String line : Files.readAllLines(source)) {
+                if (line.contains("@@BOOT_MODULE_NAMES@@")) {
+                    line = patch(line, "@@BOOT_MODULE_NAMES@@", bootModules, needsQuotes);
+                } else if (line.contains("@@PLATFORM_MODULE_NAMES@@")) {
+                    line = patch(line, "@@PLATFORM_MODULE_NAMES@@", platformModules, needsQuotes);
+                }
+                writer.println(line);
+            }
+        }
+    }
+
+    private static String patch(String s, String tag, Stream<String> stream, boolean needsQuotes) {
+        String mns = null;
+        if (needsQuotes) {
+            mns = stream.sorted()
+                .collect(Collectors.joining("\",\n            \""));
+        } else {
+            mns = stream.sorted()
+                .collect(Collectors.joining("\n"));
+        }
+        return s.replace(tag, mns);
+    }
+
+    /**
+     * Reads the contents of the given modules file.
+     */
+    private static Set<String> readModuleSet(String name) throws IOException {
+        try (InputStream is = GenModuleLoaderMap.class.getResourceAsStream(name);
+             BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
+            return reader.lines().collect(Collectors.toSet());
+        }
+    }
+}
--- a/make/src/classes/build/tools/module/GenModulesList.java	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- */
-
-package build.tools.module;
-
-import java.io.PrintWriter;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * $ java build.tools.module.GenModulesList \
- *        -o modules.list \
- *        top/modules.xml ...
- */
-public final class GenModulesList {
-    private final static String USAGE =
-        "Usage: GenModulesList -o <output file> path-to-modules-xml";
-
-    private Set<Module> modules = new HashSet<>();
-    private HashMap<String,Module> nameToModule = new HashMap<>();
-
-    public static void main(String[] args) throws Exception {
-        GenModulesList gen = new GenModulesList();
-        gen.run(args);
-    }
-
-    void run(String[] args) throws Exception {
-        Path outfile = null;
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i];
-            if (arg.equals("-o")) {
-                outfile = Paths.get(args[i+1]);
-                i = i+2;
-            } else {
-                break;
-            }
-        }
-        if (outfile == null || i >= args.length) {
-            System.err.println(USAGE);
-            System.exit(-1);
-        }
-
-        for (; i < args.length; i++) {
-            Path p = Paths.get(args[i]);
-            modules.addAll(ModulesXmlReader.readModules(p));
-        }
-
-        modules.stream()
-               .forEach(m -> nameToModule.put(m.name(), m));
-
-        Path parent = outfile.getParent();
-        if (parent != null)
-            Files.createDirectories(parent);
-
-        Iterable<Module> sortedModules = (new TopoSorter(modules)).result();
-        try (PrintWriter writer = new PrintWriter(outfile.toFile())) {
-            for (Module m : sortedModules) {
-                if (isNotAggregator(m)) {
-                    String deps = getModuleDependences(m).stream()
-                            .filter(GenModulesList::isNotAggregator)
-                            .map(Module::name)
-                            .collect(Collectors.joining(" "));
-                    writer.format("%s: %s%n", m.name(), deps);
-                }
-            }
-        }
-    }
-
-    private Module nameToModule(String name) {
-        return nameToModule.get(name);
-    }
-
-    private Set<Module> getModuleDependences(Module m) {
-        return m.requires().stream()
-                .map(d -> d.name())
-                .map(this::nameToModule)
-                .collect(Collectors.toSet());
-    }
-
-    static boolean isNotAggregator(Module m) {
-        return isNotAggregator(m.name());
-    }
-
-    static boolean isNotAggregator(String name) {
-        return AGGREGATORS.contains(name) ? false : true;
-    }
-
-    static final List<String> AGGREGATORS = Arrays.asList(new String[] {
-            "java.se", "java.compact1", "java.compact2", "java.compact3"});
-
-    class TopoSorter {
-        final Deque<Module> result = new LinkedList<>();
-        final Deque<Module> nodes = new LinkedList<>();
-
-        TopoSorter(Collection<Module> nodes) {
-            nodes.stream()
-                 .forEach(m -> this.nodes.add(m));
-
-            sort();
-        }
-
-        public Iterable<Module> result() {
-            return result;
-        }
-
-        private void sort() {
-            Deque<Module> visited = new LinkedList<>();
-            Deque<Module> done = new LinkedList<>();
-            Module node;
-            while ((node = nodes.poll()) != null) {
-                if (!visited.contains(node)) {
-                    visit(node, visited, done);
-                }
-            }
-        }
-
-        private void visit(Module m, Deque<Module> visited, Deque<Module> done) {
-            if (visited.contains(m)) {
-                if (!done.contains(m)) {
-                    throw new IllegalArgumentException("Cyclic detected: " +
-                            m + " " + getModuleDependences(m));
-                }
-                return;
-            }
-            visited.add(m);
-            getModuleDependences(m).stream()
-                                   .forEach(x -> visit(x, visited, done));
-            done.add(m);
-            result.addLast(m);
-        }
-    }
-}
--- a/make/src/classes/build/tools/module/ImageBuilder.java	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,499 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- */
-
-package build.tools.module;
-
-import jdk.internal.jimage.Archive;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.nio.ByteOrder;
-import java.nio.file.Files;
-import java.nio.file.InvalidPathException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import jdk.internal.jimage.ImageFileCreator;
-
-/**
- * A tool for building a runtime image.
- *
- * java build.tools.module.ImageBuilder <options> --output <path> top/modules.xml,...
- *  Possible options are:
- *  --cmds                  Location of native commands
- *  --configs               Location of config files
- *  --help                  Print this usage message
- *  --classes               Location of module classes files
- *  --libs                  Location of native libraries
- *  --mods                  Comma separated list of module names
- *  --output                Location of the output path
- *  --endian                Byte order of the target runtime; {little,big}
- */
-class ImageBuilder {
-    static class BadArgs extends Exception {
-        private static final long serialVersionUID = 0L;
-        BadArgs(String format, Object... args) {
-            super(String.format(format, args));
-            this.format = format;
-            this.args = args;
-        }
-        BadArgs showUsage(boolean b) {
-            showUsage = b;
-            return this;
-        }
-        final String format;
-        final Object[] args;
-        boolean showUsage;
-    }
-
-    static class Option {
-
-        interface Processing {
-
-            void process(ImageBuilder task, String opt, String arg) throws BadArgs;
-        }
-
-        final boolean hasArg;
-        final String[] aliases;
-        final String description;
-        final Processing processing;
-
-        Option(boolean hasArg, String description, Processing processing,
-                String... aliases) {
-            this.hasArg = hasArg;
-            this.description = description;
-            this.processing = processing;
-            this.aliases = aliases;
-        }
-        boolean isHidden() {
-            return false;
-        }
-        boolean matches(String opt) {
-            for (String a : aliases) {
-                if (a.equals(opt)) {
-                    return true;
-                } else if (opt.startsWith("--") && hasArg && opt.startsWith(a + "=")) {
-                    return true;
-                }
-            }
-            return false;
-        }
-        boolean ignoreRest() {
-            return false;
-        }
-        void process(ImageBuilder task, String opt, String arg) throws BadArgs {
-            processing.process(task, opt, arg);
-        }
-        String description() {
-            return description;
-        }
-    }
-
-    private static Path CWD = Paths.get("");
-
-    private static List<Path> splitPath(String arg, String separator)
-        throws BadArgs
-    {
-        List<Path> paths = new ArrayList<>();
-        for (String p: arg.split(separator)) {
-            if (p.length() > 0) {
-                try {
-                    Path path = CWD.resolve(p);
-                    if (Files.notExists(path))
-                        throw new BadArgs("path not found: %s", path);
-                    paths.add(path);
-                } catch (InvalidPathException x) {
-                    throw new BadArgs("path not valid: %s", p);
-                }
-            }
-        }
-        return paths;
-    }
-
-    static Option[] recognizedOptions = {
-        new Option(true, "Location of native commands", (task, opt, arg) -> {
-            task.options.cmds = splitPath(arg, File.pathSeparator);
-        }, "--cmds"),
-        new Option(true, "Location of config files", (task, opt, arg) -> {
-            task.options.configs = splitPath(arg, File.pathSeparator);
-        }, "--configs"),
-        new Option(false, "Print this usage message", (task, opt, arg) -> {
-            task.options.help = true;
-        }, "--help"),
-        new Option(true, "Location of module classes files", (task, opt, arg) -> {
-            task.options.classes = splitPath(arg, File.pathSeparator);
-        }, "--classes"),
-        new Option(true, "Location of native libraries", (task, opt, arg) -> {
-            task.options.libs = splitPath(arg, File.pathSeparator);
-        }, "--libs"),
-        new Option(true, "Comma separated list of module names",
-        (task, opt, arg) -> {
-            for (String mn : arg.split(",")) {
-                if (mn.isEmpty()) {
-                    throw new BadArgs("Module not found", mn);
-                }
-                task.options.mods.add(mn);
-            }
-        }, "--mods"),
-        new Option(true, "Location of the output path", (task, opt, arg) -> {
-            Path path = Paths.get(arg);
-            task.options.output = path;
-        }, "--output"),
-        new Option(true, "Byte order of the target runtime; {little,big}",
-        (task, opt, arg) -> {
-            if (arg.equals("little")) {
-                task.options.endian = ByteOrder.LITTLE_ENDIAN;
-            } else if (arg.equals("big")) {
-                task.options.endian = ByteOrder.BIG_ENDIAN;
-            } else {
-                throw new BadArgs("Unknown byte order " + arg);
-            }
-        }, "--endian")
-    };
-
-    private final Options options = new Options();
-
-    private PrintWriter log;
-    void setLog(PrintWriter out) {
-        log = out;
-    }
-
-    Set<Module> moduleGraph = new java.util.HashSet<>();
-
-    /** Module list files */
-    private static final String BOOT_MODULES = "boot.modules";
-    private static final String EXT_MODULES = "ext.modules";
-
-    /**
-     * Result codes.
-     */
-    static final int EXIT_OK = 0,       // Completed with no errors.
-                     EXIT_ERROR = 1,    // Completed but reported errors.
-                     EXIT_CMDERR = 2,   // Bad command-line arguments
-                     EXIT_SYSERR = 3,   // System error or resource exhaustion.
-                     EXIT_ABNORMAL = 4; // terminated abnormally
-
-
-    static class Options {
-        boolean help;
-        List<Path> classes;
-        List<Path> cmds;
-        List<Path> configs;
-        List<Path> libs;
-        Set<String> mods = new HashSet<>();
-        Path output;
-        ByteOrder endian = ByteOrder.nativeOrder(); // default, if not specified
-    }
-
-    public static void main(String[] args) throws Exception {
-        ImageBuilder builder = new ImageBuilder();
-        int rc = builder.run(args);
-        System.exit(rc);
-    }
-
-    int run(String[] args) {
-        if (log == null)
-            log = new PrintWriter(System.out);
-
-        try {
-            handleOptions(args);
-            if (options.help) {
-                showHelp();
-                return EXIT_OK;
-            }
-
-            if (options.classes == null)
-                throw new BadArgs("--classes must be specified").showUsage(true);
-
-            Path output = options.output;
-            if (output == null)
-                throw new BadArgs("--output must be specified").showUsage(true);
-            Files.createDirectories(output);
-            if (Files.list(output).findFirst().isPresent())
-                throw new BadArgs("dir not empty", output);
-
-            if (options.mods.isEmpty())
-                throw new BadArgs("--mods must be specified").showUsage(true);
-
-            if (moduleGraph.isEmpty())
-                throw new BadArgs("modules.xml must be specified").showUsage(true);
-
-            if (options.cmds == null || options.cmds.isEmpty())
-                warning("--commands is not set");
-            if (options.libs == null || options.libs.isEmpty())
-                warning("--libs is not set");
-            //if (options.configs == null || options.configs.isEmpty())
-            //    warning("--configs is not set");
-
-            // additional option combination validation
-
-            boolean ok = run();
-            return ok ? EXIT_OK : EXIT_ERROR;
-        } catch (BadArgs e) {
-            reportError(e.format, e.args);
-            if (e.showUsage)
-                log.println(USAGE_SUMMARY);
-            return EXIT_CMDERR;
-        } catch (Exception x) {
-            x.printStackTrace();
-            return EXIT_ABNORMAL;
-        } finally {
-            log.flush();
-        }
-    }
-
-    private boolean run() throws IOException {
-        createImage();
-        return true;
-    }
-
-    class SimpleResolver {
-        private final Set<Module> initialMods;
-        private final Map<String,Module> nameToModule = new HashMap<>();
-
-        SimpleResolver(Set<String> mods, Set<Module> graph) {
-            graph.stream()
-                 .forEach(m -> nameToModule.put(m.name(), m));
-            initialMods = mods.stream()
-                         .map(this::nameToModule)
-                         .collect(Collectors.toSet());
-        }
-
-        /** Returns the transitive closure, in topological order */
-        List<String> resolve() {
-            List<Module> result = new LinkedList<>();
-            Set<Module> visited = new HashSet<>();
-            Set<Module> done = new HashSet<>();
-            for (Module m : initialMods) {
-                if (!visited.contains(m))
-                    visit(m, visited, result, done);
-            }
-            return result.stream()
-                         .map(m -> m.name())
-                         .collect(Collectors.toList());
-        }
-
-        private void visit(Module m, Set<Module> visited,
-                           List<Module> result, Set<Module> done) {
-            if (visited.contains(m)) {
-                if (!done.contains(m))
-                    throw new IllegalArgumentException("Cyclic detected: " +
-                            m + " " + getModuleDependences(m));
-                return;
-            }
-            visited.add(m);
-            getModuleDependences(m).stream()
-                                   .forEach(d -> visit(d, visited, result, done));
-            done.add(m);
-            result.add(m);
-        }
-
-        private Module nameToModule(String name) {
-            Module m = nameToModule.get(name);
-            if (m == null)
-                throw new RuntimeException("No module definition for " + name);
-            return m;
-        }
-
-        private Set<Module> getModuleDependences(Module m) {
-            return m.requires().stream()
-                    .map(d -> d.name())
-                    .map(this::nameToModule)
-                    .collect(Collectors.toSet());
-        }
-    }
-
-    private List<String> resolve(Set<String> mods ) {
-        return (new SimpleResolver(mods, moduleGraph)).resolve();
-    }
-
-    private void createImage() throws IOException {
-        Collection<String> modules = resolve(options.mods);
-        log.print(modules.stream().collect(Collectors.joining(" ")));
-        ImageFileHelper imageHelper = new ImageFileHelper(modules);
-        imageHelper.createModularImage(options.output);
-
-        // jspawnhelper, might be in lib or lib/ARCH
-        Path jspawnhelper = Paths.get("jspawnhelper");
-        Path lib = options.output.resolve("lib");
-        Optional<Path> helper = Files.walk(lib, 2)
-                                     .filter(f -> f.getFileName().equals(jspawnhelper))
-                                     .findFirst();
-        if (helper.isPresent())
-            helper.get().toFile().setExecutable(true, false);
-    }
-
-    private class ImageFileHelper {
-        final Collection<String> modules;
-        final Set<String> bootModules;
-        final Set<String> extModules;
-        final Set<String> appModules;
-
-        ImageFileHelper(Collection<String> modules) throws IOException {
-            this.modules = modules;
-            this.bootModules = modulesFor(BOOT_MODULES).stream()
-                    .filter(modules::contains)
-                    .collect(Collectors.toSet());
-            this.extModules = modulesFor(EXT_MODULES).stream()
-                    .filter(modules::contains)
-                    .collect(Collectors.toSet());
-            this.appModules = modules.stream()
-                    .filter(m -> m.length() != 0 &&
-                                 !bootModules.contains(m) &&
-                                 !extModules.contains(m))
-                    .collect(Collectors.toSet());
-        }
-
-        void createModularImage(Path output) throws IOException {
-            Set<Archive> bootArchives = bootModules.stream()
-                    .map(this::toModuleArchive)
-                    .collect(Collectors.toSet());
-            Set<Archive> extArchives = extModules.stream()
-                    .map(this::toModuleArchive)
-                    .collect(Collectors.toSet());
-            Set<Archive> appArchives = appModules.stream()
-                    .map(this::toModuleArchive)
-                    .collect(Collectors.toSet());
-            ImageFileCreator.create(output, "bootmodules", bootArchives, options.endian);
-            ImageFileCreator.create(output, "extmodules", extArchives, options.endian);
-            ImageFileCreator.create(output, "appmodules", appArchives, options.endian);
-        }
-
-        ModuleArchive toModuleArchive(String mn) {
-            return new ModuleArchive(mn,
-                                     moduleToPath(mn, options.classes, false/*true*/),
-                                     moduleToPath(mn, options.cmds, false),
-                                     moduleToPath(mn, options.libs, false),
-                                     moduleToPath(mn, options.configs, false));
-        }
-
-        private Path moduleToPath(String name, List<Path> paths, boolean expect) {
-            Set<Path> foundPaths = new HashSet<>();
-            if (paths != null) {
-                for (Path p : paths) {
-                    Path rp = p.resolve(name);
-                    if (Files.exists(rp))
-                        foundPaths.add(rp);
-                }
-            }
-            if (foundPaths.size() > 1)
-                throw new RuntimeException("Found more that one path for " + name);
-            if (expect && foundPaths.size() != 1)
-                throw new RuntimeException("Expected to find classes path for " + name);
-            return foundPaths.size() == 0 ? null : foundPaths.iterator().next();
-        }
-
-        private List<String> modulesFor(String name) throws IOException {
-            try (InputStream is = ImageBuilder.class.getResourceAsStream(name);
-                 BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
-                return reader.lines().collect(Collectors.toList());
-            }
-        }
-    }
-
-    public void handleOptions(String[] args) throws BadArgs {
-        // process options
-        for (int i=0; i < args.length; i++) {
-            if (args[i].charAt(0) == '-') {
-                String name = args[i];
-                Option option = getOption(name);
-                String param = null;
-                if (option.hasArg) {
-                    if (name.startsWith("--") && name.indexOf('=') > 0) {
-                        param = name.substring(name.indexOf('=') + 1, name.length());
-                    } else if (i + 1 < args.length) {
-                        param = args[++i];
-                    }
-                    if (param == null || param.isEmpty() || param.charAt(0) == '-') {
-                        throw new BadArgs("Missing arg for %n", name).showUsage(true);
-                    }
-                }
-                option.process(this, name, param);
-                if (option.ignoreRest()) {
-                    i = args.length;
-                }
-            } else {
-                // process rest of the input arguments
-                Path p = Paths.get(args[i]);
-                try {
-                    moduleGraph.addAll(ModulesXmlReader.readModules(p)
-                            .stream()
-                            .collect(Collectors.toSet()));
-                } catch (Exception e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        }
-    }
-
-    private Option getOption(String name) throws BadArgs {
-        for (Option o : recognizedOptions) {
-            if (o.matches(name)) {
-                return o;
-            }
-        }
-        throw new BadArgs("Unknown option %s", name).showUsage(true);
-    }
-
-    private void reportError(String format, Object... args) {
-        log.format("Error: " + format + "%n", args);
-    }
-
-    private void warning(String format, Object... args) {
-        log.format("Warning: " + format + "%n", args);
-    }
-
-    private static final String USAGE =
-            "ImageBuilder <options> --output <path> path-to-modules-xml\n";
-
-    private static final String USAGE_SUMMARY =
-            USAGE + "Use --help for a list of possible options.";
-
-    private void showHelp() {
-        log.format(USAGE);
-        log.format("Possible options are:%n");
-        for (Option o : recognizedOptions) {
-            String name = o.aliases[0].substring(1); // there must always be at least one name
-            name = name.charAt(0) == '-' ? name.substring(1) : name;
-            if (o.isHidden() || name.equals("h"))
-                continue;
-
-            log.format("  --%s\t\t\t%s%n", name, o.description());
-        }
-    }
-}
--- a/make/src/classes/build/tools/module/Module.java	Thu Mar 24 11:21:21 2016 +0100
+++ b/make/src/classes/build/tools/module/Module.java	Thu Mar 24 16:21:19 2016 +0100
@@ -25,10 +25,17 @@
 
 package build.tools.module;
 
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 public class Module {
-    static class Dependence {
+    public static class Dependence implements Comparable<Dependence> {
         final String name;
         final boolean reexport;
         Dependence(String name) {
@@ -43,6 +50,10 @@
             return name;
         }
 
+        public boolean reexport(){
+            return reexport;
+        }
+
         @Override
         public int hashCode() {
             int hash = 5;
@@ -55,20 +66,35 @@
             Dependence d = (Dependence)o;
             return this.name.equals(d.name) && this.reexport == d.reexport;
         }
+
+        @Override
+        public int compareTo(Dependence o) {
+            int rc = this.name.compareTo(o.name);
+            return rc != 0 ? rc : Boolean.compare(this.reexport, o.reexport);
+        }
+
+        @Override
+        public String toString() {
+            return String.format("requires %s%s;",
+                                 reexport ? "public " : "", name);
+        }
     }
     private final String moduleName;
     private final Set<Dependence> requires;
     private final Map<String, Set<String>> exports;
-    private final Set<String> packages;
+    private final Set<String> uses;
+    private final Map<String, Set<String>> provides;
 
     private Module(String name,
-            Set<Dependence> requires,
-            Map<String, Set<String>> exports,
-            Set<String> packages) {
+                   Set<Dependence> requires,
+                   Map<String, Set<String>> exports,
+                   Set<String> uses,
+                   Map<String, Set<String>> provides) {
         this.moduleName = name;
         this.requires = Collections.unmodifiableSet(requires);
         this.exports = Collections.unmodifiableMap(exports);
-        this.packages = Collections.unmodifiableSet(packages);
+        this.uses  = Collections.unmodifiableSet(uses);
+        this.provides = Collections.unmodifiableMap(provides);
     }
 
     public String name() {
@@ -83,8 +109,12 @@
         return exports;
     }
 
-    public Set<String> packages() {
-        return packages;
+    public Set<String> uses() {
+        return uses;
+    }
+
+    public Map<String, Set<String>> provides() {
+        return provides;
     }
 
     @Override
@@ -95,8 +125,7 @@
         Module that = (Module) ob;
         return (moduleName.equals(that.moduleName)
                 && requires.equals(that.requires)
-                && exports.equals(that.exports)
-                && packages.equals(that.packages));
+                && exports.equals(that.exports));
     }
 
     @Override
@@ -104,43 +133,55 @@
         int hc = moduleName.hashCode();
         hc = hc * 43 + requires.hashCode();
         hc = hc * 43 + exports.hashCode();
-        hc = hc * 43 + packages.hashCode();
         return hc;
     }
 
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("module ").append(moduleName).append(" {").append("\n");
-        requires.stream().sorted().forEach(d ->
-                sb.append(String.format("   requires %s%s%n", d.reexport ? "public " : "", d.name)));
-        exports.entrySet().stream().filter(e -> e.getValue().isEmpty())
+        sb.append(String.format("module %s {%n", moduleName));
+        requires.stream()
+                .sorted()
+                .map(d -> String.format("    requires %s%s;%n", d.reexport ? "public " : "", d.name))
+                .forEach(sb::append);
+        exports.entrySet().stream()
+                .filter(e -> e.getValue().isEmpty())
                 .sorted(Map.Entry.comparingByKey())
-                .forEach(e -> sb.append(String.format("   exports %s%n", e.getKey())));
-        exports.entrySet().stream().filter(e -> !e.getValue().isEmpty())
+                .map(e -> String.format("    exports %s;%n", e.getKey()))
+                .forEach(sb::append);
+        exports.entrySet().stream()
+                .filter(e -> !e.getValue().isEmpty())
                 .sorted(Map.Entry.comparingByKey())
-                .forEach(e -> sb.append(String.format("   exports %s to %s%n", e.getKey(), e.getValue())));
-        packages.stream().sorted().forEach(pn -> sb.append(String.format("   includes %s%n", pn)));
-        sb.append("}");
+                .map(e -> String.format("    exports %s to%n%s;%n", e.getKey(),
+                        e.getValue().stream().sorted()
+                                .map(mn -> String.format("        %s", mn))
+                                .collect(Collectors.joining(",\n"))))
+                .forEach(sb::append);
+        uses.stream().sorted()
+                .map(s -> String.format("    uses %s;%n", s))
+                .forEach(sb::append);
+        provides.entrySet().stream()
+                .sorted(Map.Entry.comparingByKey())
+                .flatMap(e -> e.getValue().stream().sorted()
+                        .map(impl -> String.format("    provides %s with %s;%n", e.getKey(), impl)))
+                .forEach(sb::append);
+        sb.append("}").append("\n");
         return sb.toString();
     }
 
+    /**
+     * Module Builder
+     */
     static class Builder {
         private String name;
-        private final Set<Dependence> requires = new HashSet<>();
-        private final Map<String, Set<String>> exports = new HashMap<>();
-        private final Set<String> packages = new HashSet<>();
+        final Set<Dependence> requires = new HashSet<>();
+        final Map<String, Set<String>> exports = new HashMap<>();
+        final Set<String> uses = new HashSet<>();
+        final Map<String, Set<String>> provides = new HashMap<>();
 
         public Builder() {
         }
 
-        public Builder(Module module) {
-            name = module.name();
-            requires.addAll(module.requires());
-            exports.putAll(module.exports());
-            packages.addAll(module.packages());
-        }
-
         public Builder name(String n) {
             name = n;
             return this;
@@ -151,28 +192,89 @@
             return this;
         }
 
-        public Builder include(String p) {
-            packages.add(p);
-            return this;
+        public Builder export(String p) {
+            Objects.requireNonNull(p);
+            if (exports.containsKey(p)) {
+                throw new RuntimeException(name + " already exports " + p +
+                        " " + exports.get(p));
+            }
+            return exportTo(p, Collections.emptySet());
         }
 
-        public Builder export(String p) {
-            return exportTo(p, Collections.emptySet());
+        public Builder exportTo(String p, String mn) {
+            Objects.requireNonNull(p);
+            Objects.requireNonNull(mn);
+            Set<String> ms = exports.get(p);
+            if (ms != null && ms.isEmpty()) {
+                throw new RuntimeException(name + " already has unqualified exports " + p);
+            }
+            exports.computeIfAbsent(p, _k -> new HashSet<>()).add(mn);
+            return this;
         }
 
         public Builder exportTo(String p, Set<String> ms) {
             Objects.requireNonNull(p);
             Objects.requireNonNull(ms);
             if (exports.containsKey(p)) {
-                throw new RuntimeException(name + " already exports " + p);
+                throw new RuntimeException(name + " already exports " + p +
+                        " " + exports.get(p));
             }
             exports.put(p, new HashSet<>(ms));
             return this;
         }
 
+        public Builder use(String cn) {
+            uses.add(cn);
+            return this;
+        }
+
+        public Builder provide(String s, String impl) {
+            provides.computeIfAbsent(s, _k -> new HashSet<>()).add(impl);
+            return this;
+        }
+
+        public Builder merge(Module m1, Module m2) {
+            if (!m1.name().equals(m2.name())) {
+                throw new IllegalArgumentException(m1.name() + " != " + m2.name());
+            }
+            name = m1.name();
+            // ## reexports
+            requires.addAll(m1.requires());
+            requires.addAll(m2.requires());
+            Stream.concat(m1.exports().keySet().stream(), m2.exports().keySet().stream())
+                    .distinct()
+                    .forEach(pn -> {
+                        Set<String> s1 = m2.exports().get(pn);
+                        Set<String> s2 = m2.exports().get(pn);
+                        if (s1 == null || s2 == null) {
+                            exportTo(pn, s1 != null ? s1 : s2);
+                        } else if (s1.isEmpty() || s2.isEmpty()) {
+                            // unqualified exports
+                            export(pn);
+                        } else {
+                            exportTo(pn, Stream.concat(s1.stream(), s2.stream())
+                                               .collect(Collectors.toSet()));
+                        }
+                    });
+            uses.addAll(m1.uses());
+            uses.addAll(m2.uses());
+            m1.provides().keySet().stream()
+                    .forEach(s -> m1.provides().get(s).stream()
+                            .forEach(impl -> provide(s, impl)));
+            m2.provides().keySet().stream()
+                    .forEach(s -> m2.provides().get(s).stream()
+                            .forEach(impl -> provide(s, impl)));
+            return this;
+        }
+
         public Module build() {
-            Module m = new Module(name, requires, exports, packages);
+            Module m = new Module(name, requires, exports, uses, provides);
             return m;
         }
+
+        @Override
+        public String toString() {
+            return name != null ? name : "Unknown";
+        }
     }
 }
--- a/make/src/classes/build/tools/module/ModuleArchive.java	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- */
-
-package build.tools.module;
-
-import jdk.internal.jimage.Archive;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UncheckedIOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import jdk.internal.jimage.Archive.Entry.EntryType;
-
-/**
- * An Archive backed by an exploded representation on disk.
- */
-public class ModuleArchive implements Archive {
-    private final Path classes;
-    private final Path cmds;
-    private final Path libs;
-    private final Path configs;
-    private final String moduleName;
-
-    private final List<InputStream> opened = new ArrayList<>();
-
-    public ModuleArchive(String moduleName, Path classes, Path cmds,
-                         Path libs, Path configs) {
-        this.moduleName = moduleName;
-        this.classes = classes;
-        this.cmds = cmds;
-        this.libs = libs;
-        this.configs = configs;
-    }
-
-    @Override
-    public String moduleName() {
-        return moduleName;
-    }
-
-    @Override
-    public void open() throws IOException {
-        // NOOP
-    }
-
-    @Override
-    public void close() throws IOException {
-        IOException e = null;
-        for (InputStream stream : opened) {
-            try {
-                stream.close();
-            } catch (IOException ex) {
-                if (e == null) {
-                    e = ex;
-                } else {
-                    e.addSuppressed(ex);
-                }
-            }
-        }
-        if (e != null) {
-            throw e;
-        }
-    }
-
-    @Override
-    public Stream<Entry> entries() {
-        List<Entry> entries = new ArrayList<>();
-        try {
-            /*
-             * This code should be revisited to avoid buffering of the entries.
-             * 1) Do we really need sorting classes? This force buffering of entries.
-             *    libs, cmds and configs are not sorted.
-             * 2) I/O streams should be concatenated instead of buffering into
-             *    entries list.
-             * 3) Close I/O streams in a close handler.
-             */
-            if (classes != null) {
-                try (Stream<Path> stream = Files.walk(classes)) {
-                    entries.addAll(stream
-                            .filter(p -> !Files.isDirectory(p)
-                                    && !classes.relativize(p).toString().startsWith("_the.")
-                                    && !classes.relativize(p).toString().endsWith(".bc")
-                                    && !classes.relativize(p).toString().equals("javac_state"))
-                            .sorted()
-                            .map(p -> toEntry(p, classes, EntryType.CLASS_OR_RESOURCE))
-                            .collect(Collectors.toList()));
-                }
-            }
-            if (cmds != null) {
-                try (Stream<Path> stream = Files.walk(cmds)) {
-                    entries.addAll(stream
-                            .filter(p -> !Files.isDirectory(p))
-                            .map(p -> toEntry(p, cmds, EntryType.NATIVE_CMD))
-                            .collect(Collectors.toList()));
-                }
-            }
-            if (libs != null) {
-                try (Stream<Path> stream = Files.walk(libs)) {
-                    entries.addAll(stream
-                            .filter(p -> !Files.isDirectory(p))
-                            .map(p -> toEntry(p, libs, EntryType.NATIVE_LIB))
-                            .collect(Collectors.toList()));
-                }
-            }
-            if (configs != null) {
-                try (Stream<Path> stream = Files.walk(configs)) {
-                entries.addAll(stream
-                        .filter(p -> !Files.isDirectory(p))
-                        .map(p -> toEntry(p, configs, EntryType.CONFIG))
-                        .collect(Collectors.toList()));
-                }
-            }
-        } catch (IOException ioe) {
-            throw new UncheckedIOException(ioe);
-        }
-        return entries.stream();
-    }
-
-    private class FileEntry extends Entry {
-        private final boolean isDirectory;
-        private final long size;
-        private final Path entryPath;
-        FileEntry(Path entryPath, String path, EntryType type,
-                  boolean isDirectory, long size) {
-            super(ModuleArchive.this, path, path, type);
-            this.entryPath = entryPath;
-            this.isDirectory = isDirectory;
-            this.size = size;
-        }
-
-        public boolean isDirectory() {
-            return isDirectory;
-        }
-
-        @Override
-        public long size() {
-            return size;
-        }
-
-        @Override
-        public InputStream stream() throws IOException {
-            InputStream stream = Files.newInputStream(entryPath);
-            opened.add(stream);
-            return stream;
-        }
-    }
-
-    private Entry toEntry(Path entryPath, Path basePath, EntryType section) {
-        try {
-            String path = basePath.relativize(entryPath).toString().replace('\\', '/');
-            return new FileEntry(entryPath, path, section,
-                    false, Files.size(entryPath));
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-    }
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/module/ModuleInfoReader.java	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,357 @@
+/*
+ * 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.
+ */
+package build.tools.module;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.function.Supplier;
+import java.util.regex.Pattern;
+import java.util.stream.Stream;
+
+import build.tools.module.Module.Builder;
+
+/**
+ * Source reader of module-info.java
+ */
+public class ModuleInfoReader {
+    private final Path sourcefile;
+    private final Builder builder;
+    private ModuleInfoReader(Path file) {
+        this.sourcefile = file;
+        this.builder = new Builder();
+    }
+
+    public static Builder builder(Path file) throws IOException {
+        ModuleInfoReader reader = new ModuleInfoReader(file);
+        reader.readFile();
+        return reader.builder;
+    }
+
+    /**
+     * Reads the source file.
+     */
+    void readFile() throws IOException {
+        List<String> lines = Files.readAllLines(sourcefile);
+        boolean done = false;
+        int lineNumber = 0;
+        boolean inBlockComment = false;
+        boolean inRequires = false;
+        boolean reexports = false;
+        boolean inProvides = false;
+        boolean inWith = false;
+        String serviceIntf = null;
+        String providerClass = null;
+        boolean inUses = false;
+        boolean inExports = false;
+        boolean inExportsTo = false;
+        String qualifiedExports = null;
+        Counter counter = new Counter();
+
+        for (String line : lines) {
+            lineNumber++;
+            if (inBlockComment) {
+                int c = line.indexOf("*/");
+                if (c >= 0) {
+                    line = line.substring(c + 2, line.length());
+                    inBlockComment = false;
+                } else {
+                    // skip lines until end of comment block
+                    continue;
+                }
+            }
+            inBlockComment = beginBlockComment(line);
+
+            line = trimComment(line).trim();
+            // ignore empty lines
+            if (line.length() == 0) {
+                continue;
+            }
+            String values;
+            if (inRequires || inExports | inUses | (inWith && providerClass == null)) {
+                values = line;
+            } else {
+                String[] s = line.split("\\s+");
+                String keyword = s[0].trim();
+                int nextIndex = keyword.length();
+                switch (keyword) {
+                    case "module":
+                        if (s.length != 3 || !s[2].trim().equals("{")) {
+                            throw new RuntimeException(sourcefile + ", line " +
+                                    lineNumber + ", is malformed");
+                        }
+                        builder.name(s[1].trim());
+                        continue;  // next line
+                    case "requires":
+                        inRequires = true;
+                        counter.numRequires++;
+                        if (s.length >= 2) {
+                            String ss = s[1].trim();
+                            if (ss.equals("public")) {
+                                nextIndex = line.indexOf(ss) + ss.length();
+                                reexports = true;
+                            }
+                        }
+                        break;
+                    case "exports":
+                        inExports = true;
+                        inExportsTo = false;
+                        counter.numExports++;
+                        qualifiedExports = null;
+                        if (s.length >= 3) {
+                            qualifiedExports = s[1].trim();
+                            nextIndex = line.indexOf(qualifiedExports, nextIndex)
+                                            + qualifiedExports.length();
+                            if (s[2].trim().equals("to")) {
+                                inExportsTo = true;
+                                nextIndex = line.indexOf("to", nextIndex) + "to".length();
+                            } else {
+                                throw new RuntimeException(sourcefile + ", line " +
+                                        lineNumber + ", is malformed: " + s[2]);
+                            }
+                        }
+                        break;
+                    case "to":
+                        if (!inExports || qualifiedExports == null) {
+                            throw new RuntimeException(sourcefile + ", line " +
+                                    lineNumber + ", is malformed");
+                        }
+                        inExportsTo = true;
+                        break;
+                    case "uses":
+                        inUses = true;
+                        counter.numUses++;
+                        break;
+                    case "provides":
+                        inProvides = true;
+                        inWith = false;
+                        counter.numProvides++;
+                        serviceIntf = null;
+                        providerClass = null;
+                        if (s.length >= 2) {
+                            serviceIntf = s[1].trim();
+                            nextIndex = line.indexOf(serviceIntf) + serviceIntf.length();
+                        }
+                        if (s.length >= 3) {
+                            if (s[2].trim().equals("with")) {
+                                inWith = true;
+                                nextIndex = line.indexOf("with") + "with".length();
+                            } else {
+                                throw new RuntimeException(sourcefile + ", line " +
+                                        lineNumber + ", is malformed: " + s[2]);
+                            }
+                        }
+                        break;
+                    case "with":
+                        if (!inProvides || serviceIntf == null) {
+                            throw new RuntimeException(sourcefile + ", line " +
+                                    lineNumber + ", is malformed");
+                        }
+                        inWith = true;
+                        nextIndex = line.indexOf("with") + "with".length();
+                        break;
+                    case "}":
+                        counter.validate(builder);
+                        done = true;
+                        continue;  // next line
+                    default:
+                        throw new RuntimeException(sourcefile + ", \"" +
+                                keyword + "\" on line " +
+                                lineNumber + ", is not recognized");
+                }
+                values = line.substring(nextIndex, line.length()).trim();
+            }
+
+            int len = values.length();
+            if (len == 0) {
+                continue;  // next line
+            }
+            char lastchar = values.charAt(len - 1);
+            if (lastchar != ',' && lastchar != ';') {
+                throw new RuntimeException(sourcefile + ", line " +
+                        lineNumber + ", is malformed:" +
+                        " ',' or ';' is missing.");
+            }
+
+            values = values.substring(0, len - 1).trim();
+            // parse the values specified for a keyword specified
+            for (String s : values.split(",")) {
+                s = s.trim();
+                if (s.length() > 0) {
+                    if (inRequires) {
+                        if (builder.requires.contains(s)) {
+                            throw new RuntimeException(sourcefile + ", line "
+                                    + lineNumber + " duplicated requires: \"" + s + "\"");
+                        }
+                        builder.require(s, reexports);
+                    } else if (inExports) {
+                        if (!inExportsTo && qualifiedExports == null) {
+                            builder.export(s);
+                        } else {
+                            builder.exportTo(qualifiedExports, s);
+                        }
+                    } else if (inUses) {
+                        builder.use(s);
+                    } else if (inProvides) {
+                        if (!inWith) {
+                            serviceIntf = s;
+                        } else {
+                            providerClass = s;
+                            builder.provide(serviceIntf, providerClass);
+                        }
+                    }
+                }
+            }
+            if (lastchar == ';') {
+                inRequires = false;
+                reexports = false;
+                inExports = false;
+                inExportsTo = false;
+                inProvides = false;
+                inWith = false;
+                inUses = false;
+            }
+        }
+
+        if (inBlockComment) {
+            throw new RuntimeException(sourcefile + ", line " +
+                    lineNumber + ", missing \"*/\" to end a block comment");
+        }
+        if (!done) {
+            throw new RuntimeException(sourcefile + ", line " +
+                    lineNumber + ", missing \"}\" to end module definition" +
+                    " for \"" + builder + "\"");
+        }
+        return;
+    }
+
+    // the naming convention for the module names without dashes
+    private static final Pattern CLASS_NAME_PATTERN = Pattern.compile("[\\w\\.\\*_$/]+");
+    private static boolean beginBlockComment(String line) {
+        int pos = 0;
+        while (pos >= 0 && pos < line.length()) {
+            int c = line.indexOf("/*", pos);
+            if (c < 0) {
+                return false;
+            }
+
+            if (c > 0 && !Character.isWhitespace(line.charAt(c - 1))) {
+                return false;
+            }
+
+            int c1 = line.indexOf("//", pos);
+            if (c1 >= 0 && c1 < c) {
+                return false;
+            }
+
+            int c2 = line.indexOf("*/", c + 2);
+            if (c2 < 0) {
+                return true;
+            }
+            pos = c + 2;
+        }
+        return false;
+    }
+    private static String trimComment(String line) {
+        StringBuilder sb = new StringBuilder();
+
+        int pos = 0;
+        while (pos >= 0 && pos < line.length()) {
+            int c1 = line.indexOf("//", pos);
+            if (c1 > 0 && !Character.isWhitespace(line.charAt(c1 - 1))) {
+                // not a comment
+                c1 = -1;
+            }
+
+            int c2 = line.indexOf("/*", pos);
+            if (c2 > 0 && !Character.isWhitespace(line.charAt(c2 - 1))) {
+                // not a comment
+                c2 = -1;
+            }
+
+            int c = line.length();
+            int n = line.length();
+            if (c1 >= 0 || c2 >= 0) {
+                if (c1 >= 0) {
+                    c = c1;
+                }
+                if (c2 >= 0 && c2 < c) {
+                    c = c2;
+                }
+                int c3 = line.indexOf("*/", c2 + 2);
+                if (c == c2 && c3 > c2) {
+                    n = c3 + 2;
+                }
+            }
+            if (c > 0) {
+                if (sb.length() > 0) {
+                    // add a whitespace if multiple comments on one line
+                    sb.append(" ");
+                }
+                sb.append(line.substring(pos, c));
+            }
+            pos = n;
+        }
+        return sb.toString();
+    }
+
+
+    static class Counter {
+        int numRequires;
+        int numExports;
+        int numUses;
+        int numProvides;
+
+        void validate(Builder builder) {
+            assertEquals("requires", numRequires, builder.requires.size(),
+                         () -> builder.requires.stream()
+                                      .map(Module.Dependence::toString));
+            assertEquals("exports", numExports, builder.exports.size(),
+                         () -> builder.exports.entrySet().stream()
+                                      .map(e -> "exports " + e.getKey() + " to " + e.getValue()));
+            assertEquals("uses", numUses, builder.uses.size(),
+                         () -> builder.uses.stream());
+            assertEquals("provides", numProvides,
+                         (int)builder.provides.values().stream()
+                                     .flatMap(s -> s.stream())
+                                     .count(),
+                         () -> builder.provides.entrySet().stream()
+                                      .map(e -> "provides " + e.getKey() + " with " + e.getValue()));
+        }
+
+        private static void assertEquals(String msg, int expected, int got,
+                                         Supplier<Stream<String>> supplier) {
+            if (expected != got){
+                System.err.println("ERROR: mismatched " + msg +
+                        " expected: " + expected + " got: " + got );
+                supplier.get().sorted()
+                        .forEach(System.err::println);
+                throw new AssertionError("mismatched " + msg +
+                        " expected: " + expected + " got: " + got + " ");
+            }
+        }
+    }
+}
--- a/make/src/classes/build/tools/module/boot.modules	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-java.base
-java.compiler
-java.datatransfer
-java.desktop
-java.httpclient
-java.instrument
-java.logging
-java.management
-java.naming
-java.prefs
-java.rmi
-java.scripting
-java.security.jgss
-java.security.sasl
-java.smartcardio
-java.sql
-java.sql.rowset
-java.xml
-java.xml.crypto
-jdk.charsets
-jdk.deploy
-jdk.httpserver
-jdk.jfr
-jdk.jsobject
-jdk.net
-jdk.vm.cds
-jdk.vm.ci
-jdk.management
-jdk.management.cmm
-jdk.management.jfr
-jdk.management.resource
-jdk.naming.rmi
-jdk.sctp
-jdk.security.auth
-jdk.security.jgss
-jdk.snmp
--- a/make/src/classes/build/tools/module/ext.modules	Thu Mar 24 11:21:21 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-java.activation
-java.annotations.common
-java.corba
-java.transaction
-java.xml.bind
-java.xml.ws
-jdk.accessibility
-jdk.crypto.ec
-jdk.crypto.mscapi
-jdk.crypto.pkcs11
-jdk.crypto.ucrypto
-jdk.dynalink
-jdk.localedata
-jdk.naming.dns
-jdk.scripting.nashorn
-jdk.xml.dom
-jdk.zipfs
--- a/src/demo/share/java2d/J2DBench/src/j2dbench/ResultSet.java	Thu Mar 24 11:21:21 2016 +0100
+++ b/src/demo/share/java2d/J2DBench/src/j2dbench/ResultSet.java	Thu Mar 24 16:21:19 2016 +0100
@@ -84,7 +84,6 @@
         "java.util.prefs.PreferencesFactory",
         "sun.java2d.fontpath",
         "sun.boot.library.path",
-        "sun.boot.class.path",
     };
 
     /*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/macosx/classes/module-info.java.extra	Thu Mar 24 16:21:19 2016 +0100
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+exports jdk.internal.loader to java.desktop;
+provides java.security.Provider with apple.security.AppleProvider;
--- a/src/java.base/share/classes/com/sun/java/util/jar/pack/intrinsic.properties	Thu Mar 24 11:21:21 2016 +0100
+++ b/src/java.base/share/classes/com/sun/java/util/jar/pack/intrinsic.properties	Thu Mar 24 16:21:19 2016 +0100
@@ -6,7 +6,7 @@
 # but may be overridden here, if necessary.
 
 # The makefile for this directory must copy this file
-# into the target class hierarchy so it will get into rt.jar.
+# into the target class hierarchy so it will get into runtime image.
 
 # JCOV attributes
 pack.code.attribute.CoverageTable = NH[PHHII]
@@ -14,6 +14,15 @@
 pack.class.attribute.SourceID = RUH
 pack.class.attribute.CompilationID = RUH
 
+# Module attributes, supported by the tool and not JSR-200
+pack.class.attribute.Module = NH[RUHFH]NH[RUHNH[RUH]]NH[RCH]NH[RCHRCH]
+pack.class.attribute.ConcealedPackages = NH[RUH]
+pack.class.attribute.Version = RUH
+pack.class.attribute.MainClass = RUH
+pack.class.attribute.TargetPlatform = RUHRUHRUH
+pack.class.attribute.Hashes = RUHNH[RUHRUH]
+
+
 # Note:  Zero-length ("marker") attributes do not need to be specified here.
 # They are automatically defined to have an empty layout.
 #pack.class.attribute.Deprecated =
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java	Thu Mar 24 11:21:21 2016 +0100
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java	Thu Mar 24 16:21:19 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, 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
@@ -36,7 +36,7 @@
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import java.util.Arrays;
-import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import static java.io.ObjectStreamClass.processQueue;
@@ -212,20 +212,20 @@
     /** marker for unshared objects in internal handle table */
     private static final Object unsharedMarker = new Object();
 
-    /** table mapping primitive type names to corresponding class objects */
-    private static final HashMap<String, Class<?>> primClasses
-        = new HashMap<>(8, 1.0F);
-    static {
-        primClasses.put("boolean", boolean.class);
-        primClasses.put("byte", byte.class);
-        primClasses.put("char", char.class);
-        primClasses.put("short", short.class);
-        primClasses.put("int", int.class);
-        primClasses.put("long", long.class);
-        primClasses.put("float", float.class);
-        primClasses.put("double", double.class);
-        primClasses.put("void", void.class);
-    }
+    /**
+     * immutable table mapping primitive type names to corresponding
+     * class objects
+     */
+    private static final Map<String, Class<?>> primClasses =
+        Map.of("boolean", boolean.class,
+               "byte", byte.class,
+               "char", char.class,
+               "short", short.class,
+               "int", int.class,
+               "long", long.class,
+               "float", float.class,
+               "double", double.class,
+               "void", void.class);
 
     private static class Caches {
         /** cache of subclass security audit results */
@@ -713,9 +713,11 @@
             classObjs[i] = cl;
         }
         try {
-            return Proxy.getProxyClass(
+            @SuppressWarnings("deprecation")
+            Class<?> proxyClass = Proxy.getProxyClass(
                 hasNonPublicInterface ? nonPublicLoader : latestLoader,
                 classObjs);
+            return proxyClass;
         } catch (IllegalArgumentException e) {
             throw new ClassNotFoundException(null, e);
         }
--- a/src/java.base/share/classes/java/lang/Class.java	Thu Mar 24 11:21:21 2016 +0100
+++ b/src/java.base/share/classes/java/lang/Class.java	Thu Mar 24 16:21:19 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2016, 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
@@ -25,6 +25,8 @@
 
 package java.lang;
 
+import java.lang.annotation.Annotation;
+import java.lang.module.ModuleReader;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Array;
 import java.lang.reflect.GenericArrayType;
@@ -33,15 +35,19 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
+import java.lang.reflect.Module;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.AnnotatedType;
+import java.lang.reflect.Proxy;
 import java.lang.ref.SoftReference;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectStreamField;
+import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
@@ -55,9 +61,11 @@
 import java.util.HashMap;
 import java.util.Objects;
 import java.util.StringJoiner;
+import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.loader.BootLoader;
+import jdk.internal.loader.BuiltinClassLoader;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.misc.VM;
-import jdk.internal.HotSpotIntrinsicCandidate;
 import sun.reflect.CallerSensitive;
 import sun.reflect.ConstantPool;
 import sun.reflect.Reflection;
@@ -69,8 +77,6 @@
 import sun.reflect.generics.repository.ConstructorRepository;
 import sun.reflect.generics.scope.ClassScope;
 import sun.security.util.SecurityConstants;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Proxy;
 import sun.reflect.annotation.*;
 import sun.reflect.misc.ReflectUtil;
 
@@ -378,6 +384,86 @@