changeset 7608:0fae4dd88557

Merge
author duke
date Wed, 05 Jul 2017 17:30:26 +0200
parents 06df97f9d413 69cc9eb2cdf7
children 1cdc1b4b6855
files hotspot/make/linux/makefiles/makedeps.make hotspot/make/solaris/makefiles/makedeps.make hotspot/make/windows/README hotspot/make/windows/makefiles/makedeps.make hotspot/src/os/linux/launcher/java.c hotspot/src/os/linux/launcher/java.h hotspot/src/os/linux/launcher/java_md.c hotspot/src/os/linux/launcher/java_md.h hotspot/src/os/linux/vm/hpi_linux.cpp hotspot/src/os/linux/vm/hpi_linux.hpp hotspot/src/os/solaris/launcher/java.c hotspot/src/os/solaris/launcher/java.h hotspot/src/os/solaris/launcher/java_md.c hotspot/src/os/solaris/launcher/java_md.h hotspot/src/os/solaris/vm/hpi_solaris.cpp hotspot/src/os/solaris/vm/hpi_solaris.hpp hotspot/src/os/windows/vm/hpi_windows.cpp hotspot/src/os/windows/vm/hpi_windows.hpp hotspot/src/share/tools/MakeDeps/ArgsParser.java hotspot/src/share/tools/MakeDeps/BuildConfig.java hotspot/src/share/tools/MakeDeps/Database.java hotspot/src/share/tools/MakeDeps/DirectoryTree.java hotspot/src/share/tools/MakeDeps/DirectoryTreeNode.java hotspot/src/share/tools/MakeDeps/FileFormatException.java hotspot/src/share/tools/MakeDeps/FileList.java hotspot/src/share/tools/MakeDeps/FileName.java hotspot/src/share/tools/MakeDeps/Macro.java hotspot/src/share/tools/MakeDeps/MacroDefinitions.java hotspot/src/share/tools/MakeDeps/MakeDeps.java hotspot/src/share/tools/MakeDeps/MetroWerksMacPlatform.java hotspot/src/share/tools/MakeDeps/Platform.java hotspot/src/share/tools/MakeDeps/UnixPlatform.java hotspot/src/share/tools/MakeDeps/Util.java hotspot/src/share/tools/MakeDeps/WinGammaPlatform.java hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC6.java hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC8.java hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC9.java hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge hotspot/src/share/vm/gc_implementation/includeDB_gc_serial hotspot/src/share/vm/gc_implementation/includeDB_gc_shared hotspot/src/share/vm/includeDB_compiler1 hotspot/src/share/vm/includeDB_compiler2 hotspot/src/share/vm/includeDB_core hotspot/src/share/vm/includeDB_features hotspot/src/share/vm/includeDB_gc hotspot/src/share/vm/includeDB_gc_parallel hotspot/src/share/vm/includeDB_jvmti hotspot/src/share/vm/includeDB_shark hotspot/src/share/vm/includeDB_zero hotspot/src/share/vm/prims/hpi_imported.h hotspot/src/share/vm/runtime/hpi.cpp hotspot/src/share/vm/runtime/hpi.hpp jdk/src/share/classes/java/dyn/BootstrapMethod.java jdk/src/share/classes/java/dyn/LinkagePermission.java jdk/src/share/classes/java/dyn/MethodHandleProvider.java jdk/src/share/classes/sun/dyn/JavaMethodHandle.java jdk/src/share/demo/nio/zipfs/META-INF/services/java.nio.file.spi.FileSystemProvider jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/JarFileSystemProvider.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipCoder.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipConstants.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipDirectoryStream.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributeView.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileAttributes.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileStore.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystem.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipFileSystemProvider.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipInfo.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipPath.java jdk/src/share/demo/nio/zipfs/com/sun/nio/zipfs/ZipUtils.java jdk/src/share/native/sun/font/layout/HebrewLigatureData.cpp jdk/src/share/native/sun/font/layout/HebrewShaping.cpp jdk/src/share/native/sun/font/layout/HebrewShaping.h jdk/test/java/dyn/JavaDocExamples.java
diffstat 2111 files changed, 63449 insertions(+), 42256 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags-top-repo	Mon Dec 20 17:19:42 2010 -0800
+++ b/.hgtags-top-repo	Wed Jul 05 17:30:26 2017 +0200
@@ -96,3 +96,4 @@
 661360bef6ccad6c119f067f5829b207de80c936 jdk7-b119
 366ff0b6d2151595629806b033e2e1497e3a55d4 jdk7-b120
 2c2d4f88637b488014c37e1a2eb401f68bca8838 jdk7-b121
