changeset 51766:3b5fd72147c9

Merge
author jwilhelm
date Sat, 14 Jul 2018 02:14:54 +0200
parents bb16beb8f792 a602706ccaaa
children 4db6e8715e35
files .hgtags src/hotspot/os/linux/os_linux.cpp src/hotspot/share/adlc/arena.cpp src/hotspot/share/adlc/main.cpp src/hotspot/share/compiler/disassembler.cpp src/java.base/share/lib/security/cacerts src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties test/hotspot/jtreg/ProblemList.txt test/jdk/ProblemList.txt
diffstat 101 files changed, 778 insertions(+), 347 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Jul 12 15:02:41 2018 -0700
+++ b/.hgtags	Sat Jul 14 02:14:54 2018 +0200
@@ -495,4 +495,5 @@
 9816d7cc655e53ba081f938b656e31971b8f097a jdk-11+20
 14708e1acdc3974f4539027cbbcfa6d69f83cf51 jdk-11+21
 00b16d0457e43d23f6ca5ade6b243edce62750a0 jdk-12+1
+9937ef7499dcd7673714517fd5e450410c14ba4e jdk-11+22
 69b438908512d3dfef5852c6a843a5778333a309 jdk-12+2
--- a/make/autoconf/hotspot.m4	Thu Jul 12 15:02:41 2018 -0700
+++ b/make/autoconf/hotspot.m4	Sat Jul 14 02:14:54 2018 +0200
@@ -500,7 +500,7 @@
 
   # Enable features depending on variant.
   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
-  JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
+  JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES"
   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
   JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt"
   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
--- a/make/common/MakeBase.gmk	Thu Jul 12 15:02:41 2018 -0700
+++ b/make/common/MakeBase.gmk	Sat Jul 14 02:14:54 2018 +0200
@@ -1015,7 +1015,7 @@
   $(call LogCmdlines, Exececuting: [$(strip $2)]) \
   $(call MakeDir, $(dir $(strip $1))) \
   $(call WriteFile, $2, $(strip $1).cmdline) \
-  ( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \
+  ( $(RM) $(strip $1).log && $(strip $2) > >($(TEE) -a $(strip $1).log) 2> >($(TEE) -a $(strip $1).log >&2) || \
       ( exitcode=$(DOLLAR)? && \
       $(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).log && \
       $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \
--- a/make/hotspot/gensrc/GensrcJfr.gmk	Thu Jul 12 15:02:41 2018 -0700
+++ b/make/hotspot/gensrc/GensrcJfr.gmk	Sat Jul 14 02:14:54 2018 +0200
@@ -27,7 +27,7 @@
 # Build tools needed for the JFR source code generation
 
 JFR_TOOLS_SRCDIR := $(TOPDIR)/make/src/classes
-JFR_TOOLS_OUTPUTDIR := $(OUTPUTDIR)/buildtools/tools_classes
+JFR_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/buildtools/tools_classes
 
 $(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \
     JAVAC := $(JAVAC), \
--- a/src/hotspot/cpu/x86/vm_version_ext_x86.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/cpu/x86/vm_version_ext_x86.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -470,8 +470,8 @@
 }
 
 size_t VM_Version_Ext::cpu_write_support_string(char* const buf, size_t buf_len) {
-  assert(buf != NULL, "buffer is NULL!");
-  assert(buf_len > 0, "buffer len not enough!");
+  guarantee(buf != NULL, "buffer is NULL!");
+  guarantee(buf_len > 0, "buffer len not enough!");
 
   unsigned int flag = 0;
   unsigned int fi = 0;
@@ -481,8 +481,7 @@
 #define WRITE_TO_BUF(string)                                                          \
   {                                                                                   \
     int res = jio_snprintf(&buf[written], buf_len - written, "%s%s", prefix, string); \
-    if (res < 0 || (size_t) res >= buf_len - 1) {                                     \
-      buf[buf_len-1] = '\0';                                                          \
+    if (res < 0) {                                                                    \
       return buf_len - 1;                                                             \
     }                                                                                 \
     written += res;                                                                   \
@@ -592,7 +591,7 @@
     _cpuid_info.ext_cpuid1_edx);
 
   if (outputLen < 0 || (size_t) outputLen >= buf_len - 1) {
-    buf[buf_len-1] = '\0';
+    if (buf_len > 0) { buf[buf_len-1] = '\0'; }
     return OS_ERR;
   }
 
--- a/src/hotspot/cpu/x86/vm_version_ext_x86.hpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/cpu/x86/vm_version_ext_x86.hpp	Sat Jul 14 02:14:54 2018 +0200
@@ -63,6 +63,7 @@
   static bool cpu_is_em64t(void);
   static bool is_netburst(void);
 
+  // Returns bytes written excluding termninating null byte.
   static size_t cpu_write_support_string(char* const buf, size_t buf_len);
   static void resolve_cpu_information_details(void);
   static jlong max_qualified_cpu_freq_from_brand_string(void);
--- a/src/hotspot/cpu/x86/x86.ad	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/cpu/x86/x86.ad	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2011, 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
@@ -1444,6 +1444,7 @@
       case Op_CMoveVF:
         if (vlen != 8)
           ret_value  = false;
+        break;
       case Op_CMoveVD:
         if (vlen != 4)
           ret_value  = false;
--- a/src/hotspot/os/linux/os_linux.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/os/linux/os_linux.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -2093,7 +2093,9 @@
   // special case for debian
   if (file_exists("/etc/debian_version")) {
     strncpy(buf, "Debian ", buflen);
-    parse_os_info(&buf[7], buflen-7, "/etc/debian_version");
+    if (buflen > 7) {
+      parse_os_info(&buf[7], buflen-7, "/etc/debian_version");
+    }
   } else {
     strncpy(buf, "Linux", buflen);
   }
@@ -2805,8 +2807,8 @@
 }
 
 int os::Linux::get_existing_num_nodes() {
-  size_t node;
-  size_t highest_node_number = Linux::numa_max_node();
+  int node;
+  int highest_node_number = Linux::numa_max_node();
   int num_nodes = 0;
 
   // Get the total number of nodes in the system including nodes without memory.
@@ -2819,14 +2821,14 @@
 }
 
 size_t os::numa_get_leaf_groups(int *ids, size_t size) {
-  size_t highest_node_number = Linux::numa_max_node();
+  int highest_node_number = Linux::numa_max_node();
   size_t i = 0;
 
-  // Map all node ids in which is possible to allocate memory. Also nodes are
+  // Map all node ids in which it is possible to allocate memory. Also nodes are
   // not always consecutively available, i.e. available from 0 to the highest
   // node number.
-  for (size_t node = 0; node <= highest_node_number; node++) {
-    if (Linux::isnode_in_configured_nodes(node)) {
+  for (int node = 0; node <= highest_node_number; node++) {
+    if (Linux::isnode_in_configured_nodes((unsigned int)node)) {
       ids[i++] = node;
     }
   }
--- a/src/hotspot/os/linux/perfMemory_linux.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/os/linux/perfMemory_linux.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -534,15 +534,14 @@
   // directory search
   char* oldest_user = NULL;
   time_t oldest_ctime = 0;
-  char buffer[TMP_BUFFER_LEN];
+  char buffer[MAXPATHLEN + 1];
   int searchpid;
   char* tmpdirname = (char *)os::get_temp_directory();
   assert(strlen(tmpdirname) == 4, "No longer using /tmp - update buffer size");
 
   if (nspid == -1) {
     searchpid = vmid;
-  }
-  else {
+  } else {
     jio_snprintf(buffer, MAXPATHLEN, "/proc/%d/root%s", vmid, tmpdirname);
     tmpdirname = buffer;
     searchpid = nspid;
--- a/src/hotspot/share/adlc/archDesc.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/adlc/archDesc.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 1997, 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
@@ -543,14 +543,18 @@
   }
 
   // Identify index position among ideal operands
-  intptr_t    index     = _last_opcode;
-  const char *indexStr  = node ? node->_opType : (char *) " ";
-  index            = (intptr_t)_idealIndex[indexStr];
+  intptr_t index = _last_opcode;
+  const char *indexStr = node ? node->_opType : (char *) " ";
+  index = (intptr_t)_idealIndex[indexStr];
   if (index == 0) {
     fprintf(stderr, "error: operand \"%s\" not found\n", indexStr);
     assert(0, "fatal error");
   }
 
+  if (node == NULL) {
+    fprintf(stderr, "error: node is NULL\n");
+    assert(0, "fatal error");
+  }
   // Build MatchLists for children
   // Check each child for an internal operand name, and use that name
   // for the parent's matchlist entry if it exists
--- a/src/hotspot/share/adlc/arena.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/adlc/arena.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -43,7 +43,7 @@
   while( k ) {
     Chunk *tmp = k->_next;
     // clear out this chunk (to detect allocation bugs)
-    memset(k, 0xBAADBABE, k->_len);
+    memset(k, 0xBE, k->_len);
     free(k);                    // Free chunk (was malloc'd)
     k = tmp;
   }
--- a/src/hotspot/share/adlc/dfa.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/adlc/dfa.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -502,9 +502,11 @@
     case '"':  // such as: #line 10 "myfile.ad"\n mypredicate
       return true;
     case '|':
-      if( prev != pred && *(prev-1) == '|' ) return true;
+      if (prev != pred && *(prev-1) == '|') return true;
+      break;
     case '&':
-      if( prev != pred && *(prev-1) == '&' ) return true;
+      if (prev != pred && *(prev-1) == '&') return true;
+      break;
     default:
       return false;
     }
@@ -717,21 +719,21 @@
 
   // Preserve use of external name which has a zero value
   if( c1->_external_name != NULL ) {
-    sprintf( string_buffer, "%s", c1->as_string());
+    sprintf(string_buffer, "%s", c1->as_string());
     if( !c2->is_zero() ) {
-      strcat( string_buffer, "+");
-      strcat( string_buffer, c2->as_string());
+      strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
+      strncat(string_buffer, c2->as_string(), STRING_BUFFER_LENGTH);
     }
     result = strdup(string_buffer);
   }
   else if( c2->_external_name != NULL ) {
     if( !c1->is_zero() ) {
-      sprintf( string_buffer, "%s", c1->as_string());
-      strcat( string_buffer, " + ");
+      sprintf(string_buffer, "%s", c1->as_string());
+      strncat(string_buffer, " + ", STRING_BUFFER_LENGTH);
     } else {
       string_buffer[0] = '\0';
     }
-    strcat( string_buffer, c2->_external_name );
+    strncat(string_buffer, c2->_external_name, STRING_BUFFER_LENGTH);
     result = strdup(string_buffer);
   }
   return result;
@@ -741,8 +743,8 @@
   if( !c1->is_zero() ) {
     sprintf( string_buffer, "%s", c1->_expr);
     if( !c2->is_zero() ) {
-      strcat( string_buffer, "+");
-      strcat( string_buffer, c2->_expr);
+      strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
+      strncat(string_buffer, c2->_expr, STRING_BUFFER_LENGTH);
     }
   }
   else if( !c2->is_zero() ) {
--- a/src/hotspot/share/adlc/filebuff.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/adlc/filebuff.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -95,8 +95,11 @@
   va_start(args, fmt);
   switch (flag) {
   case 0: _AD._warnings += _AD.emit_msg(0, flag, linenum, fmt, args);
+    break;
   case 1: _AD._syntax_errs += _AD.emit_msg(0, flag, linenum, fmt, args);
+    break;
   case 2: _AD._semantic_errs += _AD.emit_msg(0, flag, linenum, fmt, args);
+    break;
   default: assert(0, ""); break;
   }
   va_end(args);
--- a/src/hotspot/share/adlc/formssel.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/adlc/formssel.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -3634,7 +3634,7 @@
         && (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory)
         && (name_left != NULL)       // NOT (load)
         && (name_right == NULL) ) {  // NOT (load memory foo)
-      const Form *form2_left = name_left ? globals[name_left] : NULL;
+      const Form *form2_left = globals[name_left];
       if( form2_left && form2_left->is_cisc_mem(globals) ) {
         cisc_spillable = Is_cisc_spillable;
         operand        = _name;
@@ -3645,7 +3645,7 @@
       }
     }
     // Detect reg vs memory
-    else if( form->is_cisc_reg(globals) && form2->is_cisc_mem(globals) ) {
+    else if (form->is_cisc_reg(globals) && form2 != NULL && form2->is_cisc_mem(globals)) {
       cisc_spillable = Is_cisc_spillable;
       operand        = _name;
       reg_type       = _result;
@@ -3710,8 +3710,12 @@
   }
 
   // Check right operands: recursive walk to identify reg->mem operand
-  if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) {
-    right_spillable =  Maybe_cisc_spillable;
+  if (_rChild == NULL) {
+    if (mRule2->_rChild == NULL) {
+      right_spillable =  Maybe_cisc_spillable;
+    } else {
+      assert(0, "_rChild should not be NULL");
+    }
   } else {
     right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
   }
--- a/src/hotspot/share/adlc/main.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/adlc/main.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -142,7 +142,7 @@
       const char *base = strip_ext(strdup(argv[i]));
       char       *temp = base_plus_suffix("dfa_",base);
       AD._DFA_file._name = base_plus_suffix(temp,".cpp");
-      delete temp;
+      delete[] temp;
       temp = base_plus_suffix("ad_",base);
       AD._CPP_file._name          = base_plus_suffix(temp,".cpp");
       AD._CPP_CLONE_file._name    = base_plus_suffix(temp,"_clone.cpp");
@@ -153,13 +153,13 @@
       AD._CPP_PEEPHOLE_file._name = base_plus_suffix(temp,"_peephole.cpp");
       AD._CPP_PIPELINE_file._name = base_plus_suffix(temp,"_pipeline.cpp");
       AD._HPP_file._name = base_plus_suffix(temp,".hpp");
-      delete temp;
+      delete[] temp;
       temp = base_plus_suffix("adGlobals_",base);
       AD._VM_file._name = base_plus_suffix(temp,".hpp");
-      delete temp;
+      delete[] temp;
       temp = base_plus_suffix("bugs_",base);
       AD._bug_file._name = base_plus_suffix(temp,".out");
-      delete temp;
+      delete[] temp;
     }                           // End of files vs options...
   }                             // End of while have command line arguments
 
--- a/src/hotspot/share/adlc/output_c.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/adlc/output_c.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -1936,6 +1936,7 @@
           _AD.syntax_err( _ins_encode._linenum,
                           "Parameter %s not passed to enc_class %s from instruct %s.\n",
                           rep_var, _encoding._name, _inst._ident);
+          assert(false, "inst_rep_var == NULL, cannot continue.");
         }
 
         // Check if instruction's actual parameter is a local name in the instruction
@@ -1976,8 +1977,8 @@
         }
         else {
           // Check for unimplemented functionality before hard failure
-          assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label");
-          assert( false, "ShouldNotReachHere()");
+          assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label");
+          assert(false, "ShouldNotReachHere()");
         }
       } // done checking which operand this is.
     } else {
@@ -2450,8 +2451,8 @@
       }
       else {
         // Check for unimplemented functionality before hard failure
-        assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label");
-        assert( false, "ShouldNotReachHere()");
+        assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label");
+        assert(false, "ShouldNotReachHere()");
       }
       // all done
     }
