changeset 51907:6f08e6011e7e

Merge
author prr
date Tue, 14 Aug 2018 12:11:28 -0700
parents a2f64e4e75ca 0f3bfea3acf1
children 3ba3d39b91c7
files src/hotspot/share/gc/g1/g1SATBMarkQueueFilter.cpp src/hotspot/share/gc/g1/g1SATBMarkQueueFilter.hpp src/hotspot/share/runtime/simpleThresholdPolicy.cpp src/hotspot/share/runtime/simpleThresholdPolicy.hpp src/hotspot/share/runtime/simpleThresholdPolicy.inline.hpp test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/share/transform/v2/MHSamTF.java test/jdk/com/sun/jdi/ArrayLengthDumpTest.sh test/jdk/com/sun/jdi/BreakpointWithFullGC.sh
diffstat 920 files changed, 20569 insertions(+), 4838 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Aug 10 12:36:21 2018 +0530
+++ b/.hgtags	Tue Aug 14 12:11:28 2018 -0700
@@ -499,7 +499,9 @@
 1edcf36fe15f79d6228d1a63eb680878e2386480 jdk-11+23
 ea900a7dc7d77dee30865c60eabd87fc24b1037c jdk-11+24
 331888ea4a788df801b1edf8836646cd25fc758b jdk-11+25
+945ba9278a272a5477ffb1b3ea1b04174fed8036 jdk-11+26
 69b438908512d3dfef5852c6a843a5778333a309 jdk-12+2
 990db216e7199b2ba9989d8fa20b657e0ca7d969 jdk-12+3
 499b873761d8e8a1cc4aa649daf04cbe98cbce77 jdk-12+4
 f8696e0ab9b795030429fc3374ec03e378fd9ed7 jdk-12+5
+7939b3c4e4088bf4f70ec5bbd8030393b653372f jdk-12+6
--- a/make/autoconf/flags-cflags.m4	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/autoconf/flags-cflags.m4	Tue Aug 14 12:11:28 2018 -0700
@@ -543,14 +543,14 @@
   fi
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
     WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"
-    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual"
+    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual -Wreorder"
 
     if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
       # Non-zero builds have stricter warnings
       WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wreturn-type"
     fi
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
-    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated"
+    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated -Wreorder"
     if test "x$OPENJDK_TARGET_OS" = xlinux; then
       WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-sometimes-uninitialized"
       WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/IBM1129.c2b	Tue Aug 14 12:11:28 2018 -0700
@@ -0,0 +1,94 @@
+0x21	U+ff01
+0x22	U+ff02
+0x23	U+ff03
+0x24	U+ff04
+0x25	U+ff05
+0x26	U+ff06
+0x27	U+ff07
+0x28	U+ff08
+0x29	U+ff09
+0x2a	U+ff0a
+0x2b	U+ff0b
+0x2c	U+ff0c
+0x2d	U+ff0d
+0x2e	U+ff0e
+0x2f	U+ff0f
+0x30	U+ff10
+0x31	U+ff11
+0x32	U+ff12
+0x33	U+ff13
+0x34	U+ff14
+0x35	U+ff15
+0x36	U+ff16
+0x37	U+ff17
+0x38	U+ff18
+0x39	U+ff19
+0x3a	U+ff1a
+0x3b	U+ff1b
+0x3c	U+ff1c
+0x3d	U+ff1d
+0x3e	U+ff1e
+0x3f	U+ff1f
+0x40	U+ff20
+0x41	U+ff21
+0x42	U+ff22
+0x43	U+ff23
+0x44	U+ff24
+0x45	U+ff25
+0x46	U+ff26
+0x47	U+ff27
+0x48	U+ff28
+0x49	U+ff29
+0x4a	U+ff2a
+0x4b	U+ff2b
+0x4c	U+ff2c
+0x4d	U+ff2d
+0x4e	U+ff2e
+0x4f	U+ff2f
+0x50	U+ff30
+0x51	U+ff31
+0x52	U+ff32
+0x53	U+ff33
+0x54	U+ff34
+0x55	U+ff35
+0x56	U+ff36
+0x57	U+ff37
+0x58	U+ff38
+0x59	U+ff39
+0x5a	U+ff3a
+0x5b	U+ff3b
+0x5c	U+ff3c
+0x5d	U+ff3d
+0x5e	U+ff3e
+0x5f	U+ff3f
+0x60	U+ff40
+0x61	U+ff41
+0x62	U+ff42
+0x63	U+ff43
+0x64	U+ff44
+0x65	U+ff45
+0x66	U+ff46
+0x67	U+ff47
+0x68	U+ff48
+0x69	U+ff49
+0x6a	U+ff4a
+0x6b	U+ff4b
+0x6c	U+ff4c
+0x6d	U+ff4d
+0x6e	U+ff4e
+0x6f	U+ff4f
+0x70	U+ff50
+0x71	U+ff51
+0x72	U+ff52
+0x73	U+ff53
+0x74	U+ff54
+0x75	U+ff55
+0x76	U+ff56
+0x77	U+ff57
+0x78	U+ff58
+0x79	U+ff59
+0x7a	U+ff5a
+0x7b	U+ff5b
+0x7c	U+ff5c
+0x7d	U+ff5d
+0x7e	U+ff5e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/IBM1129.map	Tue Aug 14 12:11:28 2018 -0700
@@ -0,0 +1,256 @@
+0x00	U+0000
+0x01	U+0001
+0x02	U+0002
+0x03	U+0003
+0x04	U+0004
+0x05	U+0005
+0x06	U+0006
+0x07	U+0007
+0x08	U+0008
+0x09	U+0009
+0x0a	U+000a
+0x0b	U+000b
+0x0c	U+000c
+0x0d	U+000d
+0x0e	U+000e
+0x0f	U+000f
+0x10	U+0010
+0x11	U+0011
+0x12	U+0012
+0x13	U+0013
+0x14	U+0014
+0x15	U+0015
+0x16	U+0016
+0x17	U+0017
+0x18	U+0018
+0x19	U+0019
+0x1a	U+001a
+0x1b	U+001b
+0x1c	U+001c
+0x1d	U+001d
+0x1e	U+001e
+0x1f	U+001f
+0x20	U+0020
+0x21	U+0021
+0x22	U+0022
+0x23	U+0023
+0x24	U+0024
+0x25	U+0025
+0x26	U+0026
+0x27	U+0027
+0x28	U+0028
+0x29	U+0029
+0x2a	U+002a
+0x2b	U+002b
+0x2c	U+002c
+0x2d	U+002d
+0x2e	U+002e
+0x2f	U+002f
+0x30	U+0030
+0x31	U+0031
+0x32	U+0032
+0x33	U+0033
+0x34	U+0034
+0x35	U+0035
+0x36	U+0036
+0x37	U+0037
+0x38	U+0038
+0x39	U+0039
+0x3a	U+003a
+0x3b	U+003b
+0x3c	U+003c
+0x3d	U+003d
+0x3e	U+003e
+0x3f	U+003f
+0x40	U+0040
+0x41	U+0041
+0x42	U+0042
+0x43	U+0043
+0x44	U+0044
+0x45	U+0045
+0x46	U+0046
+0x47	U+0047
+0x48	U+0048
+0x49	U+0049
+0x4a	U+004a
+0x4b	U+004b
+0x4c	U+004c
+0x4d	U+004d
+0x4e	U+004e
+0x4f	U+004f
+0x50	U+0050
+0x51	U+0051
+0x52	U+0052
+0x53	U+0053
+0x54	U+0054
+0x55	U+0055
+0x56	U+0056
+0x57	U+0057
+0x58	U+0058
+0x59	U+0059
+0x5a	U+005a
+0x5b	U+005b
+0x5c	U+005c
+0x5d	U+005d
+0x5e	U+005e
+0x5f	U+005f
+0x60	U+0060
+0x61	U+0061
+0x62	U+0062
+0x63	U+0063
+0x64	U+0064
+0x65	U+0065
+0x66	U+0066
+0x67	U+0067
+0x68	U+0068
+0x69	U+0069
+0x6a	U+006a
+0x6b	U+006b
+0x6c	U+006c
+0x6d	U+006d
+0x6e	U+006e
+0x6f	U+006f
+0x70	U+0070
+0x71	U+0071
+0x72	U+0072
+0x73	U+0073
+0x74	U+0074
+0x75	U+0075
+0x76	U+0076
+0x77	U+0077
+0x78	U+0078
+0x79	U+0079
+0x7a	U+007a
+0x7b	U+007b
+0x7c	U+007c
+0x7d	U+007d
+0x7e	U+007e
+0x7f	U+007f
+0x80	U+0080
+0x81	U+0081
+0x82	U+0082
+0x83	U+0083
+0x84	U+0084
+0x85	U+0085
+0x86	U+0086
+0x87	U+0087
+0x88	U+0088
+0x89	U+0089
+0x8a	U+008a
+0x8b	U+008b
+0x8c	U+008c
+0x8d	U+008d
+0x8e	U+008e
+0x8f	U+008f
+0x90	U+0090
+0x91	U+0091
+0x92	U+0092
+0x93	U+0093
+0x94	U+0094
+0x95	U+0095
+0x96	U+0096
+0x97	U+0097
+0x98	U+0098
+0x99	U+0099
+0x9a	U+009a
+0x9b	U+009b
+0x9c	U+009c
+0x9d	U+009d
+0x9e	U+009e
+0x9f	U+009f
+0xa0	U+00a0
+0xa1	U+00a1
+0xa2	U+00a2
+0xa3	U+00a3
+0xa4	U+00a4
+0xa5	U+00a5
+0xa6	U+00a6
+0xa7	U+00a7
+0xa8	U+0153
+0xa9	U+00a9
+0xaa	U+00aa
+0xab	U+00ab
+0xac	U+00ac
+0xad	U+00ad
+0xae	U+00ae
+0xaf	U+00af
+0xb0	U+00b0
+0xb1	U+00b1
+0xb2	U+00b2
+0xb3	U+00b3
+0xb4	U+0178
+0xb5	U+00b5
+0xb6	U+00b6
+0xb7	U+00b7
+0xb8	U+0152
+0xb9	U+00b9
+0xba	U+00ba
+0xbb	U+00bb
+0xbc	U+00bc
+0xbd	U+00bd
+0xbe	U+00be
+0xbf	U+00bf
+0xc0	U+00c0
+0xc1	U+00c1
+0xc2	U+00c2
+0xc3	U+0102
+0xc4	U+00c4
+0xc5	U+00c5
+0xc6	U+00c6
+0xc7	U+00c7
+0xc8	U+00c8
+0xc9	U+00c9
+0xca	U+00ca
+0xcb	U+00cb
+0xcc	U+0300
+0xcd	U+00cd
+0xce	U+00ce
+0xcf	U+00cf
+0xd0	U+0110
+0xd1	U+00d1
+0xd2	U+0309
+0xd3	U+00d3
+0xd4	U+00d4
+0xd5	U+01a0
+0xd6	U+00d6
+0xd7	U+00d7
+0xd8	U+00d8
+0xd9	U+00d9
+0xda	U+00da
+0xdb	U+00db
+0xdc	U+00dc
+0xdd	U+01af
+0xde	U+0303
+0xdf	U+00df
+0xe0	U+00e0
+0xe1	U+00e1
+0xe2	U+00e2
+0xe3	U+0103
+0xe4	U+00e4
+0xe5	U+00e5
+0xe6	U+00e6
+0xe7	U+00e7
+0xe8	U+00e8
+0xe9	U+00e9
+0xea	U+00ea
+0xeb	U+00eb
+0xec	U+0301
+0xed	U+00ed
+0xee	U+00ee
+0xef	U+00ef
+0xf0	U+0111
+0xf1	U+00f1
+0xf2	U+0323
+0xf3	U+00f3
+0xf4	U+00f4
+0xf5	U+01a1
+0xf6	U+00f6
+0xf7	U+00f7
+0xf8	U+00f8
+0xf9	U+00f9
+0xfa	U+00fa
+0xfb	U+00fb
+0xfc	U+00fc
+0xfd	U+01b0
+0xfe	U+20ab
+0xff	U+00ff
--- a/make/data/charsetmapping/charsets	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/data/charsetmapping/charsets	Tue Aug 14 12:11:28 2018 -0700
@@ -1241,6 +1241,16 @@
     alias   ibm-1124
     alias   1124
 
+charset x-IBM1129 IBM1129
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1129
+    ascii   false
+    alias   cp1129               # JDK historical
+    alias   ibm1129
+    alias   ibm-1129
+    alias   1129
+
 charset x-IBM1364 IBM1364
     package sun.nio.cs.ext
     type    ebcdic
--- a/make/data/charsetmapping/stdcs-aix	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/data/charsetmapping/stdcs-aix	Tue Aug 14 12:11:28 2018 -0700
@@ -19,6 +19,7 @@
 IBM970
 IBM1046
 IBM1124
+IBM1129
 IBM1383
 ISO_8859_6
 ISO_8859_8
--- a/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Tue Aug 14 12:11:28 2018 -0700
@@ -123,6 +123,7 @@
 $(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
 	($(CD) $(GENSRC_DIR)/META-INF/providers && \
 	    p=""; \
+	    impl=""; \
 	    for i in $$($(LS) | $(SORT)); do \
 	      c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
 	      if test x$$p != x$$c; then \
@@ -131,15 +132,27 @@
 	        fi; \
 	        $(ECHO) "provides $$c with" >> $@; \
                 p=$$c; \
+	        impl=""; \
 	      fi; \
-	      $(ECHO) "    $$i," >> $@; \
+              if test x$$impl != x; then \
+	        $(ECHO) "  , $$i" >> $@; \
+              else \
+	        $(ECHO) "    $$i" >> $@; \
+              fi; \
+              impl=$$i; \
 	    done); \
             $(ECHO) "    ;" >> $@; \
 	$(ECHO) "uses org.graalvm.compiler.options.OptionDescriptors;" >> $@; \
 	$(ECHO) "provides org.graalvm.compiler.options.OptionDescriptors with" >> $@; \
+        impl=""; \
 	for i in $$($(FIND) $(GENSRC_DIR) -name '*_OptionDescriptors.java' | $(SORT)); do \
 	    c=$$($(ECHO) $$i | $(SED) 's:.*/jdk\.internal\.vm\.compiler/\(.*\)\.java:\1:' | $(TR) '/' '.'); \
-	    $(ECHO) "    $$c," >> $@; \
+            if test x$$impl != x; then \
+	      $(ECHO) "  , $$c" >> $@; \
+            else \
+	      $(ECHO) "    $$c" >> $@; \
+            fi; \
+            impl=$$c; \
 	done; \
 	$(ECHO) "    ;" >> $@;
 
--- a/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -40,6 +40,7 @@
 
 #include <proc_service.h>
 #include "gc/shared/collectedHeap.hpp"
+#include "memory/heap.hpp"
 #include "runtime/vmStructs.hpp"
 
 typedef enum GEN_variant {
--- a/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java	Tue Aug 14 12:11:28 2018 -0700
@@ -37,7 +37,9 @@
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import static java.util.stream.Collectors.*;
 
@@ -131,7 +133,7 @@
         // parse module-info.java.extra
         this.extras = new ModuleInfo();
         for (Path file : extraFiles) {
-            extras.parse(file);
+            extras.parseExtra(file);
         }
 
         // merge with module-info.java.extra
@@ -177,6 +179,7 @@
         final Map<String, Statement> provides = new HashMap<>();
 
         Statement getStatement(String directive, String name) {
+            Objects.requireNonNull(name);
             switch (directive) {
                 case "exports":
                     if (moduleInfo.exports.containsKey(name) &&
@@ -223,49 +226,49 @@
             extraFiles.exports.entrySet()
                 .stream()
                 .filter(e -> exports.containsKey(e.getKey()) &&
-                                e.getValue().filter(modules))
+                    e.getValue().filter(modules))
                 .forEach(e -> mergeExportsOrOpens(exports.get(e.getKey()),
-                                                  e.getValue(),
-                                                  modules));
+                    e.getValue(),
+                    modules));
 
             // add exports that are not defined in the original module-info.java
             extraFiles.exports.entrySet()
                 .stream()
                 .filter(e -> !exports.containsKey(e.getKey()) &&
-                                e.getValue().filter(modules))
+                    e.getValue().filter(modules))
                 .forEach(e -> addTargets(getStatement("exports", e.getKey()),
-                                         e.getValue(),
-                                         modules));
+                    e.getValue(),
+                    modules));
 
             // API package opened in the original module-info.java
             extraFiles.opens.entrySet()
                 .stream()
                 .filter(e -> opens.containsKey(e.getKey()) &&
-                                e.getValue().filter(modules))
+                    e.getValue().filter(modules))
                 .forEach(e -> mergeExportsOrOpens(opens.get(e.getKey()),
-                                                  e.getValue(),
-                                                  modules));
+                    e.getValue(),
+                    modules));
 
             // add opens that are not defined in the original module-info.java
             extraFiles.opens.entrySet()
                 .stream()
                 .filter(e -> !opens.containsKey(e.getKey()) &&
-                                e.getValue().filter(modules))
+                    e.getValue().filter(modules))
                 .forEach(e -> addTargets(getStatement("opens", e.getKey()),
-                                         e.getValue(),
-                                         modules));
+                    e.getValue(),
+                    modules));
 
             // provides
             extraFiles.provides.keySet()
                 .stream()
                 .filter(service -> provides.containsKey(service))
                 .forEach(service -> mergeProvides(service,
-                                                  extraFiles.provides.get(service)));
+                    extraFiles.provides.get(service)));
             extraFiles.provides.keySet()
                 .stream()
                 .filter(service -> !provides.containsKey(service))
                 .forEach(service -> provides.put(service,
-                                                 extraFiles.provides.get(service)));
+                    extraFiles.provides.get(service)));
 
             // uses
             extraFiles.uses.keySet()
@@ -280,8 +283,8 @@
                                 Set<String> modules)
         {
             extra.targets.stream()
-                 .filter(mn -> modules.contains(mn))
-                 .forEach(mn -> statement.addTarget(mn));
+                .filter(mn -> modules.contains(mn))
+                .forEach(mn -> statement.addTarget(mn));
         }
 
         private void mergeExportsOrOpens(Statement statement,
@@ -319,7 +322,7 @@
             }
 
             extra.targets.stream()
-                 .forEach(mn -> statement.addTarget(mn));
+                .forEach(mn -> statement.addTarget(mn));
         }
 
 
@@ -358,189 +361,173 @@
                 .forEach(e -> writer.println(e.getValue()));
         }
 
-        private void parse(Path sourcefile) throws IOException {
-            List<String> lines = Files.readAllLines(sourcefile);
-            Statement statement = null;
-            boolean hasTargets = false;
 
-            for (int lineNumber = 1; lineNumber <= lines.size(); ) {
-                String l = lines.get(lineNumber-1).trim();
-                int index = 0;
+        private void parse(Path file) throws IOException {
+            Parser parser = new Parser(file);
+            parser.run();
+            if (verbose) {
+                parser.dump();
+            }
+            process(parser, false);
+        }
 
-                if (l.isEmpty()) {
-                    lineNumber++;
+        private void parseExtra(Path file) throws IOException {
+            Parser parser = new Parser(file);
+            parser.run();
+            if (verbose) {
+                parser.dump();
+            }
+            process(parser, true);
+        }
+
+
+        private void process(Parser parser, boolean extraFile) throws IOException {
+            // no duplicate statement local in each file
+            Map<String, Statement> exports = new HashMap<>();
+            Map<String, Statement> opens = new HashMap<>();
+            Map<String, Statement> uses = new HashMap<>();
+            Map<String, Statement> provides = new HashMap<>();
+
+            String token = null;
+            boolean hasCurlyBracket = false;
+            while ((token = parser.nextToken()) != null) {
+                if (token.equals("module")) {
+                    String modulename = nextIdentifier(parser);
+                    if (extraFile) {
+                        throw parser.newError("cannot declare module in " + parser.sourceFile);
+                    }
+                    skipTokenOrThrow(parser, "{", "missing {");
+                    hasCurlyBracket = true;
+                } else if (token.equals("requires")) {
+                    token = nextIdentifier(parser);
+                    if (token.equals("transitive")) {
+                        token = nextIdentifier(parser);
+                    }
+                    if (extraFile) {
+                        throw parser.newError("cannot declare requires in " + parser.sourceFile);
+                    }
+                    skipTokenOrThrow(parser, ";", "missing semicolon");
+                } else if (isExportsOpensProvidesUses(token)) {
+                    // new statement
+                    String keyword = token;
+                    String name = nextIdentifier(parser);
+                    Statement statement = getStatement(keyword, name);
+                    switch (keyword) {
+                        case "exports":
+                            if (exports.containsKey(name)) {
+                                throw parser.newError("multiple " + keyword + " " + name);
+                            }
+                            exports.put(name, statement);
+                            break;
+                        case "opens":
+                            if (opens.containsKey(name)) {
+                                throw parser.newError("multiple " + keyword + " " + name);
+                            }
+                            opens.put(name, statement);
+                            break;
+                        case "uses":
+                            if (uses.containsKey(name)) {
+                                throw parser.newError("multiple " + keyword + " " + name);
+                            }
+                            uses.put(name, statement);
+                            break;
+                        /*  Disable this check until jdk.internal.vm.compiler generated file is fixed.
+                        case "provides":
+                            if (provides.containsKey(name)) {
+                                throw parser.newError("multiple " + keyword + " " + name);
+                            }
+                            provides.put(name, statement);
+                            break;
+                        */
+                    }
+                    String lookAhead = lookAhead(parser);
+                    if (lookAhead.equals(statement.qualifier)) {
+                        parser.nextToken(); // skip qualifier
+                        while ((lookAhead = parser.peekToken()) != null) {
+                            // add target name
+                            name = nextIdentifier(parser);
+                            statement.addTarget(name);
+                            lookAhead = lookAhead(parser);
+                            if (lookAhead.equals(",") || lookAhead.equals(";")) {
+                                parser.nextToken();
+                            } else {
+                                throw parser.newError("missing semicolon");
+                            }
+                            if (lookAhead.equals(";")) {
+                                break;
+                            }
+                        }
+                    } else {
+                        skipTokenOrThrow(parser, ";", "missing semicolon");
+                    }
+                } else if (token.equals(";")) {
                     continue;
+                } else if (hasCurlyBracket && token.equals("}")) {
+                    hasCurlyBracket = false;
+                    if (parser.peekToken() != null) {  // must be EOF
+                        throw parser.newError("is malformed");
+                    }
+                } else {
+                    throw parser.newError("missing keyword");
                 }
+            }
+            if (hasCurlyBracket) {
+                parser.newError("missing }");
+            }
+        }
 
-                // comment block starts
-                if (l.startsWith("/*")) {
-                    while (l.indexOf("*/") == -1) { // end comment block
-                        l = lines.get(lineNumber++).trim();
-                    }
-                    index = l.indexOf("*/") + 2;
-                    if (index >= l.length()) {
-                        lineNumber++;
-                        continue;
-                    } else {
-                        // rest of the line
-                        l = l.substring(index, l.length()).trim();
-                        index = 0;
-                    }
-                }
+        private boolean isExportsOpensProvidesUses(String word) {
+            switch (word) {
+                case "exports":
+                case "opens":
+                case "provides":
+                case "uses":
+                    return true;
+                default:
+                    return false;
+            }
+        }
 
-                // skip comment and annotations
-                if (l.startsWith("//") || l.startsWith("@")) {
-                    lineNumber++;
-                    continue;
-                }
+        private String lookAhead(Parser parser) {
+            String lookAhead = parser.peekToken();
+            if (lookAhead == null) { // EOF
+                throw parser.newError("reach end of file");
+            }
+            return lookAhead;
+        }
 
-                int current = lineNumber;
-                int count = 0;
-                while (index < l.length()) {
-                    if (current == lineNumber && ++count > 20)
-                        throw new Error("Fail to parse line " + lineNumber + " " + sourcefile);
+        private String nextIdentifier(Parser parser) {
+            String lookAhead = parser.peekToken();
+            boolean maybeIdentifier = true;
+            switch (lookAhead) {
+                case "module":
+                case "requires":
+                case "exports":
+                case "opens":
+                case "provides":
+                case "uses":
+                case "to":
+                case "with":
+                case ",":
+                case ";":
+                case "{":
+                case "}":
+                    maybeIdentifier = false;
+            }
+            if (lookAhead == null || !maybeIdentifier) {
+                throw parser.newError("<identifier> missing");
+            }
 
-                    int end = l.indexOf(';');
-                    if (end == -1)
-                        end = l.length();
-                    String content = l.substring(0, end).trim();
-                    if (content.isEmpty()) {
-                        index = end+1;
-                        if (index < l.length()) {
-                            // rest of the line
-                            l = l.substring(index, l.length()).trim();
-                            index = 0;
-                        }
-                        continue;
-                    }
+            return parser.nextToken();
+        }
 
-                    String[] s = content.split("\\s+");
-                    String keyword = s[0].trim();
-
-                    String name = s.length > 1 ? s[1].trim() : null;
-                    trace("%d: %s index=%d len=%d%n", lineNumber, l, index, l.length());
-                    switch (keyword) {
-                        case "module":
-                        case "requires":
-                        case "}":
-                            index = l.length();  // skip to the end
-                            continue;
-
-                        case "exports":
-                        case "opens":
-                        case "provides":
-                        case "uses":
-                            // assume name immediately after exports, opens, provides, uses
-                            statement = getStatement(keyword, name);
-                            hasTargets = false;
-
-                            int i = l.indexOf(name, keyword.length()+1) + name.length() + 1;
-                            l = i < l.length() ? l.substring(i, l.length()).trim() : "";
-                            index = 0;
-
-                            if (s.length >= 3) {
-                                if (!s[2].trim().equals(statement.qualifier)) {
-                                    throw new RuntimeException(sourcefile + ", line " +
-                                        lineNumber + ", is malformed: " + s[2]);
-                                }
-                            }
-
-                            break;
-
-                        case "to":
-                        case "with":
-                            if (statement == null) {
-                                throw new RuntimeException(sourcefile + ", line " +
-                                    lineNumber + ", is malformed");
-                            }
-
-                            hasTargets = true;
-                            String qualifier = statement.qualifier;
-                            i = l.indexOf(qualifier, index) + qualifier.length() + 1;
-                            l = i < l.length() ? l.substring(i, l.length()).trim() : "";
-                            index = 0;
-                            break;
-                    }
-
-                    if (index >= l.length()) {
-                        // skip to next line
-                        continue;
-                    }
-
-                        // comment block starts
-                    if (l.startsWith("/*")) {
-                        while (l.indexOf("*/") == -1) { // end comment block
-                            l = lines.get(lineNumber++).trim();
-                        }
-                        index = l.indexOf("*/") + 2;
-                        if (index >= l.length()) {
-                            continue;
-                        } else {
-                            // rest of the line
-                            l = l.substring(index, l.length()).trim();
-                            index = 0;
-                        }
-                    }
-
-                    if (l.startsWith("//")) {
-                        index = l.length();
-                        continue;
-                    }
-
-                    if (statement == null) {
-                        throw new RuntimeException(sourcefile + ", line " +
-                            lineNumber + ": missing keyword?");
-                    }
-
-                    if (!hasTargets) {
-                        continue;
-                    }
-
-                    if (index >= l.length()) {
-                        throw new RuntimeException(sourcefile + ", line " +
-                            lineNumber + ": " + l);
-                    }
-
-                    // parse the target module of exports, opens, or provides
-                    Statement stmt = statement;
-
-                    int terminal = l.indexOf(';', index);
-                    // determine up to which position to parse
-                    int pos = terminal != -1 ? terminal : l.length();
-                    // parse up to comments
-                    int pos1 = l.indexOf("//", index);
-                    if (pos1 != -1 && pos1 < pos) {
-                        pos = pos1;
-                    }
-                    int pos2 = l.indexOf("/*", index);
-                    if (pos2 != -1 && pos2 < pos) {
-                        pos = pos2;
-                    }
-                    // target module(s) for qualitifed exports or opens
-                    // or provider implementation class(es)
-                    String rhs = l.substring(index, pos).trim();
-                    index += rhs.length();
-                    trace("rhs: index=%d [%s] [line: %s]%n", index, rhs, l);
-
-                    String[] targets = rhs.split(",");
-                    for (String t : targets) {
-                        String n = t.trim();
-                        if (n.length() > 0)
-                            stmt.addTarget(n);
-                    }
-
-                    // start next statement
-                    if (pos == terminal) {
-                        statement = null;
-                        hasTargets = false;
-                        index = terminal + 1;
-                    }
-                    l = index < l.length() ? l.substring(index, l.length()).trim() : "";
-                    index = 0;
-                }
-
-                lineNumber++;
+        private String skipTokenOrThrow(Parser parser, String token, String msg) {
+            // look ahead to report the proper line number
+            String lookAhead = parser.peekToken();
+            if (!token.equals(lookAhead)) {
+                throw parser.newError(msg);
             }
+            return parser.nextToken();
         }
     }
 
@@ -620,4 +607,175 @@
             System.out.format(fmt, params);
         }
     }
+
+    static class Parser {
+        private static final List<String> EMPTY = List.of();
+
+        private final Path sourceFile;
+        private boolean inCommentBlock = false;
+        private List<List<String>> tokens = new ArrayList<>();
+        private int lineNumber = 1;
+        private int index = 0;
+
+        Parser(Path file) {
+            this.sourceFile = file;
+        }
+
+        void run() throws IOException {
+            List<String> lines = Files.readAllLines(sourceFile);
+            for (int lineNumber = 1; lineNumber <= lines.size(); lineNumber++) {
+                String l = lines.get(lineNumber - 1).trim();
+                tokenize(l);
+            }
+        }
+
+        /*
+         * Tokenize the given string.  Comments are skipped.
+         */
+        List<String> tokenize(String l) {
+            while (!l.isEmpty()) {
+                if (inCommentBlock) {
+                    int comment = l.indexOf("*/");
+                    if (comment == -1)
+                        return emptyTokens();
+
+                    // end comment block
+                    inCommentBlock = false;
+                    if ((comment + 2) >= l.length()) {
+                        return emptyTokens();
+                    }
+                    l = l.substring(comment + 2, l.length()).trim();
+                }
+
+                // skip comment
+                int comment = l.indexOf("//");
+                if (comment >= 0) {
+                    l = l.substring(0, comment).trim();
+                    if (l.isEmpty()) return emptyTokens();
+                }
+
+                if (l.isEmpty()) {
+                    return emptyTokens();
+                }
+
+                int beginComment = l.indexOf("/*");
+                int endComment = l.indexOf("*/");
+                if (beginComment == -1)
+                    return tokens(l);
+
+                String s1 = l.substring(0, beginComment).trim();
+                if (endComment > 0) {
+                    String s2 = l.substring(endComment + 2, l.length()).trim();
+                    if (s1.isEmpty()) {
+                        l = s2;
+                    } else if (s2.isEmpty()) {
+                        l = s1;
+                    } else {
+                        l = s1 + " " + s2;
+                    }
+                } else {
+                    inCommentBlock = true;
+                    return tokens(s1);
+                }
+            }
+            return tokens(l);
+        }
+
+        private List<String> emptyTokens() {
+            this.tokens.add(EMPTY);
+            return EMPTY;
+        }
+        private List<String> tokens(String l) {
+            List<String> tokens = new ArrayList<>();
+            for (String s : l.split("\\s+")) {
+                int pos=0;
+                s = s.trim();
+                if (s.isEmpty())
+                     continue;
+
+                int i = s.indexOf(',', pos);
+                int j = s.indexOf(';', pos);
+                while ((i >= 0 && i < s.length()) || (j >= 0 && j < s.length())) {
+                    if (j == -1 || (i >= 0 && i < j)) {
+                        String n = s.substring(pos, i).trim();
+                        if (!n.isEmpty()) {
+                            tokens.add(n);
+                        }
+                        tokens.add(s.substring(i, i + 1));
+                        pos = i + 1;
+                        i = s.indexOf(',', pos);
+                    } else {
+                        String n = s.substring(pos, j).trim();
+                        if (!n.isEmpty()) {
+                            tokens.add(n);
+                        }
+                        tokens.add(s.substring(j, j + 1));
+                        pos = j + 1;
+                        j = s.indexOf(';', pos);
+                    }
+                }
+
+                String n = s.substring(pos).trim();
+                if (!n.isEmpty()) {
+                    tokens.add(n);
+                }
+            }
+            this.tokens.add(tokens);
+            return tokens;
+        }
+
+        /*
+         * Returns next token.
+         */
+        String nextToken() {
+            while (lineNumber <= tokens.size()) {
+                List<String> l = tokens.get(lineNumber-1);
+                if (index < l.size()) {
+                    return l.get(index++);
+                } else {
+                    lineNumber++;
+                    index = 0;
+                }
+            }
+            return null;
+        }
+
+        /*
+         * Peeks next token.
+         */
+        String peekToken() {
+            int ln = lineNumber;
+            int i = index;
+            while (ln <= tokens.size()) {
+                List<String> l = tokens.get(ln-1);
+                if (i < l.size()) {
+                    return l.get(i++);
+                } else {
+                    ln++;
+                    i = 0;
+                }
+            }
+            return null;
+        }
+
+        Error newError(String msg) {
+            if (lineNumber <= tokens.size()) {
+                throw new Error(sourceFile + ", line " +
+                    lineNumber + ", " + msg + " \"" + lineAt(lineNumber) + "\"");
+            } else {
+                throw new Error(sourceFile + ", line " + lineNumber + ", " + msg);
+            }
+        }
+
+        void dump() {
+            for (int i = 1; i <= tokens.size(); i++) {
+                System.out.format("%d: %s%n", i, lineAt(i));
+            }
+        }
+
+        private String lineAt(int i) {
+            return tokens.get(i-1).stream().collect(Collectors.joining(" "));
+        }
+    }
 }