+f1591eed71f64f6eba79fb7426f5616cc4dfea73 jdk7-b122
--- a/README	Mon Dec 20 17:19:42 2010 -0800
+++ b/README	Wed Jul 05 17:30:26 2017 +0200
@@ -26,6 +26,6 @@
        gnumake all
      The resulting JDK image should be found in build/*/j2sdk-image
 
-where gnumake is GNU make 3.78.1 or newer, /usr/bin/make on Linux and
+where gnumake is GNU make 3.81 or newer, /usr/bin/make on Linux and
 /usr/sfw/bin/gmake or /opt/sfw/bin/gmake on Solaris.
 
--- a/README-builds.html	Mon Dec 20 17:19:42 2010 -0800
+++ b/README-builds.html	Wed Jul 05 17:30:26 2017 +0200
@@ -524,7 +524,7 @@
             A few notes about using GNU make:
             <ul>
                 <li>
-                    In general, you need GNU make version 3.78.1 or newer.
+                    In general, you need GNU make version 3.81 or newer.
                 </li>
                 <li>
                     Place the location of the GNU make binary in the <tt>PATH</tt>. 
--- a/corba/.hgtags	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/.hgtags	Wed Jul 05 17:30:26 2017 +0200
@@ -96,3 +96,4 @@
 39829414ae31a0080578a49b751899edd518cd7d jdk7-b119
 cff5a173ec1e89013359e804a3e31736ef6fb462 jdk7-b120
 2cc9f32992101732b23730b737740e64ebc5fa89 jdk7-b121
+1523a060032c8a5b7840198da8911abeff88118f jdk7-b122
--- a/corba/make/common/shared/Platform.gmk	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/make/common/shared/Platform.gmk	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -383,7 +383,7 @@
 
 REQUIRED_ZIP_VER = 2.2
 REQUIRED_UNZIP_VER = 5.12
-REQUIRED_MAKE_VER = 3.78
+REQUIRED_MAKE_VER = 3.81
 
 # Unix type settings (same for all unix platforms)
 ifneq ($(PLATFORM), windows)
--- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerWriteStream.java	Wed Jul 05 17:30:26 2017 +0200
@@ -30,12 +30,14 @@
 import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
 import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
 import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage;
+import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
 import com.sun.corba.se.impl.encoding.BufferManagerWrite;
 import com.sun.corba.se.impl.encoding.ByteBufferWithInfo;
 import com.sun.corba.se.impl.encoding.CDROutputObject;
 import com.sun.corba.se.spi.orb.ORB;
 import com.sun.corba.se.pept.transport.Connection;
 import com.sun.corba.se.pept.encoding.OutputObject;
+import org.omg.CORBA.SystemException;
 
 /**
  * Streaming buffer manager.
@@ -66,7 +68,13 @@
         // Set the fragment's moreFragments field to true
         MessageBase.setFlag(bbwi.byteBuffer, Message.MORE_FRAGMENTS_BIT);
 
-        sendFragment(false);
+        try {
+           sendFragment(false);
+        } catch(SystemException se){
+                orb.getPIHandler().invokeClientPIEndingPoint(
+                        ReplyMessage.SYSTEM_EXCEPTION, se);
+                throw se;
+        }
 
         // Reuse the old buffer
 
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java	Wed Jul 05 17:30:26 2017 +0200
@@ -85,6 +85,9 @@
 
     private static Hashtable translatedFields;
 
+    /** true if represents enum type */
+    private boolean isEnum;
+
     private static final Bridge bridge =
         (Bridge)AccessController.doPrivileged(
             new PrivilegedAction() {
@@ -359,6 +362,7 @@
         }
 
         name = cl.getName();
+        isEnum = Enum.class.isAssignableFrom(cl);
         superclass = superdesc;
         serializable = serial;
         if (!forProxyClass) {
@@ -401,7 +405,8 @@
         if (!serializable ||
             externalizable ||
             forProxyClass ||
-            name.equals("java.lang.String")) {
+            name.equals("java.lang.String") ||
+            isEnum) {
             fields = NO_FIELDS;
         } else if (serializable) {
             /* Ask for permission to override field access checks.
@@ -502,7 +507,7 @@
          *
          * NonSerializable classes have a serialVerisonUID of 0L.
          */
-         if (isNonSerializable()) {
+         if (isNonSerializable() || isEnum) {
              suid = 0L;
          } else {
              // Lookup special Serializable members using reflection.
--- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/AOMEntry.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,10 @@
 import com.sun.corba.se.impl.orbutil.concurrent.Mutex ;
 import com.sun.corba.se.impl.orbutil.concurrent.CondVar ;
 
+import org.omg.CORBA.SystemException ;
+
+import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ;
+
 /** AOMEntry represents a Servant or potential Servant in the ActiveObjectMap.
 * It may be in several states to allow for long incarnate or etherealize operations.
 * The methods on this class mostly represent input symbols to the state machine
@@ -121,6 +125,12 @@
         }
     } ;
 
+    private static Action oaaAction = new ActionBase( "throwObjectAlreadyActive" ) {
+         public void doIt( FSM fsm, Input in ) {
+             throw new RuntimeException( new ObjectAlreadyActive() ) ;
+         }
+    } ;
+
     private static Guard waitGuard = new GuardBase( "wait" ) {
         public Guard.Result evaluate( FSM fsm, Input in ) {
             AOMEntry entry = (AOMEntry)fsm ;
@@ -173,19 +183,23 @@
         engine.add( INCARN,  START_ETH, waitGuard,              null,               INCARN      ) ;
         engine.add( INCARN,  INC_DONE,                          null,               VALID       ) ;
         engine.add( INCARN,  INC_FAIL,                          decrementAction,    INVALID     ) ;
+        engine.add( INCARN,  ACTIVATE,                          oaaAction,          INCARN      ) ;
 
         engine.add( VALID,   ENTER,                             incrementAction,    VALID       ) ;
         engine.add( VALID,   EXIT,                              decrementAction,    VALID       ) ;
         engine.add( VALID,   START_ETH, greaterZeroGuard,       null,               ETHP        ) ;
         engine.add( VALID,   START_ETH, zeroGuard,              null,               ETH         ) ;
+        engine.add( VALID,   ACTIVATE,                          oaaAction,          VALID       ) ;
 
         engine.add( ETHP,    ENTER,     waitGuard,              null,               ETHP        ) ;
         engine.add( ETHP,    START_ETH,                         null,               ETHP        ) ;
         engine.add( ETHP,    EXIT,      greaterOneGuard,        decrementAction,    ETHP        ) ;
         engine.add( ETHP,    EXIT,      oneGuard,               decrementAction,    ETH         ) ;
+        engine.add( ETHP,    ACTIVATE,                          oaaAction,          ETHP        ) ;
 
         engine.add( ETH,     START_ETH,                         null,               ETH         ) ;
         engine.add( ETH,     ETH_DONE,                          null,               DESTROYED   ) ;
+        engine.add( ETH,     ACTIVATE,                          oaaAction,          ETH         ) ;
         engine.add( ETH,     ENTER,     waitGuard,              null,               ETH         ) ;
 
         engine.setDefault( DESTROYED, throwIllegalStateExceptionAction, DESTROYED ) ;
@@ -217,7 +231,17 @@
     public void etherealizeComplete() { doIt( ETH_DONE ) ; }
     public void incarnateComplete() { doIt( INC_DONE ) ; }
     public void incarnateFailure() { doIt( INC_FAIL ) ; }
-    public void activateObject() { doIt( ACTIVATE ) ; }
+    public void activateObject() throws ObjectAlreadyActive {
+         try {
+             doIt( ACTIVATE ) ;
+         } catch (RuntimeException exc) {
+             Throwable thr = exc.getCause() ;
+             if (thr instanceof ObjectAlreadyActive)
+                 throw (ObjectAlreadyActive)thr ;
+             else
+                 throw exc ;
+         }
+    }
     public void enter() { doIt( ENTER ) ; }
     public void exit() { doIt( EXIT ) ; }
 }
--- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAPolicyMediatorBase_R.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -107,13 +107,9 @@
             throw new ServantAlreadyActive();
         ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ;
 
-        // Note that this can't happen for system assigned IDs since the
-        // POA never hands out the same ID.  However, we make this redundant
-        // check here to share the code.
-        if (activeObjectMap.containsKey(key))
-            throw new ObjectAlreadyActive() ;
+        AOMEntry entry = activeObjectMap.get( key ) ;
 
-        AOMEntry entry = activeObjectMap.get( key ) ;
+        // Check for an ObjectAlreadyActive error
         entry.activateObject() ;
         activateServant( key, entry, servant ) ;
     }
--- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -245,7 +245,14 @@
     // All access to resolver, localResolver, and urlOperation must be protected using
     // resolverLock.  Do not hold the ORBImpl lock while accessing
     // resolver, or deadlocks may occur.
-    private Object resolverLock ;
+    // Note that we now have separate locks for each resolver type.  This is due
+    // to bug 6980681 and 6238477, which was caused by a deadlock while resolving a
+    // corbaname: URL that contained a reference to the same ORB as the
+    // ORB making the call to string_to_object.  This caused a deadlock between the
+    // client thread holding the single lock for access to the urlOperation,
+    // and the server thread handling the client is_a request waiting on the
+    // same lock to access the localResolver.
+
 
     // Used for resolver_initial_references and list_initial_services
     private Resolver resolver ;
@@ -255,8 +262,14 @@
 
     // Converts strings to object references for resolvers and string_to_object
     private Operation urlOperation ;
+    private final Object urlOperationLock = new java.lang.Object() ;
 
     private CorbaServerRequestDispatcher insNamingDelegate ;
+    // resolverLock must be used for all access to either resolver or
+    // localResolver, since it is possible for the resolver to indirectly
+    // refer to the localResolver.  Also used to protect access to
+    // insNamingDelegate.
+    private final Object resolverLock = new Object() ;
 
     private TaggedComponentFactoryFinder taggedComponentFactoryFinder ;
 
@@ -396,7 +409,6 @@
             }
         };
 
-        resolverLock = new java.lang.Object() ;
 
         requestDispatcherRegistry = new RequestDispatcherRegistryImpl(
             this, ORBConstants.DEFAULT_SCID);
@@ -832,7 +844,7 @@
         if (str == null)
             throw wrapper.nullParam() ;
 
-        synchronized (resolverLock) {
+        synchronized (urlOperationLock) {
             org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
             return obj ;
         }
@@ -1778,7 +1790,7 @@
      */
     public void setURLOperation( Operation stringToObject )
     {
-        synchronized (resolverLock) {
+        synchronized (urlOperationLock) {
             urlOperation = stringToObject ;
         }
     }
@@ -1788,7 +1800,7 @@
      */
     public Operation getURLOperation()
     {
-        synchronized (resolverLock) {
+        synchronized (urlOperationLock) {
             return urlOperation ;
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties	Wed Jul 05 17:30:26 2017 +0200
@@ -0,0 +1,107 @@
+
+# Copyright (c) 2001, 2005, 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.
+#
+
+orbd.usage=Uso: {0} <options> \n\nem que <options> inclui:\n  -port                  porta de ativa\u00e7\u00e3o na qual o ORBD deve ser iniciado, padr\u00e3o 1049 (opcional)\n  -defaultdb             diret\u00f3rio dos arquivos ORBD, padr\u00e3o "./orb.db" (opcional)\n  -serverid              id do servidor para ORBD, padr\u00e3o 1 (opcional)\n  -ORBInitialPort        porta inicial (necess\u00e1rio)\n  -ORBInitialHost        nome de host inicial (necess\u00e1rio)\n
+
+servertool.usage=Uso: {0} <options> \n\nem que <options> inclui:\n  -ORBInitialPort        porta inicial (necess\u00e1rio)\n  -ORBInitialHost        nome de host inicial (necess\u00e1rio)\n
+servertool.banner=\n\nBem-vindo a ferramenta de servidor IDL Java \ninsira os comandos no prompt \n
+servertool.shorthelp=\n\n\tComandos dispon\u00edveis: \n\t------------------- \n
+servertool.baddef=Servidor mal definido: {0}
+servertool.nosuchserver=\tservidor n\u00e3o encontrado.
+servertool.helddown=\to servidor est\u00e1 em espera.
+servertool.nosuchorb=\tORB inv\u00e1lido.
+servertool.serverup=\to servidor j\u00e1 est\u00e1 ativo.
+servertool.appname=\tapplicationName     - {0}
+servertool.name=\tname      - {0}
+servertool.classpath=\tclasspath - {0}
+servertool.args=\targs      - {0}
+servertool.vmargs=\tvmargs    - {0}
+servertool.serverid=\tserver id - {0}
+servertool.servernotrunning=\to servidor n\u00e3o est\u00e1 em execu\u00e7\u00e3o.
+servertool.register=\n\n\tregister -server <server class name> \n\t         -applicationName <alternate server name> \n\t         -classpath <classpath to server> \n\t         -args <args to server> \n\t         -vmargs <args to server Java VM>\n
+servertool.register1=registra um servidor ativ\u00e1vel
+servertool.register2=\tservidor registrado (serverid = {0}).
+servertool.register3=\tservidor registrado, mas em espera (serverid = {0}).
+servertool.register4=\tservidor j\u00e1 registrado (serverid = {0}).
+
+servertool.unregister=\n\tunregister [ -serverid <server id> | -applicationName <name> ] \n
+servertool.unregister1=cancela o registro de um servidor registrado
+servertool.unregister2=\tservidor n\u00e3o registrado.
+
+servertool.locate=\n\tlocate [ -serverid <server id> | -applicationName <name> ] [ <-endpointType <endpointType> ] \n
+servertool.locate1=localiza portas de tipo espec\u00edfico para um servidor registrado
+servertool.locate2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t---------\t\t------\n
+servertool.locateorb=\n\tlocateperorb [ -serverid <server id> | -applicationName <name> ] [ -orbid <ORB name> ]\n
+servertool.locateorb1=localiza portas para um orb espec\u00edfico de servidor registrado
+servertool.locateorb2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t--------\t\t------\n
+servertool.getserverid=\n\tgetserverid [ -applicationName <name> ] \n
+servertool.getserverid1=retorna o id do servidor de um applicationName
+servertool.getserverid2=\tID do servidor de applicationName {0} \u00e9 {1}
+
+servertool.list=\n\tlist\n
+servertool.list1=lista todos os servidores registrados
+servertool.list2=\n\tId do servidor\tNome de classe do servidor\t\tAplicativo do servidor\n\t---------\t-----------------\t\t------------------\n
+servertool.listactive=\n\tlistactive
+servertool.listactive1=lista os servidores atualmente ativos
+servertool.listappnames=\tlistappnames\n
+servertool.listappnames1=lista os applicationNames atualmente definidos
+servertool.listappnames2=applicationNames do servidor atualmente definidos:
+
+servertool.shutdown=\n\tshutdown [ -serverid <server id> | -applicationName <name> ]\n
+servertool.shutdown1=desliga um servidor registrado
+servertool.shutdown2=\tservidor desligado com \u00eaxito.
+servertool.startserver=\n\tstartup [ -serverid <server id> | -applicationName <name> ]\n
+servertool.startserver1=inicia um servidor registrado
+servertool.startserver2=\tservidor iniciado com \u00eaxito.
+
+servertool.quit=\n\tquit\n
+servertool.quit1=sai desta ferramenta
+
+servertool.help=\thelp\n\tOR\n\thelp <command name>\n
+servertool.help1=obt\u00e9m ajuda
+
+servertool.orbidmap=\tUso: orblist [ -serverid <server id> | -applicationName <name> ]\n
+servertool.orbidmap1=lista de nomes de orb e seus mapeamentos
+servertool.orbidmap2=\n\tId de ORB\t\tNome de ORB\n\t------\t\t--------\n
+pnameserv.success=NameServer persistente iniciado com \u00eaxito
+
+
+bootstrap.usage=Uso: {0} <options> \n\nem que <options> inclui:\n  -ORBInitialPort        porta inicial (necess\u00e1rio)\n  -InitialServicesFile   arquivo que cont\u00e9m a lista de servi\u00e7os iniciais (necess\u00e1rio)\n
+bootstrap.success=configurando porta para {0} e lendo servi\u00e7os de {1}
+bootstrap.filenotreadable=o arquivo {0} n\u00e3o \u00e9 leg\u00edvel
+bootstrap.filenotfound=arquivo {0} n\u00e3o encontrado
+bootstrap.exception=exce\u00e7\u00e3o capturada ao salvar as propriedades no arquivo {0}: Exce\u00e7\u00e3o {1}
+
+tnameserv.exception=uma exce\u00e7\u00e3o capturada ao iniciar o servi\u00e7o de inicializa\u00e7\u00e3o na porta {0}
+tnameserv.usage=tente usar outra porta com os argumentos de linha de comando -ORBInitialPort <portno>
+tnameserv.invalidhostoption=ORBInitialHost n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService
+tnameserv.orbinitialport0=ORBInitialPort 0 n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService
+tnameserv.hs1=Contexto de nomea\u00e7\u00e3o inicial:\n{0}
+tnameserv.hs2=TransientNameServer: definindo porta para as refer\u00eancias de objeto iniciais: {0}
+tnameserv.hs3=Pronto.
+
+orbd.commfailure=\nFalha ao iniciar ORBD porque ORBinitialPort j\u00e1 est\u00e1 em uso
+orbd.internalexception=\nFalha ao iniciar ORBD devido a uma exce\u00e7\u00e3o interna. \nPoss\u00edveis causas: \n1. ORBInitialPort especificado ou ORBActivationPort j\u00e1 em uso \n2. Sem permiss\u00e3o de grava\u00e7\u00e3o para gravar orb.db 
+
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,9 +122,6 @@
     implements
         ClientRequestDispatcher
 {
-    // Used for locking
-    private Object lock = new Object();
-
     public OutputObject beginRequest(Object self, String opName,
                                      boolean isOneWay, ContactInfo contactInfo)
     {
@@ -151,7 +148,8 @@
 
         // This locking is done so that multiple connections are not created
         // for the same endpoint
-        synchronized (lock) {
+        //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints
+        synchronized (contactInfo) {
             if (contactInfo.isConnectionBased()) {
                 if (contactInfo.shouldCacheConnection()) {
                     connection = (CorbaConnection)
@@ -256,7 +254,7 @@
         registerWaiter(messageMediator);
 
         // Do connection reclaim now
-        synchronized (lock) {
+        synchronized (contactInfo) {
             if (contactInfo.isConnectionBased()) {
                 if (contactInfo.shouldCacheConnection()) {
                     OutboundConnectionCache connectionCache =
@@ -387,11 +385,15 @@
             boolean retry  =
                 getContactInfoListIterator(orb)
                     .reportException(messageMediator.getContactInfo(), e);
+
+            //Bug 6382377: must not lose exception in PI
+
+            // Must run interceptor end point before retrying.
+            Exception newException =
+                    orb.getPIHandler().invokeClientPIEndingPoint(
+                    ReplyMessage.SYSTEM_EXCEPTION, e);
+
             if (retry) {
-                // Must run interceptor end point before retrying.
-                Exception newException =
-                    orb.getPIHandler().invokeClientPIEndingPoint(
-                        ReplyMessage.SYSTEM_EXCEPTION, e);
                 if (newException == e) {
                     continueOrThrowSystemOrRemarshal(messageMediator,
                                                      new RemarshalException());
@@ -400,6 +402,14 @@
                                                      newException);
                 }
             } else {
+                if (newException instanceof RuntimeException){
+                    throw (RuntimeException)newException;
+                }
+                else if (newException instanceof RemarshalException)
+                {
+                    throw (RemarshalException)newException;
+                }
+
                 // NOTE: Interceptor ending point will run in releaseReply.
                 throw e;
             }
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 
 import com.sun.corba.se.spi.logging.CORBALogDomains;
 import com.sun.corba.se.spi.orb.ORB;
+import com.sun.corba.se.spi.transport.CorbaConnection;
 import com.sun.corba.se.spi.transport.CorbaConnectionCache;
 
 import com.sun.corba.se.impl.logging.ORBUtilSystemException;
@@ -87,6 +88,14 @@
         }
     }
 
+    public void close() {
+        synchronized (backingStore()) {
+            for (Object obj : values()) {
+                ((CorbaConnection)obj).closeConnectionResources() ;
+            }
+        }
+    }
+
     public long numberOfIdleConnections()
     {
         long count = 0;
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaTransportManagerImpl.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,7 @@
 import org.omg.CORBA.CompletionStatus;
 
 import com.sun.corba.se.pept.transport.Acceptor;
+import com.sun.corba.se.pept.transport.ConnectionCache;
 import com.sun.corba.se.pept.transport.ByteBufferPool;
 import com.sun.corba.se.pept.transport.ContactInfo;
 import com.sun.corba.se.pept.transport.InboundConnectionCache;
@@ -49,6 +50,8 @@
 import com.sun.corba.se.spi.orb.ORB;
 import com.sun.corba.se.spi.transport.CorbaAcceptor;
 import com.sun.corba.se.spi.transport.CorbaTransportManager;
+import com.sun.corba.se.pept.transport.Connection;
+import com.sun.corba.se.pept.transport.ConnectionCache;
 
 // REVISIT - impl/poa specific:
 import com.sun.corba.se.impl.oa.poa.Policies;
@@ -182,6 +185,12 @@
             if (orb.transportDebugFlag) {
                 dprint(".close->");
             }
+            for (Object cc : outboundConnectionCaches.values()) {
+                ((ConnectionCache)cc).close() ;
+            }
+            for (Object cc : inboundConnectionCaches.values()) {
+                ((ConnectionCache)cc).close() ;
+            }
             getSelector(0).close();
         } finally {
             if (orb.transportDebugFlag) {
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 import java.nio.channels.Selector;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Iterator;
 import java.util.List;
 
@@ -66,7 +67,7 @@
     private List deferredRegistrations;
     private List interestOpsList;
     private HashMap listenerThreads;
-    private HashMap readerThreads;
+    private Map readerThreads;
     private boolean selectorStarted;
     private boolean closed;
     private ORBUtilSystemException wrapper ;
@@ -81,7 +82,7 @@
         deferredRegistrations = new ArrayList();
         interestOpsList = new ArrayList();
         listenerThreads = new HashMap();
-        readerThreads = new HashMap();
+        readerThreads = java.util.Collections.synchronizedMap(new HashMap());
         closed = false;
         wrapper = ORBUtilSystemException.get(orb,CORBALogDomains.RPC_TRANSPORT);
     }
@@ -178,8 +179,13 @@
         }
 
         if (eventHandler.shouldUseSelectThreadToWait()) {
-            SelectionKey selectionKey = eventHandler.getSelectionKey();
-            selectionKey.cancel();
+            SelectionKey selectionKey ;
+            synchronized(deferredRegistrations) {
+                selectionKey = eventHandler.getSelectionKey();
+            }
+            if (selectionKey != null) {
+                selectionKey.cancel();
+            }
             selector.wakeup();
             return;
         }
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java	Wed Jul 05 17:30:26 2017 +0200
@@ -811,6 +811,7 @@
                     dprint(".close: " + this, e);
                 }
             }
+            closeConnectionResources();
         } finally {
             if (orb.transportDebugFlag) {
                 dprint(".close<-: " + this);
@@ -818,6 +819,28 @@
         }
     }
 
+    public void closeConnectionResources() {
+           if (orb.transportDebugFlag) {
+               dprint(".closeConnectionResources->: " + this);
+           }
+           Selector selector = orb.getTransportManager().getSelector(0);
+           selector.unregisterForEvent(this);
+           try {
+             if (socketChannel != null)
+              socketChannel.close() ;
+                if (socket != null && !socket.isClosed())
+                socket.close() ;
+           } catch (IOException e) {
+             if (orb.transportDebugFlag) {
+                 dprint( ".closeConnectionResources: " + this, e ) ;
+             }
+           }
+           if (orb.transportDebugFlag) {
+               dprint(".closeConnectionResources<-: " + this);
+           }
+     }
+
+
     public Acceptor getAcceptor()
     {
         return acceptor;
--- a/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/pept/transport/ConnectionCache.java	Wed Jul 05 17:30:26 2017 +0200
@@ -41,6 +41,12 @@
     public long numberOfBusyConnections();
 
     public boolean reclaim();
+
+    /** Close all connections in the connection cache.
+     * This is used as a final cleanup, and will result
+     * in abrupt termination of any pending communications.
+     */
+    public void close();
 }
 
 // End of file.
--- a/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java	Wed Jul 05 17:30:26 2017 +0200
@@ -163,6 +163,10 @@
     // REVISIT - MessageMediator parameter?
     public void serverRequestProcessingBegins();
     public void serverRequestProcessingEnds();
+
+    /** Clean up all connection resources.  Used when shutting down an ORB.
+     */
+    public void closeConnectionResources();
 }
 
 // End of file.
--- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Stub.java	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -344,17 +344,27 @@
     stream.println ("     String str = s.readUTF ();");
     stream.println ("     String[] args = null;");
     stream.println ("     java.util.Properties props = null;");
-    stream.println ("     org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);");
+    stream.println ("     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);");
+    stream.println ("   try {");
+    stream.println ("     org.omg.CORBA.Object obj = orb.string_to_object (str);");
     stream.println ("     org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();");
     stream.println ("     _set_delegate (delegate);");
+    stream.println ("   } finally {");
+    stream.println ("     orb.destroy() ;");
+    stream.println ("   }");
     stream.println ("  }");
     stream.println ();
     stream.println ("  private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException");
     stream.println ("  {");
     stream.println ("     String[] args = null;");
     stream.println ("     java.util.Properties props = null;");
-    stream.println ("     String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);");
+    stream.println ("     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);");
+    stream.println ("   try {");
+    stream.println ("     String str = orb.object_to_string (this);");
     stream.println ("     s.writeUTF (str);");
+    stream.println ("   } finally {");
+    stream.println ("     orb.destroy() ;");
+    stream.println ("   }");
     stream.println ("  }");
   }
 
--- a/hotspot/.hgtags	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/.hgtags	Wed Jul 05 17:30:26 2017 +0200
@@ -134,3 +134,5 @@
 5484e7c53fa7da5e869902437ee08a9ae10c1c69 jdk7-b119
 f5603a6e50422046ebc0d2f1671d55cb8f1bf1e9 jdk7-b120
 3f3653ab7af8dc1ddb9fa75dad56bf94f89e81a8 jdk7-b121
+3a548dc9cb456110ca8fc1514441a8c3bda0014d jdk7-b122
+5484e7c53fa7da5e869902437ee08a9ae10c1c69 hs20-b03
--- a/hotspot/agent/src/os/linux/ps_proc.c	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/agent/src/os/linux/ps_proc.c	Wed Jul 05 17:30:26 2017 +0200
@@ -121,15 +121,13 @@
 #define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, data, addr)
 #endif
 
-#ifdef _LP64
-#ifdef PTRACE_GETREGS64
+#if defined(_LP64) && defined(PTRACE_GETREGS64)
 #define PTRACE_GETREGS_REQ PTRACE_GETREGS64
+#elif defined(PTRACE_GETREGS)
+#define PTRACE_GETREGS_REQ PTRACE_GETREGS
+#elif defined(PT_GETREGS)
+#define PTRACE_GETREGS_REQ PT_GETREGS
 #endif
-#else
-#if defined(PTRACE_GETREGS) || defined(PT_GETREGS)
-#define PTRACE_GETREGS_REQ PTRACE_GETREGS
-#endif
-#endif /* _LP64 */
 
 #ifdef PTRACE_GETREGS_REQ
  if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Wed Jul 05 17:30:26 2017 +0200
@@ -60,10 +60,7 @@
     headerSize  = type.getSize();
     elementSize = 0;
     // fetch constants:
-    MULTI_OPERAND_COUNT_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_multi_operand_count_offset").intValue();
-    MULTI_OPERAND_BASE_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_multi_operand_base_offset").intValue();
     INDY_BSM_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_bsm_offset").intValue();
-    INDY_NT_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_nt_offset").intValue();
     INDY_ARGC_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argc_offset").intValue();
     INDY_ARGV_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argv_offset").intValue();
   }
@@ -83,10 +80,7 @@
   private static long headerSize;
   private static long elementSize;
 
-  private static int MULTI_OPERAND_COUNT_OFFSET;
-  private static int MULTI_OPERAND_BASE_OFFSET;
   private static int INDY_BSM_OFFSET;
-  private static int INDY_NT_OFFSET;
   private static int INDY_ARGC_OFFSET;
   private static int INDY_ARGV_OFFSET;
 
@@ -296,20 +290,23 @@
   }
 
   /** Lookup for multi-operand (InvokeDynamic) entries. */
-  public int[] getMultiOperandsAt(int i) {
+  public short[] getBootstrapSpecifierAt(int i) {
     if (Assert.ASSERTS_ENABLED) {
       Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool");
     }
-    int pos = this.getIntAt(i);
-    int countPos = pos + MULTI_OPERAND_COUNT_OFFSET;  // == pos-1
-    int basePos  = pos + MULTI_OPERAND_BASE_OFFSET;   // == pos
-    if (countPos < 0)  return null;  // safety first
+    if (getTagAt(i).value() == JVM_CONSTANT_InvokeDynamicTrans)
+        return null;
+    int bsmSpec = extractLowShortFromInt(this.getIntAt(i));
     TypeArray operands = getOperands();
     if (operands == null)  return null;  // safety first
-    int length = operands.getIntAt(countPos);
-    int[] values = new int[length];
-    for (int j = 0; j < length; j++) {
-        values[j] = operands.getIntAt(basePos+j);
+    int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0),
+                                                operands.getShortAt(bsmSpec * 2 + 1));
+    int argv = basePos + INDY_ARGV_OFFSET;
+    int argc = operands.getShortAt(basePos + INDY_ARGC_OFFSET);
+    int endPos = argv + argc;
+    short[] values = new short[endPos - basePos];
+    for (int j = 0; j < values.length; j++) {
+        values[j] = operands.getShortAt(basePos+j);
     }
     return values;
   }
@@ -334,6 +331,7 @@
     case JVM_CONSTANT_MethodHandle:       return "JVM_CONSTANT_MethodHandle";
     case JVM_CONSTANT_MethodType:         return "JVM_CONSTANT_MethodType";
     case JVM_CONSTANT_InvokeDynamic:      return "JVM_CONSTANT_InvokeDynamic";
+    case JVM_CONSTANT_InvokeDynamicTrans: return "JVM_CONSTANT_InvokeDynamic/transitional";
     case JVM_CONSTANT_Invalid:            return "JVM_CONSTANT_Invalid";
     case JVM_CONSTANT_UnresolvedClass:    return "JVM_CONSTANT_UnresolvedClass";
     case JVM_CONSTANT_UnresolvedClassInError:    return "JVM_CONSTANT_UnresolvedClassInError";
@@ -393,6 +391,7 @@
         case JVM_CONSTANT_MethodHandle:
         case JVM_CONSTANT_MethodType:
         case JVM_CONSTANT_InvokeDynamic:
+        case JVM_CONSTANT_InvokeDynamicTrans:
           visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
           break;
         }
@@ -556,19 +555,16 @@
                   break;
               }
 
+              case JVM_CONSTANT_InvokeDynamicTrans:
               case JVM_CONSTANT_InvokeDynamic: {
                   dos.writeByte(cpConstType);
-                  int[] values = getMultiOperandsAt(ci);
-                  for (int vn = 0; vn < values.length; vn++) {
-                      dos.writeShort(values[vn]);
-                  }
-                  int bootstrapMethodIndex = values[INDY_BSM_OFFSET];
-                  int nameAndTypeIndex = values[INDY_NT_OFFSET];
-                  int argumentCount = values[INDY_ARGC_OFFSET];
-                  assert(INDY_ARGV_OFFSET + argumentCount == values.length);
-                  if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bootstrapMethodIndex
-                                          + ", N&T = " + nameAndTypeIndex
-                                          + ", argc = " + argumentCount);
+                  int value = getIntAt(ci);
+                  short bsmIndex = (short) extractLowShortFromInt(value);
+                  short nameAndTypeIndex = (short) extractHighShortFromInt(value);
+                  dos.writeShort(bsmIndex);
+                  dos.writeShort(nameAndTypeIndex);
+                  if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bsmIndex
+                                          + ", N&T = " + nameAndTypeIndex);
                   break;
               }
 
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Wed Jul 05 17:30:26 2017 +0200
@@ -321,13 +321,16 @@
                      break;
                 }
 
+                case JVM_CONSTANT_InvokeDynamicTrans:
                 case JVM_CONSTANT_InvokeDynamic: {
                      dos.writeByte(cpConstType);
-                     int[] values = cpool.getMultiOperandsAt(ci);
-                     for (int vn = 0; vn < values.length; vn++) {
-                         dos.writeShort(values[vn]);
-                     }
-                     if (DEBUG) debugMessage("CP[" + ci + "] = INDY indexes = " + Arrays.toString(values));
+                     int value = cpool.getIntAt(ci);
+                     short bsmIndex = (short) extractLowShortFromInt(value);
+                     short nameAndTypeIndex = (short) extractHighShortFromInt(value);
+                     dos.writeShort(bsmIndex);
+                     dos.writeShort(nameAndTypeIndex);
+                     if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " +
+                           bsmIndex + ", N&T = " + nameAndTypeIndex);
                      break;
                 }
 
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Wed Jul 05 17:30:26 2017 +0200
@@ -460,7 +460,8 @@
       return buf.toString();
    }
 
-   private String genListOfShort(int[] values) {
+   private String genListOfShort(short[] values) {
+      if (values == null || values.length == 0)  return "";
       Formatter buf = new Formatter(genHTML);
       buf.append('[');
       for (int i = 0; i < values.length; i++) {
@@ -594,9 +595,11 @@
                buf.cell(Integer.toString(cpool.getIntAt(index)));
                break;
 
+            case JVM_CONSTANT_InvokeDynamicTrans:
             case JVM_CONSTANT_InvokeDynamic:
                buf.cell("JVM_CONSTANT_InvokeDynamic");
-               buf.cell(genListOfShort(cpool.getMultiOperandsAt(index)));
+               buf.cell(genLowHighShort(cpool.getIntAt(index)) +
+                        genListOfShort(cpool.getBootstrapSpecifierAt(index)));
                break;
 
             default:
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java	Wed Jul 05 17:30:26 2017 +0200
@@ -40,7 +40,7 @@
   private static int JVM_CONSTANT_NameAndType             = 12;
   private static int JVM_CONSTANT_MethodHandle            = 15;  // JSR 292
   private static int JVM_CONSTANT_MethodType              = 16;  // JSR 292
-  //      static int JVM_CONSTANT_InvokeDynamicTrans      = 17;  // JSR 292, only occurs in old class files
+  private static int JVM_CONSTANT_InvokeDynamicTrans      = 17;  // JSR 292, only occurs in old class files
   private static int JVM_CONSTANT_InvokeDynamic           = 18;  // JSR 292
   private static int JVM_CONSTANT_Invalid                 = 0;   // For bad value initialization
   private static int JVM_CONSTANT_UnresolvedClass         = 100; // Temporary tag until actual use
@@ -67,6 +67,8 @@
     this.tag = tag;
   }
 
+  public int value() { return tag; }
+
   public boolean isKlass()            { return tag == JVM_CONSTANT_Class; }
   public boolean isField ()           { return tag == JVM_CONSTANT_Fieldref; }
   public boolean isMethod()           { return tag == JVM_CONSTANT_Methodref; }
@@ -81,6 +83,7 @@
   public boolean isMethodHandle()     { return tag == JVM_CONSTANT_MethodHandle; }
   public boolean isMethodType()       { return tag == JVM_CONSTANT_MethodType; }
   public boolean isInvokeDynamic()    { return tag == JVM_CONSTANT_InvokeDynamic; }
+  public boolean isInvokeDynamicTrans() { return tag == JVM_CONSTANT_InvokeDynamicTrans; }
 
   public boolean isInvalid()          { return tag == JVM_CONSTANT_Invalid; }
 
--- a/hotspot/make/defs.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/defs.make	Wed Jul 05 17:30:26 2017 +0200
@@ -101,15 +101,14 @@
 endif
 
 ifdef HOTSPOT_BUILD_VERSION
-# specified in command line (PRT build)
+# specified in command line
 else
-  ifdef JPRT_BUILD_VERSION
-# JPR build
-    HOTSPOT_BUILD_VERSION=$(JPRT_BUILD_VERSION)
+  ifdef COOKED_BUILD_NUMBER
+# JRE build
+    HOTSPOT_BUILD_VERSION=
   else
-    ifdef COOKED_BUILD_NUMBER
-# JRE build
-      HOTSPOT_BUILD_VERSION=
+    ifdef USER_RELEASE_SUFFIX
+      HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX)
     else
       HOTSPOT_BUILD_VERSION=internal
     endif
--- a/hotspot/make/hotspot_version	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/hotspot_version	Wed Jul 05 17:30:26 2017 +0200
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=20
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=03
+HS_BUILD_NUMBER=04
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/hotspot/make/jprt.gmk	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/jprt.gmk	Wed Jul 05 17:30:26 2017 +0200
@@ -25,9 +25,6 @@
 # JPRT rule to build this workspace
 
 JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip
-ifdef JPRT_BUILD_VERSION
-  MILESTONE=$(JPRT_BUILD_VERSION)
-endif
 
 ifeq ($(OSNAME),windows)
   ZIPFLAGS=-q
--- a/hotspot/make/linux/makefiles/adlc.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/adlc.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -42,16 +42,14 @@
 SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
 	     $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 
 
-Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
-
 EXEC	= $(OUTDIR)/adlc
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc
+VPATH += $(Src_Dirs_V:%=%:)
 
 # set INCLUDES for C preprocessor
-Src_Dirs_I = ${Src_Dirs} $(GENERATED)
+Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)
 INCLUDES += $(Src_Dirs_I:%=-I%)
 
 # set flags for adlc compilation
--- a/hotspot/make/linux/makefiles/amd64.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/amd64.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,6 @@
 #  
 #
 
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_x86_64.o
-
 # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
 OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
 # The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
--- a/hotspot/make/linux/makefiles/build_vm_def.sh	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/build_vm_def.sh	Wed Jul 05 17:30:26 2017 +0200
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # If we're cross compiling use that path for nm
-if [ "$ALT_COMPILER_PATH" != "" ]; then 
+if [ "$CROSS_COMPILE_ARCH" != "" ]; then 
 NM=$ALT_COMPILER_PATH/nm
 else
 NM=nm
--- a/hotspot/make/linux/makefiles/buildtree.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/buildtree.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
 # HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
-# HOTSPOT_BUILD_VERSION   - internal, PRTjob ID, JPRTjob ID
+# HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
 # Builds the directory trees with makefiles plus some convenience files in
@@ -113,7 +113,7 @@
 COMPILER	= $(shell sed -n 's/^compiler[ 	]*=[ 	]*//p' $(PLATFORM_FILE))
 
 SIMPLE_DIRS	= \
-	$(PLATFORM_DIR)/generated/incls \
+	$(PLATFORM_DIR)/generated/dependencies \
 	$(PLATFORM_DIR)/generated/adfiles \
 	$(PLATFORM_DIR)/generated/jvmtifiles
 
@@ -124,7 +124,7 @@
 BUILDTREE_MAKE	= $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 
 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
-        env.sh env.csh .dbxrc test_gamma
+        env.sh env.csh jdkpath.sh .dbxrc test_gamma
 
 BUILDTREE_VARS	= GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 	ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -197,11 +197,27 @@
 	echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
 	echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
 	echo; \
-	echo "Src_Dirs = \\"; \
+	echo "# Used for platform dispatching"; \
+	echo "TARGET_DEFINES  = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
+	echo "CFLAGS += \$$(TARGET_DEFINES)"; \
+	echo; \
+	echo "Src_Dirs_V = \\"; \
 	sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
 	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
+	echo; \
+	echo "Src_Dirs_I = \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
+	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
 	[ -n "$(CFLAGS_BROWSE)" ] && \
 	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
 	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
@@ -302,6 +318,13 @@
 	sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
 	) > $@
 
+jdkpath.sh: $(BUILDTREE_MAKE)
+	@echo Creating $@ ...
+	$(QUIETLY) ( \
+	$(BUILDTREE_COMMENT); \
+	echo "JDK=${JAVA_HOME}"; \
+	) > $@	   
+
 .dbxrc:  $(BUILDTREE_MAKE)
 	@echo Creating $@ ...
 	$(QUIETLY) ( \
--- a/hotspot/make/linux/makefiles/core.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/core.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,7 @@
 
 # Sets make macros for making core version of VM
 
-# Note the effect on includeDB lists in top.make:
-# includeDB_compiler* and ad_<arch>.*pp are excluded from the build,
+# Select which files to use (in top.make)
 TYPE=CORE
 
 # There is no "core" directory in JDK. Install core build in server directory.
--- a/hotspot/make/linux/makefiles/gcc.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/gcc.make	Wed Jul 05 17:30:26 2017 +0200
@@ -25,7 +25,9 @@
 #------------------------------------------------------------------------
 # CC, CPP & AS
 
-ifdef ALT_COMPILER_PATH
+# When cross-compiling the ALT_COMPILER_PATH points
+# to the cross-compilation toolset
+ifdef CROSS_COMPILE_ARCH
 CPP = $(ALT_COMPILER_PATH)/g++
 CC  = $(ALT_COMPILER_PATH)/gcc
 else
@@ -42,9 +44,13 @@
 
 # check for precompiled headers support
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
 USE_PRECOMPILED_HEADER=1
 PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
+PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
+PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+endif
 endif
 
 
@@ -144,6 +150,16 @@
 OPT_CFLAGS/mulnode.o += -O0
 endif
 
+# Flags for generating make dependency flags.
+ifneq ("${CC_VER_MAJOR}", "2")
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/hotspot/make/linux/makefiles/i486.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/i486.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,6 @@
 #
 
 # TLS helper, assembled from .s file
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_x86_32.o
 
 # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
 OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
--- a/hotspot/make/linux/makefiles/jvmti.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/jvmti.make	Wed Jul 05 17:30:26 2017 +0200
@@ -37,11 +37,10 @@
 
 JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims
 InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter
-Src_Dirs += $(JvmtiSrcDir)
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs}
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(JvmtiSrcDir)
+VPATH += $(Src_Dirs_V:%=%:)
 
 JvmtiGeneratedNames = \
         jvmtiEnv.hpp \
--- a/hotspot/make/linux/makefiles/launcher.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/launcher.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,23 @@
 
 # Rules to build gamma launcher, used by vm.make
 
-# gamma[_g]: launcher
 
+LAUNCHER_SCRIPT = hotspot
 LAUNCHER   = gamma
-LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX)
 