@@ -3305,9 +3306,11 @@
   // Output the definitions for machine node specific pipeline data
   _machnodes.reset();
 
-  for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) {
-    fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
-      machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num);
+  if (_pipeline != NULL) {
+    for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) {
+      fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
+              machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num);
+    }
   }
 
   fprintf(_CPP_PIPELINE_file._fp, "\n");
@@ -3315,13 +3318,15 @@
   // Output the definitions for instruction pipeline static data references
   _instructions.reset();
 
-  for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) {
-    if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) {
-      fprintf(_CPP_PIPELINE_file._fp, "\n");
-      fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n",
-        max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
-      fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
-        max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
+  if (_pipeline != NULL) {
+    for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) {
+      if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) {
+        fprintf(_CPP_PIPELINE_file._fp, "\n");
+        fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n",
+                max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
+        fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n",
+                max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num);
+      }
     }
   }
 }
--- a/src/hotspot/share/aot/aotCodeHeap.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/aot/aotCodeHeap.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -549,7 +549,7 @@
     _lib_symbols_initialized = true;
 
     CollectedHeap* heap = Universe::heap();
-    SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, ci_card_table_address());
+    SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, (BarrierSet::barrier_set()->is_a(BarrierSet::CardTableBarrierSet) ? ci_card_table_address() : NULL));
     SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_top_address", address, (heap->supports_inline_contig_alloc() ? heap->top_addr() : NULL));
     SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_end_address", address, (heap->supports_inline_contig_alloc() ? heap->end_addr() : NULL));
     SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_polling_page", address, os::get_polling_page());
--- a/src/hotspot/share/asm/codeBuffer.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/asm/codeBuffer.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -187,7 +187,7 @@
   cs->_limit = new_limit;
   cs->_locs_limit = new_locs_limit;
   cs->_frozen = true;