+
--- a/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java	Tue Aug 14 12:11:28 2018 -0700
@@ -28,6 +28,7 @@
 import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.io.UncheckedIOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -35,6 +36,7 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import build.tools.module.GenModuleInfoSource.Statement;
 
@@ -42,29 +44,36 @@
  * Sanity test for GenModuleInfoSource tool
  */
 public class ModuleInfoExtraTest {
-    private static final Path DIR = Paths.get("test");
+    private static final Path DIR = Paths.get("gen-module-info-test");
+    private static boolean verbose = false;
     public static void main(String... args) throws Exception {
         if (args.length != 0)
-            GenModuleInfoSource.verbose = true;
+            verbose = true;
 
+        GenModuleInfoSource.verbose = verbose;
         ModuleInfoExtraTest test = new ModuleInfoExtraTest("m", "m1", "m2", "m3");
-        test.run();
+        test.testModuleInfo();
+        test.errorCases();
     }
 
     String[] moduleInfo = new String[] {
-        "exports p",
-        "to",
-        "   // comment",
-        "   /* comment */ m1",
+        "module m {",
+        "    requires m1;",
+        "    requires transitive m2;",
+        "    exports p",
+        "    to",
+        "               // comment ... ",
+        "    /* comment */ m1",
         ",",
-        "m2,m3",
-        "   ;",
-        "exports q to m1;",
-        "provides s with /* ",
-        "  comment */ impl     ;    // comment",
-        "provides s1",
-        "    with  ",
-        "    impl1, impl2;"
+        "       m2,m3",
+        "  ;",
+        "    exports q to m1;",
+        "    provides s with /*   ",
+        "    comment */ impl     ;    // comment",
+        "    provides s1",
+        "       with  ",
+        "       impl1, impl2;",
+        "}"
     };
 
     String[] moduleInfoExtra = new String[] {
@@ -76,33 +85,8 @@
         "opens p.q ",
         "   to /* comment */ m3",
         "   , // m1",
-        "   /* comment */, m4;",
-        "provides s1 with impl3;"
-    };
-
-    String[] test1 = new String[] {
-        "exports p1 to m1;",
-        "exports p2"
-    };
-
-    String[] test2 = new String[] {
-        "exports to m1;"
-    };
-
-    String[] test3 = new String[]{
-        "exports p3 to m1;",
-        "    m2, m3;"
-    };
-
-    String[] test4 = new String[]{
-        "provides s with impl1;",   // typo ; should be ,
-        "   impl2, impl3;"
-    };
-
-    String[] test5 = new String[]{
-        "uses s3",
-        "provides s3 with impl1,",
-        "   impl2, impl3;"
+        "   /* comment */ m4; uses p.I",
+        ";   provides s1 with impl3;"
     };
 
     final Builder builder;
@@ -110,11 +94,6 @@
         this.builder = new Builder(name).modules(modules);
     }
 
-    void run() throws IOException {
-        testModuleInfo();
-        errorCases();
-    }
-
 
     void testModuleInfo() throws IOException {
         GenModuleInfoSource source = builder.sourceFile(moduleInfo).build();
@@ -155,7 +134,9 @@
                Set<String> opensPQ,
                Set<String> providerS,
                Set<String> providerS1) {
-        source.moduleInfo.print(new PrintWriter(System.out, true));
+        if (verbose)
+            source.moduleInfo.print(new PrintWriter(System.out, true));
+
         Statement export = source.moduleInfo.exports.get("p");
         if (!export.targets.equals(targetsP)) {
             throw new Error("unexpected: " + export);
@@ -177,24 +158,112 @@
         }
     }
 
+    final Map<String[], String> badModuleInfos = Map.of(
+        new String[] {
+            "module x {",
+            "   exports p1 to ",
+            "           m1",
+            "}"
+        },                      ".*, line .*, missing semicolon.*",
+        new String[] {
+            "module x ",
+            "   exports p1;"
+        },                      ".*, line .*, missing \\{.*",
+        new String[] {
+            "module x {",
+            "   requires m1;",
+            "   requires",
+            "}"
+        },                      ".*, line .*, <identifier> missing.*",
+        new String[] {
+            "module x {",
+            "   requires transitive m1",
+            "}"
+        },                      ".*, line .*, missing semicolon.*",
+        new String[] {
+            "module x {",
+            "   exports p1 to m1;",
+            "   exports p1 to m2;",
+            "}"
+        },                      ".*, line .*, multiple exports p1.*"
+    );
 
+    final Map<String[], String> badExtraFiles = Map.of(
+            new String[] {
+                "requires m2;"     // not allowed
+            },                      ".*, line .*, cannot declare requires .*",
+            new String[] {
+                "exports p1 to m1;",
+                "exports p2"            // missing semicolon
+            },                      ".*, line .*, reach end of file.*",
+            new String[] {
+                "exports to m1;"        // missing <identifier>
+            },                      ".*, line .*, <identifier> missing.*",
+            new String[] {
+                "exports p3 to m1;",
+                "    m2, m3;"           // missing keyword
+            },                      ".*, line .*, missing keyword.*",
+            new String[] {
+                "provides s with impl1;",   // typo ; should be ,
+                "   impl2, impl3;"
+            },                      ".*, line .*, missing keyword.*",
+            new String[] {
+                "uses s3",                  // missing semicolon
+                "provides s3 with impl1,",
+                "   impl2, impl3;"
+            },                      ".*, line .*, missing semicolon.*",
+            new String[] {
+                "opens p1 to m1,, m2;"     // missing identifier
+            },                      ".*, line .*, <identifier> missing.*"
+    );
 
-    void errorCases() throws IOException {
-        fail(test1);
-        fail(test2);
-        fail(test3);
-        fail(test4);
-        fail(test5);
+    final Map<String[], String> duplicates = Map.of(
+            new String[] {
+                "   exports p1 to m1, m2;",
+                "   exports p1 to m3;",
+            },                      ".*, line .*, multiple exports p1.*",
+            new String[] {
+                "   opens p1 to m1, m2;",
+                "   exports p1 to m3;",
+                "   opens p1 to m3;"
+            },                      ".*, line .*, multiple opens p1.*",
+            new String[] {
+                "   uses s;",
+                "   uses s;"
+            },                      ".*, line .*, multiple uses s.*"
+    );
+
+    void errorCases() {
+        badModuleInfos.entrySet().stream().forEach(e -> badModuleInfoFile(e.getKey(), e.getValue()));
+        badExtraFiles.entrySet().stream().forEach(e -> badExtraFile(e.getKey(), e.getValue()));
+        duplicates.entrySet().stream().forEach(e -> badExtraFile(e.getKey(), e.getValue()));
     }
 
-    void fail(String... extras) throws IOException {
+    void badModuleInfoFile(String[] lines, String regex)  {
+        Builder builder = new Builder("x").modules("m1", "m2", "m3");
+        try {
+            GenModuleInfoSource source = builder.sourceFile(lines).build();
+            throw new RuntimeException("Expected error: " + Arrays.toString(lines));
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        } catch (Error e) {
+            if (!e.getMessage().matches(regex)) {
+                throw e;
+            }
+        }
+    }
+
+    void badExtraFile(String[] extras, String regex)  {
         Path file = DIR.resolve("test1");
-        Files.write(file, Arrays.asList(extras));
         try {
+            Files.write(file, Arrays.asList(extras));
             builder.build(file);
-        } catch (RuntimeException e) {
-            if (!e.getMessage().matches("test/test1, line .* is malformed.*") &&
-                !e.getMessage().matches("test/test1, line .* missing keyword.*")) {
+            Files.deleteIfExists(file);
+            throw new RuntimeException("Expected error: " + Arrays.toString(extras));
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        } catch (Error e) {
+            if (!e.getMessage().matches(regex)) {
                 throw e;
             }
         }
@@ -218,11 +287,9 @@
             Files.createDirectories(sourceFile.getParent());
             try (BufferedWriter bw = Files.newBufferedWriter(sourceFile);
                  PrintWriter writer = new PrintWriter(bw)) {
-                writer.format("module %s {%n", moduleName);
                 for (String l : lines) {
                     writer.println(l);
                 }
-                writer.println("}");
             }
             return this;
         }
--- a/make/lib/Awt2dLibraries.gmk	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/lib/Awt2dLibraries.gmk	Tue Aug 14 12:11:28 2018 -0700
@@ -796,6 +796,12 @@
 
   LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
 
+  ifeq ($(OPENJDK_TARGET_OS), linux)
+    ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
+      LIBSPLASHSCREEN_CFLAGS += -DPNG_POWERPC_VSX_OPT=0
+    endif
+  endif
+
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
 
--- a/make/lib/Lib-jdk.jdi.gmk	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/lib/Lib-jdk.jdi.gmk	Tue Aug 14 12:11:28 2018 -0700
@@ -32,7 +32,7 @@
   $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
       NAME := dt_shmem, \
       OPTIMIZATION := LOW, \
-      CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP, \
+      CFLAGS := $(CFLAGS_JDKLIB), \
       EXTRA_HEADER_DIRS := \
           jdk.jdwp.agent:include \
           jdk.jdwp.agent:libjdwp/export, \
--- a/make/lib/Lib-jdk.jdwp.agent.gmk	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk	Tue Aug 14 12:11:28 2018 -0700
@@ -30,8 +30,7 @@
 $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \
     NAME := dt_socket, \
     OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
-        $(LIBDT_SOCKET_CPPFLAGS), \
+    CFLAGS := $(CFLAGS_JDKLIB) $(LIBDT_SOCKET_CPPFLAGS), \
     EXTRA_HEADER_DIRS := \
         include \
         libjdwp/export, \
--- a/make/nb_native/nbproject/configurations.xml	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/nb_native/nbproject/configurations.xml	Tue Aug 14 12:11:28 2018 -0700
@@ -116,6 +116,7 @@
             <in>IBM1122.map</in>
             <in>IBM1123.map</in>
             <in>IBM1124.map</in>
+            <in>IBM1129.map</in>
             <in>IBM1140.map</in>
             <in>IBM1141.map</in>
             <in>IBM1142.map</in>
@@ -16285,6 +16286,11 @@
             tool="3"
             flavor2="0">
       </item>
+      <item path="../../make/data/charsetmapping/IBM1129.map"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
       <item path="../../make/data/charsetmapping/IBM1140.map"
             ex="false"
             tool="3"
--- a/make/test/JtregGraalUnit.gmk	Fri Aug 10 12:36:21 2018 +0530
+++ b/make/test/JtregGraalUnit.gmk	Tue Aug 14 12:11:28 2018 -0700
@@ -46,6 +46,20 @@
     COMPILE_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/test/graalunit
     LIB_OUTPUTDIR := $(TEST_IMAGE_DIR)/hotspot/jtreg/graal
 
+    TEST_COMPILE_CP := \
+        $(JDK_OUTPUTDIR)/modules/jdk.internal.vm.compiler \
+        $(JDK_OUTPUTDIR)/modules/jdk.internal.vm.ci \
+        $(LIB_OUTPUTDIR)/junit-4.12.jar \
+        $(LIB_OUTPUTDIR)/asm-5.0.4.jar \
+        $(LIB_OUTPUTDIR)/asm-tree-5.0.4.jar \
+        $(LIB_OUTPUTDIR)/java-allocation-instrumenter.jar \
+        $(LIB_OUTPUTDIR)/hamcrest-core-1.3.jar
+
+    TEST_JAVAC_FLAGS := \
+        -Xlint:none \
+        -processorpath $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
+        --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \
+
     ### Copy 3rd party libs
     $(eval $(call SetupCopyFiles, COPY_GRAALUNIT_LIBS, \
         FILES := $(wildcard $(GRAALUNIT_LIB)/*.jar), \
@@ -54,7 +68,7 @@
 
     TARGETS_EXTRA_LIB += $(COPY_GRAALUNIT_LIBS)
 
-    ### Compile and build graalunit tests
+    ### Compile graalunit tests
     $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_TESTS, \
         SETUP := GENERATE_USINGJDKBYTECODE, \
         SRC := \
@@ -84,26 +98,41 @@
             $(SRC_DIR)/org.graalvm.compiler.jtt/src \
             $(SRC_DIR)/org.graalvm.compiler.lir.jtt/src \
             , \
+        EXCLUDE_FILES := org/graalvm/compiler/core/test/VerifyDebugUsageTest.java, \
         BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
-        JAR := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests.jar, \
-        CLASSPATH := \
-            $(JDK_OUTPUTDIR)/modules/jdk.internal.vm.compiler \
-            $(JDK_OUTPUTDIR)/modules/jdk.internal.vm.ci \
-            $(LIB_OUTPUTDIR)/junit-4.12.jar \
-            $(LIB_OUTPUTDIR)/asm-5.0.4.jar \
-            $(LIB_OUTPUTDIR)/asm-tree-5.0.4.jar \
-            $(LIB_OUTPUTDIR)/java-allocation-instrumenter.jar \
-            $(LIB_OUTPUTDIR)/hamcrest-core-1.3.jar \
-            , \
-        ADD_JAVAC_FLAGS := \
-            -Xlint:none -processorpath \
-            $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
-            --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \
-            , \
+        CLASSPATH := $(TEST_COMPILE_CP), \
+        ADD_JAVAC_FLAGS := $(TEST_JAVAC_FLAGS), \
     ))
 
     TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS)
 
+    ### Compile graalunit tests which require -XDstringConcat=inline
+    $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_TESTS_SET2, \
+        SETUP := GENERATE_USINGJDKBYTECODE, \
+        DEPENDS := $(BUILD_VM_COMPILER_TESTS), \
+        SRC := $(SRC_DIR)/org.graalvm.compiler.core.test/src, \
+        INCLUDE_FILES := org/graalvm/compiler/core/test/VerifyDebugUsageTest.java, \
+        BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
+        CLASSPATH := \
+            $(TEST_COMPILE_CP) \
+            $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests \
+            , \
+        ADD_JAVAC_FLAGS := \
+            $(TEST_JAVAC_FLAGS) \
+            -XDstringConcat=inline \
+            , \
+    ))
+
+    TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS_SET2)
+
+    ### Generate jdk.vm.compiler.tests.jar
+    $(eval $(call SetupJarArchive, BUILD_VM_COMPILER_TESTS_JAR, \
+        DEPENDENCIES := $(BUILD_VM_COMPILER_TESTS) $(BUILD_VM_COMPILER_TESTS_SET2), \
+        SRCS := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
+        JAR := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests.jar, \
+    ))
+
+    TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS_JAR)
 
     ### Compile and build mxtool
     $(eval $(call SetupJavaCompilation, BUILD_MXTOOL, \
--- a/src/hotspot/cpu/aarch64/aarch64.ad	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/aarch64.ad	Tue Aug 14 12:11:28 2018 -0700
@@ -14471,7 +14471,7 @@
   format %{ "cmp   $op1, $op2\t# overflow check long" %}
   ins_cost(INSN_COST);
   ins_encode %{
-    __ cmp($op1$$Register, $op2$$constant);
+    __ subs(zr, $op1$$Register, $op2$$constant);
   %}
 
   ins_pipe(icmp_reg_imm);
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -295,7 +295,7 @@
   int _offset;
   Register _r;
 public:
-  PrePost(Register reg, int o) : _r(reg), _offset(o) { }
+  PrePost(Register reg, int o) : _offset(o), _r(reg) { }
   int offset() { return _offset; }
   Register reg() { return _r; }
 };
@@ -353,7 +353,7 @@
     ext::operation _op;
   public:
     extend() { }
-    extend(int s, int o, ext::operation op) : _shift(s), _option(o), _op(op) { }
+    extend(int s, int o, ext::operation op) : _option(o), _shift(s), _op(op) { }
     int option() const{ return _option; }
     int shift() const { return _shift; }
     ext::operation op() const { return _op; }
@@ -398,26 +398,25 @@
   Address()
     : _mode(no_mode) { }
   Address(Register r)
-    : _mode(base_plus_offset), _base(r), _offset(0), _index(noreg), _target(0) { }
+    : _base(r), _index(noreg), _offset(0), _mode(base_plus_offset), _target(0) { }
   Address(Register r, int o)
-    : _mode(base_plus_offset), _base(r), _offset(o), _index(noreg), _target(0) { }
+    : _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { }
   Address(Register r, long o)
-    : _mode(base_plus_offset), _base(r), _offset(o), _index(noreg), _target(0) { }
+    : _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { }
   Address(Register r, unsigned long o)
-    : _mode(base_plus_offset), _base(r), _offset(o), _index(noreg), _target(0) { }
+    : _base(r), _index(noreg), _offset(o), _mode(base_plus_offset), _target(0) { }
 #ifdef ASSERT
   Address(Register r, ByteSize disp)
-    : _mode(base_plus_offset), _base(r), _offset(in_bytes(disp)),
-      _index(noreg), _target(0) { }
+    : _base(r), _index(noreg), _offset(in_bytes(disp)), _mode(base_plus_offset), _target(0) { }
 #endif
   Address(Register r, Register r1, extend ext = lsl())
-    : _mode(base_plus_offset_reg), _base(r), _index(r1),
-    _ext(ext), _offset(0), _target(0) { }
+    : _base(r), _index(r1), _offset(0), _mode(base_plus_offset_reg),
+      _ext(ext), _target(0) { }
   Address(Pre p)
-    : _mode(pre), _base(p.reg()), _offset(p.offset()) { }
+    : _base(p.reg()), _offset(p.offset()), _mode(pre) { }
   Address(Post p)
-    : _mode(p.idx_reg() == NULL ? post : post_reg), _base(p.reg()),
-      _offset(p.offset()), _target(0), _index(p.idx_reg()) { }
+    : _base(p.reg()),  _index(p.idx_reg()), _offset(p.offset()),
+      _mode(p.idx_reg() == NULL ? post : post_reg), _target(0) { }
   Address(address target, RelocationHolder const& rspec)
     : _mode(literal),
       _rspec(rspec),
@@ -426,7 +425,7 @@
   Address(address target, relocInfo::relocType rtype = relocInfo::external_word_type);
   Address(Register base, RegisterOrConstant index, extend ext = lsl())
     : _base (base),
-      _ext(ext), _offset(0), _target(0) {
+      _offset(0), _ext(ext), _target(0) {
     if (index.is_register()) {
       _mode = base_plus_offset_reg;
       _index = index.as_register();
--- a/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -50,13 +50,13 @@
 }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
-  : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
+  : _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
-  : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
+  : _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
--- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1922,7 +1922,7 @@
         if (is_32bit)
           __ cmpw(reg1, imm);
         else
-          __ cmp(reg1, imm);
+          __ subs(zr, reg1, imm);
         return;
       } else {
         __ mov(rscratch1, imm);
@@ -2705,7 +2705,7 @@
 
         if (TypeEntries::is_type_none(current_klass)) {
           __ cbz(rscratch2, none);
-          __ cmp(rscratch2, TypeEntries::null_seen);
+          __ cmp(rscratch2, (u1)TypeEntries::null_seen);
           __ br(Assembler::EQ, none);
           // There is a chance that the checks above (re-reading profiling
           // data from memory) fail if another thread has just set the
@@ -2750,7 +2750,7 @@
           Label ok;
           __ ldr(rscratch1, mdo_addr);
           __ cbz(rscratch1, ok);
-          __ cmp(rscratch1, TypeEntries::null_seen);
+          __ cmp(rscratch1, (u1)TypeEntries::null_seen);
           __ br(Assembler::EQ, ok);
           // may have been set by another thread
           __ dmb(Assembler::ISHLD);
--- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -712,7 +712,7 @@
           {
             Label ok, not_ok;
             __ ldrw(obj_size, Address(klass, Klass::layout_helper_offset()));
-            __ cmp(obj_size, 0u);
+            __ cmp(obj_size, (u1)0);
             __ br(Assembler::LE, not_ok);  // make sure it's an instance (LH > 0)
             __ tstw(obj_size, Klass::_lh_instance_slow_path_bit);
             __ br(Assembler::EQ, ok);
--- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -48,6 +48,10 @@
   virtual void obj_equals(MacroAssembler* masm,
                           Register obj1, Register obj2);
 
+  virtual void resolve(MacroAssembler* masm, DecoratorSet decorators, Register obj) {
+    // Default implementation does not need to do anything.
+  }
+
   virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env,
                                              Register obj, Register tmp, Label& slowpath);
 
--- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1636,7 +1636,7 @@
 
   ldr(rscratch1, mdo_addr);
   cbz(rscratch1, none);
-  cmp(rscratch1, TypeEntries::null_seen);
+  cmp(rscratch1, (u1)TypeEntries::null_seen);
   br(Assembler::EQ, none);
   // There is a chance that the checks above (re-reading profiling
   // data from memory) fail if another thread has just set the
@@ -1670,7 +1670,7 @@
     int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
 
     ldrb(rscratch1, Address(mdp, in_bytes(DataLayout::tag_offset()) - off_to_start));
-    cmp(rscratch1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
+    cmp(rscratch1, u1(is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag));
     br(Assembler::NE, profile_continue);
 
     if (MethodData::profile_arguments()) {
@@ -1682,7 +1682,7 @@
           // If return value type is profiled we may have no argument to profile
           ldr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())));
           sub(tmp, tmp, i*TypeStackSlotEntries::per_arg_count());
-          cmp(tmp, TypeStackSlotEntries::per_arg_count());
+          cmp(tmp, (u1)TypeStackSlotEntries::per_arg_count());
           add(rscratch1, mdp, off_to_args);
           br(Assembler::LT, done);
         }
@@ -1752,13 +1752,13 @@
       // length
       Label do_profile;
       ldrb(rscratch1, Address(rbcp, 0));
-      cmp(rscratch1, Bytecodes::_invokedynamic);
+      cmp(rscratch1, (u1)Bytecodes::_invokedynamic);
       br(Assembler::EQ, do_profile);
-      cmp(rscratch1, Bytecodes::_invokehandle);
+      cmp(rscratch1, (u1)Bytecodes::_invokehandle);
       br(Assembler::EQ, do_profile);
       get_method(tmp);
       ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
-      cmp(rscratch1, vmIntrinsics::_compiledLambdaForm);
+      subs(zr, rscratch1, vmIntrinsics::_compiledLambdaForm);
       br(Assembler::NE, profile_continue);
 
       bind(do_profile);
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -494,7 +494,7 @@
     ldr(swap_reg, mark_addr);
   }
   andr(tmp_reg, swap_reg, markOopDesc::biased_lock_mask_in_place);
-  cmp(tmp_reg, markOopDesc::biased_lock_pattern);
+  cmp(tmp_reg, (u1)markOopDesc::biased_lock_pattern);
   br(Assembler::NE, cas_label);
   // The bias pattern is present in the object's header. Need to check
   // whether the bias owner and the epoch are both still current.
@@ -633,7 +633,7 @@
   // the bias bit would be clear.
   ldr(temp_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
   andr(temp_reg, temp_reg, markOopDesc::biased_lock_mask_in_place);
-  cmp(temp_reg, markOopDesc::biased_lock_pattern);
+  cmp(temp_reg, (u1)markOopDesc::biased_lock_pattern);
   br(Assembler::EQ, done);
 }
 
@@ -1137,7 +1137,7 @@
 
   if (super_check_offset.is_register()) {
     br(Assembler::EQ, *L_success);
-    cmp(super_check_offset.as_register(), sc_offset);
+    subs(zr, super_check_offset.as_register(), sc_offset);
     if (L_failure == &L_fallthrough) {
       br(Assembler::EQ, *L_slow_path);
     } else {
@@ -3312,7 +3312,7 @@
     add(table3, table0, 3*256*sizeof(juint));
 
   if (UseNeon) {
-      cmp(len, 64);
+      cmp(len, (u1)64);
       br(Assembler::LT, L_by16);
       eor(v16, T16B, v16, v16);
 
@@ -3990,6 +3990,15 @@
   }
 }
 
+void MacroAssembler::resolve(DecoratorSet decorators, Register obj) {
+  // Use stronger ACCESS_WRITE|ACCESS_READ by default.
+  if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
+    decorators |= ACCESS_READ | ACCESS_WRITE;
+  }
+  BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  return bs->resolve(this, decorators, obj);
+}
+
 void MacroAssembler::load_heap_oop(Register dst, Address src, Register tmp1,
                                    Register thread_tmp, DecoratorSet decorators) {
   access_load_at(T_OBJECT, IN_HEAP | decorators, dst, src, tmp1, thread_tmp);
@@ -4362,10 +4371,10 @@
 
   if (icnt1 == -1) {
     sub(result_tmp, cnt2, cnt1);
-    cmp(cnt1, 8);             // Use Linear Scan if cnt1 < 8 || cnt1 >= 256
+    cmp(cnt1, (u1)8);             // Use Linear Scan if cnt1 < 8 || cnt1 >= 256
     br(LT, LINEARSEARCH);
     dup(v0, T16B, cnt1); // done in separate FPU pipeline. Almost no penalty
-    cmp(cnt1, 256);
+    subs(zr, cnt1, 256);
     lsr(tmp1, cnt2, 2);
     ccmp(cnt1, tmp1, 0b0000, LT); // Source must be 4 * pattern for BM
     br(GE, LINEARSTUB);
@@ -4471,7 +4480,7 @@
     BIND(BCLOOP);
       (this->*str1_load_1chr)(ch1, Address(post(tmp3, str1_chr_size)));
       if (!str1_isL) {
-        cmp(ch1, ASIZE);
+        subs(zr, ch1, ASIZE);
         br(HS, BCSKIP);
       }
       strb(ch2, Address(sp, ch1));
@@ -4535,7 +4544,7 @@
         } else {
           mov(result_tmp, 1);
         }
-        cmp(skipch, ASIZE);
+        subs(zr, skipch, ASIZE);
         br(HS, BMADV);
       }
       ldrb(result_tmp, Address(sp, skipch)); // load skip distance
@@ -4556,7 +4565,7 @@
       b(DONE);
 
     BIND(LINEARSTUB);
-    cmp(cnt1, 16); // small patterns still should be handled by simple algorithm
+    cmp(cnt1, (u1)16); // small patterns still should be handled by simple algorithm
     br(LT, LINEAR_MEDIUM);
     mov(result, zr);
     RuntimeAddress stub = NULL;
@@ -4585,7 +4594,7 @@
     {
         Label DOSHORT, FIRST_LOOP, STR2_NEXT, STR1_LOOP, STR1_NEXT;
 
-        cmp(cnt1, str1_isL == str2_isL ? 4 : 2);
+        cmp(cnt1, u1(str1_isL == str2_isL ? 4 : 2));
         br(LT, DOSHORT);
       BIND(LINEAR_MEDIUM);
         (this->*str1_load_1chr)(first, Address(str1));
@@ -4620,7 +4629,7 @@
 
       BIND(DOSHORT);
       if (str1_isL == str2_isL) {
-        cmp(cnt1, 2);
+        cmp(cnt1, (u1)2);
         br(LT, DO1);
         br(GT, DO3);
       }
@@ -4695,7 +4704,7 @@
 
       BIND(DO1);
         (this->*str1_load_1chr)(ch1, str1);
-        cmp(cnt2, 8);
+        cmp(cnt2, (u1)8);
         br(LT, DO1_SHORT);
 
         sub(result_tmp, cnt2, 8/str2_chr_size);
@@ -4718,7 +4727,7 @@
         adds(cnt2_neg, cnt2_neg, 8);
         br(LT, CH1_LOOP);
 
-        cmp(cnt2_neg, 8);
+        cmp(cnt2_neg, (u1)8);
         mov(cnt2_neg, 0);
         br(LT, CH1_LOOP);
         b(NOMATCH);
@@ -4761,7 +4770,7 @@
   Register ch1 = rscratch1;
   Register result_tmp = rscratch2;
 
-  cmp(cnt1, 4);
+  cmp(cnt1, (u1)4);
   br(LT, DO1_SHORT);
 
   orr(ch, ch, ch, LSL, 16);
@@ -4784,7 +4793,7 @@
     adds(cnt1_neg, cnt1_neg, 8);
     br(LT, CH1_LOOP);
 
-    cmp(cnt1_neg, 8);
+    cmp(cnt1_neg, (u1)8);
     mov(cnt1_neg, 0);
     br(LT, CH1_LOOP);
     b(NOMATCH);
@@ -4821,7 +4830,7 @@
       DIFFERENCE, NEXT_WORD, SHORT_LOOP_TAIL, SHORT_LAST2, SHORT_LAST_INIT,
       SHORT_LOOP_START, TAIL_CHECK;
 
-  const int STUB_THRESHOLD = 64 + 8;
+  const u1 STUB_THRESHOLD = 64 + 8;
   bool isLL = ae == StrIntrinsicNode::LL;
   bool isLU = ae == StrIntrinsicNode::LU;
   bool isUL = ae == StrIntrinsicNode::UL;
@@ -5216,10 +5225,10 @@
     ldrw(cnt2, Address(a2, length_offset));
     // on most CPUs a2 is still "locked"(surprisingly) in ldrw and it's
     // faster to perform another branch before comparing a1 and a2
-    cmp(cnt1, elem_per_word);
+    cmp(cnt1, (u1)elem_per_word);
     br(LE, SHORT); // short or same
     ldr(tmp3, Address(pre(a1, base_offset)));
-    cmp(cnt1, stubBytesThreshold);
+    subs(zr, cnt1, stubBytesThreshold);
     br(GE, STUB);
     ldr(tmp4, Address(pre(a2, base_offset)));
     sub(tmp5, zr, cnt1, LSL, 3 + log_elem_size);
@@ -5236,7 +5245,7 @@
       cbnz(tmp4, DONE);
       ldr(tmp3, Address(pre(a1, wordSize)));
       ldr(tmp4, Address(pre(a2, wordSize)));
-      cmp(cnt1, elem_per_word);
+      cmp(cnt1, (u1)elem_per_word);
       br(LE, TAIL2);
       cmp(tmp1, tmp2);
     } br(EQ, NEXT_DWORD);
@@ -5409,7 +5418,7 @@
   assert(ptr == r10 && cnt == r11, "mismatch in register usage");
 
   BLOCK_COMMENT("zero_words {");
-  cmp(cnt, zero_words_block_size);
+  cmp(cnt, (u1)zero_words_block_size);
   Label around, done, done16;
   br(LO, around);
   {
@@ -5590,15 +5599,15 @@
       mov(result, len); // Save initial len
 
 #ifndef BUILTIN_SIM
-      cmp(len, 8); // handle shortest strings first
+      cmp(len, (u1)8); // handle shortest strings first
       br(LT, LOOP_1);
-      cmp(len, 32);
+      cmp(len, (u1)32);
       br(LT, NEXT_8);
       // The following code uses the SIMD 'uzp1' and 'uzp2' instructions
       // to convert chars to bytes
       if (SoftwarePrefetchHintDistance >= 0) {
         ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src);
-        cmp(len, SoftwarePrefetchHintDistance/2 + 16);
+        subs(tmp2, len, SoftwarePrefetchHintDistance/2 + 16);
         br(LE, NEXT_32_START);
         b(NEXT_32_PRFM_START);
         BIND(NEXT_32_PRFM);
@@ -5618,9 +5627,9 @@
           sub(len, len, 32);
           add(dst, dst, 32);
           add(src, src, 64);
-          cmp(len, SoftwarePrefetchHintDistance/2 + 16);
+          subs(tmp2, len, SoftwarePrefetchHintDistance/2 + 16);
           br(GE, NEXT_32_PRFM);
-          cmp(len, 32);
+          cmp(len, (u1)32);
           br(LT, LOOP_8);
         BIND(NEXT_32);
           ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src);
@@ -5643,12 +5652,12 @@
       sub(len, len, 32);
       add(dst, dst, 32);
       add(src, src, 64);
-      cmp(len, 32);
+      cmp(len, (u1)32);
       br(GE, NEXT_32);
       cbz(len, DONE);
 
     BIND(LOOP_8);
-      cmp(len, 8);
+      cmp(len, (u1)8);
       br(LT, LOOP_1);
     BIND(NEXT_8);
       ld1(Vtmp1, T8H, src);
@@ -5661,7 +5670,7 @@
       sub(len, len, 8);
       add(dst, dst, 8);
       add(src, src, 16);
-      cmp(len, 8);
+      cmp(len, (u1)8);
       br(GE, NEXT_8);
 
     BIND(LOOP_1);
@@ -5738,7 +5747,7 @@
       const int large_loop_threshold = (64 + 16)/8;
       ldrd(vtmp2, post(src, 8));
       andw(len, len, 7);
-      cmp(tmp4, large_loop_threshold);
+      cmp(tmp4, (u1)large_loop_threshold);
       br(GE, to_stub);
       b(loop_start);
 
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -180,8 +180,9 @@
 
   template<class T>
   inline void cmpw(Register Rd, T imm)  { subsw(zr, Rd, imm); }
-  // imm is limited to 12 bits.
-  inline void cmp(Register Rd, unsigned imm)  { subs(zr, Rd, imm); }
+
+  inline void cmp(Register Rd, unsigned char imm8)  { subs(zr, Rd, imm8); }
+  inline void cmp(Register Rd, unsigned imm) __attribute__ ((deprecated));
 
   inline void cmnw(Register Rd, unsigned imm) { addsw(zr, Rd, imm); }
   inline void cmn(Register Rd, unsigned imm) { adds(zr, Rd, imm); }
@@ -795,6 +796,10 @@
   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
                        Register tmp1, Register tmp_thread);
 
+  // Resolves obj for access. Result is placed in the same register.
+  // All other registers are preserved.
+  void resolve(DecoratorSet decorators, Register obj);
+
   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
 
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -292,7 +292,7 @@
     // vtmp1 = AS_DOUBLE_BITS(0x77F0 << 48 | mantissa(X)) == mx
     fmovd(vtmp1, tmp4);
     subw(tmp2, tmp2, 16);
-    cmp(tmp2, 0x8000);
+    subs(zr, tmp2, 0x8000);
     br(GE, SMALL_VALUE);
   bind(MAIN);
     fmovs(tmp3, vtmp5);                        // int intB0 = AS_INT_BITS(B);
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -297,7 +297,7 @@
       fmsubd(v3, v2, v6, v31); // v3 = r = t - fn * pio2_1
       fmuld(v26, v2, v7);      // v26 = w = fn * pio2_1t
       fsubd(v4, v3, v26);      // y[0] = r - w. Calculated before branch
-      cmp(n, 32);
+      cmp(n, (u1)32);
       br(GT, LARGE_ELSE);
       subw(tmp5, n, 1);        // tmp5 = n - 1
       ldrw(jv, Address(ih, tmp5, Address::lsl(2)));
@@ -312,7 +312,7 @@
           sub(tmp3, tmp5, jx, LSR, 32 + 20 + 1);   // r7 = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff);
 
           block_comment("if(i>16)"); {
-            cmp(tmp3, 16);
+            cmp(tmp3, (u1)16);
             br(LE, X_IS_MEDIUM_BRANCH_DONE);
             // i > 16. 2nd iteration needed
             ldpd(v6, v7, Address(ih, -32));
@@ -328,7 +328,7 @@
             sub(tmp3, tmp5, jx, LSR, 32 + 20 + 1); // r7 = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff);
 
             block_comment("if(i>49)"); {
-              cmp(tmp3, 49);
+              cmp(tmp3, (u1)49);
               br(LE, X_IS_MEDIUM_BRANCH_DONE);
               // 3rd iteration need, 151 bits acc
               ldpd(v6, v7, Address(ih, -16));
--- a/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -196,7 +196,7 @@
     Label L;
     BLOCK_COMMENT("verify_intrinsic_id {");
     __ ldrh(rscratch1, Address(rmethod, Method::intrinsic_id_offset_in_bytes()));
-    __ cmp(rscratch1, (int) iid);
+    __ subs(zr, rscratch1, (int) iid);
     __ br(Assembler::EQ, L);
     if (iid == vmIntrinsics::_linkToVirtual ||
         iid == vmIntrinsics::_linkToSpecial) {
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1152,12 +1152,12 @@
    public:
     MoveOperation(int src_index, VMRegPair src, int dst_index, VMRegPair dst):
       _src(src)
+    , _dst(dst)
     , _src_index(src_index)
-    , _dst(dst)
     , _dst_index(dst_index)
+    , _processed(false)
     , _next(NULL)
-    , _prev(NULL)
-    , _processed(false) { Unimplemented(); }
+    , _prev(NULL) { Unimplemented(); }
 
     VMRegPair src() const              { Unimplemented(); return _src; }
     int src_id() const                 { Unimplemented(); return 0; }
@@ -1839,6 +1839,8 @@
     // Load the oop from the handle
     __ ldr(obj_reg, Address(oop_handle_reg, 0));
 
+    __ resolve(IS_NOT_NULL, obj_reg);
+
     if (UseBiasedLocking) {
       __ biased_locking_enter(lock_reg, obj_reg, swap_reg, tmp, false, lock_done, &slow_path_lock);
     }
@@ -2001,6 +2003,8 @@
     // Get locked oop from the handle we passed to jni
     __ ldr(obj_reg, Address(oop_handle_reg, 0));
 
+    __ resolve(IS_NOT_NULL, obj_reg);
+
     Label done;
 
     if (UseBiasedLocking) {
--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -265,7 +265,7 @@
     {
       Label L;
       __ ldr(rscratch1, Address(rthread, in_bytes(Thread::pending_exception_offset())));
-      __ cmp(rscratch1, (unsigned)NULL_WORD);
+      __ cmp(rscratch1, (u1)NULL_WORD);
       __ br(Assembler::EQ, L);
       __ stop("StubRoutines::call_stub: entered with pending exception");
       __ BIND(L);
@@ -322,13 +322,13 @@
     __ ldr(j_rarg2, result);
     Label is_long, is_float, is_double, exit;
     __ ldr(j_rarg1, result_type);
-    __ cmp(j_rarg1, T_OBJECT);
+    __ cmp(j_rarg1, (u1)T_OBJECT);
     __ br(Assembler::EQ, is_long);
-    __ cmp(j_rarg1, T_LONG);
+    __ cmp(j_rarg1, (u1)T_LONG);
     __ br(Assembler::EQ, is_long);
-    __ cmp(j_rarg1, T_FLOAT);
+    __ cmp(j_rarg1, (u1)T_FLOAT);
     __ br(Assembler::EQ, is_float);
-    __ cmp(j_rarg1, T_DOUBLE);
+    __ cmp(j_rarg1, (u1)T_DOUBLE);
     __ br(Assembler::EQ, is_double);
 
     // handle T_INT case
@@ -743,7 +743,7 @@
     // Make sure we are never given < 8 words
     {
       Label L;
-      __ cmp(count, 8);
+      __ cmp(count, (u1)8);
       __ br(Assembler::GE, L);
       __ stop("genrate_copy_longs called with < 8 words");
       __ bind(L);
@@ -1103,19 +1103,19 @@
 
     if (PrefetchCopyIntervalInBytes > 0)
       __ prfm(Address(s, 0), PLDL1KEEP);
-    __ cmp(count, (UseSIMDForMemoryOps ? 96:80)/granularity);
+    __ cmp(count, u1((UseSIMDForMemoryOps ? 96:80)/granularity));
     __ br(Assembler::HI, copy_big);
 
     __ lea(send, Address(s, count, Address::lsl(exact_log2(granularity))));
     __ lea(dend, Address(d, count, Address::lsl(exact_log2(granularity))));
 
-    __ cmp(count, 16/granularity);
+    __ cmp(count, u1(16/granularity));
     __ br(Assembler::LS, copy16);
 
-    __ cmp(count, 64/granularity);
+    __ cmp(count, u1(64/granularity));
     __ br(Assembler::HI, copy80);
 
-    __ cmp(count, 32/granularity);
+    __ cmp(count, u1(32/granularity));
     __ br(Assembler::LS, copy32);
 
     // 33..64 bytes
@@ -1170,7 +1170,7 @@
 
     // 0..16 bytes
     __ bind(copy16);
-    __ cmp(count, 8/granularity);
+    __ cmp(count, u1(8/granularity));
     __ br(Assembler::LO, copy8);
 
     // 8..16 bytes
@@ -3270,7 +3270,7 @@
 
     // The pipelined loop needs at least 16 elements for 1 iteration
     // It does check this, but it is more effective to skip to the cleanup loop
-    __ cmp(len, 16);
+    __ cmp(len, (u1)16);
     __ br(Assembler::HS, L_nmax);
     __ cbz(len, L_combine);
 
@@ -3654,7 +3654,7 @@
 
   address generate_has_negatives(address &has_negatives_long) {
     StubCodeMark mark(this, "StubRoutines", "has_negatives");
-    const int large_loop_size = 64;
+    const u1 large_loop_size = 64;
     const uint64_t UPPER_BIT_MASK=0x8080808080808080;
     int dcache_line = VM_Version::dcache_line_size();
 
@@ -3668,7 +3668,7 @@
   Label RET_TRUE, RET_TRUE_NO_POP, RET_FALSE, ALIGNED, LOOP16, CHECK_16, DONE,
         LARGE_LOOP, POST_LOOP16, LEN_OVER_15, LEN_OVER_8, POST_LOOP16_LOAD_TAIL;
 
-  __ cmp(len, 15);
+  __ cmp(len, (u1)15);
   __ br(Assembler::GT, LEN_OVER_15);
   // The only case when execution falls into this code is when pointer is near
   // the end of memory page and we have to avoid reading next page
@@ -3764,7 +3764,7 @@
     __ br(Assembler::GE, LARGE_LOOP);
 
   __ bind(CHECK_16); // small 16-byte load pre-loop
-    __ cmp(len, 16);
+    __ cmp(len, (u1)16);
     __ br(Assembler::LT, POST_LOOP16);
 
   __ bind(LOOP16); // small 16-byte load loop
@@ -3773,11 +3773,11 @@
     __ orr(tmp2, tmp2, tmp3);
     __ tst(tmp2, UPPER_BIT_MASK);
     __ br(Assembler::NE, RET_TRUE);
-    __ cmp(len, 16);
+    __ cmp(len, (u1)16);
     __ br(Assembler::GE, LOOP16); // 16-byte load loop end
 
   __ bind(POST_LOOP16); // 16-byte aligned, so we can read unconditionally
-    __ cmp(len, 8);
+    __ cmp(len, (u1)8);
     __ br(Assembler::LE, POST_LOOP16_LOAD_TAIL);
     __ ldr(tmp3, Address(__ post(ary1, 8)));
     __ sub(len, len, 8);
@@ -3942,7 +3942,7 @@
         __ br(__ LE, NO_PREFETCH_LARGE_LOOP);
         generate_large_array_equals_loop_simd(prefetchLoopThreshold,
             /* prfm = */ true, NOT_EQUAL);
-        __ cmp(cnt1, nonPrefetchLoopThreshold);
+        __ subs(zr, cnt1, nonPrefetchLoopThreshold);
         __ br(__ LT, TAIL);
       }
       __ bind(NO_PREFETCH_LARGE_LOOP);
@@ -3955,7 +3955,7 @@
         __ br(__ LE, NO_PREFETCH_LARGE_LOOP);
         generate_large_array_equals_loop_nonsimd(prefetchLoopThreshold,
             /* prfm = */ true, NOT_EQUAL);
-        __ cmp(cnt1, nonPrefetchLoopThreshold);
+        __ subs(zr, cnt1, nonPrefetchLoopThreshold);
         __ br(__ LT, TAIL);
       }
       __ bind(NO_PREFETCH_LARGE_LOOP);
@@ -4106,7 +4106,7 @@
     __ ldr(tmp3, Address(__ post(cnt1, 8)));
 
     if (SoftwarePrefetchHintDistance >= 0) {
-      __ cmp(cnt2, prefetchLoopExitCondition);
+      __ subs(rscratch2, cnt2, prefetchLoopExitCondition);
       __ br(__ LT, SMALL_LOOP);
       __ bind(LARGE_LOOP_PREFETCH);
         __ prfm(Address(tmp2, SoftwarePrefetchHintDistance));
@@ -4123,7 +4123,7 @@
           __ subs(tmp4, tmp4, 1);
           __ br(__ GT, LARGE_LOOP_PREFETCH_REPEAT2);
           __ sub(cnt2, cnt2, 64);
-          __ cmp(cnt2, prefetchLoopExitCondition);
+          __ subs(rscratch2, cnt2, prefetchLoopExitCondition);
           __ br(__ GE, LARGE_LOOP_PREFETCH);
     }
     __ cbz(cnt2, LOAD_LAST); // no characters left except last load
@@ -4137,7 +4137,7 @@
       __ br(__ GE, SMALL_LOOP);
       __ cbz(cnt2, LOAD_LAST);
     __ bind(TAIL); // 1..15 characters left
-      __ cmp(cnt2, -8);
+      __ subs(zr, cnt2, -8);
       __ br(__ GT, TAIL_LOAD_16);
       __ ldrd(vtmp, Address(tmp2));
       __ zip1(vtmp3, __ T8B, vtmp, vtmpZ);
@@ -4240,7 +4240,7 @@
         compare_string_16_bytes_same(DIFF, DIFF2);
         __ sub(cnt2, cnt2, isLL ? 64 : 32);
         compare_string_16_bytes_same(DIFF, DIFF2);
-        __ cmp(cnt2, largeLoopExitCondition);
+        __ subs(rscratch2, cnt2, largeLoopExitCondition);
         compare_string_16_bytes_same(DIFF, DIFF2);
         __ br(__ GT, LARGE_LOOP_PREFETCH);
         __ cbz(cnt2, LAST_CHECK_AND_LENGTH_DIFF); // no more chars left?
@@ -4416,7 +4416,7 @@
       __ add(result, result, wordSize/str2_chr_size);
       __ br(__ GE, L_LOOP);
     __ BIND(L_POST_LOOP);
-      __ cmp(cnt2, -wordSize/str2_chr_size); // no extra characters to check
+      __ subs(zr, cnt2, -wordSize/str2_chr_size); // no extra characters to check
       __ br(__ LE, NOMATCH);
       __ ldr(ch2, Address(str2));
       __ sub(cnt2, zr, cnt2, __ LSL, LogBitsPerByte + str2_chr_shift);
@@ -4446,7 +4446,7 @@
       __ br(__ EQ, NOMATCH);
     __ BIND(L_SMALL_HAS_ZERO_LOOP);
       __ clz(tmp4, tmp2); // potentially long. Up to 4 cycles on some cpu's
-      __ cmp(cnt1, wordSize/str2_chr_size);
+      __ cmp(cnt1, u1(wordSize/str2_chr_size));
       __ br(__ LE, L_SMALL_CMP_LOOP_LAST_CMP2);
       if (str2_isL) { // LL
         __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte); // address of "index"
@@ -4659,7 +4659,7 @@
     __ zip1(v2, __ T16B, v2, v0);
     __ st1(v1, v2, __ T16B, __ post(dst, 32));
     __ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64)));