-LAUNCHERDIR   = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher
-LAUNCHERFLAGS = $(ARCHFLAG) \
+LAUNCHERDIR   := $(GAMMADIR)/src/os/posix/launcher
+LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
+LAUNCHERFLAGS := $(ARCHFLAG) \
                 -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
+                -I$(LAUNCHERDIR_SHARE) \
                 -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+                -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+                -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
                 -DARCH=\"$(LIBARCH)\" \
                 -DGAMMA \
                 -DLAUNCHER_TYPE=\"gamma\" \
-                -DLINK_INTO_$(LINK_INTO)
+                -DLINK_INTO_$(LINK_INTO) \
+                $(TARGET_DEFINES)
 
 ifeq ($(LINK_INTO),AOUT)
   LAUNCHER.o                 = launcher.o $(JVM_OBJ_FILES)
@@ -55,22 +59,35 @@
 LINK_LAUNCHER/PRE_HOOK  = $(LINK_LIB.CC/PRE_HOOK)
 LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CC/POST_HOOK)
 
-launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c
-	$(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS)
+LAUNCHER_OUT = launcher
+
+SUFFIXES += .d
+
+SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
+SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
+
+OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
+
+DEPFILES := $(patsubst %.o,%.d,$(OBJS))
+-include $(DEPFILES)
+
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
 