-  if (!next_cs->is_allocated() && !next_cs->is_frozen()) {
+  if (next_cs != NULL && !next_cs->is_allocated() && !next_cs->is_frozen()) {
     // Give remaining buffer space to the following section.
     next_cs->initialize(new_limit, old_limit - new_limit);
     next_cs->initialize_shared_locs(new_locs_limit,
@@ -494,10 +494,13 @@
       // Compute initial padding; assign it to the previous non-empty guy.
       // Cf. figure_expanded_capacities.
       csize_t padding = cs->align_at_start(buf_offset) - buf_offset;
-      if (padding != 0) {
-        buf_offset += padding;
-        assert(prev_dest_cs != NULL, "sanity");
-        prev_dest_cs->_limit += padding;
+      if (prev_dest_cs != NULL) {
+        if (padding != 0) {
+          buf_offset += padding;
+          prev_dest_cs->_limit += padding;
+        }
+      } else {
+        guarantee(padding == 0, "In first iteration no padding should be needed.");
       }
       #ifdef ASSERT
       if (prev_cs != NULL && prev_cs->is_frozen() && n < (SECT_LIMIT - 1)) {
--- a/src/hotspot/share/c1/c1_IR.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/c1/c1_IR.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -1386,7 +1386,7 @@
     n->values_do(this);
     // need to remove this instruction from the instruction stream
     if (n->subst() != n) {
-      assert(last != NULL, "must have last");
+      guarantee(last != NULL, "must have last");
       last->set_next(n->next());
     } else {
       last = n;
--- a/src/hotspot/share/c1/c1_LIRGenerator.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -2311,7 +2311,9 @@
   if (compilation()->env()->comp_level() == CompLevel_full_profile && UseSwitchProfiling) {
     ciMethod* method = x->state()->scope()->method();
     ciMethodData* md = method->method_data_or_null();
+    assert(md != NULL, "Sanity");
     ciProfileData* data = md->bci_to_data(x->state()->bci());
+    assert(data != NULL, "must have profiling data");
     assert(data->is_MultiBranchData(), "bad profile data?");
     int default_count_offset = md->byte_offset_of_slot(data, MultiBranchData::default_count_offset());
     LIR_Opr md_reg = new_register(T_METADATA);
@@ -2367,7 +2369,9 @@
   if (compilation()->env()->comp_level() == CompLevel_full_profile && UseSwitchProfiling) {
     ciMethod* method = x->state()->scope()->method();
     ciMethodData* md = method->method_data_or_null();
+    assert(md != NULL, "Sanity");
     ciProfileData* data = md->bci_to_data(x->state()->bci());
+    assert(data != NULL, "must have profiling data");
     assert(data->is_MultiBranchData(), "bad profile data?");
     int default_count_offset = md->byte_offset_of_slot(data, MultiBranchData::default_count_offset());
     LIR_Opr md_reg = new_register(T_METADATA);
@@ -3076,6 +3080,7 @@
   if (compilation()->profile_arguments()) {
     int bci = x->bci_of_invoke();
     ciMethodData* md = x->method()->method_data_or_null();
+    assert(md != NULL, "Sanity");
     ciProfileData* data = md->bci_to_data(bci);
     if (data != NULL) {
       if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) ||
@@ -3212,6 +3217,7 @@
 void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) {
   int bci = x->bci_of_invoke();
   ciMethodData* md = x->method()->method_data_or_null();
+  assert(md != NULL, "Sanity");
   ciProfileData* data = md->bci_to_data(bci);
   if (data != NULL) {
     assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
--- a/src/hotspot/share/c1/c1_LinearScan.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/c1/c1_LinearScan.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -3954,7 +3954,7 @@
     if (!processed_interval) {
       // no move could be processed because there is a cycle in the move list
       // (e.g. r1 -> r2, r2 -> r1), so one interval must be spilled to memory
-      assert(spill_candidate != -1, "no interval in register for spilling found");
+      guarantee(spill_candidate != -1, "no interval in register for spilling found");
 
       // create a new spill interval and assign a stack slot to it
       Interval* from_interval = _mapping_from.at(spill_candidate);
@@ -6301,7 +6301,8 @@
                   assert(prev_branch->cond() == prev_cmp->condition(), "should be the same");
                 }
               }
-              assert(prev_cmp != NULL, "should have found comp instruction for branch");
+              // Guarantee because it is dereferenced below.
+              guarantee(prev_cmp != NULL, "should have found comp instruction for branch");
               if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) {
 
                 TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id()));
--- a/src/hotspot/share/classfile/moduleEntry.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/classfile/moduleEntry.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -387,7 +387,8 @@
     entry->set_is_patched();
     if (log_is_enabled(Trace, module, patch)) {
       ResourceMark rm;
-      log_trace(module, patch)("Marked module %s as patched from --patch-module", name->as_C_string());
+      log_trace(module, patch)("Marked module %s as patched from --patch-module",
+                               name != NULL ? name->as_C_string() : UNNAMED_MODULE);
     }
   }
 
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1364,18 +1364,18 @@
 
     // notify a class loaded from shared object
     ClassLoadingService::notify_class_loaded(ik, true /* shared class */);
-  }
-
-  ik->set_has_passed_fingerprint_check(false);
-  if (UseAOT && ik->supers_have_passed_fingerprint_checks()) {
-    uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik);
-    uint64_t cds_fp = ik->get_stored_fingerprint();
-    if (aot_fp != 0 && aot_fp == cds_fp) {
-      // This class matches with a class saved in an AOT library
-      ik->set_has_passed_fingerprint_check(true);
-    } else {
-      ResourceMark rm;
-      log_info(class, fingerprint)("%s :  expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp);
+
+    ik->set_has_passed_fingerprint_check(false);
+    if (UseAOT && ik->supers_have_passed_fingerprint_checks()) {
+      uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik);
+      uint64_t cds_fp = ik->get_stored_fingerprint();
+      if (aot_fp != 0 && aot_fp == cds_fp) {
+        // This class matches with a class saved in an AOT library
+        ik->set_has_passed_fingerprint_check(true);
+      } else {
+        ResourceMark rm;
+        log_info(class, fingerprint)("%s :  expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp);
+      }
     }
   }
   return ik;
--- a/src/hotspot/share/classfile/systemDictionaryShared.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -766,10 +766,11 @@
   SharedDictionaryEntry* entry = ((SharedDictionary*)(k->class_loader_data()->dictionary()))->find_entry_for(k);
   ResourceMark rm;
   // Lambda classes are not archived and will be regenerated at runtime.
-  if (entry == NULL && strstr(k->name()->as_C_string(), "Lambda$") != NULL) {
+  if (entry == NULL) {
+    guarantee(strstr(k->name()->as_C_string(), "Lambda$") != NULL,
+              "class should be in dictionary before being verified");
     return true;
   }
-  assert(entry != NULL, "class should be in dictionary before being verified");
   entry->add_verification_constraint(name, from_name, from_field_is_protected,
                                      from_is_array, from_is_object);
   if (entry->is_builtin()) {
--- a/src/hotspot/share/classfile/verifier.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/classfile/verifier.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -719,7 +719,8 @@
         ResourceMark rm(THREAD);
         LogStream ls(lt);
         current_frame.print_on(&ls);
-        lt.print("offset = %d,  opcode = %s", bci, Bytecodes::name(opcode));
+        lt.print("offset = %d,  opcode = %s", bci,
+                 opcode == Bytecodes::_illegal ? "illegal" : Bytecodes::name(opcode));
       }
 
       // Make sure wide instruction is in correct format
--- a/src/hotspot/share/code/codeCache.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/code/codeCache.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1363,22 +1363,22 @@
       const char *msg1 = msg1_stream.as_string();
       const char *msg2 = msg2_stream.as_string();
 
-      log_warning(codecache)(msg1);
-      log_warning(codecache)(msg2);
-      warning(msg1);
-      warning(msg2);
+      log_warning(codecache)("%s", msg1);
+      log_warning(codecache)("%s", msg2);
+      warning("%s", msg1);
+      warning("%s", msg2);
     } else {
       const char *msg1 = "CodeCache is full. Compiler has been disabled.";
       const char *msg2 = "Try increasing the code cache size using -XX:ReservedCodeCacheSize=";
 
-      log_warning(codecache)(msg1);
-      log_warning(codecache)(msg2);
-      warning(msg1);
-      warning(msg2);
+      log_warning(codecache)("%s", msg1);
+      log_warning(codecache)("%s", msg2);
+      warning("%s", msg1);
+      warning("%s", msg2);
     }
     ResourceMark rm;
     stringStream s;
-    // Dump code cache  into a buffer before locking the tty,
+    // Dump code cache into a buffer before locking the tty.
     {
       MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
       print_summary(&s);
--- a/src/hotspot/share/compiler/compileLog.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/compiler/compileLog.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -217,14 +217,17 @@
       file->print_raw_cr("'>");
 
       size_t nr; // number read into buf from partial log
+      // In case of unsuccessful completion, read returns -1.
+      ssize_t bytes_read;
       // Copy data up to the end of the last <event> element:
       julong to_read = log->_file_end;
       while (to_read > 0) {
         if (to_read < (julong)buflen)
               nr = (size_t)to_read;
         else  nr = buflen;
-        nr = read(partial_fd, buf, (int)nr);
-        if (nr <= 0)  break;
+        bytes_read = read(partial_fd, buf, (int)nr);
+        if (bytes_read <= 0) break;
+        nr = bytes_read;
         to_read -= (julong)nr;
         file->write(buf, nr);
       }
@@ -232,7 +235,8 @@
       // Copy any remaining data inside a quote:
       bool saw_slop = false;
       int end_cdata = 0;  // state machine [0..2] watching for too many "]]"
-      while ((nr = read(partial_fd, buf, buflen-1)) > 0) {
+      while ((bytes_read = read(partial_fd, buf, buflen-1)) > 0) {
+        nr = bytes_read;
         buf[buflen-1] = '\0';
         if (!saw_slop) {
           file->print_raw_cr("<fragment>");
--- a/src/hotspot/share/compiler/disassembler.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/compiler/disassembler.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -124,7 +124,7 @@
     _decode_instructions_virtual = CAST_TO_FN_PTR(Disassembler::decode_func_virtual,
                                           os::dll_lookup(_library, decode_instructions_virtual_name));
   }
-  if (_decode_instructions_virtual == NULL) {
+  if (_decode_instructions_virtual == NULL && _library != NULL) {
     // could not spot in new version, try old version
     _decode_instructions = CAST_TO_FN_PTR(Disassembler::decode_func,
                                           os::dll_lookup(_library, decode_instructions_name));
--- a/src/hotspot/share/compiler/methodLiveness.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/compiler/methodLiveness.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -484,7 +484,7 @@
     while (block == NULL && t > 0) {
      block = _block_map->at(--t);
     }
-    assert( block != NULL, "invalid bytecode index; must be instruction index" );
+    guarantee(block != NULL, "invalid bytecode index; must be instruction index");
     assert(bci >= block->start_bci() && bci < block->limit_bci(), "block must contain bci.");
 
     answer = block->get_liveness_at(method(), bci);
--- a/src/hotspot/share/compiler/oopMap.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/compiler/oopMap.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -571,14 +571,14 @@
 
 const ImmutableOopMap* ImmutableOopMapSet::find_map_at_offset(int pc_offset) const {
   ImmutableOopMapPair* pairs = get_pairs();
-  ImmutableOopMapPair* last = NULL;
 
-  for (int i = 0; i < _count; ++i) {
+  int i;
+  for (i = 0; i < _count; ++i) {
     if (pairs[i].pc_offset() >= pc_offset) {
-      last = &pairs[i];
       break;
     }
   }
+  ImmutableOopMapPair* last = &pairs[i];
 
   assert(last->pc_offset() == pc_offset, "oopmap not found");
   return last->get_from(this);
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -236,6 +236,8 @@
 
   JVMCIKlassHandle klass(THREAD);
   oop result = NULL;
+  guarantee(h != NULL,
+            "If DebugInformationRecorder::describe_scope passes NULL oldCount == newCount must hold.");
   if (h->is_klass()) {
     klass = (Klass*) h;
     result = CompilerToVM::get_jvmci_type(klass, CATCH);
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -349,7 +349,9 @@
     klass = *((Klass**) (intptr_t) (base_address + offset));
   } else {
     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
-                err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", base_object->klass()->external_name(), offset, compressed ? "true" : "false"));
+                err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s",
+                        base_object != NULL ? base_object->klass()->external_name() : "null",
+                        offset, compressed ? "true" : "false"));
   }
   assert (klass == NULL || klass->is_klass(), "invalid read");
   oop result = CompilerToVM::get_jvmci_type(klass, CHECK_NULL);
--- a/src/hotspot/share/logging/logOutput.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/logging/logOutput.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -262,7 +262,9 @@
   while (n_deviates > 0) {
     size_t prev_deviates = n_deviates;
     int max_score = 0;
-    const LogSelection* best_selection = NULL;
+
+    guarantee(n_selections > 0, "Cannot find maximal selection.");
+    const LogSelection* best_selection = &selections[0];
     for (size_t i = 0; i < n_selections; i++) {
 
       // Give the selection a score based on how many deviating tag sets it selects (with correct level)
@@ -287,13 +289,12 @@
 
       // Pick the selection with the best score, or in the case of a tie, the one with fewest tags
       if (score > max_score ||
-          (score == max_score && best_selection != NULL && selections[i].ntags() < best_selection->ntags())) {
+          (score == max_score && selections[i].ntags() < best_selection->ntags())) {
         max_score = score;
         best_selection = &selections[i];
       }
     }
 
-    assert(best_selection != NULL, "must always find a maximal selection");
     add_to_config_string(*best_selection);
 
     // Remove all deviates that this selection covered
--- a/src/hotspot/share/memory/filemap.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/memory/filemap.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -631,7 +631,9 @@
   si->_read_only = read_only;
   si->_allow_exec = allow_exec;
   si->_crc = ClassLoader::crc32(0, base, (jint)size);
-  write_bytes_aligned(base, (int)size);
+  if (base != NULL) {
+    write_bytes_aligned(base, (int)size);
+  }
 }
 
 // Write out the given archive heap memory regions.  GC code combines multiple
--- a/src/hotspot/share/memory/metaspace.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/memory/metaspace.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1260,7 +1260,9 @@
       tty->print_cr("Please increase MaxMetaspaceSize (currently " SIZE_FORMAT " bytes).", MaxMetaspaceSize);
       vm_exit(1);
     }
-    report_metadata_oome(loader_data, word_size, type, mdtype, CHECK_NULL);
+    report_metadata_oome(loader_data, word_size, type, mdtype, THREAD);
+    assert(HAS_PENDING_EXCEPTION, "sanity");
+    return NULL;
   }
 
   // Zero initialize.
--- a/src/hotspot/share/memory/virtualspace.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/memory/virtualspace.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -70,6 +70,18 @@
   initialize(size, alignment, large, NULL, executable);
 }
 
+ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment,
+                             bool special, bool executable) : _fd_for_heap(-1) {
+  assert((size % os::vm_allocation_granularity()) == 0,
+         "size not allocation aligned");
+  _base = base;
+  _size = size;
+  _alignment = alignment;
+  _noaccess_prefix = 0;
+  _special = special;
+  _executable = executable;
+}
+
 // Helper method
 static void unmap_or_release_memory(char* base, size_t size, bool is_file_mapped) {
   if (is_file_mapped) {
@@ -218,20 +230,6 @@
   }
 }
 
-
-ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment,
-                             bool special, bool executable) {
-  assert((size % os::vm_allocation_granularity()) == 0,
-         "size not allocation aligned");
-  _base = base;
-  _size = size;
-  _alignment = alignment;
-  _noaccess_prefix = 0;
-  _special = special;
-  _executable = executable;
-}
-
-
 ReservedSpace ReservedSpace::first_part(size_t partition_size, size_t alignment,
                                         bool split, bool realloc) {
   assert(partition_size <= size(), "partition failed");
--- a/src/hotspot/share/opto/arraycopynode.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/arraycopynode.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -366,6 +366,9 @@
   if (!forward_ctl->is_top()) {
     // copy forward
     mem = start_mem_dest;
+    uint alias_idx_src = phase->C->get_alias_index(atp_src);
+    uint alias_idx_dest = phase->C->get_alias_index(atp_dest);
+    bool same_alias = (alias_idx_src == alias_idx_dest);
 
     if (count > 0) {
       Node* v = LoadNode::make(*phase, forward_ctl, start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered);
@@ -376,7 +379,7 @@
         Node* off  = phase->MakeConX(type2aelembytes(copy_type) * i);
         Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off));
         Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off));
-        v = LoadNode::make(*phase, forward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered);
+        v = LoadNode::make(*phase, forward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered);
         v = phase->transform(v);
         mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered);
         mem = phase->transform(mem);
@@ -408,18 +411,21 @@
   if (!backward_ctl->is_top()) {
     // copy backward
     mem = start_mem_dest;
+    uint alias_idx_src = phase->C->get_alias_index(atp_src);
+    uint alias_idx_dest = phase->C->get_alias_index(atp_dest);
+    bool same_alias = (alias_idx_src == alias_idx_dest);
 
     if (count > 0) {
       for (int i = count-1; i >= 1; i--) {
         Node* off  = phase->MakeConX(type2aelembytes(copy_type) * i);
         Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off));
         Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off));
-        Node* v = LoadNode::make(*phase, backward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered);
+        Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered);
         v = phase->transform(v);
         mem = StoreNode::make(*phase, backward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered);
         mem = phase->transform(mem);
       }
-      Node* v = LoadNode::make(*phase, backward_ctl, mem, adr_src, atp_src, value_type, copy_type, MemNode::unordered);
+      Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered);
       v = phase->transform(v);
       mem = StoreNode::make(*phase, backward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered);
       mem = phase->transform(mem);
@@ -659,7 +665,8 @@
   c = bs->step_over_gc_barrier(c);
 
   CallNode* call = NULL;
-  if (c != NULL && c->is_Region()) {
+  guarantee(c != NULL, "step_over_gc_barrier failed, there must be something to step to.");
+  if (c->is_Region()) {
     for (uint i = 1; i < c->req(); i++) {
       if (c->in(i) != NULL) {
         Node* n = c->in(i)->in(0);
--- a/src/hotspot/share/opto/bytecodeInfo.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/bytecodeInfo.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -520,10 +520,10 @@
                                                caller_bci, inline_msg);
   if (C->print_inlining()) {
     C->print_inlining(callee_method, inline_level(), caller_bci, inline_msg);
-    if (callee_method == NULL) tty->print(" callee not monotonic or profiled");
-    if (Verbose && callee_method) {
+    guarantee(callee_method != NULL, "would crash in post_inlining_event");
+    if (Verbose) {
       const InlineTree *top = this;
-      while( top->caller_tree() != NULL ) { top = top->caller_tree(); }
+      while (top->caller_tree() != NULL) { top = top->caller_tree(); }
       //tty->print("  bcs: %d+%d  invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count());
     }
   }
--- a/src/hotspot/share/opto/callnode.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/callnode.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -759,6 +759,7 @@
         }
       }
     }
+    guarantee(dest != NULL, "Call had only one ptr in, broken IR!");
     if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) {
       return true;
     }
--- a/src/hotspot/share/opto/compile.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/compile.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -4049,9 +4049,9 @@
 
 int Compile::ConstantTable::find_offset(Constant& con) const {
   int idx = _constants.find(con);
-  assert(idx != -1, "constant must be in constant table");
+  guarantee(idx != -1, "constant must be in constant table");
   int offset = _constants.at(idx).offset();
-  assert(offset != -1, "constant table not emitted yet?");
+  guarantee(offset != -1, "constant table not emitted yet?");
   return offset;
 }
 
--- a/src/hotspot/share/opto/gcm.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/gcm.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1263,6 +1263,7 @@
         Node* use = self->fast_out(i);
         LCA = raise_LCA_above_use(LCA, use, self, this);
       }
+      guarantee(LCA != NULL, "There must be a LCA");
     }  // (Hide defs of imax, i from rest of block.)
 
     // Place temps in the block of their use.  This isn't a
--- a/src/hotspot/share/opto/ifnode.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/ifnode.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -387,6 +387,7 @@
     } else {
       assert( 0, "do not know how to handle this guy" );
     }