-    __ cmp(octetCounter, large_loop_threshold);
+    __ subs(rscratch1, octetCounter, large_loop_threshold);
     __ br(__ LE, LOOP_START);
     __ b(LOOP_PRFM_START);
     __ bind(LOOP_PRFM);
@@ -4667,17 +4667,17 @@
     __ bind(LOOP_PRFM_START);
       __ prfm(Address(src, SoftwarePrefetchHintDistance));
       __ sub(octetCounter, octetCounter, 8);
-      __ cmp(octetCounter, large_loop_threshold);
+      __ subs(rscratch1, octetCounter, large_loop_threshold);
       inflate_and_store_2_fp_registers(true, v3, v4);
       inflate_and_store_2_fp_registers(true, v5, v6);
       __ br(__ GT, LOOP_PRFM);
-      __ cmp(octetCounter, 8);
+      __ cmp(octetCounter, (u1)8);
       __ br(__ LT, DONE);
     __ bind(LOOP);
       __ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64)));
       __ bind(LOOP_START);
       __ sub(octetCounter, octetCounter, 8);
-      __ cmp(octetCounter, 8);
+      __ cmp(octetCounter, (u1)8);
       inflate_and_store_2_fp_registers(false, v3, v4);
       inflate_and_store_2_fp_registers(false, v5, v6);
       __ br(__ GE, LOOP);
@@ -5308,7 +5308,7 @@
       {
         ldr(Rn, Address(Pn_base, 0));
         mul(Rlo_mn, Rn, inv);
-        cmp(Rlo_mn, -1);
+        subs(zr, Rlo_mn, -1);
         Label ok;
         br(EQ, ok); {
           stop("broken inverse in Montgomery multiply");
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -836,6 +836,7 @@
 #endif // ASSERT
 
     __ bind(done);
+    __ resolve(IS_NOT_NULL, r0);
   }
 
   // add space for monitor & lock
@@ -1062,6 +1063,7 @@
       __ ldrw(crc,   Address(esp, 4*wordSize)); // Initial CRC
     } else {
       __ ldr(buf, Address(esp, 2*wordSize)); // byte[] array
+      __ resolve(IS_NOT_NULL | ACCESS_READ, buf);
       __ add(buf, buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
       __ ldrw(off, Address(esp, wordSize)); // offset
       __ add(buf, buf, off); // + offset
@@ -1106,6 +1108,9 @@
     __ ldrw(off, Address(esp, wordSize)); // int offset
     __ sub(len, end, off);
     __ ldr(buf, Address(esp, 2*wordSize)); // byte[] buf | long buf
+    if (kind == Interpreter::java_util_zip_CRC32C_updateBytes) {
+      __ resolve(IS_NOT_NULL | ACCESS_READ, buf);
+    }
     __ add(buf, buf, off); // + offset
     if (kind == Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer) {
       __ ldrw(crc, Address(esp, 4*wordSize)); // long crc
@@ -1355,7 +1360,7 @@
   {
     Label L;
     __ ldrw(t, Address(rthread, JavaThread::thread_state_offset()));
-    __ cmp(t, _thread_in_Java);
+    __ cmp(t, (u1)_thread_in_Java);
     __ br(Assembler::EQ, L);
     __ stop("Wrong thread state in native stub");
     __ bind(L);
@@ -1462,7 +1467,7 @@
     Label no_reguard;
     __ lea(rscratch1, Address(rthread, in_bytes(JavaThread::stack_guard_state_offset())));
     __ ldrw(rscratch1, Address(rscratch1));
-    __ cmp(rscratch1, JavaThread::stack_guard_yellow_reserved_disabled);
+    __ cmp(rscratch1, (u1)JavaThread::stack_guard_yellow_reserved_disabled);
     __ br(Assembler::NE, no_reguard);
 
     __ pusha(); // XXX only save smashed registers
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -331,16 +331,16 @@
   __ ldarb(r3, r3);
 
   // unresolved class - get the resolved class
-  __ cmp(r3, JVM_CONSTANT_UnresolvedClass);
+  __ cmp(r3, (u1)JVM_CONSTANT_UnresolvedClass);
   __ br(Assembler::EQ, call_ldc);
 
   // unresolved class in error state - call into runtime to throw the error
   // from the first resolution attempt
-  __ cmp(r3, JVM_CONSTANT_UnresolvedClassInError);
+  __ cmp(r3, (u1)JVM_CONSTANT_UnresolvedClassInError);
   __ br(Assembler::EQ, call_ldc);
 
   // resolved class - need to call vm to get java mirror of the class
-  __ cmp(r3, JVM_CONSTANT_Class);
+  __ cmp(r3, (u1)JVM_CONSTANT_Class);
   __ br(Assembler::NE, notClass);
 
   __ bind(call_ldc);
@@ -351,7 +351,7 @@
   __ b(Done);
 
   __ bind(notClass);
-  __ cmp(r3, JVM_CONSTANT_Float);
+  __ cmp(r3, (u1)JVM_CONSTANT_Float);
   __ br(Assembler::NE, notFloat);
   // ftos
   __ adds(r1, r2, r1, Assembler::LSL, 3);
@@ -361,7 +361,7 @@
 
   __ bind(notFloat);
 
-  __ cmp(r3, JVM_CONSTANT_Integer);
+  __ cmp(r3, (u1)JVM_CONSTANT_Integer);
   __ br(Assembler::NE, notInt);
 
   // itos
@@ -2333,7 +2333,7 @@
 
   assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
   __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size);
-  __ cmp(temp, (int) code);  // have we resolved this bytecode?
+  __ subs(zr, temp, (int) code);  // have we resolved this bytecode?
   __ br(Assembler::EQ, resolved);
 
   // resolve first time through
@@ -2515,7 +2515,7 @@
   __ b(Done);
 
   __ bind(notByte);
-  __ cmp(flags, ztos);
+  __ cmp(flags, (u1)ztos);
   __ br(Assembler::NE, notBool);
 
   // ztos (same code as btos)
@@ -2529,7 +2529,7 @@
   __ b(Done);
 
   __ bind(notBool);
-  __ cmp(flags, atos);
+  __ cmp(flags, (u1)atos);
   __ br(Assembler::NE, notObj);
   // atos
   do_oop_load(_masm, field, r0, IN_HEAP);
@@ -2540,7 +2540,7 @@
   __ b(Done);
 
   __ bind(notObj);
-  __ cmp(flags, itos);
+  __ cmp(flags, (u1)itos);
   __ br(Assembler::NE, notInt);
   // itos
   __ access_load_at(T_INT, IN_HEAP, r0, field, noreg, noreg);
@@ -2552,7 +2552,7 @@
   __ b(Done);
 
   __ bind(notInt);
-  __ cmp(flags, ctos);
+  __ cmp(flags, (u1)ctos);
   __ br(Assembler::NE, notChar);
   // ctos
   __ access_load_at(T_CHAR, IN_HEAP, r0, field, noreg, noreg);
@@ -2564,7 +2564,7 @@
   __ b(Done);
 
   __ bind(notChar);
-  __ cmp(flags, stos);
+  __ cmp(flags, (u1)stos);
   __ br(Assembler::NE, notShort);
   // stos
   __ access_load_at(T_SHORT, IN_HEAP, r0, field, noreg, noreg);
@@ -2576,7 +2576,7 @@
   __ b(Done);
 
   __ bind(notShort);
-  __ cmp(flags, ltos);
+  __ cmp(flags, (u1)ltos);
   __ br(Assembler::NE, notLong);
   // ltos
   __ access_load_at(T_LONG, IN_HEAP, r0, field, noreg, noreg);
@@ -2588,7 +2588,7 @@
   __ b(Done);
 
   __ bind(notLong);
-  __ cmp(flags, ftos);
+  __ cmp(flags, (u1)ftos);
   __ br(Assembler::NE, notFloat);
   // ftos
   __ access_load_at(T_FLOAT, IN_HEAP, noreg /* ftos */, field, noreg, noreg);
@@ -2601,7 +2601,7 @@
 
   __ bind(notFloat);
 #ifdef ASSERT
-  __ cmp(flags, dtos);
+  __ cmp(flags, (u1)dtos);
   __ br(Assembler::NE, notDouble);
 #endif
   // dtos
@@ -2751,7 +2751,7 @@
   }
 
   __ bind(notByte);
-  __ cmp(flags, ztos);
+  __ cmp(flags, (u1)ztos);
   __ br(Assembler::NE, notBool);
 
   // ztos
@@ -2766,7 +2766,7 @@
   }
 
   __ bind(notBool);
-  __ cmp(flags, atos);
+  __ cmp(flags, (u1)atos);
   __ br(Assembler::NE, notObj);
 
   // atos
@@ -2782,7 +2782,7 @@
   }
 
   __ bind(notObj);
-  __ cmp(flags, itos);
+  __ cmp(flags, (u1)itos);
   __ br(Assembler::NE, notInt);
 
   // itos
@@ -2797,7 +2797,7 @@
   }
 
   __ bind(notInt);
-  __ cmp(flags, ctos);
+  __ cmp(flags, (u1)ctos);
   __ br(Assembler::NE, notChar);
 
   // ctos
@@ -2812,7 +2812,7 @@
   }
 
   __ bind(notChar);
-  __ cmp(flags, stos);
+  __ cmp(flags, (u1)stos);
   __ br(Assembler::NE, notShort);
 
   // stos
@@ -2827,7 +2827,7 @@
   }
 
   __ bind(notShort);
-  __ cmp(flags, ltos);
+  __ cmp(flags, (u1)ltos);
   __ br(Assembler::NE, notLong);
 
   // ltos
@@ -2842,7 +2842,7 @@
   }
 
   __ bind(notLong);
-  __ cmp(flags, ftos);
+  __ cmp(flags, (u1)ftos);
   __ br(Assembler::NE, notFloat);
 
   // ftos
@@ -2858,7 +2858,7 @@
 
   __ bind(notFloat);
 #ifdef ASSERT
-  __ cmp(flags, dtos);
+  __ cmp(flags, (u1)dtos);
   __ br(Assembler::NE, notDouble);
 #endif
 
@@ -3534,7 +3534,7 @@
   __ lea(rscratch1, Address(r0, r3, Address::lsl(0)));
   __ lea(rscratch1, Address(rscratch1, tags_offset));
   __ ldarb(rscratch1, rscratch1);
-  __ cmp(rscratch1, JVM_CONSTANT_Class);
+  __ cmp(rscratch1, (u1)JVM_CONSTANT_Class);
   __ br(Assembler::NE, slow_case);
 
   // get InstanceKlass
@@ -3543,7 +3543,7 @@
   // make sure klass is initialized & doesn't have finalizer
   // make sure klass is fully initialized
   __ ldrb(rscratch1, Address(r4, InstanceKlass::init_state_offset()));
-  __ cmp(rscratch1, InstanceKlass::fully_initialized);
+  __ cmp(rscratch1, (u1)InstanceKlass::fully_initialized);
   __ br(Assembler::NE, slow_case);
 
   // get instance_size in InstanceKlass (scaled to a count of bytes)
@@ -3683,7 +3683,7 @@
   __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
   __ lea(r1, Address(rscratch1, r19));
   __ ldarb(r1, r1);
-  __ cmp(r1, JVM_CONSTANT_Class);
+  __ cmp(r1, (u1)JVM_CONSTANT_Class);
   __ br(Assembler::EQ, quicked);
 
   __ push(atos); // save receiver for result, and for GC
@@ -3737,7 +3737,7 @@
   __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
   __ lea(r1, Address(rscratch1, r19));
   __ ldarb(r1, r1);
-  __ cmp(r1, JVM_CONSTANT_Class);
+  __ cmp(r1, (u1)JVM_CONSTANT_Class);
   __ br(Assembler::EQ, quicked);
 
   __ push(atos); // save receiver for result, and for GC
@@ -3840,6 +3840,8 @@
   // check for NULL object
   __ null_check(r0);
 
+  __ resolve(IS_NOT_NULL, r0);
+
   const Address monitor_block_top(
         rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
   const Address monitor_block_bot(
@@ -3939,6 +3941,8 @@
   // check for NULL object
   __ null_check(r0);
 
+  __ resolve(IS_NOT_NULL, r0);
+
   const Address monitor_block_top(
         rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
   const Address monitor_block_bot(
--- a/src/hotspot/cpu/arm/assembler_arm_32.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/arm/assembler_arm_32.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1083,6 +1083,7 @@
       break;
     default:
       ShouldNotReachHere();
+      return;
     }
     emit_int32(0xf << 28 | 0x1 << 25 | 0x1 << 23 | 0x1 << 4 |
               (imm8 >> 7) << 24 | ((imm8 & 0x70) >> 4) << 16 | (imm8 & 0xf) |
@@ -1113,6 +1114,7 @@
       break;
     default:
       ShouldNotReachHere();
+      return;
     }
     emit_int32(cond << 28 | 0x1D /* 0b11101 */ << 23 | 0xB /* 0b1011 */ << 8 | 0x1 << 4 |
               quad << 21 | b << 22 |  e << 5 | Rs->encoding() << 12 |
@@ -1143,6 +1145,7 @@
       break;
     default:
       ShouldNotReachHere();
+      return;
     }
     emit_int32(0xF /* 0b1111 */ << 28 | 0x3B /* 0b00111011 */ << 20 | 0x6 /* 0b110 */ << 9 |
                quad << 6 | imm4 << 16 |
--- a/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -52,13 +52,13 @@
 
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
-  : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
+  : _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
-  : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
+  : _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
--- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -3086,7 +3086,7 @@
 
   Label ok;
   if (op->condition() != lir_cond_always) {
-    AsmCondition acond;
+    AsmCondition acond = al;
     switch (op->condition()) {
       case lir_cond_equal:        acond = eq; break;
       case lir_cond_notEqual:     acond = ne; break;
--- a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -733,6 +733,7 @@
 
     default:
       ShouldNotReachHere();
+      return;
   }
 #else
   switch (x->op()) {
@@ -757,6 +758,7 @@
         break;
       default:
         ShouldNotReachHere();
+        return;
       }
       LIR_Opr result = call_runtime(x->y(), x->x(), entry, x->type(), NULL);
       set_result(x, result);
@@ -824,7 +826,7 @@
       if (x->op() == Bytecodes::_irem) {
         out_reg = FrameMap::R0_opr;
         __ irem(left_arg->result(), right_arg->result(), out_reg, tmp, info);
-      } else if (x->op() == Bytecodes::_idiv) {
+      } else { // (x->op() == Bytecodes::_idiv)
         out_reg = FrameMap::R1_opr;
         __ idiv(left_arg->result(), right_arg->result(), out_reg, tmp, info);
       }
--- a/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -39,13 +39,13 @@
 
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
-  : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
+  : _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
-  : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
+  : _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
--- a/src/hotspot/cpu/ppc/frame_ppc.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/ppc/frame_ppc.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -359,13 +359,13 @@
   //            ...
   //
 
-  // frame pointer for this frame
-  intptr_t* _fp;
-
   // The frame's stack pointer before it has been extended by a c2i adapter;
   // needed by deoptimization
   intptr_t* _unextended_sp;
 
+  // frame pointer for this frame
+  intptr_t* _fp;
+
  public:
 
   // Accessors for fields
--- a/src/hotspot/cpu/ppc/frame_ppc.inline.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/ppc/frame_ppc.inline.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -55,7 +55,7 @@
 // Constructors
 
 // Initialize all fields, _unextended_sp will be adjusted in find_codeblob_and_set_pc_and_deopt_state.
-inline frame::frame() : _sp(NULL), _unextended_sp(NULL), _fp(NULL), _cb(NULL), _pc(NULL), _deopt_state(unknown) {}
+inline frame::frame() : _sp(NULL), _pc(NULL), _cb(NULL),  _deopt_state(unknown), _unextended_sp(NULL), _fp(NULL) {}
 
 inline frame::frame(intptr_t* sp) : _sp(sp), _unextended_sp(sp) {
   find_codeblob_and_set_pc_and_deopt_state((address)own_abi()->lr); // also sets _fp and adjusts _unextended_sp
--- a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -29,6 +29,7 @@
 #include "gc/g1/g1BarrierSetAssembler.hpp"
 #include "gc/g1/g1BarrierSetRuntime.hpp"
 #include "gc/g1/g1CardTable.hpp"
+#include "gc/g1/g1SATBMarkQueueSet.hpp"
 #include "gc/g1/g1ThreadLocalData.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "interpreter/interp_masm.hpp"
@@ -458,7 +459,7 @@
   __ mflr(R0);
   __ std(R0, _abi(lr), R1_SP);
   __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call
-  __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread);
+  __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread);
   __ pop_frame();
   __ ld(R0, _abi(lr), R1_SP);
   __ mtlr(R0);
--- a/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -41,13 +41,13 @@
 #define CHECK_BAILOUT() { if (ce->compilation()->bailed_out()) return; }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
-  : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
+  : _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
-  : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
+  : _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
--- a/src/hotspot/cpu/s390/frame_s390.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/s390/frame_s390.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -444,12 +444,12 @@
 
   // NOTE: Stack pointer is now held in the base class, so remove it from here.
 
+  // Needed by deoptimization.
+  intptr_t* _unextended_sp;
+
   // Frame pointer for this frame.
   intptr_t* _fp;
 
-  // Needed by deoptimization.
-  intptr_t* _unextended_sp;
-
  public:
 
   // Interface for all frames:
--- a/src/hotspot/cpu/s390/frame_s390.inline.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/s390/frame_s390.inline.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -54,7 +54,7 @@
 // Constructors
 
 // Initialize all fields, _unextended_sp will be adjusted in find_codeblob_and_set_pc_and_deopt_state.
-inline frame::frame() : _sp(NULL), _unextended_sp(NULL), _fp(NULL), _cb(NULL), _pc(NULL), _deopt_state(unknown) {}
+inline frame::frame() : _sp(NULL), _pc(NULL), _cb(NULL), _deopt_state(unknown), _unextended_sp(NULL), _fp(NULL) {}
 
 inline frame::frame(intptr_t* sp) : _sp(sp), _unextended_sp(sp) {
   find_codeblob_and_set_pc_and_deopt_state((address)own_abi()->return_pc);
@@ -71,7 +71,7 @@
 // Generic constructor. Used by pns() in debug.cpp only
 #ifndef PRODUCT
 inline frame::frame(void* sp, void* pc, void* unextended_sp) :
-  _sp((intptr_t*)sp), _unextended_sp((intptr_t*)unextended_sp), _cb(NULL), _pc(NULL) {
+  _sp((intptr_t*)sp), _pc(NULL), _cb(NULL), _unextended_sp((intptr_t*)unextended_sp) {
   find_codeblob_and_set_pc_and_deopt_state((address)pc); // Also sets _fp and adjusts _unextended_sp.
 }
 #endif
--- a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -30,6 +30,7 @@
 #include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1BarrierSetAssembler.hpp"
 #include "gc/g1/g1BarrierSetRuntime.hpp"
+#include "gc/g1/g1SATBMarkQueueSet.hpp"
 #include "gc/g1/g1ThreadLocalData.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "interpreter/interp_masm.hpp"
@@ -520,7 +521,7 @@
   __ bind(refill);
   save_volatile_registers(sasm);
   __ z_lgr(tmp, pre_val); // save pre_val
-  __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread),
+  __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1SATBMarkQueueSet::handle_zero_index_for_thread),
                   Z_thread);
   __ z_lgr(pre_val, tmp); // restore pre_val
   restore_volatile_registers(sasm);
--- a/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -28,6 +28,7 @@
 #include "gc/g1/g1BarrierSetAssembler.hpp"
 #include "gc/g1/g1BarrierSetRuntime.hpp"
 #include "gc/g1/g1CardTable.hpp"
+#include "gc/g1/g1SATBMarkQueueSet.hpp"
 #include "gc/g1/g1ThreadLocalData.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "interpreter/interp_masm.hpp"
@@ -160,7 +161,7 @@
 
   address handle_zero =
     CAST_FROM_FN_PTR(address,
-                     &SATBMarkQueueSet::handle_zero_index_for_thread);
+                     &G1SATBMarkQueueSet::handle_zero_index_for_thread);
   // This should be rare enough that we can afford to save all the
   // scratch registers that the calling context might be using.
   __ mov(G1_scratch, L0);
@@ -606,8 +607,8 @@
 
   __ call_VM_leaf(L7_thread_cache,
                   CAST_FROM_FN_PTR(address,
-                                   SATBMarkQueueSet::handle_zero_index_for_thread),
-                                   G2_thread);
+                                   G1SATBMarkQueueSet::handle_zero_index_for_thread),
+                  G2_thread);
 
   __ restore_live_registers(true);
 