-launcher.c:
-	@echo Generating $@
-	$(QUIETLY) { \
-	echo '#define debug launcher_debug'; \
-	echo '#include "java.c"'; \
-	echo '#include "java_md.c"'; \
-	} > $@
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
 
-$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE)
-	$(QUIETLY) { \
-	    echo Linking launcher...; \
-	    $(LINK_LAUNCHER/PRE_HOOK) \
-	    $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \
-	    $(LINK_LAUNCHER/POST_HOOK) \
-	    [ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \
-        }
+$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
+	$(QUIETLY) echo Linking launcher...
+	$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
+	$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
+	$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
+
+$(LAUNCHER): $(LAUNCHER_SCRIPT)
+
+$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
+	$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
+	$(QUIETLY) chmod +x $@
+
--- a/hotspot/make/linux/makefiles/makedeps.make	Mon Dec 20 17:19:42 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#  
-#
-
-include $(GAMMADIR)/make/linux/makefiles/rules.make
-
-COMPILE.JAVAC.FLAGS += -d $(OUTDIR)
-
-MakeDepsSources=\
-	$(GAMMADIR)/src/share/tools/MakeDeps/Database.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java        
-
-MakeDepsOptions=
--- a/hotspot/make/linux/makefiles/rules.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/rules.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -151,20 +151,20 @@
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
-	$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
 else
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
 	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
-	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
-	   $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
+	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
 endif
 
 %.o: %.s
 	@echo Assembling $<
 	$(QUIETLY) $(REMOVE_TARGET)
-	$(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE)
+	$(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
 
 %.s: %.cpp
 	@echo Generating assembly for $<
--- a/hotspot/make/linux/makefiles/saproc.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/saproc.make	Wed Jul 05 17:30:26 2017 +0200
@@ -55,10 +55,12 @@
 # if $(AGENT_DIR) does not exist, we don't build SA
 # also, we don't build SA on Itanium, PPC, ARM or zero.
 
-checkAndBuildSA:
-	$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "arm" -a "$(SRCARCH)" != "ppc" -a "$(SRCARCH)" != "zero" ] ; then \
-	   $(MAKE) -f vm.make $(LIBSAPROC); \
-	fi
+ifneq ($(wildcard $(AGENT_DIR)),)
+ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
+  BUILDLIBSAPROC = $(LIBSAPROC)
+endif
+endif
+
 
 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
 
@@ -81,10 +83,10 @@
 	           -lthread_db
 	$(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
 
-install_saproc: checkAndBuildSA
+install_saproc: $(BUILDLIBSAPROC)
 	$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then             \
 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
 	fi
 
-.PHONY: checkAndBuildSA install_saproc
+.PHONY: install_saproc
--- a/hotspot/make/linux/makefiles/sparc.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/sparc.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,3 @@
 #  
 #
 
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_sparc.o
-
--- a/hotspot/make/linux/makefiles/sparcWorks.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/sparcWorks.make	Wed Jul 05 17:30:26 2017 +0200
@@ -74,6 +74,14 @@
 OPT_CFLAGS+=-xO4
 OPT_CFLAGS/NOOPT=-xO0
 
+# Flags for creating the dependency files.
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/hotspot/make/linux/makefiles/sparcv9.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/sparcv9.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,10 +21,6 @@
 # questions.
 #  
 
-#
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_sparc.o
-
 # gcc 4.0 miscompiles this code in -m64
 OPT_CFLAGS/macro.o = -O0
 
--- a/hotspot/make/linux/makefiles/top.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/top.make	Wed Jul 05 17:30:26 2017 +0200
@@ -31,7 +31,7 @@
 #   -generate sa-jdi.jar (JDI binding to core files)
 
 # It assumes the following flags are set:
-# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Obj_Files
+# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files
 
 # -- D. Ungar (5/97) from a file by Bill Bush
 
@@ -45,10 +45,6 @@
 Plat_File   = $(Platform_file)
 CDG         = cd $(GENERATED); 
 
-# Pick up MakeDeps' sources and definitions
-include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
-MakeDepsClass = MakeDeps.class
-
 ifdef USE_PRECOMPILED_HEADER
 PrecompiledOption = -DUSE_PRECOMPILED_HEADER
 UpdatePCH         = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS) 
@@ -57,33 +53,7 @@
 PrecompiledOption = 
 endif
 
-MakeDeps    = $(RUN.JAVA) $(PrecompiledOption) -classpath $(GENERATED) MakeDeps
-
-Include_DBs/GC          = $(VM)/includeDB_gc \
-                          $(VM)/includeDB_gc_parallel \
-                          $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
-                          $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
-                          $(VM)/gc_implementation/includeDB_gc_parNew \
-                          $(VM)/gc_implementation/includeDB_gc_g1     \
-                          $(VM)/gc_implementation/includeDB_gc_serial \
-                          $(VM)/gc_implementation/includeDB_gc_shared
-
-Include_DBs/CORE        = $(VM)/includeDB_core   $(Include_DBs/GC) \
-                          $(VM)/includeDB_jvmti \
-                          $(VM)/includeDB_features
-Include_DBs/COMPILER1   = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
-Include_DBs/COMPILER2   = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
-Include_DBs/TIERED      = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
-Include_DBs/ZERO        = $(Include_DBs/CORE) $(VM)/includeDB_zero
-Include_DBs/SHARK       = $(Include_DBs/ZERO) $(VM)/includeDB_shark
-Include_DBs = $(Include_DBs/$(TYPE))
-
 Cached_plat = $(GENERATED)/platform.current
-Cached_db   = $(GENERATED)/includeDB.current
-
-Incremental_Lists = $(Cached_db)
-# list generation also creates $(GENERATED)/$(Cached_plat)
-
 
 AD_Dir   = $(GENERATED)/adfiles
 ADLC     = $(AD_Dir)/adlc
@@ -102,7 +72,7 @@
 MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
 
 
-# default target: make makeDeps, update lists, make vm
+# default target: update lists, make vm
 # done in stages to force sequential order with parallel make
 #
 
@@ -110,39 +80,18 @@
 	@echo All done.
 
 # This is an explicit dependency for the sake of parallel makes.
-vm_build_preliminaries:  checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
+vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff
 	@# We need a null action here, so implicit rules don't get consulted.
 
-# make makeDeps: (and zap the cached db files to force a nonincremental run)
-
-$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
-	@$(REMOTE) $(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources)
-	@echo Removing $(Incremental_Lists) to force regeneration.
-	@rm -f $(Incremental_Lists)
-	@$(CDG) echo >$(Cached_plat)
-
-# make incremental_lists, if cached files out of date, run makeDeps
-
-$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
-	$(CDG) cat $(Include_DBs) > $(GENERATED)/includeDB
-	$(CDG) if [ ! -r incls ] ; then \
-	mkdir incls ; \
-	fi
-	$(CDG) (echo $(CDG) echo $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) $(GENERATED)/includeDB $(MakeDepsOptions)) > makeDeps.sh
-	$(CDG) $(REMOTE) sh $(GENERATED)/makeDeps.sh
-	$(CDG) cp includeDB    $(Cached_db)
+$(Cached_plat): $(Plat_File)
 	$(CDG) cp $(Plat_File) $(Cached_plat)
 