+    guarantee(proj != NULL, "sanity");
 
     Node *proj_path_data, *proj_path_ctrl;
     if( proj->Opcode() == Op_IfTrue ) {
--- a/src/hotspot/share/opto/indexSet.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/indexSet.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -319,7 +319,7 @@
   if (_max_blocks <= preallocated_block_list_size) {
     _blocks = _preallocated_block_list;
   } else {
-    _blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks);
+    _blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks);
   }
   for (uint i = 0; i < _max_blocks; i++) {
     set_block(i, &_empty_block);
@@ -343,7 +343,7 @@
   if (_max_blocks <= preallocated_block_list_size) {
     _blocks = _preallocated_block_list;
   } else {
-    _blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks);
+    _blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks);
   }
   for (uint i = 0; i < _max_blocks; i++) {
     set_block(i, &_empty_block);
--- a/src/hotspot/share/opto/lcm.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/lcm.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -646,7 +646,7 @@
     }
   } // End of for all ready nodes in worklist
 
-  assert(idx >= 0, "index should be set");
+  guarantee(idx >= 0, "index should be set");
   Node *n = worklist[(uint)idx];      // Get the winner
 
   worklist.map((uint)idx, worklist.pop());     // Compress worklist
--- a/src/hotspot/share/opto/loopPredicate.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/loopPredicate.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -684,6 +684,7 @@
   Node* max_idx_expr = NULL;
   const TypeInt* idx_type = TypeInt::INT;
   if ((stride > 0) == (scale > 0) == upper) {
+    guarantee(limit != NULL, "sanity");
     if (TraceLoopPredicate) {
       if (limit->is_Con()) {
         predString->print("(%d ", con_limit);
--- a/src/hotspot/share/opto/loopTransform.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/loopTransform.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -768,11 +768,12 @@
   Node *init_n = cl->init_trip();
   Node *limit_n = cl->limit();
   int stride_con = cl->stride_con();
+  if (limit_n == NULL) return false; // We will dereference it below.
+
   // Non-constant bounds.
   // Protect against over-unrolling when init or/and limit are not constant
   // (so that trip_count's init value is maxint) but iv range is known.
-  if (init_n   == NULL || !init_n->is_Con()  ||
-      limit_n  == NULL || !limit_n->is_Con()) {
+  if (init_n == NULL || !init_n->is_Con() || !limit_n->is_Con()) {
     Node* phi = cl->phi();
     if (phi != NULL) {
       assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi.");
--- a/src/hotspot/share/opto/macro.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/macro.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -2154,6 +2154,7 @@
 
   Node* mem  = alock->in(TypeFunc::Memory);
   Node* ctrl = alock->in(TypeFunc::Control);
+  guarantee(ctrl != NULL, "missing control projection, cannot replace_node() with NULL");
 
   extract_call_projections(alock);
   // There are 2 projections from the lock.  The lock node will
@@ -2188,8 +2189,7 @@
   }
 
   // Seach for MemBarReleaseLock node and delete it also.
-  if (alock->is_Unlock() && ctrl != NULL && ctrl->is_Proj() &&
-      ctrl->in(0)->is_MemBar()) {
+  if (alock->is_Unlock() && ctrl->is_Proj() && ctrl->in(0)->is_MemBar()) {
     MemBarNode* membar = ctrl->in(0)->as_MemBar();
     assert(membar->Opcode() == Op_MemBarReleaseLock &&
            mem->is_Proj() && membar == mem->in(0), "");
--- a/src/hotspot/share/opto/memnode.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/memnode.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -370,10 +370,10 @@
 
   if (mem != old_mem) {
     set_req(MemNode::Memory, mem);
-    if (can_reshape && old_mem->outcnt() == 0) {
-        igvn->_worklist.push(old_mem);
+    if (can_reshape && old_mem->outcnt() == 0 && igvn != NULL) {
+      igvn->_worklist.push(old_mem);
     }
-    if (phase->type( mem ) == Type::TOP) return NodeSentinel;
+    if (phase->type(mem) == Type::TOP) return NodeSentinel;
     return this;
   }
 
@@ -825,7 +825,7 @@
     }
     break;
   default:
-    // ShouldNotReachHere(); ???
+    ShouldNotReachHere();
     break;
   }
   assert(load != NULL, "LoadNode should have been created");
--- a/src/hotspot/share/opto/node.hpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/node.hpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1689,9 +1689,10 @@
   int block_idx = (idx >> _log2_node_notes_block_size);
   int grow_by = (block_idx - (arr == NULL? 0: arr->length()));
   if (grow_by >= 0) {
-    if (!can_grow)  return NULL;
+    if (!can_grow) return NULL;
     grow_node_notes(arr, grow_by + 1);
   }
+  if (arr == NULL) return NULL;
   // (Every element of arr is a sub-array of length _node_notes_block_size.)
   return arr->at(block_idx) + (idx & (_node_notes_block_size-1));
 }
--- a/src/hotspot/share/opto/output.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/output.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1424,7 +1424,7 @@
 
       // See if this instruction has a delay slot
       if (valid_bundle_info(n) && node_bundling(n)->use_unconditional_delay()) {
-        assert(delay_slot != NULL, "expecting delay slot node");
+        guarantee(delay_slot != NULL, "expecting delay slot node");
 
         // Back up 1 instruction
         cb->set_insts_end(cb->insts_end() - Pipeline::instr_unit_size());
--- a/src/hotspot/share/opto/parse1.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/parse1.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -1823,7 +1823,7 @@
       // Instead, wire the new split into a MergeMem on the backedge.
       // The optimizer will sort it out, slicing the phi.
       if (remerge == NULL) {
-        assert(base != NULL, "");
+        guarantee(base != NULL, "");
         assert(base->in(0) != NULL, "should not be xformed away");
         remerge = MergeMemNode::make(base->in(pnum));
         gvn().set_type(remerge, Type::MEMORY);
--- a/src/hotspot/share/opto/reg_split.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/reg_split.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -683,7 +683,7 @@
         if( needs_phi ) {
           // create a new phi node and insert it into the block
           // type is taken from left over pointer to a predecessor
-          assert(n3,"No non-NULL reaching DEF for a Phi");
+          guarantee(n3, "No non-NULL reaching DEF for a Phi");
           phi = new PhiNode(b->head(), n3->bottom_type());
           // initialize the Reaches entry for this LRG
           Reachblock[slidx] = phi;
--- a/src/hotspot/share/opto/runtime.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/runtime.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1608,7 +1608,12 @@
     }
     int bci = jvms->bci();
     if (bci < 0) bci = 0;
-    st.print("%s.%s@%d", m->holder()->name()->as_utf8(), m->name()->as_utf8(), bci);
+    if (m != NULL) {
+      st.print("%s.%s", m->holder()->name()->as_utf8(), m->name()->as_utf8());
+    } else {
+      st.print("no method");
+    }
+    st.print("@%d", bci);
     // To print linenumbers instead of bci use: m->line_number_from_bci(bci)
   }
   NamedCounter* c;
--- a/src/hotspot/share/opto/type.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/opto/type.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -252,17 +252,16 @@
         ciObject* oop_constant = constant.as_object();
         if (oop_constant->is_null_object()) {
           con_type = Type::get_zero_type(T_OBJECT);
-        } else if (require_constant || oop_constant->should_be_constant()) {
+        } else {
+          guarantee(require_constant || oop_constant->should_be_constant(), "con_type must get computed");
           con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant);
-          if (con_type != NULL) {
-            if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
-              con_type = con_type->is_aryptr()->cast_to_autobox_cache(true);
-            }
-            if (stable_dimension > 0) {
-              assert(FoldStableValues, "sanity");
-              assert(!con_type->is_zero_type(), "default value for stable field");
-              con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension);
-            }
+          if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
+            con_type = con_type->is_aryptr()->cast_to_autobox_cache(true);
+          }
+          if (stable_dimension > 0) {
+            assert(FoldStableValues, "sanity");
+            assert(!con_type->is_zero_type(), "default value for stable field");
+            con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension);
           }
         }
         if (is_narrow_oop) {
--- a/src/hotspot/share/prims/jvmtiEnvBase.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1219,7 +1219,7 @@
   }
   infop->state = state;
 
-  if (thr != NULL || (state & JVMTI_THREAD_STATE_ALIVE) != 0) {
+  if (thr != NULL && (state & JVMTI_THREAD_STATE_ALIVE) != 0) {
     infop->frame_buffer = NEW_RESOURCE_ARRAY(jvmtiFrameInfo, max_frame_count());
     env()->get_stack_trace(thr, 0, max_frame_count(),
                            infop->frame_buffer, &(infop->frame_count));
--- a/src/hotspot/share/runtime/deoptimization.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/runtime/deoptimization.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -2044,7 +2044,7 @@
   bool ignore_maybe_prior_recompile;
   assert(!reason_is_speculate(reason), "reason speculate only used by compiler");
   // JVMCI uses the total counts to determine if deoptimizations are happening too frequently -> do not adjust total counts
-  bool update_total_counts = JVMCI_ONLY(false) NOT_JVMCI(true);
+  bool update_total_counts = true JVMCI_ONLY( && !UseJVMCICompiler);
   query_update_method_data(trap_mdo, trap_bci,
                            (DeoptReason)reason,
                            update_total_counts,
--- a/src/hotspot/share/runtime/flags/jvmFlag.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/runtime/flags/jvmFlag.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -939,6 +939,10 @@
     }
   }
 
+  if (match == NULL) {
+    return NULL;
+  }
+
   if (!(match->is_unlocked() || match->is_unlocker())) {
     if (!allow_locked) {
       return NULL;
--- a/src/hotspot/share/runtime/simpleThresholdPolicy.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/runtime/simpleThresholdPolicy.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -266,8 +266,9 @@
     max_method = max_task->method();
   }
 
-  if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile
-      && is_method_profiled(max_method)) {
+  if (max_task != NULL && max_task->comp_level() == CompLevel_full_profile &&
+      TieredStopAtLevel > CompLevel_full_profile &&
+      max_method != NULL && is_method_profiled(max_method)) {
     max_task->set_comp_level(CompLevel_limited_profile);
     if (PrintTieredEvents) {
       print_event(UPDATE_IN_QUEUE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level());
--- a/src/hotspot/share/services/writeableFlags.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/services/writeableFlags.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -79,7 +79,7 @@
     case JVMFlag::NON_WRITABLE:
       buffer_concat(buffer, "flag is not writeable."); break;
     case JVMFlag::OUT_OF_BOUNDS:
-      print_flag_error_message_bounds(name, buffer); break;
+      if (name != NULL) { print_flag_error_message_bounds(name, buffer); } break;
     case JVMFlag::VIOLATES_CONSTRAINT:
       buffer_concat(buffer, "value violates its flag's constraint."); break;
     case JVMFlag::INVALID_FLAG:
--- a/src/hotspot/share/utilities/ostream.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/hotspot/share/utilities/ostream.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -531,7 +531,8 @@
 long fileStream::fileSize() {
   long size = -1;
   if (_file != NULL) {
-    long pos  = ::ftell(_file);
+    long pos = ::ftell(_file);
+    if (pos < 0) return pos;
     if (::fseek(_file, 0, SEEK_END) == 0) {
       size = ::ftell(_file);
     }
--- a/src/java.base/share/classes/java/nio/Bits.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.base/share/classes/java/nio/Bits.java	Sat Jul 14 02:14:54 2018 +0200
@@ -207,43 +207,24 @@
         assert cnt >= 0 && reservedMem >= 0 && totalCap >= 0;
     }
 
-    // -- Monitoring of direct buffer usage --
-
-    static {
-        // setup access to this package in SharedSecrets
-        SharedSecrets.setJavaNioAccess(
-            new JavaNioAccess() {
-                @Override
-                public JavaNioAccess.BufferPool getDirectBufferPool() {
-                    return new JavaNioAccess.BufferPool() {
-                        @Override
-                        public String getName() {
-                            return "direct";
-                        }
-                        @Override
-                        public long getCount() {
-                            return Bits.COUNT.get();
-                        }
-                        @Override
-                        public long getTotalCapacity() {
-                            return Bits.TOTAL_CAPACITY.get();
-                        }
-                        @Override
-                        public long getMemoryUsed() {
-                            return Bits.RESERVED_MEMORY.get();
-                        }
-                    };
-                }
-                @Override
-                public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) {
-                    return new DirectByteBuffer(addr, cap, ob);
-                }
-                @Override
-                public void truncate(Buffer buf) {
-                    buf.truncate();
-                }
-        });
-    }
+    static final JavaNioAccess.BufferPool BUFFER_POOL = new JavaNioAccess.BufferPool() {
+        @Override
+        public String getName() {
+            return "direct";
+        }
+        @Override
+        public long getCount() {
+            return Bits.COUNT.get();
+        }
+        @Override
+        public long getTotalCapacity() {
+            return Bits.TOTAL_CAPACITY.get();
+        }
+        @Override
+        public long getMemoryUsed() {
+            return Bits.RESERVED_MEMORY.get();
+        }
+    };
 
     // These numbers represent the point at which we have empirically
     // determined that the average cost of a JNI call exceeds the expense
--- a/src/java.base/share/classes/java/nio/Buffer.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.base/share/classes/java/nio/Buffer.java	Sat Jul 14 02:14:54 2018 +0200
@@ -26,6 +26,8 @@
 package java.nio;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.JavaNioAccess;
+import jdk.internal.misc.SharedSecrets;
 import jdk.internal.misc.Unsafe;
 
 import java.util.Spliterator;
@@ -707,4 +709,23 @@
             throw new IndexOutOfBoundsException();
     }
 
+    static {
+        // setup access to this package in SharedSecrets
+        SharedSecrets.setJavaNioAccess(
+            new JavaNioAccess() {
+                @Override
+                public JavaNioAccess.BufferPool getDirectBufferPool() {
+                    return Bits.BUFFER_POOL;
+                }
+                @Override
+                public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) {
+                    return new DirectByteBuffer(addr, cap, ob);
+                }
+                @Override
+                public void truncate(Buffer buf) {
+                    buf.truncate();
+                }
+            });
+    }
+
 }
--- a/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java	Sat Jul 14 02:14:54 2018 +0200
@@ -194,10 +194,9 @@
 
     public static JavaNioAccess getJavaNioAccess() {
         if (javaNioAccess == null) {
-            // Ensure java.nio.ByteOrder is initialized; we know that
-            // this class initializes java.nio.Bits that provides the
+            // Ensure java.nio.Buffer is initialized, which provides the
             // shared secret.
-            unsafe.ensureClassInitialized(java.nio.ByteOrder.class);
+            unsafe.ensureClassInitialized(java.nio.Buffer.class);
         }
         return javaNioAccess;
     }
--- a/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java	Sat Jul 14 02:14:54 2018 +0200
@@ -333,7 +333,6 @@
      * @return whether they are in the same package
      */
     public static boolean isSamePackage(Class<?> class1, Class<?> class2) {
-        assert(!class1.isArray() && !class2.isArray());
         if (class1 == class2)
             return true;
         if (class1.getClassLoader() != class2.getClassLoader())
--- a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java	Sat Jul 14 02:14:54 2018 +0200
@@ -73,12 +73,20 @@
             boolean withDefaultCertPathConstraints) {
         AlgorithmConstraints configuredConstraints = null;
         if (socket != null) {
-            HandshakeContext hc =
-                    ((SSLSocketImpl)socket).conContext.handshakeContext;
-            if (hc != null) {
-                configuredConstraints = hc.sslConfig.algorithmConstraints;
+            // Note that the KeyManager or TrustManager implementation may be
+            // not implemented in the same provider as SSLSocket/SSLEngine.
+            // Please check the instance before casting to use SSLSocketImpl.
+            if (socket instanceof SSLSocketImpl) {
+                HandshakeContext hc =
+                        ((SSLSocketImpl)socket).conContext.handshakeContext;
+                if (hc != null) {
+                    configuredConstraints = hc.sslConfig.algorithmConstraints;
+                } else {
+                    configuredConstraints = null;
+                }
             } else {
-                configuredConstraints = null;
+                configuredConstraints =
+                        socket.getSSLParameters().getAlgorithmConstraints();
             }
         }
         this.userSpecifiedConstraints = configuredConstraints;
@@ -90,12 +98,20 @@
             boolean withDefaultCertPathConstraints) {
         AlgorithmConstraints configuredConstraints = null;
         if (engine != null) {
-            HandshakeContext hc =
-                    ((SSLEngineImpl)engine).conContext.handshakeContext;
-            if (hc != null) {
-                configuredConstraints = hc.sslConfig.algorithmConstraints;
+            // Note that the KeyManager or TrustManager implementation may be
+            // not implemented in the same provider as SSLSocket/SSLEngine.
+            // Please check the instance before casting to use SSLEngineImpl.
+            if (engine instanceof SSLEngineImpl) {
+                HandshakeContext hc =
+                        ((SSLEngineImpl)engine).conContext.handshakeContext;
+                if (hc != null) {
+                    configuredConstraints = hc.sslConfig.algorithmConstraints;
+                } else {
+                    configuredConstraints = null;
+                }
             } else {
-                configuredConstraints = null;
+                configuredConstraints =
+                        engine.getSSLParameters().getAlgorithmConstraints();
             }
         }
         this.userSpecifiedConstraints = configuredConstraints;
--- a/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java	Sat Jul 14 02:14:54 2018 +0200
@@ -130,7 +130,8 @@
 
         // Fill in for the empty names.
         // English names are prefilled for performance.
-        if (locale.getLanguage() != "en") {
+        if (!locale.equals(Locale.ENGLISH) &&
+            !locale.equals(Locale.US)) {
             for (int zoneIndex = 0; zoneIndex < ret.length; zoneIndex++) {
                 deriveFallbackNames(ret[zoneIndex], locale);
             }
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Sat Jul 14 02:14:54 2018 +0200
@@ -378,7 +378,7 @@
 
         // Either java.awt.Frame or java.awt.Dialog can be resizable, however java.awt.Window is never resizable
         {
-            final boolean resizable = isFrame ? ((Frame)target).isResizable() : (isDialog ? ((Dialog)target).isResizable() : false);
+            final boolean resizable = isTargetResizable() && isNativelyFocusableWindow();
             styleBits = SET(styleBits, RESIZABLE, resizable);
             if (!resizable) {
                 styleBits = SET(styleBits, ZOOMABLE, false);
@@ -482,6 +482,16 @@
         return styleBits;
     }
 
+    private boolean isTargetResizable() {
+        if (target instanceof Frame) {
+            return ((Frame)target).isResizable();
+        } else if (target instanceof Dialog) {
+            return ((Dialog)target).isResizable();
+        }
+
+        return false;
+    }
+
     // this is the counter-point to -[CWindow _nativeSetStyleBit:]
     private void setStyleBits(final int mask, final boolean value) {
         execute(ptr -> nativeSetNSWindowStyleBits(ptr, mask, value ? mask : 0));
@@ -676,10 +686,9 @@
         // Manage the extended state when showing
         if (visible) {
             /* Frame or Dialog should be set property WINDOW_FULLSCREENABLE to true if the
-            Frame or Dialog is resizable.
+            Frame or Dialog is resizable and focusable.
             **/
-            final boolean resizable = (target instanceof Frame) ? ((Frame)target).isResizable() :
-            ((target instanceof Dialog) ? ((Dialog)target).isResizable() : false);
+            final boolean resizable = isTargetResizable() && isNativelyFocusableWindow();
             if (resizable) {
                 setCanFullscreen(true);
             }
@@ -814,9 +823,10 @@
 
     @Override
     public void setResizable(final boolean resizable) {
-        setCanFullscreen(resizable);
-        setStyleBits(RESIZABLE, resizable);
-        setStyleBits(ZOOMABLE, resizable);
+        final boolean windowResizable = resizable && isNativelyFocusableWindow();
+        setCanFullscreen(windowResizable);
+        setStyleBits(RESIZABLE, windowResizable);
+        setStyleBits(ZOOMABLE, windowResizable);
     }
 
     @Override
@@ -858,8 +868,8 @@
 
     @Override
     public void updateFocusableWindowState() {
-        final boolean isFocusable = isNativelyFocusableWindow();
-        setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN | RESIZABLE, isFocusable); // set bits at once
+        setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN | RESIZABLE,
+                (isNativelyFocusableWindow() && isTargetResizable()));
     }
 
     @Override
--- a/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -24,13 +24,41 @@
  */
 package javax.swing.text.html;
 
-import java.awt.*;
+import java.awt.Rectangle;
+import java.awt.Image;
+import java.awt.Container;
+import java.awt.Color;
+import java.awt.Shape;
+import java.awt.Graphics;
+import java.awt.Toolkit;
+
 import java.awt.image.ImageObserver;
-import java.net.*;
+import java.net.URL;
+import java.net.MalformedURLException;
+
 import java.util.Dictionary;
-import javax.swing.*;
-import javax.swing.text.*;
-import javax.swing.event.*;
+
+import javax.swing.GrayFilter;
+import javax.swing.ImageIcon;
+import javax.swing.Icon;
+import javax.swing.UIManager;
+import javax.swing.SwingUtilities;
+
+import javax.swing.text.JTextComponent;
+import javax.swing.text.StyledDocument;
+import javax.swing.text.View;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.Element;
+import javax.swing.text.ViewFactory;
+import javax.swing.text.Position;
+import javax.swing.text.Segment;
+import javax.swing.text.Highlighter;
+import javax.swing.text.LayeredHighlighter;
+import javax.swing.text.AbstractDocument;
+import javax.swing.text.Document;
+import javax.swing.text.BadLocationException;
+
+import javax.swing.event.DocumentEvent;
 
 /**
  * View of an Image, intended to support the HTML &lt;IMG&gt; tag.
@@ -744,12 +772,22 @@
             // anything that might cause the image to be loaded, and thus the
             // ImageHandler to be called.
             newWidth = getIntAttr(HTML.Attribute.WIDTH, -1);
+            newHeight = getIntAttr(HTML.Attribute.HEIGHT, -1);
+
             if (newWidth > 0) {
                 newState |= WIDTH_FLAG;
+                if (newHeight <= 0) {
+                    newHeight = newWidth;
+                    newState |= HEIGHT_FLAG;
+                }
             }
-            newHeight = getIntAttr(HTML.Attribute.HEIGHT, -1);
+
             if (newHeight > 0) {
                 newState |= HEIGHT_FLAG;
+                if (newWidth <= 0) {
+                    newWidth = newHeight;
+                    newState |= WIDTH_FLAG;
+                }
             }
 
             if (newWidth <= 0) {
--- a/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java	Sat Jul 14 02:14:54 2018 +0200
@@ -69,13 +69,15 @@
 
         initImpl(key);
 
-        // the private key parameters must match params
-        XECParameters xecParams = XECParameters.get(
-            InvalidAlgorithmParameterException::new, params);
-        if (!xecParams.oidEquals(this.ops.getParameters())) {
-            throw new InvalidKeyException(
-                "Incorrect private key parameters"
-            );
+        // the private key parameters must match params, if present
+        if (params != null) {
+            XECParameters xecParams = XECParameters.get(
+                InvalidAlgorithmParameterException::new, params);
+            if (!xecParams.oidEquals(this.ops.getParameters())) {
+                throw new InvalidKeyException(
+                    "Incorrect private key parameters"
+                );
+            }
         }
     }
 
@@ -171,7 +173,9 @@
             throw new IllegalStateException("Not initialized correctly");
         }
 
-        return secret.clone();
+        byte[] result = secret;
+        secret = null;
+        return result;
     }
 
     @Override
@@ -189,7 +193,8 @@
         }
 
         System.arraycopy(this.secret, 0, sharedSecret, offset, secretLen);
-        return secret.length;
+        secret = null;
+        return secretLen;
     }
 
     @Override
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java	Sat Jul 14 02:14:54 2018 +0200
@@ -83,7 +83,7 @@
             if (AArch64LIRFlagsVersioned.useLSE(masm.target.arch)) {
                 Register expected = asRegister(expectedValue);
                 masm.mov(size, result, expected);
-                masm.cas(size, expected, newVal, address, true /* acquire */, true /* release */);
+                masm.cas(size, result, newVal, address, true /* acquire */, true /* release */);
                 AArch64Compare.gpCompare(masm, resultValue, expectedValue);
             } else {
                 // We could avoid using a scratch register here, by reusing resultValue for the
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Sat Jul 14 02:14:54 2018 +0200
@@ -423,6 +423,21 @@
             ul.addContent(htmlTree);
         }
 
+        // Search
+        Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                contents.getContent("doclet.help.search.head"));
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(searchHead)
+                : HtmlTree.LI(HtmlStyle.blockList, searchHead);
+        Content searchBody = contents.getContent("doclet.help.search.body");
+        Content searchPara = HtmlTree.P(searchBody);
+        htmlTree.addContent(searchPara);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
+
         Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
         divContent.addContent(new HtmlTree(HtmlTag.HR));
         Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties	Sat Jul 14 02:14:54 2018 +0200
@@ -192,6 +192,10 @@
     Annotation Type Declaration
 doclet.help.annotation_type.description=\
     Annotation Type Description
+doclet.help.search.head=Search
+doclet.help.search.body=You can search for definitions of modules, packages, types, fields, methods \
+    and other terms defined in the API, using some or all of the name. "Camel-case" abbreviations \
+    are supported: for example, "InpStr" will find "InputStream" and "InputStreamReader".
 
 doclet.ClassUse_Packages.that.use.0=Packages that use {0}
 doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1}
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java	Sat Jul 14 02:14:54 2018 +0200
@@ -91,7 +91,7 @@
             "\u5927\u6b63", // Taisho
             "\u662d\u548c", // Showa
             "\u5e73\u6210", // Heisei
-            "\u65b0\u5143\u53f7", // NewEra
+            "\u5143\u53f7", // NewEra
         };
         final String[] rocEras = {
             "\u6c11\u56fd\u524d",
--- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java	Sat Jul 14 02:14:54 2018 +0200
@@ -154,7 +154,7 @@
             "\u5927\u6b63",
             "\u662d\u548c",
             "\u5e73\u6210",
-            "\u65b0\u5143\u53f7", // NewEra
+            "\u5143\u53f7", // NewEra
         };
 
         final String[] sharedJavaTimeShortEras = {
--- a/test/hotspot/gtest/logging/logTestUtils.inline.hpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/gtest/logging/logTestUtils.inline.hpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 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
@@ -95,6 +95,7 @@
   int buflen = 512;
   char* buf = NEW_RESOURCE_ARRAY(char, buflen);
   long pos = ftell(fp);
+  if (pos < 0) return NULL;
 
   char* ret = fgets(buf, buflen, fp);
   while (ret != NULL && buf[strlen(buf) - 1] != '\n' && !feof(fp)) {
--- a/test/hotspot/gtest/memory/test_metachunk.cpp	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/gtest/memory/test_metachunk.cpp	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 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
@@ -60,7 +60,7 @@
   // Check sizes
   EXPECT_EQ(metachunk->size(), metachunk->word_size());
   EXPECT_EQ(pointer_delta(metachunk->end(), metachunk->bottom(),
-                sizeof (MetaWord*)),
+                          sizeof (MetaWord)),
             metachunk->word_size());
 
   // Check usage
--- a/test/hotspot/jtreg/ProblemList.txt	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/ProblemList.txt	Sat Jul 14 02:14:54 2018 +0200
@@ -81,7 +81,6 @@
 
 serviceability/sa/TestRevPtrsForInvokeDynamic.java   8191270 generic-all
 serviceability/sa/sadebugd/SADebugDTest.java         8163805 generic-all
-serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java 8205643 generic-all
 serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 8205541 generic-all
 serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java 8205652 generic-all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java	Sat Jul 14 02:14:54 2018 +0200
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8200282
+ * @summary arraycopy converted as a series of loads/stores uses wrong slice for loads
+ *
+ * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,ACasLoadsStoresBadMem::not_inlined  ACasLoadsStoresBadMem
+ *
+ */
+
+public class ACasLoadsStoresBadMem {
+    public static void main(String[] args) {
+        int[] dst = new int[5];
+        for (int i = 0; i < 20_000; i++) {
+            test1(dst, 1);
+            for (int j = 1; j < 5; j++) {
+                if (dst[j] != j) {
+                    throw new RuntimeException("Bad copy ");
+                }
+            }
+        }
+    }
+
+    private static void test1(int[] dst, int dstPos) {
+        int[] src = new int[4];
+        not_inlined();
+        src[0] = 1;
+        src[1] = 2;
+        src[2] = 3;
+        src[3] = 4;
+        System.arraycopy(src, 0, dst, dstPos, 4);
+    }
+
+    private static void not_inlined() {
+    }
+}
--- a/test/hotspot/jtreg/compiler/c2/Test8062950.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/compiler/c2/Test8062950.java	Sat Jul 14 02:14:54 2018 +0200
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 8062950
+ * @requires vm.flavor == "server"
  * @key regression
  * @library /test/lib
  * @run driver compiler.c2.Test8062950
--- a/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java	Sat Jul 14 02:14:54 2018 +0200
@@ -25,6 +25,7 @@
  * @test
  * @bug 8193130 8203915
  * @summary Bad graph when unrolled loop bounds conflicts with range checks
+ * @requires vm.flavor == "server"
  *
  * @run main/othervm IterationSplitPredicateInconsistency
  * @run main/othervm -XX:-UseLoopPredicate IterationSplitPredicateInconsistency
--- a/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java	Sat Jul 14 02:14:54 2018 +0200
@@ -25,6 +25,7 @@
  * @test
  * @bug 8187822
  * @summary C2 conditonal move optimization might create broken graph
+ * @requires vm.flavor == "server"
  * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestCMovSplitThruPhi::not_inlined -XX:CompileOnly=TestCMovSplitThruPhi::test -XX:-LoopUnswitching TestCMovSplitThruPhi
  *
  */
--- a/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java	Sat Jul 14 02:14:54 2018 +0200
@@ -25,6 +25,7 @@
  * @test
  * @bug 8196294
  * @summary when loop strip is enabled, LoopStripMiningIterShortLoop should be not null
+ * @requires vm.flavor == "server"
  * @library /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java	Sat Jul 14 02:14:54 2018 +0200
@@ -117,22 +117,15 @@
         }
 
         // should deoptimize for speculative type check
+        // Intepreter will also add actual type check trap information into MDO
+        // when it throw ClassCastException
         if (!deoptimize(method, src_obj)) {
             throw new RuntimeException(method.getName() + " is not deoptimized");
         }
 
         // compile again
-        WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
-        if (!WHITE_BOX.isMethodCompiled(method)) {
-            throw new RuntimeException(method.getName() + " is not recompiled");
-        }
-
-        // should deoptimize for actual type check
-        if (!deoptimize(method, src_obj)) {
-            throw new RuntimeException(method.getName() + " is not deoptimized (should deoptimize for actual type check)");
-        }
-
-        // compile once again
+        // c2 will generate throw instead of uncommon trap because
+        // actual type check trap information is present in MDO
         WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
         if (!WHITE_BOX.isMethodCompiled(method)) {
             throw new RuntimeException(method.getName() + " is not recompiled");
--- a/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java	Sat Jul 14 02:14:54 2018 +0200
@@ -25,6 +25,7 @@
  * @test
  * @bug 8201367
  * @summary RPO walk of counted loop block doesn't properly order loads
+ * @requires vm.flavor == "server"
  *
  * @run main/othervm -XX:-BackgroundCompilation -XX:-UseCountedLoopSafepoints TestUnexpectedLoadOrdering
  *
--- a/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java	Sat Jul 14 02:14:54 2018 +0200
@@ -25,13 +25,38 @@
  * @test
  * @bug 8193373
  * @summary Test reading ELF info direct from underlaying file
- * @requires (os.family == "linux")
+ * @requires (os.family == "linux") & (os.arch != "ppc64")
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail TestElfDirectRead
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+                     -XX:NativeMemoryTracking=detail TestElfDirectRead
+ */
+
+// This test intentionally disables caching of Elf sections during symbol lookup
+// with WhiteBox.disableElfSectionCache(). On platforms which do not use file
+// descriptors instead of plain function pointers this slows down the lookup just a
+// little bit, because all the symbols from an Elf file are still read consecutively
+// after one 'fseek()' call. But on platforms with file descriptors like ppc64
+// big-endian, we get two 'fseek()' calls for each symbol read from the Elf file
+// because reading the file descriptor table is nested inside the loop which reads
+// the symbols. This really trashes the I/O system and considerable slows down the
+// test, so we need an extra long timeout setting.
+
+/*
+ * @test
+ * @bug 8193373
+ * @summary Test reading ELF info direct from underlaying file
+ * @requires (os.family == "linux") & (os.arch == "ppc64")
+ * @modules java.base/jdk.internal.misc
+ * @library /test/lib
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+                                 -XX:NativeMemoryTracking=detail TestElfDirectRead
  */
 
 import jdk.test.lib.process.ProcessTools;
--- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java	Sat Jul 14 02:14:54 2018 +0200
@@ -23,9 +23,13 @@
 
 package MyPackage;
 
+import java.lang.management.ManagementFactory;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.sun.management.HotSpotDiagnosticMXBean;
+import com.sun.management.VMOption;
+
 /** API for handling the underlying heap sampling monitoring system. */
 public class HeapMonitor {
   private static int[][] arrays;
@@ -56,7 +60,7 @@
     int sum = 0;
     List<Frame> frames = new ArrayList<Frame>();
     allocate(frames);
-    frames.add(new Frame("allocate", "()Ljava/util/List;", "HeapMonitor.java", 58));
+    frames.add(new Frame("allocate", "()Ljava/util/List;", "HeapMonitor.java", 62));
     return frames;
   }
 
@@ -65,8 +69,8 @@
     for (int j = 0; j < allocationIterations; j++) {
       sum += actuallyAllocate();
     }
-    frames.add(new Frame("actuallyAllocate", "()I", "HeapMonitor.java", 93));
-    frames.add(new Frame("allocate", "(Ljava/util/List;)V", "HeapMonitor.java", 66));
+    frames.add(new Frame("actuallyAllocate", "()I", "HeapMonitor.java", 97));
+    frames.add(new Frame("allocate", "(Ljava/util/List;)V", "HeapMonitor.java", 70));
   }
 
   public static List<Frame> repeatAllocate(int max) {
@@ -74,7 +78,7 @@
     for (int i = 0; i < max; i++) {
       frames = allocate();
     }
-    frames.add(new Frame("repeatAllocate", "(I)Ljava/util/List;", "HeapMonitor.java", 75));
+    frames.add(new Frame("repeatAllocate", "(I)Ljava/util/List;", "HeapMonitor.java", 79));
     return frames;
   }
 
@@ -152,14 +156,42 @@
   }
 
   public native static int sampledEvents();
-  public native static boolean obtainedEvents(Frame[] frames);
-  public native static boolean garbageContains(Frame[] frames);
+  public native static boolean obtainedEvents(Frame[] frames, boolean checkLines);
+  public native static boolean garbageContains(Frame[] frames, boolean checkLines);
   public native static boolean eventStorageIsEmpty();
   public native static void resetEventStorage();
   public native static int getEventStorageElementCount();
   public native static void forceGarbageCollection();
   public native static boolean enableVMEvents();
 
+  private static boolean getCheckLines() {
+    boolean checkLines = true;
+
+    // Do not check lines for Graal since it is not always "precise" with BCIs at uncommon traps.
+    try {
+      HotSpotDiagnosticMXBean bean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
+
+      VMOption enableJVMCI = bean.getVMOption("EnableJVMCI");
+      VMOption useJVMCICompiler = bean.getVMOption("UseJVMCICompiler");
+      String compiler = System.getProperty("jvmci.Compiler");
+
+      checkLines = !(enableJVMCI.getValue().equals("true")
+          && useJVMCICompiler.getValue().equals("true") && compiler.equals("graal"));
+    } catch (Exception e) {
+      // NOP.
+    }
+
+    return checkLines;
+  }
+
+  public static boolean obtainedEvents(Frame[] frames) {
+    return obtainedEvents(frames, getCheckLines());
+  }
+
+  public static boolean garbageContains(Frame[] frames) {
+    return garbageContains(frames, getCheckLines());
+  }
+
   public static boolean statsHaveExpectedNumberSamples(int expected, int acceptedErrorPercentage) {
     double actual = getEventStorageElementCount();
     double diffPercentage = Math.abs(actual - expected) / expected;
--- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java	Sat Jul 14 02:14:54 2018 +0200
@@ -28,6 +28,7 @@
  * @summary Verifies the JVMTI Heap Monitor Statistics using CMS GC
  * @build Frame HeapMonitor
  * @requires vm.gc == "ConcMarkSweep" | vm.gc == "null"
+ * @requires !vm.graal.enabled
  * @compile HeapMonitorGCCMSTest.java
  * @run main/othervm/native -agentlib:HeapMonitorTest -XX:+UseConcMarkSweepGC MyPackage.HeapMonitorGCTest
  */
--- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java	Sat Jul 14 02:14:54 2018 +0200
@@ -26,11 +26,13 @@
 import java.util.ArrayList;
 import java.util.List;
 
+// Graal is not tested here due to Graal not supporting DisableIntrinsic.
 /**
  * @test
  * @summary Verifies that when the VM event is sent, sampled events are also collected.
  * @build Frame HeapMonitor
  * @compile HeapMonitorVMEventsTest.java
+ * @requires !vm.graal.enabled
  * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions
  *                          -XX:DisableIntrinsic=_clone
  *                          -agentlib:HeapMonitorTest MyPackage.HeapMonitorVMEventsTest
--- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c	Sat Jul 14 02:14:54 2018 +0200
@@ -208,6 +208,7 @@
                                      ObjectTrace* trace,
                                      ExpectedContentFrame *expected,
                                      size_t expected_count,
+                                     jboolean check_lines,
                                      int print_out_comparisons) {
   jvmtiFrameInfo* frames;
   size_t i;
@@ -224,6 +225,7 @@
     char *name = NULL, *signature = NULL, *file_name = NULL;
     jclass declaring_class;
     int line_number;
+    jboolean differ;
     jvmtiError err;
 
     if (bci < 0 && expected[i].line_number != -1) {
@@ -258,23 +260,21 @@
       return FALSE;
     }
 
+    differ = (strcmp(name, expected[i].name) ||
+              strcmp(signature, expected[i].signature) ||
+              strcmp(file_name, expected[i].file_name) ||
+              (check_lines && line_number != expected[i].line_number));
+
     if (print_out_comparisons) {
-      fprintf(stderr, "\tComparing:\n");
+      fprintf(stderr, "\tComparing: (check_lines: %d)\n", check_lines);
       fprintf(stderr, "\t\tNames: %s and %s\n", name, expected[i].name);
       fprintf(stderr, "\t\tSignatures: %s and %s\n", signature, expected[i].signature);
       fprintf(stderr, "\t\tFile name: %s and %s\n", file_name, expected[i].file_name);
       fprintf(stderr, "\t\tLines: %d and %d\n", line_number, expected[i].line_number);
-      fprintf(stderr, "\t\tResult is %d\n",
-              (strcmp(name, expected[i].name) ||
-               strcmp(signature, expected[i].signature) ||
-               strcmp(file_name, expected[i].file_name) ||
-               line_number != expected[i].line_number));
+      fprintf(stderr, "\t\tResult is %d\n", differ);
     }
 
-    if (strcmp(name, expected[i].name) ||
-        strcmp(signature, expected[i].signature) ||
-        strcmp(file_name, expected[i].file_name) ||
-        line_number != expected[i].line_number) {
+    if (differ) {
       return FALSE;
     }
   }
@@ -388,14 +388,15 @@
 static jboolean event_storage_contains(JNIEnv* env,
                                        EventStorage* storage,
                                        ExpectedContentFrame* frames,
-                                       size_t size) {
+                                       size_t size,
+                                       jboolean check_lines) {
   int i;
   event_storage_lock(storage);
   fprintf(stderr, "Checking storage count %d\n", storage->live_object_count);
   for (i = 0; i < storage->live_object_count; i++) {
     ObjectTrace* trace = storage->live_objects[i];
 
-    if (check_sample_content(env, trace, frames, size, PRINT_OUT)) {
+    if (check_sample_content(env, trace, frames, size, check_lines, PRINT_OUT)) {
       event_storage_unlock(storage);
       return TRUE;
     }
@@ -407,7 +408,8 @@
 static jboolean event_storage_garbage_contains(JNIEnv* env,
                                                EventStorage* storage,
                                                ExpectedContentFrame* frames,
-                                               size_t size) {
+                                               size_t size,
+                                               jboolean check_lines) {
   int i;
   event_storage_lock(storage);
   fprintf(stderr, "Checking garbage storage count %d\n",
@@ -419,7 +421,7 @@
       continue;
     }
 
-    if (check_sample_content(env, trace, frames, size, PRINT_OUT)) {
+    if (check_sample_content(env, trace, frames, size, check_lines, PRINT_OUT)) {
       event_storage_unlock(storage);
       return TRUE;
     }
@@ -876,7 +878,9 @@
 }
 
 JNIEXPORT jboolean JNICALL
-Java_MyPackage_HeapMonitor_obtainedEvents(JNIEnv* env, jclass cls, jobjectArray frames) {
+Java_MyPackage_HeapMonitor_obtainedEvents(JNIEnv* env, jclass cls,
+                                          jobjectArray frames,
+                                          jboolean check_lines) {
   jboolean result;
   jsize size = (*env)->GetArrayLength(env, frames);
   ExpectedContentFrame *native_frames = malloc(size * sizeof(*native_frames));
@@ -886,14 +890,17 @@
   }
 
   fill_native_frames(env, frames, native_frames, size);
-  result = event_storage_contains(env, &global_event_storage, native_frames, size);
+  result = event_storage_contains(env, &global_event_storage, native_frames,
+                                  size, check_lines);
 
   free(native_frames), native_frames = NULL;
   return result;
 }
 
 JNIEXPORT jboolean JNICALL
-Java_MyPackage_HeapMonitor_garbageContains(JNIEnv* env, jclass cls, jobjectArray frames) {
+Java_MyPackage_HeapMonitor_garbageContains(JNIEnv* env, jclass cls,
+                                           jobjectArray frames,
+                                           jboolean check_lines) {
   jboolean result;
   jsize size = (*env)->GetArrayLength(env, frames);
   ExpectedContentFrame *native_frames = malloc(size * sizeof(*native_frames));
@@ -903,7 +910,8 @@
   }
 
   fill_native_frames(env, frames, native_frames, size);
-  result = event_storage_garbage_contains(env, &global_event_storage, native_frames, size);
+  result = event_storage_garbage_contains(env, &global_event_storage,
+                                          native_frames, size, check_lines);
 
   free(native_frames), native_frames = NULL;
   return result;
--- a/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -32,10 +32,13 @@
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @library ../share
- * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies
+                     -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02
  */
 import utils.*;
 
+// This test produces more than 90_000 classes until it eats up ~70% of the 128M meta space.
+// We turn off VerifyDependencies because it slows down the test considerably in debug builds.
 public class GcCauseTest02 {
 
     public static void main(String[] args) throws Exception {
--- a/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -32,10 +32,13 @@
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @library ../share
- * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies
+                     -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02
  */
 import utils.*;
 
+// This test produces more than 90_000 classes until it eats up ~70% of the 128M meta space.
+// We turn off VerifyDependencies because it slows down the test considerably in debug builds.
 public class GcTest02 {
 
     public static void main(String[] args) throws Exception {
--- a/test/jdk/ProblemList.txt	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/ProblemList.txt	Sat Jul 14 02:14:54 2018 +0200
@@ -520,6 +520,7 @@
 java/lang/management/MemoryMXBean/PendingAllGC.sh               8158837 generic-all
 
 java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java    8081652 generic-all
+java/lang/management/ThreadMXBean/AllThreadIds.java             8131745 generic-all
 
 ############################################################################
 
--- a/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java	Sat Jul 14 02:14:54 2018 +0200
@@ -24,7 +24,7 @@
 /*
   @test
   @key headful
-  @bug 4980161 7158623
+  @bug 4980161 7158623 8204860
   @summary Setting focusable window state to false makes the maximized frame resizable
   @compile UnfocusableMaximizedFrameResizablity.java
   @run main UnfocusableMaximizedFrameResizablity
@@ -36,29 +36,84 @@
 import java.awt.AWTException;
 import java.awt.event.InputEvent;
 import java.awt.Robot;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
 
 public class UnfocusableMaximizedFrameResizablity {
 
     private static Frame frame;
+    private static JFrame jframe;
     private static Robot robot;
     private static boolean isProgInterruption = false;
     private static Thread mainThread = null;
     private static int sleepTime = 300000;
 
-    private static void createAndShowFrame() {
+    private static void createAndShowFrame() throws Exception {
 
         //The MAXIMIZED_BOTH state is not supported by the toolkit. Nothing to test.
         if (!Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) {
             return;
         }
 
-        frame = new Frame("Unfocusable frame");
+        //Case 1: Setting frame resizable to true followed by focusable to false
+        frame = createFrame("Resizable Unfocusable frame");
+        frame.setResizable(true);
+        frame.setFocusableWindowState(false);
+        tryToResizeFrame(frame);
+
+        //Case 2: Setting frame focusable to false followed by resizable to true
+        frame = createFrame("Unfocusable Resizable frame");
+        frame.setFocusableWindowState(false);
+        frame.setResizable(true);
+        tryToResizeFrame(frame);
+
+        //Case 3: Testing JFrame fullscreen behaviour only on Mac OS
+        if (System.getProperty("os.name").toLowerCase().startsWith("mac")) {
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                Override
+                public void run() {
+                    jframe = createJFrame("Unfocusable Resizable JFrame");
+                    jframe.setFocusableWindowState(false);
+                    jframe.setResizable(true);
+                    Object prop1 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable");
+                    jframe.setVisible(false);
+                    jframe.setVisible(true);
+                    Object prop2 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable");
+
+                    if((prop1 != null && prop2 != null) && (!prop1.equals(prop2))) {
+                        jframe.dispose();
+                        cleanup();
+                        throw new RuntimeException("Non-focusable resizable JFrame is fullscreenable!!");
+                    }
+                }
+            });
+        }
+
+        cleanup();
+    }
+
+    private static JFrame createJFrame(String title) {
+        JFrame jframe = new JFrame(title);
+        jframe.setMaximizedBounds(new Rectangle(0, 0, 300, 300));
+        jframe.setSize(200, 200);
+        jframe.setVisible(true);
+        jframe.setExtendedState(Frame.MAXIMIZED_BOTH);
+
+        return jframe;
+    }
+
+    private static Frame createFrame(String title) {
+        Frame frame = new Frame(title);
         frame.setMaximizedBounds(new Rectangle(0, 0, 300, 300));
         frame.setSize(200, 200);
         frame.setVisible(true);
         frame.setExtendedState(Frame.MAXIMIZED_BOTH);
-        frame.setFocusableWindowState(false);
 
+        return frame;
+    }
+
+    private static void tryToResizeFrame(Frame frame) {
         try {
             robot = new Robot();
         } catch (AWTException e) {
@@ -89,16 +144,16 @@
             cleanup();
             throw new RuntimeException("The maximized unfocusable frame can be resized.");
         }
-        cleanup();
+
+        frame.dispose();
     }
 
     private static void cleanup() {
-        frame.dispose();
         isProgInterruption = true;
         mainThread.interrupt();
     }
 
-    public static void main(String args[]) throws InterruptedException {
+    public static void main(String args[]) throws Exception {
 
         mainThread = Thread.currentThread();
 
--- a/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 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
@@ -24,6 +24,7 @@
  */
 
 /* @test
+ * @bug 8150782 8207027
  * @compile TestAccessClass.java TestCls.java
  * @run testng/othervm -ea -esa test.java.lang.invoke.t8150782.TestAccessClass
  */
@@ -54,11 +55,17 @@
     }
 
     @Test
-    public void returnsSameClass() throws IllegalAccessException, ClassNotFoundException {
+    public void returnsSameClassInSamePackage() throws IllegalAccessException, ClassNotFoundException {
         Class<?> aClass = lookup().accessClass(Class1.class);
         assertEquals(Class1.class, aClass);
     }
 
+    @Test
+    public void returnsSameArrayClassInSamePackage() throws IllegalAccessException, ClassNotFoundException {
+        Class<?> aClass = lookup().accessClass(Class1[].class);
+        assertEquals(Class1[].class, aClass);
+    }
+
     @DataProvider
     Object[][] illegalAccessAccess() {
         return new Object[][] {
--- a/test/jdk/java/lang/invoke/t8150782/TestFindClass.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/java/lang/invoke/t8150782/TestFindClass.java	Sat Jul 14 02:14:54 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 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
@@ -24,6 +24,7 @@
  */
 
 /* @test
+ * @bug 8150782 8207027
  * @compile TestFindClass.java TestCls.java
  * @run testng/othervm -ea -esa test.java.lang.invoke.t8150782.TestFindClass
  */
@@ -56,11 +57,17 @@
     }
 
     @Test
-    public void returnsRequestedClass() throws IllegalAccessException, ClassNotFoundException {
+    public void returnsRequestedClassInSamePackage() throws IllegalAccessException, ClassNotFoundException {
         Class<?> aClass = lookup().findClass(PACKAGE_PREFIX + "TestFindClass$Class1");
         assertEquals(Class1.class, aClass);
     }
 
+    @Test
+    public void returnsRequestedArrayClassInSamePackage() throws IllegalAccessException, ClassNotFoundException {
+        Class<?> aClass = lookup().findClass("[L" + PACKAGE_PREFIX + "TestFindClass$Class1;");
+        assertEquals(Class1[].class, aClass);
+    }
+
     @Test(expectedExceptions = {ClassNotFoundException.class})
     public void classNotFoundExceptionTest() throws IllegalAccessException, ClassNotFoundException {
         lookup().findClass(PACKAGE_PREFIX + "TestFindClass$NonExistent");
--- a/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java	Sat Jul 14 02:14:54 2018 +0200
@@ -28,6 +28,7 @@
  */
 
 import java.io.IOException;
+import java.nio.channels.ClosedSelectorException;
 import java.nio.channels.Pipe;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
@@ -44,9 +45,14 @@
             @Override
             public Void call() throws IOException {
                 for (;;) {
-                    sel.select();
+                    try {
+                        sel.select();
+                    } catch (ClosedSelectorException ignore) {
+                        return null;
+                    }
                     if (sel.isOpen()) {
                         barrier.arriveAndAwaitAdvance();
+                        System.out.println("selectLoop advanced ...");
                     } else {
                         // closed
                         return null;
@@ -107,3 +113,4 @@
 
     }
 }
+
--- a/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java	Sat Jul 14 02:14:54 2018 +0200
@@ -49,7 +49,7 @@
 
 /*
  * @test
- * @bug 8081022 8151876 8166875 8189784
+ * @bug 8081022 8151876 8166875 8189784 8206980
  * @key randomness
  */
 
@@ -156,12 +156,15 @@
             {"America/Chicago",  "CST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
             {"Asia/Taipei",      "CST",                   preferred, Locale.ENGLISH, TextStyle.SHORT},
             {"Australia/South",  "ACST",                  preferred_s, Locale.ENGLISH, TextStyle.SHORT},
-            {"America/Chicago",  "CDT",                   none,        Locale.ENGLISH, TextStyle.SHORT},
+            {"America/Chicago",  "CDT",                   none,      Locale.ENGLISH, TextStyle.SHORT},
             {"Asia/Shanghai",    "CDT",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
-            {"America/Juneau",   "AKST",                  none,        Locale.ENGLISH, TextStyle.SHORT},
-            {"America/Juneau",   "AKDT",                  none,        Locale.ENGLISH, TextStyle.SHORT},
-            {"Pacific/Honolulu", "HST",                   none,        Locale.ENGLISH, TextStyle.SHORT},
-            {"America/Halifax",  "AST",                   none,        Locale.ENGLISH, TextStyle.SHORT},
+            {"America/Juneau",   "AKST",                  none,      Locale.ENGLISH, TextStyle.SHORT},
+            {"America/Juneau",   "AKDT",                  none,      Locale.ENGLISH, TextStyle.SHORT},
+            {"Pacific/Honolulu", "HST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
+            {"America/Halifax",  "AST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
+            {"Z",                "Z",                     none,      Locale.ENGLISH, TextStyle.SHORT},
+            {"Z",                "Z",                     none,      Locale.US,      TextStyle.SHORT},
+            {"Z",                "Z",                     none,      Locale.CANADA,  TextStyle.SHORT},
        };
     }
 
--- a/test/jdk/java/util/Calendar/JapaneseEraNameTest.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/java/util/Calendar/JapaneseEraNameTest.java	Sat Jul 14 02:14:54 2018 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8202088
+ * @bug 8202088 8207152
  * @summary Test the localized Japanese new era name (May 1st. 2019-)
  *      is retrieved no matter CLDR provider contains the name or not.
  * @modules jdk.localedata
@@ -51,7 +51,7 @@
     Object[][] names() {
         return new Object[][] {
             // type,    locale,  name
-            { LONG,     JAPAN,   "\u65b0\u5143\u53f7" }, // NewEra
+            { LONG,     JAPAN,   "\u5143\u53f7" }, // NewEra
             { LONG,     US,      "NewEra" },
             { SHORT,    JAPAN,   "N" },
             { SHORT,    US,      "N" },
--- a/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java	Sat Jul 14 02:14:54 2018 +0200
@@ -24,7 +24,7 @@
 /**
  * @test
  * @key headful
- * @bug 8195095
+ * @bug 8195095 8206238
  * @summary Tests if Images are scaled correctly in JEditorPane.
  * @run main ImageViewTest
  */
@@ -40,22 +40,16 @@
 
 public class ImageViewTest {
 
-    private static final int WIDTH = 200;
-    private static final int HEIGHT = 200;
     private static JFrame f;
 
-    private static JEditorPane editorPane1;
-    private static JEditorPane editorPane2;
-    private static JEditorPane editorPane3;
-    private static JEditorPane editorPane4;
-
-    private static void test(Robot r, JEditorPane editorPane)  throws Exception {
+    private static void test(Robot r, JEditorPane editorPane,
+                            final int WIDTH, final int HEIGHT )  throws Exception {
 
         SwingUtilities.invokeAndWait(() -> {
             f = new JFrame();
             editorPane.setEditable(false);
             f.add(editorPane);
-            f.setSize(220,240);
+            f.setSize(WIDTH + 20, HEIGHT + 40);
             f.setLocationRelativeTo(null);
 
             f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
@@ -109,34 +103,78 @@
 
         Robot r = new Robot();
 
+        final JEditorPane[] editorPanes = new JEditorPane[11];
+
         SwingUtilities.invokeAndWait(() -> {
-            editorPane1 = new JEditorPane("text/html",
+            editorPanes[0] = new JEditorPane("text/html",
                     "<img height=\"200\" src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
 
-            editorPane2 = new JEditorPane("text/html",
+            editorPanes[1] = new JEditorPane("text/html",
                     "<img width=\"200\" src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
 
-            editorPane3 = new JEditorPane("text/html",
+            editorPanes[2] = new JEditorPane("text/html",
                     "<img width=\"200\" height=\"200\" src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
 
-            editorPane4 = new JEditorPane("text/html",
+            editorPanes[3] = new JEditorPane("text/html",
                     "<img src=\"file:///" + ABSOLUTE_FILE_PATH + "\"");
 
+            editorPanes[4] = new JEditorPane("text/html",
+                    "<img width=\"100\" src =\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+            editorPanes[5] = new JEditorPane("text/html",
+                    "<img height=\"100\" src =\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+            editorPanes[6] = new JEditorPane("text/html",
+                    "<img width=\"100\" height=\"100\" src =\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+            editorPanes[7] = new JEditorPane("text/html",
+                    "<img width=\"50\" src =\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+            editorPanes[8] = new JEditorPane("text/html",
+                    "<img height=\"50\" src =\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+            editorPanes[9] = new JEditorPane("text/html",
+                    "<img width=\"300\" src =\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
+            editorPanes[10] = new JEditorPane("text/html",
+                    "<img height=\"300\" src =\"file:///" + ABSOLUTE_FILE_PATH + "\"");
+
         });
 
         r.waitForIdle();
 
         System.out.println("Test with only height set to 200");
-        test(r, editorPane1);
+        test(r, editorPanes[0], 200, 200);
 
         System.out.println("Test with only width set to 200");
-        test(r, editorPane2);
+        test(r, editorPanes[1], 200, 200);
 
-        System.out.println("Test with none of them set");
-        test(r, editorPane3);
+        System.out.println("Test with both of them set");
+        test(r, editorPanes[2], 200, 200);
 
-        System.out.println("Test with both of them set to 200");
-        test(r, editorPane4);
+        System.out.println("Test with none of them set to 200");
+        test(r, editorPanes[3], 200, 200);
+
+        System.out.println("Test with only width set to 100");
+        test(r, editorPanes[4], 100, 100);
+
+        System.out.println("Test with only height set to 100");
+        test(r, editorPanes[5], 100, 100);
+
+        System.out.println("Test with both width and height set to 100");
+        test(r, editorPanes[6], 100, 100);
+
+        System.out.println("Test with only width set to 50");
+        test(r, editorPanes[7], 50, 50);
+
+        System.out.println("Test with only height set to 50");
+        test(r, editorPanes[8], 50, 50);
+
+        System.out.println("Test with only width set to 300");
+        test(r, editorPanes[9], 300, 300);
+
+        System.out.println("Test with only height set to 300");
+        test(r, editorPanes[10], 300, 300);
 
         System.out.println("Test Passed.");
     }
--- a/test/jdk/lib/security/cacerts/VerifyCACerts.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/lib/security/cacerts/VerifyCACerts.java	Sat Jul 14 02:14:54 2018 +0200
@@ -24,7 +24,7 @@
 
 /**
  * @test
- * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774
+ * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779
  * @requires java.runtime.name ~= "OpenJDK.*"
  * @summary Check root CA entries in cacerts file
  */
@@ -42,7 +42,7 @@
             + File.separator + "security" + File.separator + "cacerts";
 
     // The numbers of certs now.
-    private static final int COUNT = 83;
+    private static final int COUNT = 90;
 
     // map of cert alias to SHA-256 fingerprint
     private static final Map<String, String> FINGERPRINT_MAP
@@ -214,6 +214,20 @@
                     "03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7");
             put("affirmtrustpremiumeccca [jdk]",
                     "BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23");
+            put("deutschetelekomrootca2 [jdk]",
+                    "B6:19:1A:50:D0:C3:97:7F:7D:A9:9B:CD:AA:C8:6A:22:7D:AE:B9:67:9E:C7:0B:A3:B0:C9:D9:22:71:C1:70:D3");
+            put("ttelesecglobalrootclass3ca [jdk]",
+                    "FD:73:DA:D3:1C:64:4F:F1:B4:3B:EF:0C:CD:DA:96:71:0B:9C:D9:87:5E:CA:7E:31:70:7A:F3:E9:6D:52:2B:BD");
+            put("ttelesecglobalrootclass2ca [jdk]",
+                    "91:E2:F5:78:8D:58:10:EB:A7:BA:58:73:7D:E1:54:8A:8E:CA:CD:01:45:98:BC:0B:14:3E:04:1B:17:05:25:52");
+            put("starfieldservicesrootg2ca [jdk]",
+                    "56:8D:69:05:A2:C8:87:08:A4:B3:02:51:90:ED:CF:ED:B1:97:4A:60:6A:13:C6:E5:29:0F:CB:2A:E6:3E:DA:B5");
+            put("globalsignca [jdk]",
+                    "EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99");
+            put("globalsignr3ca [jdk]",
+                    "CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B");
+            put("globalsigneccrootcar5 [jdk]",
+                    "17:9F:BC:14:8A:3D:D0:0F:D2:4E:A1:34:58:CC:43:BF:A7:F5:9C:81:82:D7:83:A5:13:F6:EB:EC:10:0C:89:24");
         }
     };
 
--- a/test/jdk/sun/security/ec/xec/TestXDH.java	Thu Jul 12 15:02:41 2018 -0700
+++ b/test/jdk/sun/security/ec/xec/TestXDH.java	Sat Jul 14 02:14:54 2018 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8171277
+ * @bug 8171277 8206915
  * @summary Test XDH key agreement
  * @library /test/lib
  * @build jdk.test.lib.Convert
@@ -66,15 +66,17 @@
         throws Exception {
 
         KeyPairGenerator kpg = KeyPairGenerator.getInstance(name);
+        AlgorithmParameterSpec paramSpec = null;
         if (param instanceof Integer) {
             kpg.initialize((Integer) param);
         } else if (param instanceof String) {
-            kpg.initialize(new NamedParameterSpec((String) param));
+            paramSpec = new NamedParameterSpec((String) param);
+            kpg.initialize(paramSpec);
         }
         KeyPair kp = kpg.generateKeyPair();
 
         KeyAgreement ka = KeyAgreement.getInstance(name);
-        ka.init(kp.getPrivate());
+        ka.init(kp.getPrivate(), paramSpec);
         ka.doPhase(kp.getPublic(), true);
 
         byte[] secret = ka.generateSecret();
@@ -96,6 +98,16 @@
             throw new RuntimeException("Arrays not equal");
         }
 
+        // make sure generateSecret() resets the state to after init()
+        try {
+            ka.generateSecret();
+            throw new RuntimeException("generateSecret does not reset state");
+        } catch (IllegalStateException ex) {
+            // do nothing---this is expected
+        }
+        ka.doPhase(pubKey, true);
+        ka.generateSecret();
+
         // test with XDH key specs
         XECPublicKeySpec xdhPublic =
             kf.getKeySpec(kp.getPublic(), XECPublicKeySpec.class);