@@ -694,7 +695,7 @@
   __ call_VM_leaf(L7_thread_cache,
                   CAST_FROM_FN_PTR(address,
                                    DirtyCardQueueSet::handle_zero_index_for_thread),
-                                   G2_thread);
+                  G2_thread);
 
   __ restore_live_registers(true);
 
--- a/src/hotspot/cpu/x86/assembler_x86.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/assembler_x86.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -2219,8 +2219,8 @@
       _evex_encoding(0),
       _is_clear_context(true),
       _is_extended_context(false),
-      _current_assembler(NULL),
-      _embedded_opmask_register_specifier(1) { // hard code k1, it will be initialized for now
+      _embedded_opmask_register_specifier(1), // hard code k1, it will be initialized for now
+      _current_assembler(NULL) {
     if (UseAVX < 3) _legacy_mode = true;
   }
 
--- a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -89,13 +89,13 @@
 }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
-  : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
+  : _index(index), _array(array), _throw_index_out_of_bounds_exception(false) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
 
 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
-  : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
+  : _index(index), _array(NULL), _throw_index_out_of_bounds_exception(true) {
   assert(info != NULL, "must have info");
   _info = new CodeEmitInfo(info);
 }
--- a/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -110,9 +110,9 @@
 
 FpuStackAllocator::FpuStackAllocator(Compilation* compilation, LinearScan* allocator)
   : _compilation(compilation)
+  , _allocator(allocator)
   , _lir(NULL)
   , _pos(-1)
-  , _allocator(allocator)
   , _sim(compilation)
   , _temp_sim(compilation)
 {}
--- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -61,6 +61,10 @@
   virtual void obj_equals(MacroAssembler* masm,
                           Register obj1, Address obj2);
 
+  virtual void resolve(MacroAssembler* masm, DecoratorSet decorators, Register obj) {
+    // Default implementation does not need to do anything.
+  }
+
   // Support for jniFastGetField to try resolving a jobject/jweak in native
   virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env,
                                              Register obj, Register tmp, Label& slowpath);
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -6287,6 +6287,15 @@
   }
 }
 
+void MacroAssembler::resolve(DecoratorSet decorators, Register obj) {
+  // Use stronger ACCESS_WRITE|ACCESS_READ by default.
+  if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
+    decorators |= ACCESS_READ | ACCESS_WRITE;
+  }
+  BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+  return bs->resolve(this, decorators, obj);
+}
+
 void MacroAssembler::load_heap_oop(Register dst, Address src, Register tmp1,
                                    Register thread_tmp, DecoratorSet decorators) {
   access_load_at(T_OBJECT, IN_HEAP | decorators, dst, src, tmp1, thread_tmp);
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -319,6 +319,10 @@
   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
                        Register tmp1, Register tmp2);
 
+  // Resolves obj access. Result is placed in the same register.
+  // All other registers are preserved.
+  void resolve(DecoratorSet decorators, Register obj);
+
   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
   void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1633,12 +1633,12 @@
    public:
     MoveOperation(int src_index, VMRegPair src, int dst_index, VMRegPair dst):
       _src(src)
+    , _dst(dst)
     , _src_index(src_index)
-    , _dst(dst)
     , _dst_index(dst_index)
+    , _processed(false)
     , _next(NULL)
-    , _prev(NULL)
-    , _processed(false) {
+    , _prev(NULL) {
     }
 
     VMRegPair src() const              { return _src; }
@@ -2450,6 +2450,7 @@
     // Load the oop from the handle
     __ movptr(obj_reg, Address(oop_handle_reg, 0));
 
+    __ resolve(IS_NOT_NULL, obj_reg);
     if (UseBiasedLocking) {
       __ biased_locking_enter(lock_reg, obj_reg, swap_reg, rscratch1, false, lock_done, &slow_path_lock);
     }
@@ -2635,6 +2636,7 @@
 
     // Get locked oop from the handle we passed to jni
     __ movptr(obj_reg, Address(oop_handle_reg, 0));
+    __ resolve(IS_NOT_NULL, obj_reg);
 
     Label done;
 
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -635,6 +635,7 @@
 #endif // ASSERT
 
     __ bind(done);
+    __ resolve(IS_NOT_NULL, rax);
   }
 
   // add space for monitor & lock
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -257,6 +257,7 @@
       __ movl(crc,   Address(rsp, 5*wordSize)); // Initial CRC
     } else {
       __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array
+      __ resolve(IS_NOT_NULL | ACCESS_READ, buf);
       __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
       __ movl2ptr(off, Address(rsp, 2*wordSize)); // offset
       __ addq(buf, off); // + offset
@@ -312,6 +313,7 @@
       //    "When calculating operand stack length, values of type long and double have length two."
     } else {
       __ movptr(buf, Address(rsp, 3 * wordSize)); // byte[] array
+      __ resolve(IS_NOT_NULL | ACCESS_READ, buf);
       __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
       __ movl2ptr(off, Address(rsp, 2 * wordSize)); // offset
       __ addq(buf, off); // + offset
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -4357,6 +4357,8 @@
   // check for NULL object
   __ null_check(rax);
 
+  __ resolve(IS_NOT_NULL, rax);
+
   const Address monitor_block_top(
         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
   const Address monitor_block_bot(
@@ -4454,6 +4456,8 @@
   // check for NULL object
   __ null_check(rax);
 
+  __ resolve(IS_NOT_NULL, rax);
+
   const Address monitor_block_top(
         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
   const Address monitor_block_bot(
--- a/src/hotspot/os/aix/os_aix.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/os/aix/os_aix.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -2705,10 +2705,6 @@
   return (ret == 0) ? OS_OK : OS_ERR;
 }
 
-// Hint to the underlying OS that a task switch would not be good.
-// Void return because it's a hint and can fail.
-void os::hint_no_preempt() {}
-
 ////////////////////////////////////////////////////////////////////////////////
 // suspend/resume support
 
--- a/src/hotspot/os/bsd/os_bsd.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/os/bsd/os_bsd.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -2465,10 +2465,6 @@
   return (*priority_ptr != -1 || errno == 0 ? OS_OK : OS_ERR);
 }
 
-// Hint to the underlying OS that a task switch would not be good.
-// Void return because it's a hint and can fail.
-void os::hint_no_preempt() {}
-
 ////////////////////////////////////////////////////////////////////////////////
 // suspend/resume support
 
--- a/src/hotspot/os/linux/os_linux.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/os/linux/os_linux.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -4192,10 +4192,6 @@
   return (*priority_ptr != -1 || errno == 0 ? OS_OK : OS_ERR);
 }
 
-// Hint to the underlying OS that a task switch would not be good.
-// Void return because it's a hint and can fail.
-void os::hint_no_preempt() {}
-
 ////////////////////////////////////////////////////////////////////////////////
 // suspend/resume support
 
--- a/src/hotspot/os/linux/os_perf_linux.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/os/linux/os_perf_linux.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1094,7 +1094,7 @@
 
   NetworkInterface* ret = NULL;
   for (cur_address = addresses; cur_address != NULL; cur_address = cur_address->ifa_next) {
-    if (cur_address->ifa_addr->sa_family != AF_PACKET) {
+    if ((cur_address->ifa_addr == NULL) || (cur_address->ifa_addr->sa_family != AF_PACKET)) {
       continue;
     }
 
@@ -1105,6 +1105,7 @@
     ret = cur;
   }
 
+  freeifaddrs(addresses);
   *network_interfaces = ret;
 
   return OS_OK;
--- a/src/hotspot/os/solaris/os_perf_solaris.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/os/solaris/os_perf_solaris.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -808,6 +808,7 @@
     }
   }
 
+  kstat_close(ctl);
   *network_interfaces = ret;
 
   return OS_OK;
--- a/src/hotspot/os/solaris/os_solaris.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/os/solaris/os_solaris.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -78,7 +78,6 @@
 # include <link.h>
 # include <poll.h>
 # include <pthread.h>
-# include <schedctl.h>
 # include <setjmp.h>
 # include <signal.h>
 # include <stdio.h>
@@ -742,7 +741,6 @@
   OSThread* osthr = thread->osthread();
 
   osthr->set_lwp_id(_lwp_self());  // Store lwp in case we are bound
-  thread->_schedctl = (void *) schedctl_init();
 
   log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ").",
     os::current_thread_id());
@@ -812,7 +810,6 @@
   // Store info on the Solaris thread into the OSThread
   osthread->set_thread_id(thread_id);
   osthread->set_lwp_id(_lwp_self());
-  thread->_schedctl = (void *) schedctl_init();
 
   if (UseNUMA) {
     int lgrp_id = os::numa_get_group_id();
@@ -3407,13 +3404,6 @@
   return OS_OK;
 }
 
-
-// Hint to the underlying OS that a task switch would not be good.
-// Void return because it's a hint and can fail.
-void os::hint_no_preempt() {
-  schedctl_start(schedctl_init());
-}
-
 ////////////////////////////////////////////////////////////////////////////////
 // suspend/resume support
 
--- a/src/hotspot/os/windows/os_windows.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/os/windows/os_windows.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -3609,11 +3609,6 @@
   return OS_OK;
 }
 
-
-// Hint to the underlying OS that a task switch would not be good.
-// Void return because it's a hint and can fail.
-void os::hint_no_preempt() {}
-
 void os::interrupt(Thread* thread) {
   debug_only(Thread::check_for_dangling_thread_pointer(thread);)
 
--- a/src/hotspot/share/adlc/output_h.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/adlc/output_h.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1006,19 +1006,19 @@
   fprintf(fp_hpp, "           enum machPipelineStages * const stage,\n");
   fprintf(fp_hpp, "           uint                    * const cycles,\n");
   fprintf(fp_hpp, "           Pipeline_Use                    resource_use)\n");
-  fprintf(fp_hpp, "  : _write_stage(write_stage)\n");
-  fprintf(fp_hpp, "  , _read_stage_count(count)\n");
+  fprintf(fp_hpp, "  : _read_stage_count(count)\n");
+  fprintf(fp_hpp, "  , _write_stage(write_stage)\n");
+  fprintf(fp_hpp, "  , _fixed_latency(fixed_latency)\n");
+  fprintf(fp_hpp, "  , _instruction_count(instruction_count)\n");
   fprintf(fp_hpp, "  , _has_fixed_latency(has_fixed_latency)\n");
-  fprintf(fp_hpp, "  , _fixed_latency(fixed_latency)\n");
+  fprintf(fp_hpp, "  , _has_branch_delay(has_branch_delay)\n");
+  fprintf(fp_hpp, "  , _has_multiple_bundles(has_multiple_bundles)\n");
+  fprintf(fp_hpp, "  , _force_serialization(force_serialization)\n");
+  fprintf(fp_hpp, "  , _may_have_no_code(may_have_no_code)\n");
   fprintf(fp_hpp, "  , _read_stages(dst)\n");
   fprintf(fp_hpp, "  , _resource_stage(stage)\n");
   fprintf(fp_hpp, "  , _resource_cycles(cycles)\n");
   fprintf(fp_hpp, "  , _resource_use(resource_use)\n");
-  fprintf(fp_hpp, "  , _instruction_count(instruction_count)\n");
-  fprintf(fp_hpp, "  , _has_branch_delay(has_branch_delay)\n");
-  fprintf(fp_hpp, "  , _has_multiple_bundles(has_multiple_bundles)\n");
-  fprintf(fp_hpp, "  , _force_serialization(force_serialization)\n");
-  fprintf(fp_hpp, "  , _may_have_no_code(may_have_no_code)\n");
   fprintf(fp_hpp, "  {};\n");
   fprintf(fp_hpp, "\n");
   fprintf(fp_hpp, "  uint writeStage() const {\n");
--- a/src/hotspot/share/aot/aotCodeHeap.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/aot/aotCodeHeap.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -714,7 +714,7 @@
 void AOTCodeHeap::sweep_method(AOTCompiledMethod *aot) {
   int indexes[] = {aot->method_index()};
   sweep_dependent_methods(indexes, 1);
-  vmassert(aot->method()->code() != aot && aot->method()->aot_code() == NULL, "method still active");
+  vmassert(aot->method()->code() != aot TIERED_ONLY( && aot->method()->aot_code() == NULL), "method still active");
 }
 
 
--- a/src/hotspot/share/aot/aotCompiledMethod.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/aot/aotCompiledMethod.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -206,6 +206,7 @@
   return true;
 }
 
+#ifdef TIERED
 bool AOTCompiledMethod::make_entrant() {
   assert(!method()->is_old(), "reviving evolved method!");
   assert(*_state_adr != not_entrant, "%s", method()->has_aot_code() ? "has_aot_code() not cleared" : "caller didn't check has_aot_code()");
@@ -240,6 +241,7 @@
 
   return true;
 }
+#endif // TIERED
 
 // We don't have full dependencies for AOT methods, so flushing is
 // more conservative than for nmethods.
--- a/src/hotspot/share/aot/aotCompiledMethod.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/aot/aotCompiledMethod.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -138,8 +138,8 @@
     _heap(heap),
     _name(name),
     _metadata_size(metadata_size),