-# symbolic target for command lines
-lists: $(Incremental_Lists)
-	@: lists are now up to date
-
 # make AD files as necessary
-ad_stuff: $(Incremental_Lists) $(adjust-mflags)
+ad_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f adlc.make $(MFLAGS-adjusted)
 
 # generate JVMTI files from the spec
-jvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
+jvmti_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
 
 # generate SA jar files and native header
@@ -169,7 +118,7 @@
 install: the_vm
 	@$(MAKE) -f vm.make install
 
-# next rules support "make foo.[oi]"
+# next rules support "make foo.[ois]"
 
 %.o %.i %.s:
 	$(UpdatePCH) 
@@ -179,7 +128,6 @@
 # this should force everything to be rebuilt
 clean: 
 	rm -f $(GENERATED)/*.class
-	$(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
 	$(MAKE) -f vm.make $(MFLAGS) clean
 
 # just in case it doesn't, this should do it
--- a/hotspot/make/linux/makefiles/vm.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/vm.make	Wed Jul 05 17:30:26 2017 +0200
@@ -35,9 +35,10 @@
 # Defs
 
 GENERATED     = ../generated
+DEP_DIR       = $(GENERATED)/dependencies
 
-# read a generated file defining the set of .o's and the .o .h dependencies
-include $(GENERATED)/Dependencies
+# reads the generated files defining the set of .o's and the .o .h dependencies
+-include $(DEP_DIR)/*.d
 
 # read machine-specific adjustments (%%% should do this via buildtree.make?)
 ifeq ($(ZERO_BUILD), true)
@@ -47,16 +48,16 @@
 endif
 
 # set VPATH so make knows where to look for source files
-# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
-# The incls directory contains generated header file lists for inclusion.
+# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
 # The adfiles directory contains ad_<arch>.[ch]pp.
 # The jvmtifiles directory contains jvmti*.[ch]pp
-Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
+VPATH += $(Src_Dirs_V:%=%:)
 
-# set INCLUDES for C preprocessor
-Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
-INCLUDES += $(Src_Dirs_I:%=-I%)
+# set INCLUDES for C preprocessor.
+Src_Dirs_I += $(GENERATED)
+# The order is important for the precompiled headers to work.
+INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
 
 ifeq (${VERSION}, debug)
   SYMFLAG = -g
@@ -118,6 +119,64 @@
 LIBJVM   = lib$(JVM).so
 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
 
+CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
+CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
+CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
+CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
+CORE_PATHS += $(GENERATED)/jvmtifiles
+
+COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
+
+COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
+COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
+COMPILER2_PATHS +=  $(GENERATED)/adfiles
+
+# Include dirs per type.
+Src_Dirs/CORE      := $(CORE_PATHS)
+Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
+Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/ZERO      := $(CORE_PATHS)
+Src_Dirs/SHARK     := $(CORE_PATHS)
+Src_Dirs := $(Src_Dirs/$(TYPE))
+
+COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
+COMPILER1_SPECIFIC_FILES := c1_\*
+SHARK_SPECIFIC_FILES     := shark
+ZERO_SPECIFIC_FILES      := zero
+
+# Always exclude these.
+Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+
+# Exclude per type.
+Src_Files_EXCLUDE/CORE      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/TIERED    := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
+Src_Files_EXCLUDE/ZERO      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+Src_Files_EXCLUDE/SHARK     := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
+
+Src_Files_EXCLUDE +=  $(Src_Files_EXCLUDE/$(TYPE))
+
+# Special handling of arch model.
+ifeq ($(Platform_arch_model), x86_32)
+Src_Files_EXCLUDE += \*x86_64\*
+endif
+ifeq ($(Platform_arch_model), x86_64)
+Src_Files_EXCLUDE += \*x86_32\*
+endif
+
+# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
+define findsrc
+	$(notdir $(shell find $(1)/. ! -name . -prune \
+		-a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
+		-a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
+endef
+
+Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
+
+Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
+
 JVM_OBJ_FILES = $(Obj_Files)
 
 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
@@ -180,10 +239,10 @@
 LINK_VM = $(LINK_LIB.c)
 
 # rule for building precompiled header
-$(PRECOMPILED_HEADER): $(Precompiled_Files)
+$(PRECOMPILED_HEADER):
 	$(QUIETLY) echo Generating precompiled header $@
-	$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls
-	$(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE)
+	$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
+	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
 
 # making the library:
 
@@ -252,7 +311,7 @@
 
 #----------------------------------------------------------------------
 
-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
 
 install: install_jvm install_jsig install_saproc
 
--- a/hotspot/make/linux/makefiles/zero.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/linux/makefiles/zero.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2009 Red Hat, Inc.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -25,7 +25,7 @@
 
 # Setup for Zero (non-Shark) version of VM
 
-# Select which includeDB files to use (in top.make)
+# Select which files to use (in top.make)
 TYPE = ZERO
 
 # Install libjvm.so, etc in in server directory.
--- a/hotspot/make/solaris/makefiles/adlc.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/adlc.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -42,16 +42,14 @@
 SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
 	     $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 
 
-Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
-
 EXEC	= $(OUTDIR)/adlc
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GAMMADIR)/src/share/vm/adlc
+VPATH += $(Src_Dirs_V:%=%:)
 
 # set INCLUDES for C preprocessor
-Src_Dirs_I = ${Src_Dirs} $(GENERATED)
+Src_Dirs_I += $(GAMMADIR)/src/share/vm/adlc $(GENERATED)
 INCLUDES += $(Src_Dirs_I:%=-I%)
 
 # set flags for adlc compilation
--- a/hotspot/make/solaris/makefiles/amd64.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/amd64.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,6 @@
 # Must also specify if CPU is little endian
 CFLAGS += -DVM_LITTLE_ENDIAN
 
-# Not included in includeDB because it has no dependencies
-Obj_Files += solaris_x86_64.o
-
 #
 # Special case flags for compilers and compiler versions on amd64.
 #
--- a/hotspot/make/solaris/makefiles/buildtree.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/buildtree.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
 # OS_FAMILY	- operating system
 # VARIANT	- core, compiler1, compiler2, or tiered
 # HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
-# HOTSPOT_BUILD_VERSION   - internal, PRTjob ID, JPRTjob ID
+# HOTSPOT_BUILD_VERSION   - internal, internal-$(USER_RELEASE_SUFFIX) or empty
 # JRE_RELEASE_VERSION     - <major>.<minor>.<micro> (1.7.0)
 #
 # Builds the directory trees with makefiles plus some convenience files in
@@ -106,7 +106,7 @@
 COMPILER	= $(shell sed -n 's/^compiler[ 	]*=[ 	]*//p' $(PLATFORM_FILE))
 
 SIMPLE_DIRS	= \
