Merge
authorthartmann
Fri, 19 May 2017 06:50:58 +0000
changeset 46483 94ffd2984ec9
parent 46482 10dde7fbed26 (current diff)
parent 46481 a8e8bb9d1603 (diff)
child 46484 688e3a206b86
Merge
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Fri May 19 06:50:58 2017 +0000
@@ -459,9 +459,9 @@
     native long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
 
     /**
-     * Determines if {@code method} should not be inlined or compiled.
+     * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
      */
-    native void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
+    native void setNotInlineableOrCompileable(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Invalidates the profiling information for {@code method} and (re)initializes it such that
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java	Fri May 19 06:50:58 2017 +0000
@@ -57,9 +57,9 @@
     boolean hasReservedStackAccess();
 
     /**
-     * Manually adds a DontInline annotation to this method.
+     * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
      */
-    void setNotInlineable();
+    void setNotInlineableOrCompileable();
 
     /**
      * Returns true if this method is one of the special methods that is ignored by security stack
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java	Fri May 19 06:50:58 2017 +0000
@@ -318,10 +318,10 @@
     }
 
     /**
-     * Manually adds a DontInline annotation to this method.
+     * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
      */
-    public void setNotInlineable() {
-        compilerToVM().doNotInlineOrCompile(this);
+    public void setNotInlineableOrCompileable() {
+        compilerToVM().setNotInlineableOrCompileable(this);
     }
 
     /**
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Fri May 19 06:50:58 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -5250,12 +5250,30 @@
 int os::fork_and_exec(char* cmd) {
   STARTUPINFO si;
   PROCESS_INFORMATION pi;
-
+  DWORD exit_code;
+
+  char * cmd_string;
+  char * cmd_prefix = "cmd /C ";
+  size_t len = strlen(cmd) + strlen(cmd_prefix) + 1;
+  cmd_string = NEW_C_HEAP_ARRAY_RETURN_NULL(char, len, mtInternal);
+  if (cmd_string == NULL) {
+    return -1;
+  }
+  cmd_string[0] = '\0';
+  strcat(cmd_string, cmd_prefix);
+  strcat(cmd_string, cmd);
+
+  // now replace all '\n' with '&'
+  char * substring = cmd_string;
+  while ((substring = strchr(substring, '\n')) != NULL) {
+    substring[0] = '&';
+    substring++;
+  }
   memset(&si, 0, sizeof(si));
   si.cb = sizeof(si);
   memset(&pi, 0, sizeof(pi));
   BOOL rslt = CreateProcess(NULL,   // executable name - use command line
-                            cmd,    // command line
+                            cmd_string,    // command line
                             NULL,   // process security attribute
                             NULL,   // thread security attribute
                             TRUE,   // inherits system handles
@@ -5269,17 +5287,17 @@
     // Wait until child process exits.
     WaitForSingleObject(pi.hProcess, INFINITE);
 
-    DWORD exit_code;
     GetExitCodeProcess(pi.hProcess, &exit_code);
 
     // Close process and thread handles.
     CloseHandle(pi.hProcess);
     CloseHandle(pi.hThread);
-
-    return (int)exit_code;
   } else {
-    return -1;
-  }
+    exit_code = -1;
+  }
+
+  FREE_C_HEAP_ARRAY(char, cmd_string);
+  return (int)exit_code;
 }
 
 bool os::find(address addr, outputStream* st) {
--- a/hotspot/src/share/vm/adlc/filebuff.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/adlc/filebuff.cpp	Fri May 19 06:50:58 2017 +0000
@@ -67,7 +67,7 @@
 //------------------------------~FileBuff--------------------------------------
 // Nuke the FileBuff
 FileBuff::~FileBuff() {
-  delete _bigbuf;
+  delete[] _bigbuf;
 }
 
 //------------------------------get_line----------------------------------------
--- a/hotspot/src/share/vm/classfile/dictionary.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/classfile/dictionary.cpp	Fri May 19 06:50:58 2017 +0000
@@ -337,15 +337,12 @@
 DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
                                        Symbol* class_name,
                                        ClassLoaderData* loader_data) {
-  DEBUG_ONLY(_lookup_count++);
   for (DictionaryEntry* entry = bucket(index);
                         entry != NULL;
                         entry = entry->next()) {
     if (entry->hash() == hash && entry->equals(class_name, loader_data)) {
-      DEBUG_ONLY(bucket_count_hit(index));
       return entry;
     }
-    DEBUG_ONLY(_lookup_length++);
   }
   return NULL;
 }
@@ -548,114 +545,24 @@
   tty->cr();
 }
 
-#ifdef ASSERT
-void Dictionary::printPerformanceInfoDetails() {
-  if (log_is_enabled(Info, hashtables)) {
-    ResourceMark rm;
-
-    log_info(hashtables)(" ");
-    log_info(hashtables)("Java system dictionary (table_size=%d, classes=%d)",
-                            table_size(), number_of_entries());
-    log_info(hashtables)("1st number: the bucket index");
-    log_info(hashtables)("2nd number: the hit percentage for this bucket");
-    log_info(hashtables)("3rd number: the entry's index within this bucket");
-    log_info(hashtables)("4th number: the hash index of this entry");
-    log_info(hashtables)(" ");
-
-    // find top buckets with highest lookup count
-#define TOP_COUNT 16
-    int topItemsIndicies[TOP_COUNT];
-    for (int i = 0; i < TOP_COUNT; i++) {
-      topItemsIndicies[i] = i;
-    }
-    double total = 0.0;
-    for (int i = 0; i < table_size(); i++) {
-      // find the total count number, so later on we can
-      // express bucket lookup count as a percentage of all lookups
-      unsigned value = bucket_hits(i);
-      total += value;
-
-      // find the top entry with min value
-      int min_index = 0;
-      unsigned min_value = bucket_hits(topItemsIndicies[min_index]);
-      for (int j = 1; j < TOP_COUNT; j++) {
-        unsigned top_value = bucket_hits(topItemsIndicies[j]);
-        if (top_value < min_value) {
-          min_value = top_value;
-          min_index = j;
-        }
-      }
-      // if the bucket loookup value is bigger than the top buckets min
-      // move that bucket index into the top list
-      if (value > min_value) {
-        topItemsIndicies[min_index] = i;
-      }
-    }
-
-    for (int index = 0; index < table_size(); index++) {
-      double percentage = 100.0 * (double)bucket_hits(index)/total;
-      int chain = 0;
-      for (DictionaryEntry* probe = bucket(index);
-           probe != NULL;
-           probe = probe->next()) {
-        Klass* e = probe->klass();
-        ClassLoaderData* loader_data =  probe->loader_data();
-        bool is_defining_class =
-        (loader_data == e->class_loader_data());
-        log_info(hashtables)("%4d: %5.2f%%: %3d: %10u: %s, loader %s",
-                                index, percentage, chain, probe->hash(), e->external_name(),
-                                (loader_data != NULL) ? loader_data->loader_name() : "NULL");
-
-        chain++;
-      }
-      if (chain == 0) {
-        log_info(hashtables)("%4d:", index+1);
-      }
-    }
-    log_info(hashtables)(" ");
-
-    // print out the TOP_COUNT of buckets with highest lookup count (unsorted)
-    log_info(hashtables)("Top %d buckets:", TOP_COUNT);
-    for (int i = 0; i < TOP_COUNT; i++) {
-      log_info(hashtables)("%4d: hits %5.2f%%",
-                              topItemsIndicies[i],
-                                100.0*(double)bucket_hits(topItemsIndicies[i])/total);
-    }
-  }
+void DictionaryEntry::verify() {
+  Klass* e = klass();
+  ClassLoaderData* cld = loader_data();
+  guarantee(e->is_instance_klass(),
+                          "Verify of system dictionary failed");
+  // class loader must be present;  a null class loader is the
+  // boostrap loader
+  guarantee(cld != NULL || DumpSharedSpaces ||
+            cld->class_loader() == NULL ||
+            cld->class_loader()->is_instance(),
+            "checking type of class_loader");
+  e->verify();
+  verify_protection_domain_set();
 }
-#endif // ASSERT
 
 void Dictionary::verify() {
   guarantee(number_of_entries() >= 0, "Verify of system dictionary failed");
-
-  int element_count = 0;
-  for (int index = 0; index < table_size(); index++) {
-    for (DictionaryEntry* probe = bucket(index);
-                          probe != NULL;
-                          probe = probe->next()) {
-      Klass* e = probe->klass();
-      ClassLoaderData* loader_data = probe->loader_data();
-      guarantee(e->is_instance_klass(),
-                              "Verify of system dictionary failed");
-      // class loader must be present;  a null class loader is the
-      // boostrap loader
-      guarantee(loader_data != NULL || DumpSharedSpaces ||
-                loader_data->class_loader() == NULL ||
-                loader_data->class_loader()->is_instance(),
-                "checking type of class_loader");
-      e->verify();
-      probe->verify_protection_domain_set();
-      element_count++;
-    }
-  }
-  guarantee(number_of_entries() == element_count,
-            "Verify of system dictionary failed");
-#ifdef ASSERT
-  if (!verify_lookup_length((double)number_of_entries() / table_size(), "System Dictionary")) {
-    this->printPerformanceInfoDetails();
-  }
-#endif // ASSERT
-
+  verify_table<DictionaryEntry>("System Dictionary");
   _pd_cache_table->verify();
 }
 
--- a/hotspot/src/share/vm/classfile/dictionary.hpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/classfile/dictionary.hpp	Fri May 19 06:50:58 2017 +0000
@@ -211,6 +211,8 @@
     }
     st->print_cr("pd set count = #%d", count);
   }
+
+  void verify();
 };
 
 // Entry in a SymbolPropertyTable, mapping a single Symbol*
--- a/hotspot/src/share/vm/classfile/moduleEntry.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/classfile/moduleEntry.cpp	Fri May 19 06:50:58 2017 +0000
@@ -510,18 +510,7 @@
 }
 
 void ModuleEntryTable::verify() {
-  int element_count = 0;
-  for (int i = 0; i < table_size(); i++) {
-    for (ModuleEntry* probe = bucket(i);
-                              probe != NULL;
-                              probe = probe->next()) {
-      probe->verify();
-      element_count++;
-    }
-  }
-  guarantee(number_of_entries() == element_count,
-            "Verify of Module Entry Table failed");
-  DEBUG_ONLY(verify_lookup_length((double)number_of_entries() / table_size(), "Module Entry Table"));
+  verify_table<ModuleEntry>("Module Entry Table");
 }
 
 void ModuleEntry::verify() {
--- a/hotspot/src/share/vm/classfile/packageEntry.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/classfile/packageEntry.cpp	Fri May 19 06:50:58 2017 +0000
@@ -350,18 +350,7 @@
 }
 
 void PackageEntryTable::verify() {
-  int element_count = 0;
-  for (int index = 0; index < table_size(); index++) {
-    for (PackageEntry* probe = bucket(index);
-                              probe != NULL;
-                              probe = probe->next()) {
-      probe->verify();
-      element_count++;
-    }
-  }
-  guarantee(number_of_entries() == element_count,
-            "Verify of Package Entry Table failed");
-  DEBUG_ONLY(verify_lookup_length((double)number_of_entries() / table_size(), "Package Entry Table"));
+  verify_table<PackageEntry>("Package Entry Table");
 }
 
 void PackageEntry::verify() {
--- a/hotspot/src/share/vm/classfile/protectionDomainCache.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/classfile/protectionDomainCache.cpp	Fri May 19 06:50:58 2017 +0000
@@ -97,18 +97,7 @@
 #endif
 
 void ProtectionDomainCacheTable::verify() {
-  int element_count = 0;
-  for (int index = 0; index < table_size(); index++) {
-    for (ProtectionDomainCacheEntry* probe = bucket(index);
-                                     probe != NULL;
-                                     probe = probe->next()) {
-      probe->verify();
-      element_count++;
-    }
-  }
-  guarantee(number_of_entries() == element_count,
-            "Verify of protection domain cache table failed");
-  DEBUG_ONLY(verify_lookup_length((double)number_of_entries() / table_size(), "Domain Cache Table"));
+  verify_table<ProtectionDomainCacheEntry>("Protection Domain Table");
 }
 
 void ProtectionDomainCacheEntry::verify() {
--- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Fri May 19 06:50:58 2017 +0000
@@ -630,7 +630,7 @@
     if (nm != NULL && env == NULL) {
       DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, compiler);
       bool printnmethods = directive->PrintAssemblyOption || directive->PrintNMethodsOption;
-      if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) {
+      if (!printnmethods && (PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers)) {
         nm->print_nmethod(printnmethods);
       }
       DirectivesStack::release(directive);
--- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Fri May 19 06:50:58 2017 +0000
@@ -1003,7 +1003,7 @@
   return -1;
 C2V_END
 
-C2V_VMENTRY(void, doNotInlineOrCompile,(JNIEnv *, jobject,  jobject jvmci_method))
+C2V_VMENTRY(void, setNotInlineableOrCompileable,(JNIEnv *, jobject,  jobject jvmci_method))
   methodHandle method = CompilerToVM::asMethod(jvmci_method);
   method->set_not_c1_compilable();
   method->set_not_c2_compilable();
@@ -1770,7 +1770,7 @@
   {CC "getImplementor",                               CC "(" HS_RESOLVED_KLASS ")" HS_RESOLVED_KLASS,                                       FN_PTR(getImplementor)},
   {CC "getStackTraceElement",                         CC "(" HS_RESOLVED_METHOD "I)" STACK_TRACE_ELEMENT,                                   FN_PTR(getStackTraceElement)},
   {CC "methodIsIgnoredBySecurityStackWalk",           CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(methodIsIgnoredBySecurityStackWalk)},
-  {CC "doNotInlineOrCompile",                         CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(doNotInlineOrCompile)},
+  {CC "setNotInlineableOrCompileable",                CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(setNotInlineableOrCompileable)},
   {CC "isCompilable",                                 CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(isCompilable)},
   {CC "hasNeverInlineDirective",                      CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(hasNeverInlineDirective)},
   {CC "shouldInlineMethod",                           CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(shouldInlineMethod)},
--- a/hotspot/src/share/vm/runtime/handles.hpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/runtime/handles.hpp	Fri May 19 06:50:58 2017 +0000
@@ -126,6 +126,8 @@
 
 // Metadata Handles.  Unlike oop Handles these are needed to prevent metadata
 // from being reclaimed by RedefineClasses.
+// Metadata Handles should be passed around as const references to avoid copy construction
+// and destruction for parameters.
 
 // Specific Handles for different oop types
 #define DEF_METADATA_HANDLE(name, type)          \
--- a/hotspot/src/share/vm/utilities/hashtable.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/utilities/hashtable.cpp	Fri May 19 06:50:58 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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,7 +24,11 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
+#include "classfile/dictionary.hpp"
 #include "classfile/javaClasses.inline.hpp"
+#include "classfile/moduleEntry.hpp"
+#include "classfile/packageEntry.hpp"
+#include "classfile/protectionDomainCache.hpp"
 #include "classfile/stringTable.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
@@ -276,14 +280,22 @@
 }
 
 
-template <MEMFLAGS F> void BasicHashtable<F>::verify() {
-  int count = 0;
-  for (int i = 0; i < table_size(); i++) {
-    for (BasicHashtableEntry<F>* p = bucket(i); p != NULL; p = p->next()) {
-      ++count;
+template <MEMFLAGS F>
+template <class T> void BasicHashtable<F>::verify_table(const char* table_name) {
+  int element_count = 0;
+  int max_bucket_count = 0;
+  for (int index = 0; index < table_size(); index++) {
+    int bucket_count = 0;
+    for (T* probe = (T*)bucket(index); probe != NULL; probe = probe->next()) {
+      probe->verify();
+      bucket_count++;
     }
+    element_count += bucket_count;
+    max_bucket_count = MAX2(max_bucket_count, bucket_count);
   }
-  assert(count == number_of_entries(), "number of hashtable entries incorrect");
+  guarantee(number_of_entries() == element_count,
+            "Verify of %s failed", table_name);
+  DEBUG_ONLY(verify_lookup_length(max_bucket_count, table_name));
 }
 
 
@@ -291,18 +303,12 @@
 
 #ifdef ASSERT
 
-template <MEMFLAGS F> bool BasicHashtable<F>::verify_lookup_length(double load, const char *table_name) {
-  if ((!_lookup_warning) && (_lookup_count != 0)
-      && ((double)_lookup_length / (double)_lookup_count > load * 2.0)) {
-    warning("Performance bug: %s lookup_count=%d "
-            "lookup_length=%d average=%lf load=%f",
-            table_name, _lookup_count, _lookup_length,
-            (double)_lookup_length / _lookup_count, load);
-    _lookup_warning = true;
-
-    return false;
-  }
-  return true;
+// Assert if the longest bucket is 10x longer than the average bucket size.
+// Could change back to a warning, but warnings are not noticed.
+template <MEMFLAGS F> void BasicHashtable<F>::verify_lookup_length(int max_bucket_count, const char *table_name) {
+  log_info(hashtables)("%s max bucket size %d element count %d table size %d", table_name,
+                       max_bucket_count, _number_of_entries, _table_size);
+  assert (max_bucket_count < ((1 + number_of_entries()/table_size())*10), "Table is unbalanced");
 }
 
 #endif
@@ -344,3 +350,8 @@
 template class BasicHashtable<mtTracing>;
 #endif
 template class BasicHashtable<mtCompiler>;
+
+template void BasicHashtable<mtClass>::verify_table<DictionaryEntry>(char const*);
+template void BasicHashtable<mtModule>::verify_table<ModuleEntry>(char const*);
+template void BasicHashtable<mtModule>::verify_table<PackageEntry>(char const*);
+template void BasicHashtable<mtClass>::verify_table<ProtectionDomainCacheEntry>(char const*);
--- a/hotspot/src/share/vm/utilities/hashtable.hpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/utilities/hashtable.hpp	Fri May 19 06:50:58 2017 +0000
@@ -124,17 +124,9 @@
   // Instance variable
   BasicHashtableEntry<F>*       _entry;
 
-#ifdef ASSERT
-private:
-  unsigned _hits;
-public:
-  unsigned hits()   { return _hits; }
-  void count_hit()  { _hits++; }
-#endif
-
 public:
   // Accessing
-  void clear()                        { _entry = NULL; DEBUG_ONLY(_hits = 0); }
+  void clear()                        { _entry = NULL; }
 
   // The following methods use order access methods to avoid race
   // conditions in multiprocessor systems.
@@ -179,10 +171,7 @@
 protected:
 
 #ifdef ASSERT
-  bool              _lookup_warning;
-  mutable int       _lookup_count;
-  mutable int       _lookup_length;
-  bool verify_lookup_length(double load, const char *table_name);
+  void verify_lookup_length(int max_bucket_count, const char *table_name);
 #endif
 
   void initialize(int table_size, int entry_size, int number_of_entries);
@@ -232,16 +221,7 @@
 
   int number_of_entries() { return _number_of_entries; }
 
-  void verify() PRODUCT_RETURN;
-
-#ifdef ASSERT
-  void bucket_count_hit(int i) const {
-    _buckets[i].count_hit();
-  }
-  unsigned bucket_hits(int i) const {
-    return _buckets[i].hits();
-  }
-#endif
+  template <class T> void verify_table(const char* table_name) PRODUCT_RETURN;
 };
 
 
--- a/hotspot/src/share/vm/utilities/hashtable.inline.hpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/utilities/hashtable.inline.hpp	Fri May 19 06:50:58 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -64,11 +64,6 @@
   _first_free_entry = NULL;
   _end_block = NULL;
   _number_of_entries = number_of_entries;
-#ifdef ASSERT
-  _lookup_warning = false;
-  _lookup_count = 0;
-  _lookup_length = 0;
-#endif
 }
 
 
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Fri May 19 06:50:58 2017 +0000
@@ -1396,6 +1396,8 @@
       out.print_raw   ("/bin/sh -c ");
 #elif defined(SOLARIS)
       out.print_raw   ("/usr/bin/sh -c ");
+#elif defined(WINDOWS)
+      out.print_raw   ("cmd /C ");
 #endif
       out.print_raw   ("\"");
       out.print_raw   (cmd);
--- a/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java	Fri May 19 06:50:58 2017 +0000
@@ -215,8 +215,8 @@
         return CTVM.getLocalVariableTableStart((HotSpotResolvedJavaMethodImpl)method);
     }
 
-    public static void doNotInlineOrCompile(HotSpotResolvedJavaMethod method) {
-        CTVM.doNotInlineOrCompile((HotSpotResolvedJavaMethodImpl)method);
+    public static void setNotInlineableOrCompileable(HotSpotResolvedJavaMethod method) {
+        CTVM.setNotInlineableOrCompileable((HotSpotResolvedJavaMethodImpl)method);
     }
 
     public static void reprofile(HotSpotResolvedJavaMethod method) {
--- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java	Fri May 19 06:50:58 2017 +0000
@@ -71,10 +71,10 @@
         boolean hasNeverInlineDirective = CompilerToVMHelper.hasNeverInlineDirective(method);
         Asserts.assertFalse(hasNeverInlineDirective, "Unexpected initial " +
                 "value of property 'hasNeverInlineDirective'");
-        CompilerToVMHelper.doNotInlineOrCompile(method);
+        CompilerToVMHelper.setNotInlineableOrCompileable(method);
         hasNeverInlineDirective = CompilerToVMHelper.hasNeverInlineDirective(method);
         Asserts.assertTrue(hasNeverInlineDirective, aMethod
-                + " : hasNeverInlineDirective is false even after doNotInlineOrCompile'");
+                + " : hasNeverInlineDirective is false even after setNotInlineableOrCompileable'");
     }
 
     private static List<Executable> createTestCases() {
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java	Fri May 19 06:50:58 2017 +0000
@@ -34,7 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.amd64
  *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java TestHotSpotVMConfig.java NativeCallTest.java TestAssembler.java sparc/SPARCTestAssembler.java amd64/AMD64TestAssembler.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI  -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest
+ * @run junit/othervm/native -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI  -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest
  */
 package jdk.vm.ci.code.test;
 
--- a/hotspot/test/runtime/ErrorHandling/TestOnOutOfMemoryError.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/test/runtime/ErrorHandling/TestOnOutOfMemoryError.java	Fri May 19 06:50:58 2017 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,11 @@
 
 /*
  * @test TestOnOutOfMemoryError
- * @summary Test using -XX:OnOutOfMemoryError=<cmd>
+ * @summary Test using single and multiple -XX:OnOutOfMemoryError=<cmd>
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @run main TestOnOutOfMemoryError
- * @bug 8078470
+ * @bug 8078470 8177522
  */
 
 import jdk.test.lib.process.ProcessTools;
@@ -44,13 +44,22 @@
         }
 
         // else this is the main test
-        String msg = "Test Succeeded";
-        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-           "-XX:OnOutOfMemoryError=echo " + msg,
+        String msg1 = "Test1 Succeeded";
+        String msg2 = "Test2 Succeeded";
+        ProcessBuilder pb_single = ProcessTools.createJavaProcessBuilder(
+           "-XX:OnOutOfMemoryError=echo " + msg1,
            TestOnOutOfMemoryError.class.getName(),
            "throwOOME");
 
-        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        ProcessBuilder pb_multiple = ProcessTools.createJavaProcessBuilder(
+           "-XX:OnOutOfMemoryError=echo " + msg1,
+           "-XX:OnOutOfMemoryError=echo " + msg2,
+           TestOnOutOfMemoryError.class.getName(),
+           "throwOOME");
+
+        OutputAnalyzer output_single = new OutputAnalyzer(pb_single.start());
+
+        OutputAnalyzer output_multiple = new OutputAnalyzer(pb_multiple.start());
 
         /* Actual output should look like this:
            #
@@ -64,8 +73,13 @@
            So we don't want to match on the "# Executing ..." line, and they
            both get written to stdout.
         */
-        output.shouldContain("Requested array size exceeds VM limit");
-        output.stdoutShouldMatch("^" + msg); // match start of line only
+        output_single.shouldContain("Requested array size exceeds VM limit");
+        output_single.stdoutShouldMatch("^" + msg1); // match start of line only
+
+        output_multiple.shouldContain("Requested array size exceeds VM limit");
+        output_multiple.stdoutShouldMatch("^" + msg1); // match start of line only
+        output_multiple.stdoutShouldMatch("^" + msg2); // match start of line only
+
         System.out.println("PASSED");
     }
 }
--- a/hotspot/test/runtime/noClassDefFoundMsg/NoClassDefFoundMsg.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/test/runtime/noClassDefFoundMsg/NoClassDefFoundMsg.java	Fri May 19 06:50:58 2017 +0000
@@ -28,7 +28,7 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.compiler
- * @run main NoClassDefFoundMsg
+ * @run main/native NoClassDefFoundMsg
  */
 
 import jdk.test.lib.InMemoryJavaCompiler;
--- a/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java	Fri May 19 08:36:49 2017 +0200
+++ b/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java	Fri May 19 06:50:58 2017 +0000
@@ -25,7 +25,7 @@
  * @test
  * @summary Verifies the JVMTI GetAllModules API
  * @library /test/lib
- * @run main/othervm -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest
+ * @run main/othervm/native -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest
  *
  */
 import java.lang.module.ModuleReference;