-    _method_index(method_index),
-    _aot_id(aot_id) {
+    _aot_id(aot_id),
+    _method_index(method_index) {
 
     _is_far_code = CodeCache::is_far_target(code) ||
                    CodeCache::is_far_target(code + meta->code_size());
@@ -194,7 +194,7 @@
   virtual address verified_entry_point() const { return _code + _meta->verified_entry_offset(); }
   virtual void log_identity(xmlStream* stream) const;
   virtual void log_state_change() const;
-  virtual bool make_entrant();
+  virtual bool make_entrant() NOT_TIERED({ ShouldNotReachHere(); return false; });
   virtual bool make_not_entrant() { return make_not_entrant_helper(not_entrant); }
   virtual bool make_not_used() { return make_not_entrant_helper(not_used); }
   virtual address entry_point() const { return _code + _meta->entry_offset(); }
--- a/src/hotspot/share/c1/c1_CodeStubs.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_CodeStubs.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -218,7 +218,7 @@
 
  public:
   ImplicitNullCheckStub(int offset, CodeEmitInfo* info)
-    : _offset(offset), _info(info) {
+    : _info(info), _offset(offset) {
   }
   virtual void emit_code(LIR_Assembler* e);
   virtual CodeEmitInfo* info() const             { return _info; }
@@ -479,7 +479,7 @@
 
  public:
   SimpleExceptionStub(Runtime1::StubID stub, LIR_Opr obj, CodeEmitInfo* info):
-    _obj(obj), _info(info), _stub(stub) {
+    _obj(obj), _stub(stub), _info(info) {
   }
 
   void set_obj(LIR_Opr obj) {
--- a/src/hotspot/share/c1/c1_Compilation.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_Compilation.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -538,12 +538,13 @@
   }
 }
 
-
 Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
                          int osr_bci, BufferBlob* buffer_blob, DirectiveSet* directive)
-: _compiler(compiler)
+: _next_id(0)
+, _next_block_id(0)
+, _compiler(compiler)
+, _directive(directive)
 , _env(env)
-, _directive(directive)
 , _log(env->log())
 , _method(method)
 , _osr_bci(osr_bci)
@@ -553,19 +554,17 @@
 , _masm(NULL)
 , _has_exception_handlers(false)
 , _has_fpu_code(true)   // pessimistic assumption
+, _has_unsafe_access(false)
 , _would_profile(false)
-, _has_unsafe_access(false)
 , _has_method_handle_invokes(false)
 , _has_reserved_stack_access(method->has_reserved_stack_access())
 , _bailout_msg(NULL)
 , _exception_info_list(NULL)
 , _allocator(NULL)
-, _next_id(0)
-, _next_block_id(0)
 , _code(buffer_blob)
 , _has_access_indexed(false)
+, _interpreter_frame_size(0)
 , _current_instruction(NULL)
-, _interpreter_frame_size(0)
 #ifndef PRODUCT
 , _last_instruction_printed(NULL)
 , _cfg_printer_output(NULL)
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -102,11 +102,11 @@
  , _scope(scope)
  , _blocks(16)
  , _bci2block(new BlockList(scope->method()->code_size(), NULL))
- , _next_block_number(0)
  , _active()         // size not known yet
  , _visited()        // size not known yet
+ , _loop_map() // size not known yet
  , _next_loop_index(0)
- , _loop_map() // size not known yet
+ , _next_block_number(0)
 {
   set_entries(osr_bci);
   set_leaders();
@@ -680,10 +680,10 @@
   , _has_handler(false)
   , _stream(NULL)
   , _work_list(NULL)
+  , _caller_stack_size(-1)
+  , _continuation(NULL)
   , _parsing_jsr(false)
   , _jsr_xhandlers(NULL)
-  , _caller_stack_size(-1)
-  , _continuation(NULL)
   , _num_returns(0)
   , _cleanup_block(NULL)
   , _cleanup_return_prev(NULL)
@@ -3195,11 +3195,11 @@
 
 GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope)
   : _scope_data(NULL)
+  , _compilation(compilation)
+  , _memory(new MemoryBuffer())
+  , _inline_bailout_msg(NULL)
   , _instruction_count(0)
   , _osr_entry(NULL)
-  , _memory(new MemoryBuffer())
-  , _compilation(compilation)
-  , _inline_bailout_msg(NULL)
 {
   int osr_bci = compilation->osr_bci();
 
--- a/src/hotspot/share/c1/c1_IR.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_IR.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -132,8 +132,8 @@
 
 
 IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph)
-: _callees(2)
-, _compilation(compilation)
+: _compilation(compilation)
+, _callees(2)
 , _requires_phi_function(method->max_locals())
 {
   _caller             = caller;
@@ -184,11 +184,11 @@
 
 // Stack must be NON-null
 CodeEmitInfo::CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers, bool deoptimize_on_exception)
-  : _scope(stack->scope())
-  , _scope_debug_info(NULL)
+  : _scope_debug_info(NULL)
+  , _scope(stack->scope())
+  , _exception_handlers(exception_handlers)
   , _oop_map(NULL)
   , _stack(stack)
-  , _exception_handlers(exception_handlers)
   , _is_method_handle_invoke(false)
   , _deoptimize_on_exception(deoptimize_on_exception) {
   assert(_stack != NULL, "must be non null");
@@ -196,9 +196,9 @@
 
 
 CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, ValueStack* stack)
-  : _scope(info->_scope)
+  : _scope_debug_info(NULL)
+  , _scope(info->_scope)
   , _exception_handlers(NULL)
-  , _scope_debug_info(NULL)
   , _oop_map(NULL)
   , _stack(stack == NULL ? info->_stack : stack)
   , _is_method_handle_invoke(info->_is_method_handle_invoke)
@@ -497,6 +497,7 @@
   // computation of final block order
   BlockBegin* common_dominator(BlockBegin* a, BlockBegin* b);
   void compute_dominator(BlockBegin* cur, BlockBegin* parent);
+  void compute_dominator_impl(BlockBegin* cur, BlockBegin* parent);
   int  compute_weight(BlockBegin* cur);
   bool ready_for_processing(BlockBegin* cur);
   void sort_into_work_list(BlockBegin* b);
@@ -526,14 +527,14 @@
   _num_blocks(0),
   _num_loops(0),
   _iterative_dominators(false),
+  _linear_scan_order(NULL), // initialized later with correct size
   _visited_blocks(_max_block_id),
   _active_blocks(_max_block_id),
   _dominator_blocks(_max_block_id),
   _forward_branches(_max_block_id, _max_block_id, 0),
   _loop_end_blocks(8),
+  _loop_map(0),             // initialized later with correct size
   _work_list(8),
-  _linear_scan_order(NULL), // initialized later with correct size
-  _loop_map(0),             // initialized later with correct size
   _compilation(c)
 {
   TRACE_LINEAR_SCAN(2, tty->print_cr("***** computing linear-scan block order"));
@@ -770,6 +771,14 @@
 }
 
 void ComputeLinearScanOrder::compute_dominator(BlockBegin* cur, BlockBegin* parent) {
+  init_visited();
+  compute_dominator_impl(cur, parent);
+}
+
+void ComputeLinearScanOrder::compute_dominator_impl(BlockBegin* cur, BlockBegin* parent) {
+  // Mark as visited to avoid recursive calls with same parent
+  set_visited(cur);
+
   if (cur->dominator() == NULL) {
     TRACE_LINEAR_SCAN(4, tty->print_cr("DOM: initializing dominator of B%d to B%d", cur->block_id(), parent->block_id()));
     cur->set_dominator(parent);
@@ -788,7 +797,9 @@
   int num_cur_xhandler = cur->number_of_exception_handlers();
   for (int j = 0; j < num_cur_xhandler; j++) {
     BlockBegin* xhandler = cur->exception_handler_at(j);
-    compute_dominator(xhandler, parent);
+    if (!is_visited(xhandler)) {
+      compute_dominator_impl(xhandler, parent);
+    }
   }
 }
 
--- a/src/hotspot/share/c1/c1_IR.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_IR.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -215,8 +215,8 @@
                    GrowableArray<MonitorValue*>* monitors,
                    IRScopeDebugInfo*             caller):
       _scope(scope)
+    , _bci(bci)
     , _locals(locals)
-    , _bci(bci)
     , _expressions(expressions)
     , _monitors(monitors)
     , _caller(caller) {}
--- a/src/hotspot/share/c1/c1_Instruction.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_Instruction.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -410,19 +410,20 @@
 
   // creation
   Instruction(ValueType* type, ValueStack* state_before = NULL, bool type_is_constant = false)
-  : _use_count(0)
+  :
 #ifndef PRODUCT
-  , _printable_bci(-99)
+  _printable_bci(-99),
 #endif
+    _use_count(0)
   , _pin_state(0)
   , _type(type)
   , _next(NULL)
-  , _block(NULL)
   , _subst(NULL)
+  , _operand(LIR_OprFact::illegalOpr)
   , _flags(0)
-  , _operand(LIR_OprFact::illegalOpr)
   , _state_before(state_before)
   , _exception_handlers(NULL)
+  , _block(NULL)
   {
     check_state(state_before);
     assert(type != NULL && (!type->is_constant() || type_is_constant), "type must exist");
@@ -705,8 +706,8 @@
   Local(ciType* declared, ValueType* type, int index, bool receiver)
     : Instruction(type)
     , _java_index(index)
+    , _is_receiver(receiver)
     , _declared_type(declared)
-    , _is_receiver(receiver)
   {
     NOT_PRODUCT(set_printable_bci(-1));
   }
@@ -1664,19 +1665,21 @@
   , _bci(bci)
   , _depth_first_number(-1)
   , _linear_scan_number(-1)
+  , _dominator_depth(-1)
   , _loop_depth(0)
+  , _loop_index(-1)
   , _flags(0)
-  , _dominator_depth(-1)
+  , _total_preds(0)
+  , _stores_to_locals()
+  , _successors(2)
+  , _predecessors(2)
+  , _dominates(2)
   , _dominator(NULL)
   , _end(NULL)
-  , _predecessors(2)
-  , _successors(2)
-  , _dominates(2)
   , _exception_handlers(1)
   , _exception_states(NULL)
   , _exception_handler_pco(-1)
   , _lir(NULL)
-  , _loop_index(-1)
   , _live_in()
   , _live_out()
   , _live_gen()
@@ -1685,8 +1688,6 @@
   , _fpu_stack_state(NULL)
   , _first_lir_instruction_id(-1)
   , _last_lir_instruction_id(-1)
-  , _total_preds(0)
-  , _stores_to_locals()
   {
     _block = this;
 #ifndef PRODUCT
@@ -1872,18 +1873,18 @@
   // creation
   Goto(BlockBegin* sux, ValueStack* state_before, bool is_safepoint = false)
     : BlockEnd(illegalType, state_before, is_safepoint)
-    , _direction(none)
     , _profiled_method(NULL)
-    , _profiled_bci(0) {
+    , _profiled_bci(0)
+    , _direction(none) {
     BlockList* s = new BlockList(1);
     s->append(sux);
     set_sux(s);
   }
 
   Goto(BlockBegin* sux, bool is_safepoint) : BlockEnd(illegalType, NULL, is_safepoint)
-                                           , _direction(none)
                                            , _profiled_method(NULL)
-                                           , _profiled_bci(0) {
+                                           , _profiled_bci(0)
+                                           , _direction(none) {
     BlockList* s = new BlockList(1);
     s->append(sux);
     set_sux(s);
@@ -2550,9 +2551,9 @@
  public:
   RuntimeCall(ValueType* type, const char* entry_name, address entry, Values* args, bool pass_thread = true)
     : Instruction(type)
+    , _entry_name(entry_name)
     , _entry(entry)
     , _args(args)
-    , _entry_name(entry_name)
     , _pass_thread(pass_thread) {
     ASSERT_VALUES
     pin();
--- a/src/hotspot/share/c1/c1_InstructionPrinter.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_InstructionPrinter.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -47,8 +47,8 @@
 
  public:
   InstructionPrinter(bool print_phis = true, outputStream* output = tty)
-    : _print_phis(print_phis)
-    , _output(output)
+    : _output(output)
+    , _print_phis(print_phis)
   {}
 
   outputStream* output() { return _output; }
--- a/src/hotspot/share/c1/c1_LIR.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_LIR.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -321,9 +321,9 @@
   , _tmp2(tmp2)
   , _tmp3(tmp3)
   , _fast_check(fast_check)
-  , _stub(stub)
   , _info_for_patch(info_for_patch)
   , _info_for_exception(info_for_exception)
+  , _stub(stub)
   , _profiled_method(NULL)
   , _profiled_bci(-1)
   , _should_profile(false)
@@ -348,9 +348,9 @@
   , _tmp2(tmp2)
   , _tmp3(tmp3)
   , _fast_check(false)
-  , _stub(NULL)
   , _info_for_patch(NULL)
   , _info_for_exception(info_for_exception)
+  , _stub(NULL)
   , _profiled_method(NULL)
   , _profiled_bci(-1)
   , _should_profile(false)
@@ -367,14 +367,14 @@
 LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length,
                                  LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info)
   : LIR_Op(lir_arraycopy, LIR_OprFact::illegalOpr, info)
-  , _tmp(tmp)
   , _src(src)
   , _src_pos(src_pos)
   , _dst(dst)
   , _dst_pos(dst_pos)
-  , _flags(flags)
+  , _length(length)
+  , _tmp(tmp)
   , _expected_type(expected_type)
-  , _length(length) {
+  , _flags(flags) {
   _stub = new ArrayCopyStub(this);
 }
 
--- a/src/hotspot/share/c1/c1_LIR.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_LIR.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -516,36 +516,36 @@
        _base(base)
      , _index(index)
      , _scale(times_1)
-     , _type(type)
-     , _disp(0) { verify(); }
+     , _disp(0)
+     , _type(type) { verify(); }
 
   LIR_Address(LIR_Opr base, intx disp, BasicType type):
        _base(base)
      , _index(LIR_OprDesc::illegalOpr())
      , _scale(times_1)
-     , _type(type)
-     , _disp(disp) { verify(); }
+     , _disp(disp)
+     , _type(type) { verify(); }
 
   LIR_Address(LIR_Opr base, BasicType type):
        _base(base)
      , _index(LIR_OprDesc::illegalOpr())
      , _scale(times_1)
-     , _type(type)
-     , _disp(0) { verify(); }
+     , _disp(0)
+     , _type(type) { verify(); }
 
   LIR_Address(LIR_Opr base, LIR_Opr index, intx disp, BasicType type):
        _base(base)
      , _index(index)
      , _scale(times_1)
-     , _type(type)
-     , _disp(disp) { verify(); }
+     , _disp(disp)
+     , _type(type) { verify(); }
 
   LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type):
        _base(base)
      , _index(index)
      , _scale(scale)
-     , _type(type)
-     , _disp(disp) { verify(); }
+     , _disp(disp)
+     , _type(type) { verify(); }
 
   LIR_Opr base()  const                          { return _base;  }
   LIR_Opr index() const                          { return _index; }
@@ -1058,30 +1058,32 @@
 
  public:
   LIR_Op()
-    : _result(LIR_OprFact::illegalOpr)
+    :
+#ifdef ASSERT
+      _file(NULL)
+    , _line(0),
+#endif
+      _result(LIR_OprFact::illegalOpr)
     , _code(lir_none)
     , _flags(0)
     , _info(NULL)
-#ifdef ASSERT
-    , _file(NULL)
-    , _line(0)
-#endif
+    , _id(-1)
     , _fpu_pop_count(0)
-    , _source(NULL)
-    , _id(-1)                             {}
+    , _source(NULL) {}
 
   LIR_Op(LIR_Code code, LIR_Opr result, CodeEmitInfo* info)
-    : _result(result)
+    :
+#ifdef ASSERT
+      _file(NULL)
+    , _line(0),
+#endif
+      _result(result)
     , _code(code)
     , _flags(0)
     , _info(info)
-#ifdef ASSERT
-    , _file(NULL)
-    , _line(0)
-#endif
+    , _id(-1)
     , _fpu_pop_count(0)
-    , _source(NULL)
-    , _id(-1)                             {}
+    , _source(NULL) {}
 
   CodeEmitInfo* info() const                  { return _info;   }
   LIR_Code code()      const                  { return (LIR_Code)_code;   }
@@ -1153,8 +1155,8 @@
   LIR_OpCall(LIR_Code code, address addr, LIR_Opr result,
              LIR_OprList* arguments, CodeEmitInfo* info = NULL)
     : LIR_Op(code, result, info)
-    , _arguments(arguments)
-    , _addr(addr) {}
+    , _addr(addr)
+    , _arguments(arguments) {}
 
  public:
   address addr() const                           { return _addr; }
@@ -1180,8 +1182,8 @@
                  address addr, LIR_OprList* arguments,
                  CodeEmitInfo* info)
   : LIR_OpCall(code, addr, result, arguments, info)
+  , _method(method)
   , _receiver(receiver)
-  , _method(method)
   , _method_handle_invoke_SP_save_opr(LIR_OprFact::illegalOpr)
   { assert(is_in_range(code, begin_opJavaCall, end_opJavaCall), "code check"); }
 
@@ -1189,8 +1191,8 @@
                  LIR_Opr receiver, LIR_Opr result, intptr_t vtable_offset,
                  LIR_OprList* arguments, CodeEmitInfo* info)
   : LIR_OpCall(code, (address)vtable_offset, result, arguments, info)
+  , _method(method)
   , _receiver(receiver)
-  , _method(method)
   , _method_handle_invoke_SP_save_opr(LIR_OprFact::illegalOpr)
   { assert(is_in_range(code, begin_opJavaCall, end_opJavaCall), "code check"); }
 
@@ -1345,14 +1347,14 @@
   LIR_Op1(LIR_Code code, LIR_Opr opr, LIR_Opr result = LIR_OprFact::illegalOpr, BasicType type = T_ILLEGAL, LIR_PatchCode patch = lir_patch_none, CodeEmitInfo* info = NULL)
     : LIR_Op(code, result, info)
     , _opr(opr)
-    , _patch(patch)
-    , _type(type)                      { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
+    , _type(type)
+    , _patch(patch)                    { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
 
   LIR_Op1(LIR_Code code, LIR_Opr opr, LIR_Opr result, BasicType type, LIR_PatchCode patch, CodeEmitInfo* info, LIR_MoveKind kind)
     : LIR_Op(code, result, info)
     , _opr(opr)
-    , _patch(patch)
-    , _type(type)                      {
+    , _type(type)
+    , _patch(patch)                    {
     assert(code == lir_move, "must be");
     set_kind(kind);
   }
@@ -1360,8 +1362,8 @@
   LIR_Op1(LIR_Code code, LIR_Opr opr, CodeEmitInfo* info)
     : LIR_Op(code, LIR_OprFact::illegalOpr, info)
     , _opr(opr)
-    , _patch(lir_patch_none)
-    , _type(T_ILLEGAL)                 { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
+    , _type(T_ILLEGAL)
+    , _patch(lir_patch_none)           { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
 
   LIR_Opr in_opr()           const               { return _opr;   }
   LIR_PatchCode patch_code() const               { return _patch; }
@@ -1462,8 +1464,8 @@
  public:
    LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub)
      : LIR_Op1(lir_convert, opr, result)
-     , _stub(stub)
-     , _bytecode(code)                           {}
+     , _bytecode(code)
+     , _stub(stub)                               {}
 
   Bytecodes::Code bytecode() const               { return _bytecode; }
   ConversionStub* stub() const                   { return _stub; }
@@ -1501,8 +1503,8 @@
     , _tmp4(t4)
     , _hdr_size(hdr_size)
     , _obj_size(obj_size)
-    , _init_check(init_check)
-    , _stub(stub)                                { }
+    , _stub(stub)
+    , _init_check(init_check)                    { }
 
   LIR_Opr klass()        const                   { return in_opr();     }
   LIR_Opr obj()          const                   { return result_opr(); }
@@ -1611,31 +1613,31 @@
  public:
   LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, CodeEmitInfo* info = NULL)
     : LIR_Op(code, LIR_OprFact::illegalOpr, info)
+    , _fpu_stack_size(0)
     , _opr1(opr1)
     , _opr2(opr2)
     , _type(T_ILLEGAL)
-    , _condition(condition)
-    , _fpu_stack_size(0)
     , _tmp1(LIR_OprFact::illegalOpr)
     , _tmp2(LIR_OprFact::illegalOpr)
     , _tmp3(LIR_OprFact::illegalOpr)
     , _tmp4(LIR_OprFact::illegalOpr)
-    , _tmp5(LIR_OprFact::illegalOpr) {
+    , _tmp5(LIR_OprFact::illegalOpr)
+    , _condition(condition) {
     assert(code == lir_cmp || code == lir_assert, "code check");
   }
 
   LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type)
     : LIR_Op(code, result, NULL)
+    , _fpu_stack_size(0)
     , _opr1(opr1)
     , _opr2(opr2)
     , _type(type)
-    , _condition(condition)
-    , _fpu_stack_size(0)
     , _tmp1(LIR_OprFact::illegalOpr)
     , _tmp2(LIR_OprFact::illegalOpr)
     , _tmp3(LIR_OprFact::illegalOpr)
     , _tmp4(LIR_OprFact::illegalOpr)
-    , _tmp5(LIR_OprFact::illegalOpr) {
+    , _tmp5(LIR_OprFact::illegalOpr)
+    , _condition(condition) {
     assert(code == lir_cmove, "code check");
     assert(type != T_ILLEGAL, "cmove should have type");
   }
@@ -1643,32 +1645,32 @@
   LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result = LIR_OprFact::illegalOpr,
           CodeEmitInfo* info = NULL, BasicType type = T_ILLEGAL)
     : LIR_Op(code, result, info)
+    , _fpu_stack_size(0)
     , _opr1(opr1)
     , _opr2(opr2)
     , _type(type)
-    , _condition(lir_cond_unknown)
-    , _fpu_stack_size(0)
     , _tmp1(LIR_OprFact::illegalOpr)
     , _tmp2(LIR_OprFact::illegalOpr)
     , _tmp3(LIR_OprFact::illegalOpr)
     , _tmp4(LIR_OprFact::illegalOpr)
-    , _tmp5(LIR_OprFact::illegalOpr) {
+    , _tmp5(LIR_OprFact::illegalOpr)
+    , _condition(lir_cond_unknown) {
     assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check");
   }
 
   LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2 = LIR_OprFact::illegalOpr,
           LIR_Opr tmp3 = LIR_OprFact::illegalOpr, LIR_Opr tmp4 = LIR_OprFact::illegalOpr, LIR_Opr tmp5 = LIR_OprFact::illegalOpr)
     : LIR_Op(code, result, NULL)
+    , _fpu_stack_size(0)
     , _opr1(opr1)
     , _opr2(opr2)
     , _type(T_ILLEGAL)
-    , _condition(lir_cond_unknown)
-    , _fpu_stack_size(0)
     , _tmp1(tmp1)
     , _tmp2(tmp2)
     , _tmp3(tmp3)
     , _tmp4(tmp4)
-    , _tmp5(tmp5) {
+    , _tmp5(tmp5)
+    , _condition(lir_cond_unknown) {
     assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check");
   }
 
@@ -1833,8 +1835,8 @@
  public:
   LIR_OpAssert(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, const char* msg, bool halt)
     : LIR_Op2(lir_assert, condition, opr1, opr2)
-    , _halt(halt)
-    , _msg(msg) {
+    , _msg(msg)
+    , _halt(halt) {
   }
 
   const char* msg() const                        { return _msg; }
@@ -1942,9 +1944,9 @@
     : LIR_Op(lir_profile_type, LIR_OprFact::illegalOpr, NULL)  // no result, no info
     , _mdp(mdp)
     , _obj(obj)
+    , _tmp(tmp)
     , _exact_klass(exact_klass)
     , _current_klass(current_klass)
-    , _tmp(tmp)
     , _not_null(not_null)
     , _no_conflict(no_conflict) { }
 
--- a/src/hotspot/share/c1/c1_LIRAssembler.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_LIRAssembler.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -99,9 +99,9 @@
 
 
 LIR_Assembler::LIR_Assembler(Compilation* c):
-   _compilation(c)
- , _masm(c->masm())
+   _masm(c->masm())
  , _bs(BarrierSet::barrier_set())
+ , _compilation(c)
  , _frame_map(c->frame_map())
  , _current_block(NULL)
  , _pending_non_safepoint(NULL)
--- a/src/hotspot/share/c1/c1_LinearScan.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_LinearScan.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -74,6 +74,7 @@
  , _ir(ir)
  , _gen(gen)
  , _frame_map(frame_map)
+ , _cached_blocks(*ir->linear_scan_order())
  , _num_virtual_regs(gen->max_virtual_register_number())
  , _has_fpu_registers(false)
  , _num_calls(-1)
@@ -87,9 +88,8 @@
  , _block_of_op(0) // initialized later with correct length
  , _has_info(0)
  , _has_call(0)
+ , _interval_in_loop(0)  // initialized later with correct length
  , _scope_value_cache(0) // initialized later with correct length
- , _interval_in_loop(0)  // initialized later with correct length
- , _cached_blocks(*ir->linear_scan_order())
 #ifdef X86
  , _fpu_stack_allocator(NULL)
 #endif
@@ -3717,13 +3717,13 @@
 
 MoveResolver::MoveResolver(LinearScan* allocator) :
   _allocator(allocator),
-  _multiple_reads_allowed(false),
+  _insert_list(NULL),
+  _insert_idx(-1),
+  _insertion_buffer(),
   _mapping_from(8),
   _mapping_from_opr(8),
   _mapping_to(8),
-  _insert_list(NULL),
-  _insert_idx(-1),
-  _insertion_buffer()
+  _multiple_reads_allowed(false)
 {
   for (int i = 0; i < LinearScan::nof_regs; i++) {
     _register_blocked[i] = 0;
@@ -4127,9 +4127,9 @@
   _split_children(0),
   _canonical_spill_slot(-1),
   _insert_move_when_activated(false),
-  _register_hint(NULL),
   _spill_state(noDefinitionFound),
-  _spill_definition_pos(-1)
+  _spill_definition_pos(-1),
+  _register_hint(NULL)
 {
   _split_parent = this;
   _current_split_child = this;
--- a/src/hotspot/share/c1/c1_Optimizer.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_Optimizer.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -47,7 +47,7 @@
   int _has_substitution;
 
  public:
-  CE_Eliminator(IR* hir) : _cee_count(0), _ifop_count(0), _hir(hir) {
+  CE_Eliminator(IR* hir) : _hir(hir), _cee_count(0), _ifop_count(0) {
     _has_substitution = false;
     _hir->iterate_preorder(this);
     if (_has_substitution) {
@@ -592,10 +592,10 @@
   // constructor
   NullCheckEliminator(Optimizer* opt)
     : _opt(opt)
+    , _work_list(new BlockList())
     , _set(new ValueSet())
-    , _last_explicit_null_check(NULL)
     , _block_states(BlockBegin::number_of_blocks(), BlockBegin::number_of_blocks(), NULL)
-    , _work_list(new BlockList()) {
+    , _last_explicit_null_check(NULL) {
     _visitable_instructions = new ValueSet();
     _visitor.set_eliminator(this);
     CompileLog* log = _opt->ir()->compilation()->log();
--- a/src/hotspot/share/c1/c1_Runtime1.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_Runtime1.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -568,6 +568,7 @@
     if (log_is_enabled(Info, exceptions)) {
       ResourceMark rm;
       stringStream tempst;
+      assert(nm->method() != NULL, "Unexpected NULL method()");
       tempst.print("compiled method <%s>\n"
                    " at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
                    nm->method()->print_value_string(), p2i(pc), p2i(thread));
--- a/src/hotspot/share/c1/c1_ValueMap.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_ValueMap.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -485,9 +485,9 @@
 
 
 GlobalValueNumbering::GlobalValueNumbering(IR* ir)
-  : _current_map(NULL)
+  : _compilation(ir->compilation())
+  , _current_map(NULL)
   , _value_maps(ir->linear_scan_order()->length(), ir->linear_scan_order()->length(), NULL)
-  , _compilation(ir->compilation())
 {
   TRACE_VALUE_NUMBERING(tty->print_cr("****** start of global value numbering"));
 
--- a/src/hotspot/share/c1/c1_ValueType.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/c1/c1_ValueType.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -104,7 +104,7 @@
   const ValueTag _tag;
   ValueType();
  protected:
-  ValueType(ValueTag tag, int size): _tag(tag), _size(size) {}
+  ValueType(ValueTag tag, int size): _size(size), _tag(tag) {}
 
  public:
   // initialization
--- a/src/hotspot/share/ci/bcEscapeAnalyzer.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/ci/bcEscapeAnalyzer.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1447,8 +1447,8 @@
 #endif
 
 BCEscapeAnalyzer::BCEscapeAnalyzer(ciMethod* method, BCEscapeAnalyzer* parent)
-    : _conservative(method == NULL || !EstimateArgEscape)
-    , _arena(CURRENT_ENV->arena())
+    : _arena(CURRENT_ENV->arena())
+    , _conservative(method == NULL || !EstimateArgEscape)
     , _method(method)
     , _methodData(method ? method->method_data() : NULL)
     , _arg_size(method ? method->arg_size() : 0)
--- a/src/hotspot/share/ci/ciInstanceKlass.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/ci/ciInstanceKlass.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -596,6 +596,7 @@
     // Go into the VM to fetch the implementor.
     {
       VM_ENTRY_MARK;
+      MutexLocker ml(Compile_lock);
       Klass* k = get_instanceKlass()->implementor();
       if (k != NULL) {
         if (k == get_instanceKlass()) {
--- a/src/hotspot/share/ci/ciMethod.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/ci/ciMethod.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -166,16 +166,16 @@
   ciMetadata((Metadata*)NULL),
   _name(                   name),
   _holder(                 holder),
+  _method_data(            NULL),
+  _method_blocks(          NULL),
   _intrinsic_id(           vmIntrinsics::_none),
-  _liveness(               NULL),
+  _instructions_size(-1),
   _can_be_statically_bound(false),
-  _method_blocks(          NULL),
-  _method_data(            NULL)
+  _liveness(               NULL)
 #if defined(COMPILER2)
   ,
   _flow(                   NULL),
-  _bcea(                   NULL),
-  _instructions_size(-1)
+  _bcea(                   NULL)
 #endif // COMPILER2
 {
   // Usually holder and accessor are the same type but in some cases
--- a/src/hotspot/share/ci/ciMethodBlocks.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/ci/ciMethodBlocks.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -345,13 +345,13 @@
 }
 #endif
 
-
 ciBlock::ciBlock(ciMethod *method, int index, int start_bci) :
+                         _idx(index), _start_bci(start_bci), _limit_bci(-1), _control_bci(fall_through_bci),
+                         _flags(0), _ex_start_bci(-1), _ex_limit_bci(-1)
 #ifndef PRODUCT
-                         _method(method),
+                         , _method(method)
 #endif
-                         _idx(index), _flags(0), _start_bci(start_bci), _limit_bci(-1), _control_bci(fall_through_bci),
-                         _ex_start_bci(-1), _ex_limit_bci(-1) {
+{
 }
 
 void ciBlock::set_exception_range(int start_bci, int limit_bci)  {
--- a/src/hotspot/share/ci/ciTypeFlow.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/ci/ciTypeFlow.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -724,8 +724,8 @@
 
   public:
     Loop(Block* head, Block* tail) :
+      _parent(NULL), _sibling(NULL), _child(NULL),
       _head(head),   _tail(tail),
-      _parent(NULL), _sibling(NULL), _child(NULL),
       _irreducible(false), _def_locals() {}
 
     Loop* parent()  const { return _parent; }
--- a/src/hotspot/share/classfile/classFileParser.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -922,10 +922,10 @@
   assert(has_nonstatic_concrete_methods != NULL, "invariant");
 
   if (itfs_len == 0) {
-    _local_interfaces = Universe::the_empty_klass_array();
+    _local_interfaces = Universe::the_empty_instance_klass_array();
   } else {
     assert(itfs_len > 0, "only called for len>0");
-    _local_interfaces = MetadataFactory::new_array<Klass*>(_loader_data, itfs_len, NULL, CHECK);
+    _local_interfaces = MetadataFactory::new_array<InstanceKlass*>(_loader_data, itfs_len, NULL, CHECK);
 
     int index;
     for (index = 0; index < itfs_len; index++) {
@@ -966,7 +966,7 @@
       if (InstanceKlass::cast(interf)->has_nonstatic_concrete_methods()) {
         *has_nonstatic_concrete_methods = true;
       }
-      _local_interfaces->at_put(index, interf);
+      _local_interfaces->at_put(index, InstanceKlass::cast(interf));
     }
 
     if (!_need_verify || itfs_len <= 1) {
@@ -984,8 +984,8 @@
     {
       debug_only(NoSafepointVerifier nsv;)
       for (index = 0; index < itfs_len; index++) {
-        const Klass* const k = _local_interfaces->at(index);
-        name = InstanceKlass::cast(k)->name();
+        const InstanceKlass* const k = _local_interfaces->at(index);
+        name = k->name();
         // If no duplicates, add (name, NULL) in hashtable interface_names.
         if (!put_after_lookup(name, NULL, interface_names)) {
           dup = true;
@@ -4496,7 +4496,7 @@
     }
 
     // add super interface dependencies
-    const Array<Klass*>* const local_interfaces = defined_klass->local_interfaces();
+    const Array<InstanceKlass*>* const local_interfaces = defined_klass->local_interfaces();
     if (local_interfaces != NULL) {
       const int length = local_interfaces->length();
       for (int i = 0; i < length; i++) {
@@ -4508,21 +4508,21 @@
 
 // utility methods for appending an array with check for duplicates
 
-static void append_interfaces(GrowableArray<Klass*>* result,
-                              const Array<Klass*>* const ifs) {
+static void append_interfaces(GrowableArray<InstanceKlass*>* result,
+                              const Array<InstanceKlass*>* const ifs) {
   // iterate over new interfaces
   for (int i = 0; i < ifs->length(); i++) {
-    Klass* const e = ifs->at(i);
-    assert(e->is_klass() && InstanceKlass::cast(e)->is_interface(), "just checking");
+    InstanceKlass* const e = ifs->at(i);
+    assert(e->is_klass() && e->is_interface(), "just checking");
     // add new interface
     result->append_if_missing(e);
   }
 }
 
-static Array<Klass*>* compute_transitive_interfaces(const InstanceKlass* super,
-                                                    Array<Klass*>* local_ifs,
-                                                    ClassLoaderData* loader_data,
-                                                    TRAPS) {
+static Array<InstanceKlass*>* compute_transitive_interfaces(const InstanceKlass* super,
+                                                            Array<InstanceKlass*>* local_ifs,
+                                                            ClassLoaderData* loader_data,
+                                                            TRAPS) {
   assert(local_ifs != NULL, "invariant");
   assert(loader_data != NULL, "invariant");
 
@@ -4537,15 +4537,15 @@
   // Add local interfaces' super interfaces
   const int local_size = local_ifs->length();
   for (int i = 0; i < local_size; i++) {
-    Klass* const l = local_ifs->at(i);
-    max_transitive_size += InstanceKlass::cast(l)->transitive_interfaces()->length();
+    InstanceKlass* const l = local_ifs->at(i);
+    max_transitive_size += l->transitive_interfaces()->length();
   }
   // Finally add local interfaces
   max_transitive_size += local_size;
   // Construct array
   if (max_transitive_size == 0) {
     // no interfaces, use canonicalized array
-    return Universe::the_empty_klass_array();
+    return Universe::the_empty_instance_klass_array();
   } else if (max_transitive_size == super_size) {
     // no new local interfaces added, share superklass' transitive interface array
     return super->transitive_interfaces();
@@ -4554,7 +4554,7 @@
     return local_ifs;
   } else {
     ResourceMark rm;
-    GrowableArray<Klass*>* const result = new GrowableArray<Klass*>(max_transitive_size);
+    GrowableArray<InstanceKlass*>* const result = new GrowableArray<InstanceKlass*>(max_transitive_size);
 
     // Copy down from superclass
     if (super != NULL) {
@@ -4563,8 +4563,8 @@
 
     // Copy down from local interfaces' superinterfaces
     for (int i = 0; i < local_size; i++) {
-      Klass* const l = local_ifs->at(i);
-      append_interfaces(result, InstanceKlass::cast(l)->transitive_interfaces());
+      InstanceKlass* const l = local_ifs->at(i);
+      append_interfaces(result, l->transitive_interfaces());
     }
     // Finally add local interfaces
     append_interfaces(result, local_ifs);
@@ -4572,10 +4572,10 @@
     // length will be less than the max_transitive_size if duplicates were removed
     const int length = result->length();
     assert(length <= max_transitive_size, "just checking");
-    Array<Klass*>* const new_result =
-      MetadataFactory::new_array<Klass*>(loader_data, length, CHECK_NULL);
+    Array<InstanceKlass*>* const new_result =
+      MetadataFactory::new_array<InstanceKlass*>(loader_data, length, CHECK_NULL);
     for (int i = 0; i < length; i++) {
-      Klass* const e = result->at(i);
+      InstanceKlass* const e = result->at(i);
       assert(e != NULL, "just checking");
       new_result->at_put(i, e);
     }
@@ -4643,17 +4643,17 @@
 
 static void check_super_interface_access(const InstanceKlass* this_klass, TRAPS) {
   assert(this_klass != NULL, "invariant");
-  const Array<Klass*>* const local_interfaces = this_klass->local_interfaces();
+  const Array<InstanceKlass*>* const local_interfaces = this_klass->local_interfaces();
   const int lng = local_interfaces->length();
   for (int i = lng - 1; i >= 0; i--) {
-    Klass* const k = local_interfaces->at(i);
+    InstanceKlass* const k = local_interfaces->at(i);
     assert (k != NULL && k->is_interface(), "invalid interface");
     Reflection::VerifyClassAccessResults vca_result =
-      Reflection::verify_class_access(this_klass, InstanceKlass::cast(k), false);
+      Reflection::verify_class_access(this_klass, k, false);
     if (vca_result != Reflection::ACCESS_OK) {
       ResourceMark rm(THREAD);
       char* msg = Reflection::verify_class_access_msg(this_klass,
-                                                      InstanceKlass::cast(k),
+                                                      k,
                                                       vca_result);
       if (msg == NULL) {
         bool same_module = (this_klass->module() == k->module());
@@ -5735,11 +5735,11 @@
                    ik->java_super()->external_name());
       }
       // print out each of the interface classes referred to by this class.
-      const Array<Klass*>* const local_interfaces = ik->local_interfaces();
+      const Array<InstanceKlass*>* const local_interfaces = ik->local_interfaces();
       if (local_interfaces != NULL) {
         const int length = local_interfaces->length();
         for (int i = 0; i < length; i++) {
-          const Klass* const k = local_interfaces->at(i);
+          const InstanceKlass* const k = local_interfaces->at(i);
           const char * to = k->external_name();
           log_debug(class, resolve)("%s %s (interface)", from, to);
         }
@@ -6272,7 +6272,7 @@
   assert(_loader_data != NULL, "invariant");
 
   if (_class_name == vmSymbols::java_lang_Object()) {
-    check_property(_local_interfaces == Universe::the_empty_klass_array(),
+    check_property(_local_interfaces == Universe::the_empty_instance_klass_array(),
                    "java.lang.Object cannot implement an interface in class file %s",
                    CHECK);
   }
--- a/src/hotspot/share/classfile/classFileParser.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/classFileParser.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -99,8 +99,8 @@
   Array<u2>* _inner_classes;
   Array<u2>* _nest_members;
   u2 _nest_host;
-  Array<Klass*>* _local_interfaces;
-  Array<Klass*>* _transitive_interfaces;
+  Array<InstanceKlass*>* _local_interfaces;
+  Array<InstanceKlass*>* _transitive_interfaces;
   Annotations* _combined_annotations;
   AnnotationArray* _annotations;
   AnnotationArray* _type_annotations;
--- a/src/hotspot/share/classfile/classLoaderData.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/classLoaderData.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -95,7 +95,7 @@
   ClassLoaderDataGraph::_head = _the_null_class_loader_data;
   assert(_the_null_class_loader_data->is_the_null_class_loader_data(), "Must be");
 
-  LogTarget(Debug, class, loader, data) lt;
+  LogTarget(Trace, class, loader, data) lt;
   if (lt.is_enabled()) {
     ResourceMark rm;
     LogStream ls(lt);
@@ -142,19 +142,22 @@
 }
 
 ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous) :
-  _is_anonymous(is_anonymous),
+  _metaspace(NULL),
+  _metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
+                            Monitor::_safepoint_check_never)),
+  _unloading(false), _is_anonymous(is_anonymous),
+  _modified_oops(true), _accumulated_modified_oops(false),
   // An anonymous class loader data doesn't have anything to keep
   // it from being unloaded during parsing of the anonymous class.
   // The null-class-loader should always be kept alive.
   _keep_alive((is_anonymous || h_class_loader.is_null()) ? 1 : 0),
-  _metaspace(NULL), _unloading(false), _klasses(NULL),
-  _modules(NULL), _packages(NULL), _unnamed_module(NULL), _dictionary(NULL),
-  _claimed(0), _modified_oops(true), _accumulated_modified_oops(false),
-  _jmethod_ids(NULL), _handles(), _deallocate_list(NULL),
+  _claimed(0),
+  _handles(),
+  _klasses(NULL), _packages(NULL), _modules(NULL), _unnamed_module(NULL), _dictionary(NULL),
+  _jmethod_ids(NULL),
+  _deallocate_list(NULL),
   _next(NULL),
-  _class_loader_klass(NULL), _name(NULL), _name_and_id(NULL),
-  _metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
-                            Monitor::_safepoint_check_never)) {
+  _class_loader_klass(NULL), _name(NULL), _name_and_id(NULL) {
 
   if (!h_class_loader.is_null()) {
     _class_loader = _handles.add(h_class_loader());
@@ -592,7 +595,7 @@
 void ClassLoaderData::unload() {
   _unloading = true;
 
-  LogTarget(Debug, class, loader, data) lt;
+  LogTarget(Trace, class, loader, data) lt;
   if (lt.is_enabled()) {
     ResourceMark rm;
     LogStream ls(lt);
@@ -603,7 +606,7 @@
 
   // Some items on the _deallocate_list need to free their C heap structures
   // if they are not already on the _klasses list.
-  unload_deallocate_list();
+  free_deallocate_list_C_heap_structures();
 
   // Tell serviceability tools these classes are unloading
   // after erroneous classes are released.
@@ -846,7 +849,7 @@
 }
 
 // Add this metadata pointer to be freed when it's safe.  This is only during
-// class unloading because Handles might point to this metadata field.
+// a safepoint which checks if handles point to this metadata field.
 void ClassLoaderData::add_to_deallocate_list(Metadata* m) {
   // Metadata in shared region isn't deleted.
   if (!m->is_shared()) {
@@ -855,6 +858,8 @@
       _deallocate_list = new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(100, true);
     }
     _deallocate_list->append_if_missing(m);
+    log_debug(class, loader, data)("deallocate added for %s", m->print_value_string());
+    ClassLoaderDataGraph::set_should_clean_deallocate_lists();
   }
 }
 
@@ -888,16 +893,52 @@
       assert(!m->is_klass() || !((InstanceKlass*)m)->is_scratch_class(),
              "scratch classes on this list should be dead");
       // Also should assert that other metadata on the list was found in handles.
+      // Some cleaning remains.
+      ClassLoaderDataGraph::set_should_clean_deallocate_lists();
     }
   }
 }
 
+void ClassLoaderDataGraph::clean_deallocate_lists(bool walk_previous_versions) {
+  uint loaders_processed = 0;
+  for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
+    // is_alive check will be necessary for concurrent class unloading.
+    if (cld->is_alive()) {
+      // clean metaspace
+      if (walk_previous_versions) {
+        cld->classes_do(InstanceKlass::purge_previous_versions);
+      }
+      cld->free_deallocate_list();
+      loaders_processed++;
+    }
+  }
+  log_debug(class, loader, data)("clean_deallocate_lists: loaders processed %u %s",
+                                 loaders_processed, walk_previous_versions ? "walk_previous_versions" : "");
+}
+
+void ClassLoaderDataGraph::walk_metadata_and_clean_metaspaces() {
+  assert(SafepointSynchronize::is_at_safepoint(), "must only be called at safepoint");
+
+  _should_clean_deallocate_lists = false; // assume everything gets cleaned
+
+  // Mark metadata seen on the stack so we can delete unreferenced entries.
+  // Walk all metadata, including the expensive code cache walk, only for class redefinition.
+  // The MetadataOnStackMark walk during redefinition saves previous versions if it finds old methods
+  // on the stack or in the code cache, so we only have to repeat the full walk if
+  // they were found at that time.
+  // TODO: have redefinition clean old methods out of the code cache.  They still exist in some places.
+  bool walk_all_metadata = InstanceKlass::has_previous_versions_and_reset();
+
+  MetadataOnStackMark md_on_stack(walk_all_metadata);
+  clean_deallocate_lists(walk_all_metadata);
+}
+
 // This is distinct from free_deallocate_list.  For class loader data that are
 // unloading, this frees the C heap memory for items on the list, and unlinks
 // scratch or error classes so that unloading events aren't triggered for these
 // classes. The metadata is removed with the unloading metaspace.
 // There isn't C heap memory allocated for methods, so nothing is done for them.
-void ClassLoaderData::unload_deallocate_list() {
+void ClassLoaderData::free_deallocate_list_C_heap_structures() {
   // Don't need lock, at safepoint
   assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
   assert(is_unloading(), "only called for ClassLoaderData that are unloading");
@@ -907,7 +948,6 @@
   // Go backwards because this removes entries that are freed.
   for (int i = _deallocate_list->length() - 1; i >= 0; i--) {
     Metadata* m = _deallocate_list->at(i);
-    assert (!m->on_stack(), "wouldn't be unloading if this were so");
     _deallocate_list->remove_at(i);
     if (m->is_constantPool()) {
       ((ConstantPool*)m)->release_C_heap_structures();
@@ -1023,6 +1063,8 @@
 ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
 
 bool ClassLoaderDataGraph::_should_purge = false;
+bool ClassLoaderDataGraph::_should_clean_deallocate_lists = false;
+bool ClassLoaderDataGraph::_safepoint_cleanup_needed = false;
 bool ClassLoaderDataGraph::_metaspace_oom = false;
 
 // Add a new class loader data node to the list.  Assign the newly created
@@ -1053,7 +1095,7 @@
     cld->set_next(next);
     ClassLoaderData* exchanged = Atomic::cmpxchg(cld, list_head, next);
     if (exchanged == next) {
-      LogTarget(Debug, class, loader, data) lt;
+      LogTarget(Trace, class, loader, data) lt;
       if (lt.is_enabled()) {
         ResourceMark rm;
         LogStream ls(lt);
@@ -1334,7 +1376,10 @@
 
 // Move class loader data from main list to the unloaded list for unloading
 // and deallocation later.
-bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
+bool ClassLoaderDataGraph::do_unloading(bool do_cleaning) {
+
+  // Indicate whether safepoint cleanup is needed.
+  _safepoint_cleanup_needed |= do_cleaning;
 
   ClassLoaderData* data = _head;
   ClassLoaderData* prev = NULL;
@@ -1342,15 +1387,6 @@
   uint loaders_processed = 0;
   uint loaders_removed = 0;
 
-  // Mark metadata seen on the stack only so we can delete unneeded entries.
-  // Only walk all metadata, including the expensive code cache walk, for Full GC
-  // and only if class redefinition and if there's previous versions of
-  // Klasses to delete.
-  bool walk_all_metadata = clean_previous_versions &&
-                           JvmtiExport::has_redefined_a_class() &&
-                           InstanceKlass::has_previous_versions_and_reset();
-  MetadataOnStackMark md_on_stack(walk_all_metadata);
-
   // Save previous _unloading pointer for CMS which may add to unloading list before
   // purging and we don't want to rewalk the previously unloaded class loader data.
   _saved_unloading = _unloading;
@@ -1358,11 +1394,6 @@
   data = _head;
   while (data != NULL) {
     if (data->is_alive()) {
-      // clean metaspace
-      if (walk_all_metadata) {
-        data->classes_do(InstanceKlass::purge_previous_versions);
-      }
-      data->free_deallocate_list();
       prev = data;
       data = data->next();
       loaders_processed++;
@@ -1387,27 +1418,6 @@
   }
 
   if (seen_dead_loader) {
-    data = _head;
-    while (data != NULL) {
-      // Remove entries in the dictionary of live class loader that have
-      // initiated loading classes in a dead class loader.
-      if (data->dictionary() != NULL) {
-        data->dictionary()->do_unloading();
-      }
-      // Walk a ModuleEntry's reads, and a PackageEntry's exports
-      // lists to determine if there are modules on those lists that are now
-      // dead and should be removed.  A module's life cycle is equivalent
-      // to its defining class loader's life cycle.  Since a module is
-      // considered dead if its class loader is dead, these walks must
-      // occur after each class loader's aliveness is determined.
-      if (data->packages() != NULL) {
-        data->packages()->purge_all_package_exports();
-      }
-      if (data->modules_defined()) {
-        data->modules()->purge_all_module_reads();
-      }
-      data = data->next();
-    }
     JFR_ONLY(post_class_unload_events();)
   }
 
@@ -1416,6 +1426,32 @@
   return seen_dead_loader;
 }
 
+// There's at least one dead class loader.  Purge refererences of healthy module
+// reads lists and package export lists to modules belonging to dead loaders.
+void ClassLoaderDataGraph::clean_module_and_package_info() {
+  ClassLoaderData* data = _head;
+  while (data != NULL) {
+    // Remove entries in the dictionary of live class loader that have
+    // initiated loading classes in a dead class loader.
+    if (data->dictionary() != NULL) {
+      data->dictionary()->do_unloading();
+    }
+    // Walk a ModuleEntry's reads, and a PackageEntry's exports
+    // lists to determine if there are modules on those lists that are now
+    // dead and should be removed.  A module's life cycle is equivalent
+    // to its defining class loader's life cycle.  Since a module is
+    // considered dead if its class loader is dead, these walks must
+    // occur after each class loader's aliveness is determined.
+    if (data->packages() != NULL) {
+      data->packages()->purge_all_package_exports();
+    }
+    if (data->modules_defined()) {
+      data->modules()->purge_all_module_reads();
+    }
+    data = data->next();
+  }
+}
+
 void ClassLoaderDataGraph::purge() {
   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
   ClassLoaderData* list = _unloading;
--- a/src/hotspot/share/classfile/classLoaderData.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/classLoaderData.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -79,6 +79,12 @@
   static ClassLoaderData* _saved_head;
   static ClassLoaderData* _saved_unloading;
   static bool _should_purge;
+
+  // Set if there's anything to purge in the deallocate lists or previous versions
+  // during a safepoint after class unloading in a full GC.
+  static bool _should_clean_deallocate_lists;
+  static bool _safepoint_cleanup_needed;
+
   // OOM has been seen in metaspace allocation. Used to prevent some
   // allocations until class unloading
   static bool _metaspace_oom;
@@ -88,8 +94,10 @@
 
   static ClassLoaderData* add_to_graph(Handle class_loader, bool anonymous);
   static ClassLoaderData* add(Handle class_loader, bool anonymous);
+
  public:
   static ClassLoaderData* find_or_create(Handle class_loader);
+  static void clean_module_and_package_info();
   static void purge();
   static void clear_claimed_marks();
   // oops do
@@ -116,7 +124,13 @@
   static void packages_unloading_do(void f(PackageEntry*));
   static void loaded_classes_do(KlassClosure* klass_closure);
   static void classes_unloading_do(void f(Klass* const));
-  static bool do_unloading(bool clean_previous_versions);
+  static bool do_unloading(bool do_cleaning);
+
+  // Expose state to avoid logging overhead in safepoint cleanup tasks.
+  static inline bool should_clean_metaspaces_and_reset();
+  static void set_should_clean_deallocate_lists() { _should_clean_deallocate_lists = true; }
+  static void clean_deallocate_lists(bool purge_previous_versions);
+  static void walk_metadata_and_clean_metaspaces();
 
   // dictionary do
   // Iterate over all klasses in dictionary, but
@@ -185,7 +199,7 @@
       volatile juint _size;
       Chunk* _next;
 
-      Chunk(Chunk* c) : _next(c), _size(0) { }
+      Chunk(Chunk* c) : _size(0), _next(c) { }
     };
 
     Chunk* volatile _head;
@@ -297,8 +311,8 @@
   void packages_do(void f(PackageEntry*));
 
   // Deallocate free list during class unloading.
-  void free_deallocate_list();      // for the classes that are not unloaded
-  void unload_deallocate_list();    // for the classes that are unloaded
+  void free_deallocate_list();                      // for the classes that are not unloaded
+  void free_deallocate_list_C_heap_structures();    // for the classes that are unloaded
 
   // Allocate out of this class loader data
   MetaWord* allocate(size_t size);
--- a/src/hotspot/share/classfile/classLoaderData.inline.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/classLoaderData.inline.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -27,6 +27,7 @@
 
 #include "classfile/classLoaderData.hpp"
 #include "classfile/javaClasses.hpp"
+#include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/oopHandle.inline.hpp"
 #include "oops/weakHandle.inline.hpp"
@@ -92,4 +93,13 @@
   Atomic::sub(count, &_num_array_classes);
 }
 
+bool ClassLoaderDataGraph::should_clean_metaspaces_and_reset() {
+  bool do_cleaning = _safepoint_cleanup_needed && _should_clean_deallocate_lists;
+#if INCLUDE_JVMTI
+  do_cleaning = do_cleaning || InstanceKlass::has_previous_versions();
+#endif
+  _safepoint_cleanup_needed = false;  // reset
+  return do_cleaning;
+}
+
 #endif // SHARE_VM_CLASSFILE_CLASSLOADERDATA_INLINE_HPP
--- a/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -299,7 +299,7 @@
 
   LoaderTreeNode(const oop loader_oop)
     : _loader_oop(loader_oop), _cld(NULL), _child(NULL), _next(NULL),
-      _classes(NULL), _anon_classes(NULL), _num_classes(0), _num_anon_classes(0),
+      _classes(NULL), _num_classes(0), _anon_classes(NULL), _num_anon_classes(0),
       _num_folded(0)
     {}
 
--- a/src/hotspot/share/classfile/classLoaderStats.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/classLoaderStats.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -87,8 +87,8 @@
     _chunk_sz(0),
     _block_sz(0),
     _classes_count(0),
+    _anon_chunk_sz(0),
     _anon_block_sz(0),
-    _anon_chunk_sz(0),
     _anon_classes_count(0) {
   }
 };
@@ -118,11 +118,11 @@
 public:
   ClassLoaderStatsClosure(outputStream* out) :
     _out(out),
+    _stats(new StatsTable()),
     _total_loaders(0),
-    _total_block_sz(0),
+    _total_classes(0),
     _total_chunk_sz(0),
-    _total_classes(0),
-    _stats(new StatsTable()) {
+    _total_block_sz(0) {
   }
 
   virtual void do_cld(ClassLoaderData* cld);
--- a/src/hotspot/share/classfile/defaultMethods.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/defaultMethods.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -688,8 +688,8 @@
 
  public:
   FindMethodsByErasedSig(Symbol* name, Symbol* signature, bool is_interf) :
-      _method_name(name), _method_signature(signature), _cur_class_is_interface(is_interf),
-      _family(NULL) {}
+      _method_name(name), _method_signature(signature), _family(NULL),
+      _cur_class_is_interface(is_interf) {}
 
   void get_discovered_family(MethodFamily** family) {
       if (_family != NULL) {
--- a/src/hotspot/share/classfile/dictionary.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/dictionary.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -53,16 +53,16 @@
 }
 
 Dictionary::Dictionary(ClassLoaderData* loader_data, int table_size, bool resizable)
-  : _loader_data(loader_data), _resizable(resizable), _needs_resizing(false),
-  Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size()) {
+  : Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size()),
+    _resizable(resizable), _needs_resizing(false), _loader_data(loader_data) {
 };
 
 
 Dictionary::Dictionary(ClassLoaderData* loader_data,
                        int table_size, HashtableBucket<mtClass>* t,
                        int number_of_entries, bool resizable)
-  : _loader_data(loader_data), _resizable(resizable), _needs_resizing(false),
-  Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size(), t, number_of_entries) {
+  : Hashtable<InstanceKlass*, mtClass>(table_size, (int)entry_size(), t, number_of_entries),
+    _resizable(resizable), _needs_resizing(false), _loader_data(loader_data) {
 };
 
 Dictionary::~Dictionary() {
--- a/src/hotspot/share/classfile/javaClasses.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/javaClasses.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -2005,7 +2005,7 @@
  public:
 
   // constructor for new backtrace
-  BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _mirrors(NULL), _names(NULL) {
+  BacktraceBuilder(TRAPS): _head(NULL), _methods(NULL), _bcis(NULL), _mirrors(NULL), _names(NULL) {
     expand(CHECK);
     _backtrace = Handle(THREAD, _head);
     _index = 0;
@@ -2102,7 +2102,7 @@
   Symbol* _name;
   Handle _mirror;
   BacktraceElement(Handle mirror, int mid, int version, int bci, Symbol* name) :
-                   _mirror(mirror), _method_id(mid), _version(version), _bci(bci), _name(name) {}
+                   _method_id(mid), _bci(bci), _version(version), _name(name), _mirror(mirror) {}
 };
 
 class BacktraceIterator : public StackObj {
@@ -4250,6 +4250,12 @@
 int jdk_internal_module_ArchivedModuleGraph::_archivedSystemModules_offset;
 int jdk_internal_module_ArchivedModuleGraph::_archivedModuleFinder_offset;
 int jdk_internal_module_ArchivedModuleGraph::_archivedMainModule_offset;
+int jdk_internal_module_ArchivedModuleGraph::_archivedConfiguration_offset;
+int java_lang_Integer_IntegerCache::_archivedCache_offset;
+int java_lang_module_Configuration::_EMPTY_CONFIGURATION_offset;
+int java_util_ImmutableCollections_ListN::_EMPTY_LIST_offset;
+int java_util_ImmutableCollections_SetN::_EMPTY_SET_offset;
+int java_util_ImmutableCollections_MapN::_EMPTY_MAP_offset;
 
 #define STACKTRACEELEMENT_FIELDS_DO(macro) \
   macro(declaringClassObject_offset,  k, "declaringClassObject", class_signature, false); \
@@ -4412,20 +4418,96 @@
   return (hardcoded_offset * heapOopSize) + instanceOopDesc::base_offset_in_bytes();
 }
 
-#define MODULEBOOTSTRAP_FIELDS_DO(macro) \
+#define INTEGERCACHE_FIELDS_DO(macro) \
+  macro(_archivedCache_offset,  k, "archivedCache",  java_lang_Integer_array_signature, true)
+
+void java_lang_Integer_IntegerCache::compute_offsets() {
+  InstanceKlass* k = SystemDictionary::Integer_IntegerCache_klass();
+  assert(k != NULL, "must be loaded");
+  INTEGERCACHE_FIELDS_DO(FIELD_COMPUTE_OFFSET);
+}
+
+#if INCLUDE_CDS
+void java_lang_Integer_IntegerCache::serialize(SerializeClosure* f) {
+  INTEGERCACHE_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+}
+#endif
+
+#define ARCHIVEDMODULEGRAPH_FIELDS_DO(macro) \
   macro(_archivedSystemModules_offset,      k, "archivedSystemModules", systemModules_signature, true); \
   macro(_archivedModuleFinder_offset,       k, "archivedModuleFinder",  moduleFinder_signature,  true); \
-  macro(_archivedMainModule_offset,         k, "archivedMainModule",    string_signature,        true)
+  macro(_archivedMainModule_offset,         k, "archivedMainModule",    string_signature,        true); \
+  macro(_archivedConfiguration_offset,      k, "archivedConfiguration", configuration_signature, true)
 
 void jdk_internal_module_ArchivedModuleGraph::compute_offsets() {
   InstanceKlass* k = SystemDictionary::ArchivedModuleGraph_klass();
   assert(k != NULL, "must be loaded");
-  MODULEBOOTSTRAP_FIELDS_DO(FIELD_COMPUTE_OFFSET);
+  ARCHIVEDMODULEGRAPH_FIELDS_DO(FIELD_COMPUTE_OFFSET);
 }
 
 #if INCLUDE_CDS
 void jdk_internal_module_ArchivedModuleGraph::serialize(SerializeClosure* f) {
-  MODULEBOOTSTRAP_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+  ARCHIVEDMODULEGRAPH_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+}
+#endif
+
+#define CONFIGURATION_FIELDS_DO(macro) \
+  macro(_EMPTY_CONFIGURATION_offset, k, "EMPTY_CONFIGURATION", configuration_signature, true)
+
+void java_lang_module_Configuration::compute_offsets() {
+  InstanceKlass* k = SystemDictionary::Configuration_klass();
+  assert(k != NULL, "must be loaded");
+  CONFIGURATION_FIELDS_DO(FIELD_COMPUTE_OFFSET);
+}
+
+#if INCLUDE_CDS
+void java_lang_module_Configuration::serialize(SerializeClosure* f) {
+  CONFIGURATION_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+}
+#endif
+
+#define LISTN_FIELDS_DO(macro) \
+  macro(_EMPTY_LIST_offset, k, "EMPTY_LIST", list_signature, true)
+
+void java_util_ImmutableCollections_ListN::compute_offsets() {
+  InstanceKlass* k = SystemDictionary::ImmutableCollections_ListN_klass();
+  assert(k != NULL, "must be loaded");
+  LISTN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
+}
+
+#if INCLUDE_CDS
+void java_util_ImmutableCollections_ListN::serialize(SerializeClosure* f) {
+  LISTN_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+}
+#endif
+
+#define SETN_FIELDS_DO(macro) \
+  macro(_EMPTY_SET_offset, k, "EMPTY_SET", set_signature, true)
+
+void java_util_ImmutableCollections_SetN::compute_offsets() {
+  InstanceKlass* k = SystemDictionary::ImmutableCollections_SetN_klass();
+  assert(k != NULL, "must be loaded");
+  SETN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
+}
+
+#if INCLUDE_CDS
+void java_util_ImmutableCollections_SetN::serialize(SerializeClosure* f) {
+  SETN_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+}
+#endif
+
+#define MAPN_FIELDS_DO(macro) \
+  macro(_EMPTY_MAP_offset, k, "EMPTY_MAP", map_signature, true)
+
+void java_util_ImmutableCollections_MapN::compute_offsets() {
+  InstanceKlass* k = SystemDictionary::ImmutableCollections_MapN_klass();
+  assert(k != NULL, "must be loaded");
+  MAPN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
+}
+
+#if INCLUDE_CDS
+void java_util_ImmutableCollections_MapN::serialize(SerializeClosure* f) {
+  MAPN_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
 }
 #endif
 
@@ -4487,6 +4569,11 @@
   java_lang_LiveStackFrameInfo::compute_offsets();
   java_util_concurrent_locks_AbstractOwnableSynchronizer::compute_offsets();
 
+  java_lang_Integer_IntegerCache::compute_offsets();
+  java_lang_module_Configuration::compute_offsets();
+  java_util_ImmutableCollections_ListN::compute_offsets();
+  java_util_ImmutableCollections_MapN::compute_offsets();
+  java_util_ImmutableCollections_SetN::compute_offsets();
   jdk_internal_module_ArchivedModuleGraph::compute_offsets();
 
   // generated interpreter code wants to know about the offsets we just computed:
--- a/src/hotspot/share/classfile/javaClasses.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/javaClasses.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1485,15 +1485,62 @@
   static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
 };
 
+class java_lang_Integer_IntegerCache: AllStatic {
+ private:
+  static int _archivedCache_offset;
+ public:
+  static int archivedCache_offset()  { return _archivedCache_offset; }
+  static void compute_offsets();
+  static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
+};
+
 class jdk_internal_module_ArchivedModuleGraph: AllStatic {
  private:
   static int _archivedSystemModules_offset;
   static int _archivedModuleFinder_offset;
   static int _archivedMainModule_offset;
+  static int _archivedConfiguration_offset;
  public:
   static int  archivedSystemModules_offset()      { return _archivedSystemModules_offset; }
   static int  archivedModuleFinder_offset()       { return _archivedModuleFinder_offset; }
   static int  archivedMainModule_offset()         { return _archivedMainModule_offset; }
+  static int  archivedConfiguration_offset()      { return _archivedConfiguration_offset; }
+  static void compute_offsets();
+  static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
+};
+
+class java_lang_module_Configuration: AllStatic {
+ private:
+  static int _EMPTY_CONFIGURATION_offset;
+ public:
+  static int EMPTY_CONFIGURATION_offset() { return _EMPTY_CONFIGURATION_offset; }
+  static void compute_offsets();
+  static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
+};
+
+class java_util_ImmutableCollections_ListN : AllStatic {
+ private:
+  static int _EMPTY_LIST_offset;
+ public:
+  static int EMPTY_LIST_offset() { return _EMPTY_LIST_offset; }
+  static void compute_offsets();
+  static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
+};
+
+class java_util_ImmutableCollections_SetN : AllStatic {
+ private:
+  static int _EMPTY_SET_offset;
+ public:
+  static int EMPTY_SET_offset() { return _EMPTY_SET_offset; }
+  static void compute_offsets();
+  static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
+};
+
+class java_util_ImmutableCollections_MapN : AllStatic {
+ private:
+  static int _EMPTY_MAP_offset;
+ public:
+  static int EMPTY_MAP_offset() { return _EMPTY_MAP_offset; }
   static void compute_offsets();
   static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
 };
--- a/src/hotspot/share/classfile/loaderConstraints.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/loaderConstraints.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -65,7 +65,7 @@
 
 LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
                                     Symbol* name, Handle loader) {
-
+  assert_lock_strong(SystemDictionary_lock);
   unsigned int hash = compute_hash(name);
   int index = hash_to_index(hash);
   LoaderConstraintEntry** pp = bucket_addr(index);
@@ -89,7 +89,7 @@
 
 
 void LoaderConstraintTable::purge_loader_constraints() {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  assert_locked_or_safepoint(SystemDictionary_lock);
   LogTarget(Info, class, loader, constraints) lt;
   // Remove unloaded entries from constraint table
   for (int index = 0; index < table_size(); index++) {
--- a/src/hotspot/share/classfile/moduleEntry.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/moduleEntry.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -436,7 +436,7 @@
 // Remove dead modules from all other alive modules' reads list.
 // This should only occur at class unloading.
 void ModuleEntryTable::purge_all_module_reads() {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  assert_locked_or_safepoint(Module_lock);
   for (int i = 0; i < table_size(); i++) {
     for (ModuleEntry* entry = bucket(i);
                       entry != NULL;
--- a/src/hotspot/share/classfile/packageEntry.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/packageEntry.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -302,7 +302,7 @@
 
 // Remove dead entries from all packages' exported list
 void PackageEntryTable::purge_all_package_exports() {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  assert_locked_or_safepoint(Module_lock);
   for (int i = 0; i < table_size(); i++) {
     for (PackageEntry* entry = bucket(i);
                        entry != NULL;
--- a/src/hotspot/share/classfile/resolutionErrors.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/resolutionErrors.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -100,7 +100,7 @@
 // RedefineClasses support - remove matching entry of a
 // constant pool that is going away
 void ResolutionErrorTable::delete_entry(ConstantPool* c) {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  assert_locked_or_safepoint(SystemDictionary_lock);
   for (int i = 0; i < table_size(); i++) {
     for (ResolutionErrorEntry** p = bucket_addr(i); *p != NULL; ) {
       ResolutionErrorEntry* entry = *p;
@@ -118,7 +118,7 @@
 
 // Remove unloaded entries from the table
 void ResolutionErrorTable::purge_resolution_errors() {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  assert_locked_or_safepoint(SystemDictionary_lock);
   for (int i = 0; i < table_size(); i++) {
     for (ResolutionErrorEntry** p = bucket_addr(i); *p != NULL; ) {
       ResolutionErrorEntry* entry = *p;
--- a/src/hotspot/share/classfile/stackMapFrame.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/stackMapFrame.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -33,8 +33,8 @@
 
 StackMapFrame::StackMapFrame(u2 max_locals, u2 max_stack, ClassVerifier* v) :
                       _offset(0), _locals_size(0), _stack_size(0),
-                      _stack_mark(0), _flags(0), _max_locals(max_locals),
-                      _max_stack(max_stack), _verifier(v) {
+                      _stack_mark(0), _max_locals(max_locals),
+                      _max_stack(max_stack), _flags(0), _verifier(v) {
   Thread* thr = v->thread();
   _locals = NEW_RESOURCE_ARRAY_IN_THREAD(thr, VerificationType, max_locals);
   _stack = NEW_RESOURCE_ARRAY_IN_THREAD(thr, VerificationType, max_stack);
--- a/src/hotspot/share/classfile/stackMapFrame.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/stackMapFrame.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -105,12 +105,12 @@
                 u2 max_stack,
                 VerificationType* locals,
                 VerificationType* stack,
-                ClassVerifier* v) : _offset(offset), _flags(flags),
+                ClassVerifier* v) : _offset(offset),
                                     _locals_size(locals_size),
                                     _stack_size(stack_size),
                                     _stack_mark(-1),
                                     _max_locals(max_locals),
-                                    _max_stack(max_stack),
+                                    _max_stack(max_stack),  _flags(flags),
                                     _locals(locals), _stack(stack),
                                     _verifier(v) { }
 
--- a/src/hotspot/share/classfile/stringTable.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/stringTable.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -122,7 +122,7 @@
 
  public:
   StringTableLookupJchar(Thread* thread, uintx hash, const jchar* key, int len)
-    : _thread(thread), _hash(hash), _str(key), _len(len) {
+    : _thread(thread), _hash(hash), _len(len), _str(key) {
   }
   uintx get_hash() const {
     return _hash;
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -242,12 +242,23 @@
 }
 
 
-// Forwards to resolve_instance_class_or_null
+// Forwards to resolve_array_class_or_null or resolve_instance_class_or_null
 
 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {
   if (FieldType::is_array(class_name)) {
     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
-  } else if (FieldType::is_obj(class_name)) {
+  } else {
+    return resolve_instance_class_or_null_helper(class_name, class_loader, protection_domain, THREAD);
+  }
+}
+
+// name may be in the form of "java/lang/Object" or "Ljava/lang/Object;"
+InstanceKlass* SystemDictionary::resolve_instance_class_or_null_helper(Symbol* class_name,
+                                                                       Handle class_loader,
+                                                                       Handle protection_domain,
+                                                                       TRAPS) {
+  assert(class_name != NULL && !FieldType::is_array(class_name), "must be");
+  if (FieldType::is_obj(class_name)) {
     ResourceMark rm(THREAD);
     // Ignore wrapping L and ;.
     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
@@ -330,17 +341,18 @@
 // placeholders()->find_and_add(PlaceholderTable::LOAD_SUPER),
 // you need to find_and_remove it before returning.
 // So be careful to not exit with a CHECK_ macro betweeen these calls.
-Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
-                                                 Symbol* class_name,
-                                                 Handle class_loader,
-                                                 Handle protection_domain,
-                                                 bool is_superclass,
-                                                 TRAPS) {
+InstanceKlass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
+                                                       Symbol* super_name,
+                                                       Handle class_loader,
+                                                       Handle protection_domain,
+                                                       bool is_superclass,
+                                                       TRAPS) {
+  assert(!FieldType::is_array(super_name), "invalid super class name");
 #if INCLUDE_CDS
   if (DumpSharedSpaces) {
     // Special processing for CDS dump time.
-    Klass* k = SystemDictionaryShared::dump_time_resolve_super_or_fail(child_name,
-        class_name, class_loader, protection_domain, is_superclass, CHECK_NULL);
+    InstanceKlass* k = SystemDictionaryShared::dump_time_resolve_super_or_fail(child_name,
+        super_name, class_loader, protection_domain, is_superclass, CHECK_NULL);
     if (k) {
       return k;
     }
@@ -372,18 +384,17 @@
   bool throw_circularity_error = false;
   {
     MutexLocker mu(SystemDictionary_lock, THREAD);
-    Klass* childk = find_class(d_hash, child_name, dictionary);
-    Klass* quicksuperk;
+    InstanceKlass* childk = find_class(d_hash, child_name, dictionary);
+    InstanceKlass* quicksuperk;
     // to support // loading: if child done loading, just return superclass
-    // if class_name, & class_loader don't match:
+    // if super_name, & class_loader don't match:
     // if initial define, SD update will give LinkageError
     // if redefine: compare_class_versions will give HIERARCHY_CHANGED
     // so we don't throw an exception here.
     // see: nsk redefclass014 & java.lang.instrument Instrument032
     if ((childk != NULL ) && (is_superclass) &&
-       ((quicksuperk = childk->super()) != NULL) &&
-
-         ((quicksuperk->name() == class_name) &&
+        ((quicksuperk = childk->java_super()) != NULL) &&
+         ((quicksuperk->name() == super_name) &&
             (oopDesc::equals(quicksuperk->class_loader(), class_loader())))) {
            return quicksuperk;
     } else {
@@ -394,7 +405,7 @@
     }
     if (!throw_circularity_error) {
       // Be careful not to exit resolve_super
-      PlaceholderEntry* newprobe = placeholders()->find_and_add(p_index, p_hash, child_name, loader_data, PlaceholderTable::LOAD_SUPER, class_name, THREAD);
+      PlaceholderEntry* newprobe = placeholders()->find_and_add(p_index, p_hash, child_name, loader_data, PlaceholderTable::LOAD_SUPER, super_name, THREAD);
     }
   }
   if (throw_circularity_error) {
@@ -403,12 +414,13 @@
   }
 
 // java.lang.Object should have been found above
-  assert(class_name != NULL, "null super class for resolving");
+  assert(super_name != NULL, "null super class for resolving");
   // Resolve the super class or interface, check results on return
-  Klass* superk = SystemDictionary::resolve_or_null(class_name,
-                                                    class_loader,
-                                                    protection_domain,
-                                                    THREAD);
+  InstanceKlass* superk =
+    SystemDictionary::resolve_instance_class_or_null_helper(super_name,
+                                                            class_loader,
+                                                            protection_domain,
+                                                            THREAD);
 
   // Clean up of placeholders moved so that each classloadAction registrar self-cleans up
   // It is no longer necessary to keep the placeholder table alive until update_dictionary
@@ -423,7 +435,11 @@
   }
   if (HAS_PENDING_EXCEPTION || superk == NULL) {
     // can null superk
-    superk = handle_resolution_exception(class_name, true, superk, THREAD);
+    Klass* k = handle_resolution_exception(super_name, true, superk, THREAD);
+    assert(k == NULL || k == superk, "must be");
+    if (k == NULL) {
+      superk = NULL;
+    }
   }
 
   return superk;
@@ -639,10 +655,12 @@
 // placeholders()->find_and_add(PlaceholderTable::LOAD_INSTANCE),
 // you need to find_and_remove it before returning.
 // So be careful to not exit with a CHECK_ macro betweeen these calls.
-Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
-                                                        Handle class_loader,
-                                                        Handle protection_domain,
-                                                        TRAPS) {
+//
+// name must be in the form of "java/lang/Object" -- cannot be "Ljava/lang/Object;"
+InstanceKlass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
+                                                                Handle class_loader,
+                                                                Handle protection_domain,
+                                                                TRAPS) {
   assert(name != NULL && !FieldType::is_array(name) &&
          !FieldType::is_obj(name), "invalid class name");
 
@@ -663,7 +681,7 @@
   // before we return a result we call out to java to check for valid protection domain
   // to allow returning the Klass* and add it to the pd_set if it is valid
   {
-    Klass* probe = dictionary->find(d_hash, name, protection_domain);
+    InstanceKlass* probe = dictionary->find(d_hash, name, protection_domain);
     if (probe != NULL) return probe;
   }
 
@@ -706,7 +724,7 @@
     MutexLocker mu(SystemDictionary_lock, THREAD);
     InstanceKlass* check = find_class(d_hash, name, dictionary);
     if (check != NULL) {
-      // Klass is already loaded, so just return it
+      // InstanceKlass is already loaded, so just return it
       class_has_been_loaded = true;
       k = check;
     } else {
@@ -877,7 +895,7 @@
   {
     ClassLoaderData* loader_data = k->class_loader_data();
     MutexLocker mu(SystemDictionary_lock, THREAD);
-    Klass* kk = find_class(name, loader_data);
+    InstanceKlass* kk = find_class(name, loader_data);
     assert(kk == k, "should be present in dictionary");
   }
 #endif
@@ -1308,11 +1326,11 @@
       }
     }
 
-    Array<Klass*>* interfaces = ik->local_interfaces();
+    Array<InstanceKlass*>* interfaces = ik->local_interfaces();
     int num_interfaces = interfaces->length();
     for (int index = 0; index < num_interfaces; index++) {
-      Klass* k = interfaces->at(index);
-      Symbol*  name  = k->name();
+      InstanceKlass* k = interfaces->at(index);
+      Symbol* name  = k->name();
       Klass* i = resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_NULL);
       if (k != i) {
         // The dynamically resolved interface class is not the same as the one we used during dump time,
@@ -1835,6 +1853,9 @@
 
     // First, mark for unload all ClassLoaderData referencing a dead class loader.
     unloading_occurred = ClassLoaderDataGraph::do_unloading(do_cleaning);
+    if (unloading_occurred) {
+      ClassLoaderDataGraph::clean_module_and_package_info();
+    }
   }
 
   if (unloading_occurred) {
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -187,6 +187,10 @@
   do_klass(jdk_internal_loader_ClassLoaders_AppClassLoader_klass,      jdk_internal_loader_ClassLoaders_AppClassLoader,       Pre ) \
   do_klass(jdk_internal_loader_ClassLoaders_PlatformClassLoader_klass, jdk_internal_loader_ClassLoaders_PlatformClassLoader,  Pre ) \
   do_klass(CodeSource_klass,                            java_security_CodeSource,                  Pre                 ) \
+  do_klass(Configuration_klass,                         java_lang_module_Configuration,            Pre                 ) \
+  do_klass(ImmutableCollections_ListN_klass,            java_util_ImmutableCollections_ListN,      Pre                 ) \
+  do_klass(ImmutableCollections_MapN_klass,             java_util_ImmutableCollections_MapN,       Pre                 ) \
+  do_klass(ImmutableCollections_SetN_klass,             java_util_ImmutableCollections_SetN,       Pre                 ) \
   do_klass(ArchivedModuleGraph_klass,                   jdk_internal_module_ArchivedModuleGraph,   Pre                 ) \
                                                                                                                          \
   do_klass(StackTraceElement_klass,                     java_lang_StackTraceElement,               Opt                 ) \
@@ -211,6 +215,7 @@
   do_klass(Byte_klass,                                  java_lang_Byte,                            Pre                 ) \
   do_klass(Short_klass,                                 java_lang_Short,                           Pre                 ) \
   do_klass(Integer_klass,                               java_lang_Integer,                         Pre                 ) \
+  do_klass(Integer_IntegerCache_klass,                  java_lang_Integer_IntegerCache,            Pre                 ) \
   do_klass(Long_klass,                                  java_lang_Long,                            Pre                 ) \
                                                                                                                          \
   /* JVMCI classes. These are loaded on-demand. */                                                                       \
@@ -280,12 +285,12 @@
   // Resolve a superclass or superinterface. Called from ClassFileParser,
   // parse_interfaces, resolve_instance_class_or_null, load_shared_class
   // "child_name" is the class whose super class or interface is being resolved.
-  static Klass* resolve_super_or_fail(Symbol* child_name,
-                                      Symbol* class_name,
-                                      Handle class_loader,
-                                      Handle protection_domain,
-                                      bool is_superclass,
-                                      TRAPS);
+  static InstanceKlass* resolve_super_or_fail(Symbol* child_name,
+                                              Symbol* class_name,
+                                              Handle class_loader,
+                                              Handle protection_domain,
+                                              bool is_superclass,
+                                              TRAPS);
 
   // Parse new stream. This won't update the dictionary or
   // class hierarchy, simply parse the stream. Used by JVMTI RedefineClasses.
@@ -638,7 +643,11 @@
   static SymbolPropertyTable* invoke_method_table() { return _invoke_method_table; }
 
   // Basic loading operations
-  static Klass* resolve_instance_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS);
+  static InstanceKlass* resolve_instance_class_or_null_helper(Symbol* name,
+                                                              Handle class_loader,
+                                                              Handle protection_domain,
+                                                              TRAPS);
+  static InstanceKlass* resolve_instance_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS);
   static Klass* resolve_array_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS);
   static InstanceKlass* handle_parallel_super_load(Symbol* class_name, Symbol* supername, Handle class_loader, Handle protection_domain, Handle lockObject, TRAPS);
   // Wait on SystemDictionary_lock; unlocks lockObject before
--- a/src/hotspot/share/classfile/systemDictionaryShared.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -505,9 +505,9 @@
 
       {
         MutexLocker mu(SystemDictionary_lock, THREAD);
-        Klass* check = find_class(d_hash, name, dictionary);
+        InstanceKlass* check = find_class(d_hash, name, dictionary);
         if (check != NULL) {
-          return InstanceKlass::cast(check);
+          return check;
         }
       }
 
@@ -524,10 +524,9 @@
                  Symbol* class_name, Handle class_loader, TRAPS) {
   assert(UseSharedSpaces, "must be");
   assert(shared_dictionary() != NULL, "already checked");
-  Klass* k = shared_dictionary()->find_class_for_builtin_loader(class_name);
+  InstanceKlass* ik = shared_dictionary()->find_class_for_builtin_loader(class_name);
 
-  if (k != NULL) {
-    InstanceKlass* ik = InstanceKlass::cast(k);
+  if (ik != NULL) {
     if ((ik->is_shared_app_class() &&
          SystemDictionary::is_system_class_loader(class_loader()))  ||
         (ik->is_shared_platform_class() &&
@@ -594,7 +593,7 @@
   }
 
   ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader());
-  Klass* k;
+  InstanceKlass* k;
 
   { // UNREGISTERED loader
     if (!shared_dictionary()->class_exists_for_unregistered_loader(class_name)) {
@@ -613,7 +612,7 @@
     return NULL;
   }
 
-  return acquire_class_for_current_thread(InstanceKlass::cast(k), class_loader,
+  return acquire_class_for_current_thread(k, class_loader,
                                           protection_domain, THREAD);
 }
 
@@ -672,7 +671,7 @@
 // java/lang/Object id: 0
 // Interface   id: 2 super: 0 source: cust.jar
 // ChildClass  id: 4 super: 0 interfaces: 2 source: cust.jar
-Klass* SystemDictionaryShared::dump_time_resolve_super_or_fail(
+InstanceKlass* SystemDictionaryShared::dump_time_resolve_super_or_fail(
     Symbol* child_name, Symbol* class_name, Handle class_loader,
     Handle protection_domain, bool is_superclass, TRAPS) {
 
@@ -700,14 +699,14 @@
 }
 
 struct SharedMiscInfo {
-  Klass* _klass;
+  InstanceKlass* _klass;
   int _clsfile_size;
   int _clsfile_crc32;
 };
 
 static GrowableArray<SharedMiscInfo>* misc_info_array = NULL;
 
-void SystemDictionaryShared::set_shared_class_misc_info(Klass* k, ClassFileStream* cfs) {
+void SystemDictionaryShared::set_shared_class_misc_info(InstanceKlass* k, ClassFileStream* cfs) {
   assert(DumpSharedSpaces, "only when dumping");
   int clsfile_size  = cfs->length();
   int clsfile_crc32 = ClassLoader::crc32(0, (const char*)cfs->buffer(), cfs->length());
@@ -731,7 +730,7 @@
   misc_info_array->append(misc_info);
 }
 
-void SystemDictionaryShared::init_shared_dictionary_entry(Klass* k, DictionaryEntry* ent) {
+void SystemDictionaryShared::init_shared_dictionary_entry(InstanceKlass* k, DictionaryEntry* ent) {
   SharedDictionaryEntry* entry = (SharedDictionaryEntry*)ent;
   entry->_id = -1;
   entry->_clsfile_size = -1;
@@ -752,7 +751,7 @@
   }
 }
 
-bool SystemDictionaryShared::add_verification_constraint(Klass* k, Symbol* name,
+bool SystemDictionaryShared::add_verification_constraint(InstanceKlass* k, Symbol* name,
          Symbol* from_name, bool from_field_is_protected, bool from_is_array, bool from_is_object) {
   assert(DumpSharedSpaces, "called at dump time only");
 
@@ -796,7 +795,7 @@
   entry->check_verification_constraints(klass, THREAD);
 }
 
-SharedDictionaryEntry* SharedDictionary::find_entry_for(Klass* klass) {
+SharedDictionaryEntry* SharedDictionary::find_entry_for(InstanceKlass* klass) {
   Symbol* class_name = klass->name();
   unsigned int hash = compute_hash(class_name);
   int index = hash_to_index(hash);
@@ -970,7 +969,7 @@
                               entry != NULL;
                               entry = entry->next()) {
     if (entry->hash() == hash) {
-      Klass* klass = (Klass*)entry->literal();
+      InstanceKlass* klass = entry->instance_klass();
       if (klass->name() == class_name && klass->class_loader_data() == loader_data) {
         // There is already a class defined with the same name
         return false;
@@ -993,22 +992,22 @@
 //-----------------
 
 
-Klass* SharedDictionary::find_class_for_builtin_loader(const Symbol* name) const {
+InstanceKlass* SharedDictionary::find_class_for_builtin_loader(const Symbol* name) const {
   SharedDictionaryEntry* entry = get_entry_for_builtin_loader(name);
-  return entry != NULL ? entry->instance_klass() : (Klass*)NULL;
+  return entry != NULL ? entry->instance_klass() : (InstanceKlass*)NULL;
 }
 
-Klass* SharedDictionary::find_class_for_unregistered_loader(const Symbol* name,
+InstanceKlass* SharedDictionary::find_class_for_unregistered_loader(const Symbol* name,
                                                             int clsfile_size,
                                                             int clsfile_crc32) const {
 
   const SharedDictionaryEntry* entry = get_entry_for_unregistered_loader(name,
                                                                          clsfile_size,
                                                                          clsfile_crc32);
-  return entry != NULL ? entry->instance_klass() : (Klass*)NULL;
+  return entry != NULL ? entry->instance_klass() : NULL;
 }
 
-void SharedDictionary::update_entry(Klass* klass, int id) {
+void SharedDictionary::update_entry(InstanceKlass* klass, int id) {
   assert(DumpSharedSpaces, "supported only when dumping");
   Symbol* class_name = klass->name();
   unsigned int hash = compute_hash(class_name);
--- a/src/hotspot/share/classfile/systemDictionaryShared.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/systemDictionaryShared.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -132,7 +132,7 @@
 
   // See "Identifying the loader_type of archived classes" comments above.
   LoaderType loader_type() const {
-    Klass* k = (Klass*)literal();
+    InstanceKlass* k = instance_klass();
 
     if ((k->shared_classpath_index() != UNREGISTERED_INDEX)) {
       return LT_BUILTIN;
@@ -171,17 +171,17 @@
   }
 
 public:
-  SharedDictionaryEntry* find_entry_for(Klass* klass);
+  SharedDictionaryEntry* find_entry_for(InstanceKlass* klass);
   void finalize_verification_constraints();
 
   bool add_non_builtin_klass(const Symbol* class_name,
                              ClassLoaderData* loader_data,
                              InstanceKlass* obj);
 
-  void update_entry(Klass* klass, int id);
+  void update_entry(InstanceKlass* klass, int id);
 
-  Klass* find_class_for_builtin_loader(const Symbol* name) const;
-  Klass* find_class_for_unregistered_loader(const Symbol* name,
+  InstanceKlass* find_class_for_builtin_loader(const Symbol* name) const;
+  InstanceKlass* find_class_for_unregistered_loader(const Symbol* name,
                                             int clsfile_size,
                                             int clsfile_crc32) const;
   bool class_exists_for_unregistered_loader(const Symbol* name) {
@@ -317,7 +317,7 @@
 
   static bool add_non_builtin_klass(Symbol* class_name, ClassLoaderData* loader_data,
                                     InstanceKlass* k, TRAPS);
-  static Klass* dump_time_resolve_super_or_fail(Symbol* child_name,
+  static InstanceKlass* dump_time_resolve_super_or_fail(Symbol* child_name,
                                                 Symbol* class_name,
                                                 Handle class_loader,
                                                 Handle protection_domain,
@@ -327,7 +327,7 @@
   static size_t dictionary_entry_size() {
     return (DumpSharedSpaces) ? sizeof(SharedDictionaryEntry) : sizeof(DictionaryEntry);
   }
-  static void init_shared_dictionary_entry(Klass* k, DictionaryEntry* entry) NOT_CDS_RETURN;
+  static void init_shared_dictionary_entry(InstanceKlass* k, DictionaryEntry* entry) NOT_CDS_RETURN;
   static bool is_builtin(DictionaryEntry* ent) {
     // Can't use virtual function is_builtin because DictionaryEntry doesn't initialize
     // vtable because it's not constructed properly.
@@ -345,13 +345,13 @@
     return (SharedDictionary*)ClassLoaderData::the_null_class_loader_data()->dictionary();
   }
 
-  static void update_shared_entry(Klass* klass, int id) {
+  static void update_shared_entry(InstanceKlass* klass, int id) {
     assert(DumpSharedSpaces, "sanity");
     assert((SharedDictionary*)(klass->class_loader_data()->dictionary()) != NULL, "sanity");
     ((SharedDictionary*)(klass->class_loader_data()->dictionary()))->update_entry(klass, id);
   }
 
-  static void set_shared_class_misc_info(Klass* k, ClassFileStream* cfs);
+  static void set_shared_class_misc_info(InstanceKlass* k, ClassFileStream* cfs);
 
   static InstanceKlass* lookup_from_stream(const Symbol* class_name,
                                            Handle class_loader,
@@ -367,7 +367,7 @@
   // ensures that you cannot load a shared class if its super type(s) are changed. However,
   // we need an additional check to ensure that the verification_constraints did not change
   // between dump time and runtime.
-  static bool add_verification_constraint(Klass* k, Symbol* name,
+  static bool add_verification_constraint(InstanceKlass* k, Symbol* name,
                   Symbol* from_name, bool from_field_is_protected,
                   bool from_is_array, bool from_is_object) NOT_CDS_RETURN_(false);
   static void finalize_verification_constraints() NOT_CDS_RETURN;
--- a/src/hotspot/share/classfile/verifier.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/verifier.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -2678,10 +2678,10 @@
     VerificationType klass_type,
     VerificationType ref_class_type) {
   if (ref_class_type.equals(klass_type)) return true;
-  Array<Klass*>* local_interfaces = klass->local_interfaces();
+  Array<InstanceKlass*>* local_interfaces = klass->local_interfaces();
   if (local_interfaces != NULL) {
     for (int x = 0; x < local_interfaces->length(); x++) {
-      Klass* k = local_interfaces->at(x);
+      InstanceKlass* k = local_interfaces->at(x);
       assert (k != NULL && k->is_interface(), "invalid interface");
       if (ref_class_type.equals(VerificationType::reference_type(k->name()))) {
         return true;
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -438,6 +438,7 @@
   template(fileToEncodedURL_signature,                "(Ljava/io/File;)Ljava/net/URL;")           \
   template(getProtectionDomain_name,                  "getProtectionDomain")                      \
   template(getProtectionDomain_signature,             "(Ljava/security/CodeSource;)Ljava/security/ProtectionDomain;") \
+  template(java_lang_Integer_array_signature,         "[Ljava/lang/Integer;")                     \
   template(url_code_signer_array_void_signature,      "(Ljava/net/URL;[Ljava/security/CodeSigner;)V") \
   template(module_entry_name,                         "module_entry")                             \
   template(resolved_references_name,                  "<resolved_references>")                    \
@@ -648,13 +649,20 @@
   JFR_TEMPLATES(template)                                                                                         \
                                                                                                                   \
   /* cds */                                                                                                       \
+  template(configuration_signature,                "Ljava/lang/module/Configuration;")                            \
+  template(java_lang_module_Configuration,         "java/lang/module/Configuration")                              \
+  template(java_util_ImmutableCollections_ListN,   "java/util/ImmutableCollections$ListN")                        \
+  template(java_util_ImmutableCollections_MapN,    "java/util/ImmutableCollections$MapN")                         \
+  template(java_util_ImmutableCollections_SetN,    "java/util/ImmutableCollections$SetN")                         \
   template(jdk_internal_loader_ClassLoaders,       "jdk/internal/loader/ClassLoaders")                            \
-  template(jdk_vm_cds_SharedClassInfo,             "jdk/vm/cds/SharedClassInfo")                                  \
-  template(url_void_signature,                     "(Ljava/net/URL;)V")                                           \
+  template(list_signature,                         "Ljava/util/List;")                                            \
+  template(map_signature,                          "Ljava/util/Map;")                                             \
+  template(moduleFinder_signature,                 "Ljava/lang/module/ModuleFinder;")                             \
+  template(set_signature,                          "Ljava/util/Set;")                                             \
+  template(systemModules_signature,                "Ljdk/internal/module/SystemModules;")                         \
   template(toFileURL_name,                         "toFileURL")                                                   \
   template(toFileURL_signature,                    "(Ljava/lang/String;)Ljava/net/URL;")                          \
-  template(moduleFinder_signature,                 "Ljava/lang/module/ModuleFinder;")                             \
-  template(systemModules_signature,                "Ljdk/internal/module/SystemModules;")                         \
+  template(url_void_signature,                     "(Ljava/net/URL;)V")                                           \
                                                                                                                   \
   /*end*/
 
--- a/src/hotspot/share/code/codeBlob.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/codeBlob.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -71,22 +71,22 @@
 }
 
 CodeBlob::CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments) :
-  _name(name),
+  _type(type),
   _size(layout.size()),
   _header_size(layout.header_size()),
   _frame_complete_offset(frame_complete_offset),
   _data_offset(layout.data_offset()),
   _frame_size(frame_size),
-  _strings(CodeStrings()),
-  _oop_maps(oop_maps),
-  _caller_must_gc_arguments(caller_must_gc_arguments),
   _code_begin(layout.code_begin()),
   _code_end(layout.code_end()),
+  _content_begin(layout.content_begin()),
   _data_end(layout.data_end()),
   _relocation_begin(layout.relocation_begin()),
   _relocation_end(layout.relocation_end()),
-  _content_begin(layout.content_begin()),
-  _type(type)
+  _oop_maps(oop_maps),
+  _caller_must_gc_arguments(caller_must_gc_arguments),
+  _strings(CodeStrings()),
+  _name(name)
 {
   assert(is_aligned(layout.size(),            oopSize), "unaligned size");
   assert(is_aligned(layout.header_size(),     oopSize), "unaligned size");
@@ -99,21 +99,21 @@
 }
 
 CodeBlob::CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) :
-  _name(name),
+  _type(type),
   _size(layout.size()),
   _header_size(layout.header_size()),
   _frame_complete_offset(frame_complete_offset),
   _data_offset(layout.data_offset()),
   _frame_size(frame_size),
-  _strings(CodeStrings()),
-  _caller_must_gc_arguments(caller_must_gc_arguments),
   _code_begin(layout.code_begin()),
   _code_end(layout.code_end()),
+  _content_begin(layout.content_begin()),
   _data_end(layout.data_end()),
   _relocation_begin(layout.relocation_begin()),
   _relocation_end(layout.relocation_end()),
-  _content_begin(layout.content_begin()),
-  _type(type)
+  _caller_must_gc_arguments(caller_must_gc_arguments),
+  _strings(CodeStrings()),
+  _name(name)
 {
   assert(is_aligned(_size,        oopSize), "unaligned size");
   assert(is_aligned(_header_size, oopSize), "unaligned size");
--- a/src/hotspot/share/code/codeBlob.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/codeBlob.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -268,10 +268,10 @@
     _content_offset(0),
     _code_offset(0),
     _data_offset(0),
+    _code_begin(code_begin),
+    _code_end(code_end),
     _content_begin(content_begin),
     _content_end(content_end),
-    _code_begin(code_begin),
-    _code_end(code_end),
     _data_end(data_end),
     _relocation_begin(relocation_begin),
     _relocation_end(relocation_end)
--- a/src/hotspot/share/code/compiledIC.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/compiledIC.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -252,6 +252,7 @@
 
   if (TraceICs) {
     ResourceMark rm;
+    assert(!call_info->selected_method().is_null(), "Unexpected null selected method");
     tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
                    p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
   }
--- a/src/hotspot/share/code/compiledIC.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/compiledIC.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -126,7 +126,7 @@
   }
 
   CompiledICInfo(): _entry(NULL), _cached_value(NULL), _is_icholder(false),
-                    _to_interpreter(false), _to_aot(false), _is_optimized(false), _release_icholder(false) {
+                    _is_optimized(false), _to_interpreter(false), _to_aot(false), _release_icholder(false) {
   }
   ~CompiledICInfo() {
     // In rare cases the info is computed but not used, so release any
--- a/src/hotspot/share/code/compiledMethod.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/compiledMethod.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -39,13 +39,13 @@
 
 CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments)
   : CodeBlob(name, type, layout, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments),
-  _method(method), _mark_for_deoptimization_status(not_marked) {
+  _mark_for_deoptimization_status(not_marked), _method(method) {
   init_defaults();
 }
 
 CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType type, int size, int header_size, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments)
   : CodeBlob(name, type, CodeBlobLayout((address) this, size, header_size, cb), cb, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments),
-  _method(method), _mark_for_deoptimization_status(not_marked) {
+  _mark_for_deoptimization_status(not_marked), _method(method) {
   init_defaults();
 }
 
--- a/src/hotspot/share/code/dependencies.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/dependencies.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -509,9 +509,9 @@
     bool  _valid;
     void* _value;
    public:
-    DepArgument() : _is_oop(false), _value(NULL), _valid(false) {}
-    DepArgument(oop v): _is_oop(true), _value(v), _valid(true) {}
-    DepArgument(Metadata* v): _is_oop(false), _value(v), _valid(true) {}
+    DepArgument() : _is_oop(false), _valid(false), _value(NULL) {}
+    DepArgument(oop v): _is_oop(true), _valid(true), _value(v) {}
+    DepArgument(Metadata* v): _is_oop(false), _valid(true), _value(v) {}
 
     bool is_null() const               { return _value == NULL; }
     bool is_oop() const                { return _is_oop; }
@@ -582,15 +582,15 @@
 
   public:
     DepStream(Dependencies* deps)
-      : _deps(deps),
-        _code(NULL),
+      : _code(NULL),
+        _deps(deps),
         _bytes(deps->content_bytes())
     {
       initial_asserts(deps->size_in_bytes());
     }
     DepStream(nmethod* code)
-      : _deps(NULL),
-        _code(code),
+      : _code(code),
+        _deps(NULL),
         _bytes(code->dependencies_begin())
     {
       initial_asserts(code->dependencies_size());
@@ -716,7 +716,7 @@
     // iteration variables:
     ChangeType  _change_type;
     Klass*      _klass;
-    Array<Klass*>* _ti_base;    // i.e., transitive_interfaces
+    Array<InstanceKlass*>* _ti_base;    // i.e., transitive_interfaces
     int         _ti_index;
     int         _ti_limit;
 
--- a/src/hotspot/share/code/dependencyContext.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/dependencyContext.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -53,7 +53,7 @@
 
  public:
   nmethodBucket(nmethod* nmethod, nmethodBucket* next) :
-   _nmethod(nmethod), _next(next), _count(1) {}
+   _nmethod(nmethod), _count(1), _next(next) {}
 
   int count()                             { return _count; }
   int increment()                         { _count += 1; return _count; }
--- a/src/hotspot/share/code/exceptionHandlerTable.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/exceptionHandlerTable.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -147,7 +147,7 @@
   implicit_null_entry *adr( uint idx ) const { return &_data[2*idx]; }
   ReallocMark          _nesting;  // assertion check for reallocations
 public:
-  ImplicitExceptionTable( ) :  _data(0), _size(0), _len(0) { }
+  ImplicitExceptionTable( ) :  _size(0), _len(0), _data(0) { }
   // (run-time) construction from nmethod
   ImplicitExceptionTable( const nmethod *nm );
 
--- a/src/hotspot/share/code/nmethod.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/nmethod.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1540,6 +1540,7 @@
         }
       } else if (iter.type() == relocInfo::virtual_call_type) {
         // Check compiledIC holders associated with this nmethod
+        ResourceMark rm;
         CompiledIC *ic = CompiledIC_at(&iter);
         if (ic->is_icholder_call()) {
           CompiledICHolder* cichk = ic->cached_icholder();
--- a/src/hotspot/share/code/oopRecorder.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/oopRecorder.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -162,7 +162,7 @@
 
 oop ObjectLookup::ObjectEntry::oop_value() const { return JNIHandles::resolve(_value); }
 
-ObjectLookup::ObjectLookup(): _gc_count(Universe::heap()->total_collections()), _values(4) {}
+ObjectLookup::ObjectLookup(): _values(4), _gc_count(Universe::heap()->total_collections()) {}
 
 void ObjectLookup::maybe_resort() {
   // The values are kept sorted by address which may be invalidated
--- a/src/hotspot/share/code/vtableStubs.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/code/vtableStubs.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -49,8 +49,8 @@
   void* operator new(size_t size, int code_size) throw();
 
   VtableStub(bool is_vtable_stub, int index)
-        : _next(NULL), _is_vtable_stub(is_vtable_stub),
-          _index(index), _ame_offset(-1), _npe_offset(-1) {}
+        : _next(NULL), _index(index), _ame_offset(-1), _npe_offset(-1),
+          _is_vtable_stub(is_vtable_stub) {}
   VtableStub* next() const                       { return _next; }
   int index() const                              { return _index; }
   static VMReg receiver_location()               { return _receiver_location; }
--- a/src/hotspot/share/compiler/abstractCompiler.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/compiler/abstractCompiler.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -91,7 +91,7 @@
 #endif
 
  public:
-  AbstractCompiler(CompilerType type) : _type(type), _compiler_state(uninitialized), _num_compiler_threads(0) {}
+  AbstractCompiler(CompilerType type) : _num_compiler_threads(0), _compiler_state(uninitialized), _type(type) {}
 
   // This function determines the compiler thread that will perform the
   // shutdown of the corresponding compiler runtime.
--- a/src/hotspot/share/compiler/compileBroker.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1777,12 +1777,6 @@
       possibly_add_compiler_threads();
     }
 
-    // Give compiler threads an extra quanta.  They tend to be bursty and
-    // this helps the compiler to finish up the job.
-    if (CompilerThreadHintNoPreempt) {
-      os::hint_no_preempt();
-    }
-
     // Assign the task to the current thread.  Mark this compilation
     // thread as active for the profiler.
     CompileTaskWrapper ctw(task);
--- a/src/hotspot/share/compiler/compilerDirectives.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/compiler/compilerDirectives.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -31,7 +31,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 
-CompilerDirectives::CompilerDirectives() :_match(NULL), _next(NULL), _ref_count(0) {
+CompilerDirectives::CompilerDirectives() : _next(NULL), _match(NULL), _ref_count(0) {
   _c1_store = new DirectiveSet(this);
   _c2_store = new DirectiveSet(this);
 };
@@ -442,7 +442,7 @@
   char str[] = "*.*";
   const char* error_msg = NULL;
   _default_directives->add_match(str, error_msg);
-#ifdef COMPILER1
+#if defined(COMPILER1) || INCLUDE_JVMCI
   _default_directives->_c1_store->EnableOption = true;
 #endif
 #ifdef COMPILER2
--- a/src/hotspot/share/compiler/methodLiveness.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/compiler/methodLiveness.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -569,11 +569,11 @@
 
 
 MethodLiveness::BasicBlock::BasicBlock(MethodLiveness *analyzer, int start, int limit) :
-         _gen(analyzer->arena(),            analyzer->bit_map_size_bits()),
-         _kill(analyzer->arena(),           analyzer->bit_map_size_bits()),
          _entry(analyzer->arena(),          analyzer->bit_map_size_bits()),
          _normal_exit(analyzer->arena(),    analyzer->bit_map_size_bits()),
          _exception_exit(analyzer->arena(), analyzer->bit_map_size_bits()),
+         _gen(analyzer->arena(),            analyzer->bit_map_size_bits()),
+         _kill(analyzer->arena(),           analyzer->bit_map_size_bits()),
          _last_bci(-1) {
   _analyzer = analyzer;
   _start_bci = start;
--- a/src/hotspot/share/compiler/methodMatcher.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/compiler/methodMatcher.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -62,11 +62,11 @@
 #define RANGESLASH "[*" RANGEBASE "/]"
 
 MethodMatcher::MethodMatcher():
-    _class_mode(Exact)
-  , _method_mode(Exact)
-  , _class_name(NULL)
+    _class_name(NULL)
   , _method_name(NULL)
-  , _signature(NULL) {
+  , _signature(NULL)
+  , _class_mode(Exact)
+  , _method_mode(Exact) {
 }
 
 MethodMatcher::~MethodMatcher() {
--- a/src/hotspot/share/compiler/oopMap.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/compiler/oopMap.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -604,7 +604,7 @@
 }
 #endif
 
-ImmutableOopMapBuilder::ImmutableOopMapBuilder(const OopMapSet* set) : _set(set), _new_set(NULL), _empty(NULL), _last(NULL), _empty_offset(-1), _last_offset(-1), _offset(0), _required(-1) {
+ImmutableOopMapBuilder::ImmutableOopMapBuilder(const OopMapSet* set) : _set(set), _empty(NULL), _last(NULL), _empty_offset(-1), _last_offset(-1), _offset(0), _required(-1), _new_set(NULL) {
   _mapping = NEW_RESOURCE_ARRAY(Mapping, _set->size());
 }
 
--- a/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -320,7 +320,12 @@
 
 // Constructor
 CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs, MemRegion mr) :
+  _rescan_task_size(CardTable::card_size_in_words * BitsPerWord *
+                    CMSRescanMultiple),
+  _marking_task_size(CardTable::card_size_in_words * BitsPerWord *
+                    CMSConcMarkMultiple),
   _bt(bs, mr),
+  _collector(NULL),
   // free list locks are in the range of values taken by _lockRank
   // This range currently is [_leaf+2, _leaf+3]
   // Note: this requires that CFLspace c'tors
@@ -328,15 +333,10 @@
   // are acquired in the program text. This is true today.
   _freelistLock(_lockRank--, "CompactibleFreeListSpace._lock", true,
                 Monitor::_safepoint_check_sometimes),
+  _preconsumptionDirtyCardClosure(NULL),
   _parDictionaryAllocLock(Mutex::leaf - 1,  // == rank(ExpandHeap_lock) - 1
                           "CompactibleFreeListSpace._dict_par_lock", true,
-                          Monitor::_safepoint_check_never),
-  _rescan_task_size(CardTable::card_size_in_words * BitsPerWord *
-                    CMSRescanMultiple),
-  _marking_task_size(CardTable::card_size_in_words * BitsPerWord *
-                    CMSConcMarkMultiple),
-  _collector(NULL),
-  _preconsumptionDirtyCardClosure(NULL)
+                          Monitor::_safepoint_check_never)
 {
   assert(sizeof(FreeChunk) / BytesPerWord <= MinChunkSize,
          "FreeChunk is larger than expected");
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -449,57 +449,57 @@
 CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
                            CardTableRS*                   ct,
                            ConcurrentMarkSweepPolicy*     cp):
+  _overflow_list(NULL),
+  _conc_workers(NULL),     // may be set later
+  _completed_initialization(false),
+  _collection_count_start(0),
+  _should_unload_classes(CMSClassUnloadingEnabled),
+  _concurrent_cycles_since_last_unload(0),
+  _roots_scanning_options(GenCollectedHeap::SO_None),
+  _verification_mark_bm(0, Mutex::leaf + 1, "CMS_verification_mark_bm_lock"),
+  _verifying(false),
+  _collector_policy(cp),
+  _inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
+  _intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
+  _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
+  _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
+  _cms_start_registered(false),
   _cmsGen(cmsGen),
   // Adjust span to cover old (cms) gen
   _span(cmsGen->reserved()),
   _ct(ct),
-  _span_based_discoverer(_span),
-  _ref_processor(NULL),    // will be set later
-  _conc_workers(NULL),     // may be set later
-  _abort_preclean(false),
-  _start_sampling(false),
-  _between_prologue_and_epilogue(false),
   _markBitMap(0, Mutex::leaf + 1, "CMS_markBitMap_lock"),
   _modUnionTable((CardTable::card_shift - LogHeapWordSize),
                  -1 /* lock-free */, "No_lock" /* dummy */),
-  _modUnionClosurePar(&_modUnionTable),
+  _restart_addr(NULL),
+  _ser_pmc_preclean_ovflw(0),
+  _ser_pmc_remark_ovflw(0),
+  _par_pmc_remark_ovflw(0),
+  _ser_kac_preclean_ovflw(0),
+  _ser_kac_ovflw(0),
+  _par_kac_ovflw(0),
+#ifndef PRODUCT
+  _num_par_pushes(0),
+#endif
+  _span_based_discoverer(_span),
+  _ref_processor(NULL),    // will be set later
   // Construct the is_alive_closure with _span & markBitMap
   _is_alive_closure(_span, &_markBitMap),
-  _restart_addr(NULL),
-  _overflow_list(NULL),
+  _modUnionClosurePar(&_modUnionTable),
+  _between_prologue_and_epilogue(false),
+  _abort_preclean(false),
+  _start_sampling(false),
   _stats(cmsGen),
   _eden_chunk_lock(new Mutex(Mutex::leaf + 1, "CMS_eden_chunk_lock", true,
                              //verify that this lock should be acquired with safepoint check.
                              Monitor::_safepoint_check_sometimes)),
   _eden_chunk_array(NULL),     // may be set in ctor body
+  _eden_chunk_index(0),        // -- ditto --
   _eden_chunk_capacity(0),     // -- ditto --
-  _eden_chunk_index(0),        // -- ditto --
-  _survivor_plab_array(NULL),  // -- ditto --
   _survivor_chunk_array(NULL), // -- ditto --
+  _survivor_chunk_index(0),    // -- ditto --
   _survivor_chunk_capacity(0), // -- ditto --
-  _survivor_chunk_index(0),    // -- ditto --
-  _ser_pmc_preclean_ovflw(0),
-  _ser_kac_preclean_ovflw(0),
-  _ser_pmc_remark_ovflw(0),
-  _par_pmc_remark_ovflw(0),
-  _ser_kac_ovflw(0),
-  _par_kac_ovflw(0),
-#ifndef PRODUCT
-  _num_par_pushes(0),
-#endif
-  _collection_count_start(0),
-  _verifying(false),
-  _verification_mark_bm(0, Mutex::leaf + 1, "CMS_verification_mark_bm_lock"),
-  _completed_initialization(false),
-  _collector_policy(cp),
-  _should_unload_classes(CMSClassUnloadingEnabled),
-  _concurrent_cycles_since_last_unload(0),
-  _roots_scanning_options(GenCollectedHeap::SO_None),
-  _inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
-  _intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
-  _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
-  _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
-  _cms_start_registered(false)
+  _survivor_plab_array(NULL)   // -- ditto --
 {
   // Now expand the span and allocate the collection support structures
   // (MUT, marking bit map etc.) to cover both generations subject to
@@ -3037,11 +3037,12 @@
                  OopTaskQueueSet* task_queues):
     YieldingFlexibleGangTask("Concurrent marking done multi-threaded"),
     _collector(collector),
+    _n_workers(0),
+    _result(true),
     _cms_space(cms_space),
-    _n_workers(0), _result(true),
+    _bit_map_lock(collector->bitMapLock()),
     _task_queues(task_queues),
-    _term(_n_workers, task_queues, _collector),
-    _bit_map_lock(collector->bitMapLock())
+    _term(_n_workers, task_queues, _collector)
   {
     _requested_size = _n_workers;
     _term.set_task(this);
@@ -3320,9 +3321,9 @@
     _collector(collector),
     _task(task),
     _span(collector->_span),
-    _work_queue(work_queue),
     _bit_map(bit_map),
-    _overflow_stack(overflow_stack)
+    _overflow_stack(overflow_stack),
+    _work_queue(work_queue)
   { }
   virtual void do_oop(oop* p);
   virtual void do_oop(narrowOop* p);
@@ -5024,8 +5025,10 @@
     AbstractGangTaskWOopQueues("Process referents by policy in parallel",
       task_queues,
       workers->active_workers()),
-    _task(task),
-    _collector(collector), _span(span), _mark_bit_map(mark_bit_map)
+    _collector(collector),
+    _mark_bit_map(mark_bit_map),
+    _span(span),
+    _task(task)
   {
     assert(_collector->_span.equals(_span) && !_span.is_empty(),
            "Inconsistency in _span");
@@ -5064,8 +5067,8 @@
 CMSParKeepAliveClosure::CMSParKeepAliveClosure(CMSCollector* collector,
   MemRegion span, CMSBitMap* bit_map, OopTaskQueue* work_queue):
    _span(span),
+   _work_queue(work_queue),
    _bit_map(bit_map),
-   _work_queue(work_queue),
    _mark_and_push(collector, span, bit_map, work_queue),
    _low_water_mark(MIN2((work_queue->max_elems()/4),
                         ((uint)CMSWorkQueueDrainThreshold * ParallelGCThreads)))
@@ -5602,8 +5605,8 @@
 // bit vector itself. That is done by a separate call CMSBitMap::allocate()
 // further below.
 CMSBitMap::CMSBitMap(int shifter, int mutex_rank, const char* mutex_name):
+  _shifter(shifter),
   _bm(),
-  _shifter(shifter),
   _lock(mutex_rank >= 0 ? new Mutex(mutex_rank, mutex_name, true,
                                     Monitor::_safepoint_check_sometimes) : NULL)
 {
@@ -5852,15 +5855,15 @@
                                                        CMSCollector* collector,
                                                        bool should_yield,
                                                        bool concurrent_precleaning):
-  _collector(collector),
   _span(span),
   _bit_map(bit_map),
   _mark_stack(mark_stack),
   _pushAndMarkClosure(collector, span, rd, bit_map, mod_union_table,
                       mark_stack, concurrent_precleaning),
+  _collector(collector),
+  _freelistLock(NULL),
   _yield(should_yield),
-  _concurrent_precleaning(concurrent_precleaning),
-  _freelistLock(NULL)
+  _concurrent_precleaning(concurrent_precleaning)
 {
   // FIXME: Should initialize in base class constructor.
   assert(rd != NULL, "ref_discoverer shouldn't be NULL");
@@ -6957,10 +6960,10 @@
   _limit(_sp->sweep_limit()),
   _freelistLock(_sp->freelistLock()),
   _bitMap(bitMap),
-  _yield(should_yield),
   _inFreeRange(false),           // No free range at beginning of sweep
   _freeRangeInFreeLists(false),  // No free range at beginning of sweep
   _lastFreeRangeCoalesced(false),
+  _yield(should_yield),
   _freeFinger(g->used_region().start())
 {
   NOT_PRODUCT(
@@ -7514,15 +7517,14 @@
          (!_span.contains(addr) || _bit_map->isMarked(addr));
 }
 
-
 CMSKeepAliveClosure::CMSKeepAliveClosure( CMSCollector* collector,
                       MemRegion span,
                       CMSBitMap* bit_map, CMSMarkStack* mark_stack,
                       bool cpc):
   _collector(collector),
   _span(span),
+  _mark_stack(mark_stack),
   _bit_map(bit_map),
-  _mark_stack(mark_stack),
   _concurrent_precleaning(cpc) {
   assert(!_span.is_empty(), "Empty span could spell trouble");
 }
@@ -7610,8 +7612,8 @@
                                 OopTaskQueue* work_queue):
   _collector(collector),
   _span(span),
-  _bit_map(bit_map),
-  _work_queue(work_queue) { }
+  _work_queue(work_queue),
+  _bit_map(bit_map) { }
 
 void CMSInnerParMarkAndPushClosure::do_oop(oop obj) {
   HeapWord* addr = (HeapWord*)obj;
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -1452,9 +1452,9 @@
                             CMSMarkStack* mark_stack,
                             MarkRefsIntoAndScanClosure* cl):
     _space(space),
-    _num_dirty_cards(0),
     _scan_cl(collector, span, collector->ref_processor(), bit_map,
-                 mark_stack, cl) { }
+                 mark_stack, cl),
+    _num_dirty_cards(0) { }
 
   MarkFromDirtyCardsClosure(CMSCollector* collector,
                             MemRegion span,
@@ -1463,9 +1463,9 @@
                             OopTaskQueue* work_queue,
                             ParMarkRefsIntoAndScanClosure* cl):
     _space(space),
-    _num_dirty_cards(0),
     _scan_cl(collector, span, collector->ref_processor(), bit_map,
-             work_queue, cl) { }
+             work_queue, cl),
+    _num_dirty_cards(0) { }
 
   void do_MemRegion(MemRegion mr);
   void set_space(CompactibleFreeListSpace* space) { _space = space; }
@@ -1707,8 +1707,8 @@
                       bool cpc):
     _collector(collector),
     _span(span),
+    _mark_stack(mark_stack),
     _bit_map(bit_map),
-    _mark_stack(mark_stack),
     _keep_alive(keep_alive),
     _concurrent_precleaning(cpc) {
     assert(_concurrent_precleaning == _keep_alive->concurrent_precleaning(),
@@ -1732,8 +1732,8 @@
                                  OopTaskQueue* work_queue):
     _collector(collector),
     _span(span),
+    _work_queue(work_queue),
     _bit_map(bit_map),
-    _work_queue(work_queue),
     _mark_and_push(collector, span, bit_map, work_queue) { }
 
  public:
--- a/src/hotspot/share/gc/cms/parNewGeneration.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/cms/parNewGeneration.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -75,27 +75,28 @@
                                        PreservedMarks* preserved_marks_,
                                        size_t desired_plab_sz_,
                                        ParallelTaskTerminator& term_) :
-  _to_space(to_space_),
-  _old_gen(old_gen_),
-  _young_gen(young_gen_),
-  _thread_num(thread_num_),
   _work_queue(work_queue_set_->queue(thread_num_)),
-  _to_space_full(false),
   _overflow_stack(overflow_stacks_ ? overflow_stacks_ + thread_num_ : NULL),
   _preserved_marks(preserved_marks_),
-  _ageTable(false), // false ==> not the global age table, no perf data.
   _to_space_alloc_buffer(desired_plab_sz_),
   _to_space_closure(young_gen_, this),
   _old_gen_closure(young_gen_, this),
   _to_space_root_closure(young_gen_, this),
+  _older_gen_closure(young_gen_, this),
   _old_gen_root_closure(young_gen_, this),
-  _older_gen_closure(young_gen_, this),
   _evacuate_followers(this, &_to_space_closure, &_old_gen_closure,
                       &_to_space_root_closure, young_gen_, &_old_gen_root_closure,
                       work_queue_set_, &term_),
   _is_alive_closure(young_gen_),
   _scan_weak_ref_closure(young_gen_, this),
   _keep_alive_closure(&_scan_weak_ref_closure),
+  _to_space(to_space_),
+  _young_gen(young_gen_),
+  _old_gen(old_gen_),
+  _young_old_boundary(NULL),
+  _thread_num(thread_num_),
+  _ageTable(false), // false ==> not the global age table, no perf data.
+  _to_space_full(false),
   _strong_roots_time(0.0),
   _term_time(0.0)
 {
@@ -344,9 +345,9 @@
                                              PreservedMarksSet& preserved_marks_set,
                                              size_t desired_plab_sz,
                                              ParallelTaskTerminator& term)
-  : _young_gen(young_gen),
+  : _term(term),
+    _young_gen(young_gen),
     _old_gen(old_gen),
-    _term(term),
     _per_thread_states(NEW_RESOURCE_ARRAY(ParScanThreadState, num_threads)),
     _num_threads(num_threads)
 {
@@ -529,8 +530,8 @@
 
     _par_scan_state(par_scan_state_),
     _to_space_closure(to_space_closure_),
+    _to_space_root_closure(to_space_root_closure_),
     _old_gen_closure(old_gen_closure_),
-    _to_space_root_closure(to_space_root_closure_),
     _old_gen_root_closure(old_gen_root_closure_),
     _par_gen(par_gen_),
     _task_queues(task_queues_),
@@ -625,9 +626,9 @@
 
 ParNewGeneration::ParNewGeneration(ReservedSpace rs, size_t initial_byte_size)
   : DefNewGeneration(rs, initial_byte_size, "PCopy"),
+  _plab_stats("Young", YoungPLABSize, PLABWeight),
   _overflow_list(NULL),
-  _is_alive_closure(this),
-  _plab_stats("Young", YoungPLABSize, PLABWeight)
+  _is_alive_closure(this)
 {
   NOT_PRODUCT(_overflow_counter = ParGCWorkQueueOverflowInterval;)
   NOT_PRODUCT(_num_par_pushes = 0;)
--- a/src/hotspot/share/gc/epsilon/epsilonMemoryPool.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/epsilon/epsilonMemoryPool.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -27,11 +27,11 @@
 #include "gc/epsilon/epsilonMemoryPool.hpp"
 
 EpsilonMemoryPool::EpsilonMemoryPool(EpsilonHeap* heap) :
-        _heap(heap),
         CollectedMemoryPool("Epsilon Heap",
                             heap->capacity(),
                             heap->max_capacity(),
-                            false) {
+                            false),
+        _heap(heap) {
   assert(UseEpsilonGC, "sanity");
 }
 
--- a/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -42,7 +42,7 @@
   // addr (the address of the field to be read) must be a LIR_Address
   // pre_val (a temporary register) must be a register;
   G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
-    _addr(addr), _pre_val(pre_val), _do_load(true),
+    _do_load(true), _addr(addr), _pre_val(pre_val),
     _patch_code(patch_code), _info(info)
   {
     assert(_pre_val->is_register(), "should be temporary register");
@@ -52,7 +52,7 @@
   // Version that _does not_ generate load of the previous value; the
   // previous value is assumed to have already been loaded into pre_val.
   G1PreBarrierStub(LIR_Opr pre_val) :
-    _addr(LIR_OprFact::illegalOpr), _pre_val(pre_val), _do_load(false),
+    _do_load(false), _addr(LIR_OprFact::illegalOpr), _pre_val(pre_val),
     _patch_code(lir_patch_none), _info(NULL)
   {
     assert(_pre_val->is_register(), "should be a register");
--- a/src/hotspot/share/gc/g1/g1AllocRegion.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1AllocRegion.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -251,10 +251,12 @@
 
 G1AllocRegion::G1AllocRegion(const char* name,
                              bool bot_updates)
-  : _name(name), _bot_updates(bot_updates),
-    _alloc_region(NULL), _count(0),
-    _used_bytes_before(0) { }
-
+  : _alloc_region(NULL),
+    _count(0),
+    _used_bytes_before(0),
+    _bot_updates(bot_updates),
+    _name(name)
+ { }
 
 HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size,
                                                     bool force) {
--- a/src/hotspot/share/gc/g1/g1Allocator.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1Allocator.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -37,9 +37,10 @@
   _g1h(heap),
   _survivor_is_full(false),
   _old_is_full(false),
-  _retained_old_gc_alloc_region(NULL),
+  _mutator_alloc_region(),
   _survivor_gc_alloc_region(heap->alloc_buffer_stats(InCSetState::Young)),
-  _old_gc_alloc_region(heap->alloc_buffer_stats(InCSetState::Old)) {
+  _old_gc_alloc_region(heap->alloc_buffer_stats(InCSetState::Old)),
+  _retained_old_gc_alloc_region(NULL) {
 }
 
 void G1Allocator::init_mutator_alloc_region() {
--- a/src/hotspot/share/gc/g1/g1Allocator.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1Allocator.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -221,6 +221,7 @@
 
 public:
   G1ArchiveAllocator(G1CollectedHeap* g1h, bool open) :
+    _open(open),
     _g1h(g1h),
     _allocation_region(NULL),
     _allocated_regions((ResourceObj::set_allocation_type((address) &_allocated_regions,
@@ -229,8 +230,7 @@
     _summary_bytes_used(0),
     _bottom(NULL),
     _top(NULL),
-    _max(NULL),
-    _open(open) { }
+    _max(NULL) { }
 
   virtual ~G1ArchiveAllocator() {
     assert(_allocation_region == NULL, "_allocation_region not NULL");
--- a/src/hotspot/share/gc/g1/g1Analytics.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1Analytics.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -84,12 +84,12 @@
     _cost_per_entry_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
     _mixed_cost_per_entry_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
     _cost_per_byte_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
-    _cost_per_byte_ms_during_cm_seq(new TruncatedSeq(TruncatedSeqLength)),
     _constant_other_time_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
     _young_other_cost_per_region_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
     _non_young_other_cost_per_region_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
     _pending_cards_seq(new TruncatedSeq(TruncatedSeqLength)),
     _rs_lengths_seq(new TruncatedSeq(TruncatedSeqLength)),
+    _cost_per_byte_ms_during_cm_seq(new TruncatedSeq(TruncatedSeqLength)),
     _recent_prev_end_times_for_all_gcs_sec(new TruncatedSeq(NumPrevPausesForHeuristics)),
     _recent_avg_pause_time_ratio(0.0),
     _last_pause_time_ratio(0.0) {
--- a/src/hotspot/share/gc/g1/g1BarrierSet.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -48,27 +48,30 @@
 class G1BarrierSetC1;
 class G1BarrierSetC2;
 
-SATBMarkQueueSet G1BarrierSet::_satb_mark_queue_set;
-DirtyCardQueueSet G1BarrierSet::_dirty_card_queue_set;
-
 G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
   CardTableBarrierSet(make_barrier_set_assembler<G1BarrierSetAssembler>(),
                       make_barrier_set_c1<G1BarrierSetC1>(),
                       make_barrier_set_c2<G1BarrierSetC2>(),
                       card_table,
-                      BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)) {}
+                      BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)),
+  _satb_mark_queue_set(),
+  _dirty_card_queue_set()
+{}
 
 void G1BarrierSet::enqueue(oop pre_val) {
   // Nulls should have been already filtered.
   assert(oopDesc::is_oop(pre_val, true), "Error");
 
-  if (!_satb_mark_queue_set.is_active()) return;
+  G1SATBMarkQueueSet& queue_set = satb_mark_queue_set();
+  if (!queue_set.is_active()) {
+    return;
+  }
   Thread* thr = Thread::current();
   if (thr->is_Java_thread()) {
     G1ThreadLocalData::satb_mark_queue(thr).enqueue(pre_val);
   } else {
     MutexLockerEx x(Shared_SATB_Q_lock, Mutex::_no_safepoint_check_flag);
-    _satb_mark_queue_set.shared_satb_queue()->enqueue(pre_val);
+    queue_set.shared_satb_queue()->enqueue(pre_val);
   }
 }
 
--- a/src/hotspot/share/gc/g1/g1BarrierSet.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -26,7 +26,7 @@
 #define SHARE_VM_GC_G1_G1BARRIERSET_HPP
 
 #include "gc/g1/dirtyCardQueue.hpp"
-#include "gc/g1/satbMarkQueue.hpp"
+#include "gc/g1/g1SATBMarkQueueSet.hpp"
 #include "gc/shared/cardTableBarrierSet.hpp"
 
 class DirtyCardQueueSet;
@@ -39,8 +39,12 @@
 class G1BarrierSet: public CardTableBarrierSet {
   friend class VMStructs;
  private:
-  static SATBMarkQueueSet  _satb_mark_queue_set;
-  static DirtyCardQueueSet _dirty_card_queue_set;
+  G1SATBMarkQueueSet _satb_mark_queue_set;
+  DirtyCardQueueSet _dirty_card_queue_set;
+
+  static G1BarrierSet* g1_barrier_set() {
+    return barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
+  }
 
  public:
   G1BarrierSet(G1CardTable* table);
@@ -75,12 +79,12 @@
   virtual void on_thread_attach(JavaThread* thread);
   virtual void on_thread_detach(JavaThread* thread);
 
-  static SATBMarkQueueSet& satb_mark_queue_set() {
-    return _satb_mark_queue_set;
+  static G1SATBMarkQueueSet& satb_mark_queue_set() {
+    return g1_barrier_set()->_satb_mark_queue_set;
   }
 
   static DirtyCardQueueSet& dirty_card_queue_set() {
-    return _dirty_card_queue_set;
+    return g1_barrier_set()->_dirty_card_queue_set;
   }
 
   // Callbacks for runtime accesses.
--- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -75,12 +75,12 @@
 //////////////////////////////////////////////////////////////////////
 
 G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp) :
+  _next_offset_threshold(NULL),
+  _next_offset_index(0),
+  DEBUG_ONLY(_object_can_span(false) COMMA)
   _bot(array),
-  _space(gsp),
-  _next_offset_threshold(NULL),
-  _next_offset_index(0)
+  _space(gsp)
 {
-  debug_only(_object_can_span = false;)
 }
 
 // The arguments follow the normal convention of denoting
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -52,7 +52,7 @@
 #include "gc/g1/g1RemSet.hpp"
 #include "gc/g1/g1RootClosures.hpp"
 #include "gc/g1/g1RootProcessor.hpp"
-#include "gc/g1/g1SATBMarkQueueFilter.hpp"
+#include "gc/g1/g1SATBMarkQueueSet.hpp"
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/g1/g1ThreadLocalData.hpp"
 #include "gc/g1/g1YCTypes.hpp"
@@ -1407,52 +1407,70 @@
   _verifier->verify_region_sets_optional();
 }
 
-// Public methods.
-
 G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* collector_policy) :
   CollectedHeap(),
   _young_gen_sampling_thread(NULL),
+  _workers(NULL),
   _collector_policy(collector_policy),
+  _card_table(NULL),
   _soft_ref_policy(),
-  _card_table(NULL),
   _memory_manager("G1 Young Generation", "end of minor GC"),
   _full_gc_memory_manager("G1 Old Generation", "end of major GC"),
   _eden_pool(NULL),
   _survivor_pool(NULL),
   _old_pool(NULL),
+  _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
+  _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
+  _bot(NULL),
+  _listener(),
+  _hrm(),
+  _allocator(NULL),
+  _verifier(NULL),
+  _summary_bytes_used(0),
+  _archive_allocator(NULL),
+  _survivor_evac_stats("Young", YoungPLABSize, PLABWeight),
+  _old_evac_stats("Old", OldPLABSize, PLABWeight),
+  _expand_heap_after_alloc_failure(true),
+  _g1mm(NULL),
+  _humongous_reclaim_candidates(),
+  _has_humongous_reclaim_candidates(false),
+  _hr_printer(),
+  _collector_state(),
+  _old_marking_cycles_started(0),
+  _old_marking_cycles_completed(0),
+  _eden(),
+  _survivor(),
   _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
   _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()),
   _g1_policy(new G1Policy(_gc_timer_stw)),
+  _heap_sizing_policy(NULL),
   _collection_set(this, _g1_policy),
+  _hot_card_cache(NULL),
+  _g1_rem_set(NULL),
   _dirty_card_queue_set(false),
+  _cm(NULL),
+  _cm_thread(NULL),
+  _cr(NULL),
+  _task_queues(NULL),
+  _evacuation_failed(false),
+  _evacuation_failed_info_array(NULL),
+  _preserved_marks_set(true /* in_c_heap */),
+#ifndef PRODUCT
+  _evacuation_failure_alot_for_current_gc(false),
+  _evacuation_failure_alot_gc_number(0),
+  _evacuation_failure_alot_count(0),
+#endif
   _ref_processor_stw(NULL),
   _is_alive_closure_stw(this),
   _is_subject_to_discovery_stw(this),
   _ref_processor_cm(NULL),
   _is_alive_closure_cm(this),
   _is_subject_to_discovery_cm(this),
-  _bot(NULL),
-  _hot_card_cache(NULL),
-  _g1_rem_set(NULL),
-  _cr(NULL),
-  _g1mm(NULL),
-  _preserved_marks_set(true /* in_c_heap */),
-  _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
-  _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
-  _humongous_reclaim_candidates(),
-  _has_humongous_reclaim_candidates(false),
-  _archive_allocator(NULL),
-  _summary_bytes_used(0),
-  _survivor_evac_stats("Young", YoungPLABSize, PLABWeight),
-  _old_evac_stats("Old", OldPLABSize, PLABWeight),
-  _expand_heap_after_alloc_failure(true),
-  _old_marking_cycles_started(0),
-  _old_marking_cycles_completed(0),
   _in_cset_fast_test() {
 
   _workers = new WorkGang("GC Thread", ParallelGCThreads,
-                          /* are_GC_task_threads */true,
-                          /* are_ConcurrentGC_threads */false);
+                          true /* are_GC_task_threads */,
+                          false /* are_ConcurrentGC_threads */);
   _workers->initialize_workers();
   _verifier = new G1HeapVerifier(this);
 
@@ -1669,11 +1687,11 @@
   // Perform any initialization actions delegated to the policy.
   g1_policy()->init(this, &_collection_set);
 
-  G1SATBMarkQueueFilter* satb_filter = new G1SATBMarkQueueFilter(this);
-  G1BarrierSet::satb_mark_queue_set().initialize(satb_filter,
+  G1BarrierSet::satb_mark_queue_set().initialize(this,
                                                  SATB_Q_CBL_mon,
                                                  SATB_Q_FL_lock,
                                                  G1SATBProcessCompletedThreshold,
+                                                 G1SATBBufferEnqueueingThresholdPercent,
                                                  Shared_SATB_Q_lock);
 
   jint ecode = initialize_concurrent_refinement();
@@ -3576,10 +3594,10 @@
   // The constructor is run in the VMThread.
   G1ParallelCleaningTask(BoolObjectClosure* is_alive, uint num_workers, bool unloading_occurred) :
       AbstractGangTask("Parallel Cleaning"),
+      _unloading_occurred(unloading_occurred),
       _string_symbol_task(is_alive, true, true, G1StringDedup::is_enabled()),
       _code_cache_task(num_workers, is_alive, unloading_occurred),
       _klass_cleaning_task(),
-      _unloading_occurred(unloading_occurred),
       _resolved_method_cleaning_task() {
   }
 
@@ -4325,11 +4343,11 @@
 public:
   G1FreeCollectionSetTask(G1CollectionSet* collection_set, EvacuationInfo* evacuation_info, const size_t* surviving_young_words) :
     AbstractGangTask("G1 Free Collection Set"),
+    _collection_set(collection_set),
     _cl(evacuation_info, surviving_young_words),
-    _collection_set(collection_set),
     _surviving_young_words(surviving_young_words),
+    _rs_lengths(0),
     _serial_work_claim(0),
-    _rs_lengths(0),
     _parallel_work_claim(0),
     _num_work_items(collection_set->region_length()),
     _work_items(NEW_C_HEAP_ARRAY(WorkItem, _num_work_items, mtGC)) {
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -181,9 +181,6 @@
   // Start a new incremental collection set for the next pause.
   void start_new_collection_set();
 
-  // The number of regions we could create by expansion.
-  uint _expansion_regions;
-
   // The block offset table for the G1 heap.
   G1BlockOffsetTable* _bot;
 
@@ -1434,9 +1431,9 @@
                                 G1ParScanThreadState* par_scan_state,
                                 RefToScanQueueSet* queues,
                                 ParallelTaskTerminator* terminator)
-    : _g1h(g1h), _par_scan_state(par_scan_state),
-      _queues(queues), _terminator(terminator),
-      _start_term(0.0), _term_time(0.0), _term_attempts(0) {}
+    : _start_term(0.0), _term_time(0.0), _term_attempts(0),
+      _g1h(g1h), _par_scan_state(par_scan_state),
+      _queues(queues), _terminator(terminator) {}
 
   void do_void();
 
--- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -57,12 +57,11 @@
   _eden_region_length(0),
   _survivor_region_length(0),
   _old_region_length(0),
-  _bytes_used_before(0),
-  _recorded_rs_lengths(0),
   _collection_set_regions(NULL),
   _collection_set_cur_length(0),
   _collection_set_max_length(0),
-  // Incremental CSet attributes
+  _bytes_used_before(0),
+  _recorded_rs_lengths(0),
   _inc_build_state(Inactive),
   _inc_bytes_used_before(0),
   _inc_recorded_rs_lengths(0),
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -625,7 +625,7 @@
     G1CMBitMap* _bitmap;
     G1ConcurrentMark* _cm;
   public:
-    G1ClearBitmapHRClosure(G1CMBitMap* bitmap, G1ConcurrentMark* cm) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap) {
+    G1ClearBitmapHRClosure(G1CMBitMap* bitmap, G1ConcurrentMark* cm) : HeapRegionClosure(), _bitmap(bitmap), _cm(cm) {
     }
 
     virtual bool do_heap_region(HeapRegion* r) {
@@ -1095,7 +1095,7 @@
 
   public:
     G1UpdateRemSetTrackingBeforeRebuild(G1CollectedHeap* g1h, G1ConcurrentMark* cm, G1PrintRegionLivenessInfoClosure* cl) :
-      _g1h(g1h), _cm(cm), _num_regions_selected_for_rebuild(0), _cl(cl) { }
+      _g1h(g1h), _cm(cm), _cl(cl), _num_regions_selected_for_rebuild(0) { }
 
     virtual bool do_heap_region(HeapRegion* r) {
       update_remset_before_rebuild(r);
@@ -1415,10 +1415,9 @@
   bool              _is_serial;
 public:
   G1CMKeepAliveAndDrainClosure(G1ConcurrentMark* cm, G1CMTask* task, bool is_serial) :
-    _cm(cm), _task(task), _is_serial(is_serial),
-    _ref_counter_limit(G1RefProcDrainInterval) {
+    _cm(cm), _task(task), _ref_counter_limit(G1RefProcDrainInterval),
+    _ref_counter(_ref_counter_limit), _is_serial(is_serial) {
     assert(!_is_serial || _task->worker_id() == 0, "only task 0 for serial code");
-    _ref_counter = _ref_counter_limit;
   }
 
   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -42,7 +42,7 @@
   G1ConcurrentMark* const _cm;
   G1CMTask* const _task;
 public:
-  G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm) : _task(task), _cm(cm) { }
+  G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm) : _cm(cm), _task(task) { }
 
   bool do_addr(HeapWord* const addr);
 };
@@ -88,7 +88,7 @@
     return mark_distance();
   }
 
-  G1CMBitMap() : _covered(), _bm(), _shifter(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); }
+  G1CMBitMap() : _covered(), _shifter(LogMinObjAlignment), _bm(), _listener() { _listener.set_bitmap(this); }
 
   // Initializes the underlying BitMap to cover the given area.
   void initialize(MemRegion heap, G1RegionToSpaceMapper* storage);
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -74,15 +74,14 @@
   };
 };
 
-// The CM thread is created when the G1 garbage collector is used
-
 G1ConcurrentMarkThread::G1ConcurrentMarkThread(G1ConcurrentMark* cm) :
   ConcurrentGCThread(),
+  _vtime_start(0.0),
+  _vtime_accum(0.0),
+  _vtime_mark_accum(0.0),
   _cm(cm),
   _state(Idle),
-  _phase_manager_stack(),
-  _vtime_accum(0.0),
-  _vtime_mark_accum(0.0) {
+  _phase_manager_stack() {
 
   set_name("G1 Main Marker");
   create_and_start();
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -34,11 +34,12 @@
 
 G1ConcurrentRefineThread::G1ConcurrentRefineThread(G1ConcurrentRefine* cr, uint worker_id) :
   ConcurrentGCThread(),
+  _vtime_start(0.0),
+  _vtime_accum(0.0),
   _worker_id(worker_id),
   _active(false),
   _monitor(NULL),
-  _cr(cr),
-  _vtime_accum(0.0)
+  _cr(cr)
 {
   // Each thread has its own monitor. The i-th thread is responsible for signaling
   // to thread i+1 if the number of buffers in the queue exceeds a threshold for this
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -41,7 +41,6 @@
   double _vtime_start;  // Initial virtual time.
   double _vtime_accum;  // Accumulated virtual time.
   uint _worker_id;
-  uint _worker_id_offset;
 
   bool _active;
   Monitor* _monitor;
--- a/src/hotspot/share/gc/g1/g1EvacFailure.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1EvacFailure.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -46,7 +46,7 @@
 
 public:
   UpdateRSetDeferred(DirtyCardQueue* dcq) :
-    _g1h(G1CollectedHeap::heap()), _ct(_g1h->card_table()), _dcq(dcq) {}
+    _g1h(G1CollectedHeap::heap()), _dcq(dcq), _ct(_g1h->card_table()) {}
 
   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
   virtual void do_oop(      oop* p) { do_oop_work(p); }
@@ -203,10 +203,10 @@
   RemoveSelfForwardPtrHRClosure(uint worker_id,
                                 HeapRegionClaimer* hrclaimer) :
     _g1h(G1CollectedHeap::heap()),
+    _worker_id(worker_id),
+    _hrclaimer(hrclaimer),
     _dcq(&_g1h->dirty_card_queue_set()),
-    _update_rset_cl(&_dcq),
-    _worker_id(worker_id),
-    _hrclaimer(hrclaimer) {
+    _update_rset_cl(&_dcq){
   }
 
   size_t remove_self_forward_ptr_by_walking_hr(HeapRegion* hr,
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -29,12 +29,14 @@
 
 G1FullGCMarker::G1FullGCMarker(uint worker_id, PreservedMarks* preserved_stack, G1CMBitMap* bitmap) :
     _worker_id(worker_id),
+    _bitmap(bitmap),
+    _oop_stack(),
+    _objarray_stack(),
+    _preserved_stack(preserved_stack),
     _mark_closure(worker_id, this, G1CollectedHeap::heap()->ref_processor_stw()),
     _verify_closure(VerifyOption_G1UseFullMarking),
-    _cld_closure(mark_closure()),
     _stack_closure(this),
-    _preserved_stack(preserved_stack),
-    _bitmap(bitmap) {
+    _cld_closure(mark_closure()) {
   _oop_stack.initialize();
   _objarray_stack.initialize();
 }
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -45,7 +45,6 @@
 class G1CMBitMap;
 
 class G1FullGCMarker : public CHeapObj<mtGC> {
-private:
   uint               _worker_id;
   // Backing mark bitmap
   G1CMBitMap*        _bitmap;
--- a/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -39,10 +39,10 @@
 
 G1VerifyOopClosure::G1VerifyOopClosure(VerifyOption option) :
    _g1h(G1CollectedHeap::heap()),
+   _failures(false),
    _containing_obj(NULL),
    _verify_option(option),
-   _cc(0),
-   _failures(false) {
+   _cc(0) {
 }
 
 void G1VerifyOopClosure::print_object(outputStream* out, oop obj) {
--- a/src/hotspot/share/gc/g1/g1FullGCOopClosures.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCOopClosures.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -61,9 +61,9 @@
 
 public:
   G1MarkAndPushClosure(uint worker, G1FullGCMarker* marker, ReferenceDiscoverer* ref) :
+    OopIterateClosure(ref),
     _marker(marker),
-    _worker_id(worker),
-    OopIterateClosure(ref) { }
+    _worker_id(worker) { }
 
   template <class T> inline void do_oop_work(T* p);
   virtual void do_oop(oop* p);
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -61,8 +61,8 @@
 
 G1FullGCPrepareTask::G1FullGCPrepareTask(G1FullCollector* collector) :
     G1FullGCTask("G1 Prepare Compact Task", collector),
-    _hrclaimer(collector->workers()),
-    _freed_regions(false) {
+    _freed_regions(false),
+    _hrclaimer(collector->workers()) {
 }
 
 void G1FullGCPrepareTask::set_freed_regions() {
--- a/src/hotspot/share/gc/g1/g1FullGCScope.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1FullGCScope.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -36,8 +36,8 @@
     _active(),
     _cpu_time(),
     _soft_refs(clear_soft, _g1h->soft_ref_policy()),
+    _collector_stats(_g1h->g1mm()->full_collection_counters()),
     _memory_stats(memory_manager, _g1h->gc_cause()),
-    _collector_stats(_g1h->g1mm()->full_collection_counters()),
     _heap_transition(_g1h) {
   _timer.register_gc_start();
   _tracer.report_gc_start(_g1h->gc_cause(), _timer.gc_start());
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -489,7 +489,7 @@
 }
 
 G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
-    _phase_times(phase_times), _phase(phase), _worker_id(worker_id) {
+  _start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id) {
   if (_phase_times != NULL) {
     _start_time = Ticks::now();
   }
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -127,7 +127,7 @@
 
 public:
   G1VerifyCodeRootOopClosure(G1CollectedHeap* g1h, OopClosure* root_cl, VerifyOption vo):
-    _g1h(g1h), _root_cl(root_cl), _vo(vo), _nm(NULL), _failures(false) {}
+    _g1h(g1h), _root_cl(root_cl), _nm(NULL), _vo(vo), _failures(false) {}
 
   void do_oop(oop* p) { do_oop_work(p); }
   void do_oop(narrowOop* p) { do_oop_work(p); }
--- a/src/hotspot/share/gc/g1/g1HotCardCache.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1HotCardCache.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -29,7 +29,10 @@
 #include "runtime/atomic.hpp"
 
 G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
-  _g1h(g1h), _hot_cache(NULL), _use_cache(false), _card_counts(g1h) {}
+  _g1h(g1h), _use_cache(false), _card_counts(g1h),
+  _hot_cache(NULL), _hot_cache_size(0), _hot_cache_par_chunk_size(0),
+  _hot_cache_idx(0), _hot_cache_par_claimed_idx(0)
+{}
 
 void G1HotCardCache::initialize(G1RegionToSpaceMapper* card_counts_storage) {
   if (default_use_cache()) {
--- a/src/hotspot/share/gc/g1/g1IHOPControl.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1IHOPControl.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -32,8 +32,8 @@
 G1IHOPControl::G1IHOPControl(double initial_ihop_percent) :
   _initial_ihop_percent(initial_ihop_percent),
   _target_occupancy(0),
-  _last_allocated_bytes(0),
-  _last_allocation_time_s(0.0)
+  _last_allocation_time_s(0.0),
+  _last_allocated_bytes(0)
 {
   assert(_initial_ihop_percent >= 0.0 && _initial_ihop_percent <= 100.0, "Initial IHOP value must be between 0 and 100 but is %.3f", initial_ihop_percent);
 }
@@ -86,12 +86,12 @@
                                              size_t heap_reserve_percent,
                                              size_t heap_waste_percent) :
   G1IHOPControl(ihop_percent),
+  _heap_reserve_percent(heap_reserve_percent),
+  _heap_waste_percent(heap_waste_percent),
   _predictor(predictor),
   _marking_times_s(10, 0.95),
   _allocation_rate_s(10, 0.95),
-  _last_unrestrained_young_size(0),
-  _heap_reserve_percent(heap_reserve_percent),
-  _heap_waste_percent(heap_waste_percent)
+  _last_unrestrained_young_size(0)
 {
 }
 
--- a/src/hotspot/share/gc/g1/g1MemoryPool.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1MemoryPool.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -32,10 +32,11 @@
                                      size_t init_size,
                                      size_t max_size,
                                      bool support_usage_threshold) :
-  _g1mm(g1h->g1mm()), CollectedMemoryPool(name,
-                                          init_size,
-                                          max_size,
-                                          support_usage_threshold) {
+  CollectedMemoryPool(name,
+                      init_size,
+                      max_size,
+                      support_usage_threshold),
+  _g1mm(g1h->g1mm()) {
   assert(UseG1GC, "sanity");
 }
 
--- a/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -80,20 +80,24 @@
   _incremental_collection_counters(NULL),
   _full_collection_counters(NULL),
   _conc_collection_counters(NULL),
+  _young_collection_counters(NULL),
   _old_collection_counters(NULL),
   _old_space_counters(NULL),
-  _young_collection_counters(NULL),
   _eden_counters(NULL),
   _from_counters(NULL),
   _to_counters(NULL),
 
   _overall_reserved(0),
-  _overall_committed(0),    _overall_used(0),
+  _overall_committed(0),
+  _overall_used(0),
   _young_region_num(0),
   _young_gen_committed(0),
-  _eden_committed(0),       _eden_used(0),
-  _survivor_committed(0),   _survivor_used(0),
-  _old_committed(0),        _old_used(0) {
+  _eden_committed(0),
+  _eden_used(0),
+  _survivor_committed(0),
+  _survivor_used(0),
+  _old_committed(0),
+  _old_used(0) {
 
   _overall_reserved = g1h->max_capacity();
   recalculate_sizes();
--- a/src/hotspot/share/gc/g1/g1OopClosures.hpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1OopClosures.hpp	Tue Aug 14 12:11:28 2018 -0700
@@ -162,7 +162,7 @@
 public:
   G1CLDScanClosure(G1ParCopyHelper* closure,
                    bool process_only_dirty, bool must_claim)
-      : _process_only_dirty(process_only_dirty), _must_claim(must_claim), _closure(closure), _count(0) {}
+  : _closure(closure), _process_only_dirty(process_only_dirty), _must_claim(must_claim), _count(0) {}
   void do_cld(ClassLoaderData* cld);
 };
 
--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -34,8 +34,8 @@
 #include "utilities/bitMap.inline.hpp"
 
 G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) :
-  _low_boundary(NULL), _high_boundary(NULL), _committed(mtGC), _page_size(0), _special(false),
-  _dirty(mtGC), _executable(false) {
+  _low_boundary(NULL), _high_boundary(NULL), _tail_size(0), _page_size(0),
+  _committed(mtGC), _dirty(mtGC), _special(false), _executable(false) {
   initialize_with_page_size(rs, used_size, page_size);
 }
 
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Fri Aug 10 12:36:21 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Tue Aug 14 12:11:28 2018 -0700
@@ -53,21 +53,32 @@
   _mmu_tracker(new G1MMUTrackerQueue(GCPauseIntervalMillis / 1000.0, MaxGCPauseMillis / 1000.0)),
   _ihop_control(create_ihop_control(&_predictor)),
   _policy_counters(new GCPolicyCounters("GarbageFirst", 1, 2)),
+  _full_collection_start_sec(0.0),
+  _collection_pause_end_millis(os::javaTimeNanos() / NANOSECS_PER_MILLISEC),
+  _young_list_target_length(0),
   _young_list_fixed_length(0),
+  _young_list_max_length(0),
   _short_lived_surv_rate_group(new SurvRateGroup()),
   _survivor_surv_rate_group(new SurvRateGroup()),
   _reserve_factor((double) G1ReservePercent / 100.0),
   _reserve_regions(0),
+  _young_gen_sizer(),
+  _free_regions_at_end_of_collection(0),
+  _max_rs_lengths(0),
   _rs_lengths_prediction(0),
+  _pending_cards(0),
   _bytes_allocated_in_old_since_last_gc(0),
   _initial_mark_to_mixed(),
   _collection_set(NULL),
+  _bytes_copied_during_gc(0),
   _g1h(NULL),
   _phase_times(new G1GCPhaseTimes(gc_timer, ParallelGCThreads)),
+  _mark_remark_start_sec(0),
+  _mark_cleanup_start_sec(0),
   _tenuring_threshold(MaxTenuringThreshold),
   _max_survivor_regions(0),
-  _survivors_age_table(true),
-  _collection_pause_end_millis(os::javaTimeNanos() / NANOSECS_PER_MILLISEC) {
+  _survivors_age_table(true)
+{
 }
 
 G1Policy::~G1Policy() {