-	$(PLATFORM_DIR)/generated/incls \
+	$(PLATFORM_DIR)/generated/dependencies \
 	$(PLATFORM_DIR)/generated/adfiles \
 	$(PLATFORM_DIR)/generated/jvmtifiles
 
@@ -117,7 +117,7 @@
 BUILDTREE_MAKE	= $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 
 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
-        env.ksh env.csh .dbxrc test_gamma
+        env.ksh env.csh jdkpath.sh .dbxrc test_gamma
 
 BUILDTREE_VARS	= GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 	ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -191,11 +191,27 @@
 	echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
 	echo "$(LP64_SETTING/$(DATA_MODE))"; \
 	echo; \
-	echo "Src_Dirs = \\"; \
+	echo "# Used for platform dispatching"; \
+	echo "TARGET_DEFINES  = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_ARCH_MODEL_\$$(Platform_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_\$$(Platform_os_arch)"; \
+	echo "TARGET_DEFINES += -DTARGET_OS_ARCH_MODEL_\$$(Platform_os_arch_model)"; \
+	echo "TARGET_DEFINES += -DTARGET_COMPILER_\$$(Platform_compiler)"; \
+	echo "CFLAGS += \$$(TARGET_DEFINES)"; \
+	echo; \
+	echo "Src_Dirs_V = \\"; \
 	sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
 	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
 	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
+	echo; \
+	echo "Src_Dirs_I = \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm \\"; \
+	echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
+	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
+	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
 	[ -n "$(CFLAGS_BROWSE)" ] && \
 	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
 	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
@@ -298,6 +314,13 @@
 	sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
 	) > $@
 
+jdkpath.sh: $(BUILDTREE_MAKE)
+	@echo Creating $@ ...
+	$(QUIETLY) ( \
+	$(BUILDTREE_COMMENT); \
+	echo "JDK=${JAVA_HOME}"; \
+	) > $@	   
+
 .dbxrc:  $(BUILDTREE_MAKE)
 	@echo Creating $@ ...
 	$(QUIETLY) ( \
--- a/hotspot/make/solaris/makefiles/core.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/core.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,7 @@
 
 # Sets make macros for making core version of VM
 
-# Note the effect on includeDB lists in top.make:
-# includeDB_compiler* and ad_<arch>.*pp are excluded from the build,
+# Select which files to use (in top.make)
 TYPE=CORE
 
 # There is no "core" directory in JDK. Install core build in server directory.
--- a/hotspot/make/solaris/makefiles/dtrace.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/dtrace.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,6 @@
 
 # making libjvm_db
 
-INCLS = $(GENERATED)/incls
-
 # Use mapfile with libjvm_db.so
 LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
 LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
@@ -114,7 +112,7 @@
 endif
 
 lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
-                  $(INCLS)/_vmStructs.cpp.incl $(LIBJVM.o)
+                  $(LIBJVM.o)
 	$(QUIETLY) $(CCC) $(CPPFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
 		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
 
@@ -161,6 +159,27 @@
              $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
 	$(QUIETLY) cat $^ > $@
 
+DTraced_Files = ciEnv.o \
+                classLoadingService.o \
+                compileBroker.o \
+                hashtable.o \
+                instanceKlass.o \
+                java.o \
+                jni.o \
+                jvm.o \
+                memoryManager.o \
+                nmethod.o \
+                objectMonitor.o \
+                runtimeService.o \
+                sharedRuntime.o \
+                synchronizer.o \
+                thread.o \
+                unsafe.o \
+                vmThread.o \
+                vmCMSOperations.o \
+                vmPSOperations.o \
+                vmGCOperations.o \
+
 # Dtrace is available, so we build $(DTRACE.o)  
 $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
 	@echo Compiling $(DTRACE).d
--- a/hotspot/make/solaris/makefiles/gcc.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/gcc.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -47,9 +47,13 @@
 
 # check for precompiled headers support
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+# Allow the user to turn off precompiled headers from the command line.
+ifneq ($(USE_PRECOMPILED_HEADER),0)
 USE_PRECOMPILED_HEADER=1
 PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
+PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
+PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+endif
 endif
 
 
@@ -131,6 +135,17 @@
 endif
 
 OPT_CFLAGS/NOOPT=-O0
+
+# Flags for generating make dependency flags.
+ifneq ("${CC_VER_MAJOR}", "2")
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifneq ($(USE_PRECOMPILED_HEADER),1)
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
+
 #------------------------------------------------------------------------
 # Linker flags
 
--- a/hotspot/make/solaris/makefiles/i486.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/i486.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@
 CFLAGS += -DVM_LITTLE_ENDIAN
 
 # TLS helper, assembled from .s file
-# Not included in includeDB because it has no dependencies
-Obj_Files += solaris_x86_32.o
 
 #
 # Special case flags for compilers and compiler versions on i486.
--- a/hotspot/make/solaris/makefiles/jvmti.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/jvmti.make	Wed Jul 05 17:30:26 2017 +0200
@@ -36,11 +36,10 @@
 
 JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims
 InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter
-Src_Dirs += $(JvmtiSrcDir)
 
 # set VPATH so make knows where to look for source files
-Src_Dirs_V = ${Src_Dirs}
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(JvmtiSrcDir)
+VPATH += $(Src_Dirs_V:%=%:)
 
 JvmtiGeneratedNames = \
         jvmtiEnv.hpp \
--- a/hotspot/make/solaris/makefiles/launcher.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/launcher.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,22 @@
 
 # Rules to build gamma launcher, used by vm.make
 
-# gamma[_g]: launcher
+LAUNCHER_SCRIPT = hotspot
 LAUNCHER   = gamma
-LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX)
 
-LAUNCHERDIR   = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher
+LAUNCHERDIR   = $(GAMMADIR)/src/os/posix/launcher
+LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
 LAUNCHERFLAGS = $(ARCHFLAG) \
                 -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
+                -I$(LAUNCHERDIR_SHARE) \
                 -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+                -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
+                -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
                 -DARCH=\"$(LIBARCH)\" \
                 -DGAMMA \
                 -DLAUNCHER_TYPE=\"gamma\" \
-                -DLINK_INTO_$(LINK_INTO)
+                -DLINK_INTO_$(LINK_INTO) \
+                $(TARGET_DEFINES)
 
 ifeq ($(LINK_INTO),AOUT)
   LAUNCHER.o                 = launcher.o $(JVM_OBJ_FILES)
@@ -68,24 +72,37 @@
 #LAUNCHERFLAGS += -W0,-noglobal
 endif # Platform_compiler == sparcWorks
 
-launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c
-	$(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS)
+LAUNCHER_OUT = launcher
+
+SUFFIXES += .d
+
+SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
+SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
+
+OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
+
+DEPFILES := $(patsubst %.o,%.d,$(OBJS))
+-include $(DEPFILES)
 
-launcher.c:
-	@echo Generating $@
-	$(QUIETLY) { \
-	echo '#define debug launcher_debug'; \
-	echo '#include "java.c"'; \
-	echo '#include "java_md.c"'; \
-	} > $@
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
 
-$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE)
+$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
+	$(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
+	$(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CPPFLAGS)
+
+$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
 ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
-	@echo Linking launcher...
+	$(QUIETLY) echo Linking launcher...
 	$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
-	$(QUIETLY) \
-	$(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER)
+	$(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
 	$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
-	[ -f $(LAUNCHER_G) ] || ln -s $@ $(LAUNCHER_G)
 endif # filter -sbfast -xsbfast
 
+$(LAUNCHER): $(LAUNCHER_SCRIPT)
+
+$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
+	$(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
+	$(QUIETLY) chmod +x $@
+
--- a/hotspot/make/solaris/makefiles/makedeps.make	Mon Dec 20 17:19:42 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#  
-#
-
-include $(GAMMADIR)/make/solaris/makefiles/rules.make
-
-COMPILE.JAVAC.FLAGS += -d $(OUTDIR)
-
-MakeDepsSources=\
-	$(GAMMADIR)/src/share/tools/MakeDeps/Database.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \
-	$(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java
-
-MakeDepsOptions=
--- a/hotspot/make/solaris/makefiles/rules.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/rules.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -151,14 +151,14 @@
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
-	$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
 else
 %.o: %.cpp
 	@echo Compiling $<
 	$(QUIETLY) $(REMOVE_TARGET)
 	$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
-         $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
-         $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
+	   $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
+	   $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
 endif
 
 %.o: %.s
--- a/hotspot/make/solaris/makefiles/saproc.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/saproc.make	Wed Jul 05 17:30:26 2017 +0200
@@ -44,10 +44,9 @@
 
 # if $(AGENT_DIR) does not exist, we don't build SA
 
-checkAndBuildSA:
-	$(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \
-	   $(MAKE) -f vm.make $(LIBSAPROC); \
-	fi
+ifneq ($(wildcard $(AGENT_DIR)),)
+  BUILDLIBSAPROC = $(LIBSAPROC)
+endif
 
 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
 
@@ -75,10 +74,10 @@
 	           -ldl -ldemangle -lthread -lc
 	[ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
 
-install_saproc: checkAndBuildSA
+install_saproc: $(BULDLIBSAPROC)
 	$(QUIETLY) if [ -f $(LIBSAPROC) ] ; then             \
 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
 	fi
 
-.PHONY: checkAndBuildSA install_saproc
+.PHONY: install_saproc
--- a/hotspot/make/solaris/makefiles/sparcWorks.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/sparcWorks.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -145,7 +145,15 @@
 OPT_CFLAGS/O2=-xO2
 OPT_CFLAGS/NOOPT=-xO1
 
-#################################################
+# Flags for creating the dependency files.
+ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
+DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d)
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+
+################################################
 # Begin current (>=5.9) Forte compiler options #
 #################################################
 
--- a/hotspot/make/solaris/makefiles/sparcv9.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/sparcv9.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
 #  
 #
 
-Obj_Files += solaris_sparc.o
 ASFLAGS += $(AS_ARCHFLAG)
 
 ifeq ("${Platform_compiler}", "sparcWorks")
--- a/hotspot/make/solaris/makefiles/top.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/top.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 #   -generate sa-jdi.jar (JDI binding to core files)
 
 # It assumes the following flags are set:
-# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Jvm_Obj_Files
+# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Jvm_Obj_Files
 
 # -- D. Ungar (5/97) from a file by Bill Bush
 
@@ -44,42 +44,7 @@
 Plat_File   = $(Platform_file)
 CDG         = cd $(GENERATED); 
 
-# Pick up MakeDeps' sources and definitions
-include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
-MakeDepsClass = MakeDeps.class
-MakeDeps    = $(RUN.JAVA) -classpath . MakeDeps
-
-Include_DBs/GC     = $(VM)/includeDB_gc \
-                     $(VM)/includeDB_gc_parallel \
-                     $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
-                     $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
-                     $(VM)/gc_implementation/includeDB_gc_parNew \
-                     $(VM)/gc_implementation/includeDB_gc_g1 \
-                     $(VM)/gc_implementation/includeDB_gc_serial \
-                     $(VM)/gc_implementation/includeDB_gc_shared
-
-
-Include_DBs/KERNEL      = $(VM)/includeDB_core $(VM)/includeDB_gc \
-                          $(VM)/gc_implementation/includeDB_gc_serial \
-                          $(VM)/includeDB_jvmti \
-                          $(VM)/includeDB_compiler1
-
-Include_DBs/CORE        = $(VM)/includeDB_core   $(Include_DBs/GC) \
-                          $(VM)/includeDB_jvmti \
-                          $(VM)/includeDB_features
-Include_DBs/COMPILER1   = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
-Include_DBs/COMPILER2   = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
-Include_DBs/TIERED      = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 \
-                          $(VM)/includeDB_compiler2
-
-Include_DBs = $(Include_DBs/$(TYPE))
-
-Cached_plat = platform.current
-Cached_db   = includeDB.current
-
-Incremental_Lists =$(GENERATED)/$(Cached_db)
-# list generation also creates $(GENERATED)/$(Cached_plat)
-
+Cached_plat = $(GENERATED)/platform.current
 
 AD_Dir   = $(GENERATED)/adfiles
 ADLC     = $(AD_Dir)/adlc
@@ -98,7 +63,7 @@
 MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
 
 
-# default target: make makeDeps, update lists, make vm
+# default target: update lists, make vm
 # done in stages to force sequential order with parallel make
 #
 
@@ -106,38 +71,18 @@
 	@echo All done.
 
 # This is an explicit dependency for the sake of parallel makes.
-vm_build_preliminaries:  checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
+vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff sa_stuff
 	@# We need a null action here, so implicit rules don't get consulted.
 
-# make makeDeps: (and zap the cached db files to force a nonincremental run)
-
-$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
-	@$(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -d $(GENERATED) $(MakeDepsSources)
-	@echo Removing $(Incremental_Lists) to force regeneration.
-	@rm -f $(Incremental_Lists)
-	@$(CDG) echo >$(Cached_plat)
-
-# make incremental_lists, if cached files out of date, run makeDeps
-
-$(Incremental_Lists):  $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
-	$(CDG)  cat $(Include_DBs) > includeDB
-	$(CDG) if [ ! -r incls ] ; then \
-	mkdir incls ; \
-	fi
-	$(CDG)  $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) includeDB $(MakeDepsOptions)
-	$(CDG)  cp includeDB    $(Cached_db)
-	$(CDG)  cp $(Plat_File) $(Cached_plat)
-
-# symbolic target for command lines
-lists: $(Incremental_Lists)
-	@: lists are now up to date
+$(Cached_plat): $(Plat_File)
+	$(CDG) cp $(Plat_File) $(Cached_plat)
 
 # make AD files as necessary
-ad_stuff: $(Incremental_Lists) $(adjust-mflags)
+ad_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f adlc.make $(MFLAGS-adjusted)
 
 # generate JVMTI files from the spec
-jvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
+jvmti_stuff: $(Cached_plat) $(adjust-mflags)
 	@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
 
 # generate SA jar files and native header
@@ -172,7 +117,6 @@
 # this should force everything to be rebuilt
 clean: 
 	rm -f $(GENERATED)/*.class
-	$(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
 	$(MAKE) -f vm.make $(MFLAGS) clean
 
 # just in case it doesn't, this should do it
--- a/hotspot/make/solaris/makefiles/vm.make	Mon Dec 20 17:19:42 2010 -0800
+++ b/hotspot/make/solaris/makefiles/vm.make	Wed Jul 05 17:30:26 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -35,23 +35,23 @@
 # Defs
 
 GENERATED     = ../generated
+DEP_DIR       = $(GENERATED)/dependencies
 
-# read a generated file defining the set of .o's and the .o .h dependencies
-include $(GENERATED)/Dependencies
+# reads the generated files defining the set of .o's and the .o .h dependencies
+-include $(DEP_DIR)/*.d
 
 # read machine-specific adjustments (%%% should do this via buildtree.make?)
 include $(MAKEFILES_DIR)/$(BUILDARCH).make
 
 # set VPATH so make knows where to look for source files
-# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
-# The incls directory contains generated header file lists for inclusion.
+# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
 # The adfiles directory contains ad_<arch>.[ch]pp.
 # The jvmtifiles directory contains jvmti*.[ch]pp
-Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
-VPATH    += $(Src_Dirs_V:%=%:)
+Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
+VPATH += $(Src_Dirs_V:%=%:)
 
 # set INCLUDES for C preprocessor
-Src_Dirs_I = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED) 
+Src_Dirs_I += $(GENERATED)
 INCLUDES += $(Src_Dirs_I:%=-I%)
 
 ifeq (${VERSION}, debug)
@@ -106,17 +106,17 @@
 # Not sure what the 'designed for' comment is referring too above.
 #   The order may not be too significant anymore, but I have placed this
 #   older libm before libCrun, just to make sure it's found and used first.
-LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc
+LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle
 else
 ifeq ($(COMPILER_REV_NUMERIC), 502)
 # SC6.1 has it's own libm.so: specifying anything else provokes a name conflict.
-LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor
+LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle
 else
-LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor
+LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle
 endif # 502
 endif # 505
 else
-LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
+LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle
 endif # sparcWorks
 
 # By default, link the *.o into the library, not the executable.
@@ -135,6 +135,64 @@
 LIBJVM   = lib$(JVM).so
 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
 
+CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
+CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
+CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
+CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
+CORE_PATHS += $(GENERATED)/jvmtifiles
+
+COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
+
+COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
+COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
+COMPILER2_PATHS +=  $(GENERATED)/adfiles
+
+# Include dirs per type.
+Src_Dirs/CORE      := $(CORE_PATHS)
+Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
+Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
+Src_Dirs/ZERO      := $(CORE_PATHS)