changeset 11350:ace1469a7325

Merge
author vlivanov
date Fri, 27 May 2016 16:56:23 +0300
parents dc8935610625 86811737fdac
children 5e36c89aa7ad
files test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
diffstat 77 files changed, 362 insertions(+), 451 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu May 26 14:17:50 2016 +0200
+++ b/.hgtags	Fri May 27 16:56:23 2016 +0300
@@ -521,3 +521,5 @@
 61a214186dae6811dd989e9165e42f7dbf02acde jdk-9+116
 88170d3642905b9e6cac03e8efcc976885a7e6da jdk-9+117
 9b1075cac08dc836ec32e7b368415cbe3aceaf8c jdk-9+118
+15f3fe264872766bcb205696198f0c1502420e17 jdk-9+119
+0be6f4f5d18671184e62583668cb1d783dffa128 jdk-9+120
--- a/make/lib/CompileGtest.gmk	Thu May 26 14:17:50 2016 +0200
+++ b/make/lib/CompileGtest.gmk	Fri May 27 16:56:23 2016 +0300
@@ -36,9 +36,6 @@
 
 ################################################################################
 
-GTEST_TEST_SRC_FILES := $(shell $(FIND) $(HOTSPOT_TOPDIR)/test/native -name \
-    "test*.cpp" -type f)
-
 ifeq ($(OPENJDK_TARGET_OS), windows)
   GTEST_JVM_MAPFILE := $(JVM_MAPFILE)
 else
@@ -58,10 +55,12 @@
     TOOLCHAIN := $(JVM_TOOLCHAIN), \
     LIBRARY := jvm, \
     OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
-    EXTRA_FILES := $(GTEST_TEST_SRC_FILES) \
-        $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc \
-        $(GTEST_TEST_SRC)/gtestMain.cpp, \
     OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
+    SRC := $(GTEST_TEST_SRC), \
+    EXCLUDES := $(JVM_EXCLUDES), \
+    EXCLUDE_FILES := gtestLauncher.cpp, \
+    EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
+    EXTRA_FILES := $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc, \
     EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \
         $(BUILD_LIBJVM_ALL_OBJS)), \
     CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
--- a/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Fri May 27 16:56:23 2016 +0300
@@ -4767,6 +4767,7 @@
   assert(UseBlockZeroing && VM_Version::has_block_zeroing(), "only works with BIS zeroing");
   Register end = count;
   int cache_line_size = VM_Version::prefetch_data_size();
+  assert(cache_line_size > 0, "cache line size should be known for this code");
   // Minimum count when BIS zeroing can be used since
   // it needs membar which is expensive.
   int block_zero_size  = MAX2(cache_line_size*3, (int)BlockZeroingLowLimit);
--- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri May 27 16:56:23 2016 +0300
@@ -49,7 +49,7 @@
   AllocatePrefetchDistance = allocate_prefetch_distance();
   AllocatePrefetchStyle    = allocate_prefetch_style();
 
-  if (!has_blk_init()) {
+  if (!has_blk_init() || cache_line_size <= 0) {
     if (AllocatePrefetchInstr == 1) {
       warning("BIS instructions required for AllocatePrefetchInstr 1 unavailable");
       FLAG_SET_DEFAULT(AllocatePrefetchInstr, 0);
@@ -87,7 +87,7 @@
       FLAG_SET_DEFAULT(InteriorEntryAlignment, 4);
     }
     if (is_niagara_plus()) {
-      if (has_blk_init() && UseTLAB &&
+      if (has_blk_init() && (cache_line_size > 0) && UseTLAB &&
           FLAG_IS_DEFAULT(AllocatePrefetchInstr)) {
         // Use BIS instruction for TLAB allocation prefetch.
         FLAG_SET_DEFAULT(AllocatePrefetchInstr, 1);
--- a/src/os/solaris/vm/os_solaris.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/os/solaris/vm/os_solaris.cpp	Fri May 27 16:56:23 2016 +0300
@@ -756,15 +756,9 @@
     }
   }
 
-  // If the creator called set priority before we started,
-  // we need to call set_native_priority now that we have an lwp.
-  // We used to get the priority from thr_getprio (we called
-  // thr_setprio way back in create_thread) and pass it to
-  // set_native_priority, but Solaris scales the priority
-  // in java_to_os_priority, so when we read it back here,
-  // we pass trash to set_native_priority instead of what's
-  // in java_to_os_priority. So we save the native priority
-  // in the osThread and recall it here.
+  // Our priority was set when we were created, and stored in the
+  // osthread, but couldn't be passed through to our LWP until now.
+  // So read back the priority and set it again.
 
   if (osthr->thread_id() != -1) {
     if (UseThreadPriorities) {
@@ -1044,6 +1038,10 @@
   // Remember that we created this thread so we can set priority on it
   osthread->set_vm_created();
 
+  // Most thread types will set an explicit priority before starting the thread,
+  // but for those that don't we need a valid value to read back in thread_native_entry.
+  osthread->set_native_priority(NormPriority);
+
   // Initial thread state is INITIALIZED, not SUSPENDED
   osthread->set_state(INITIALIZED);
 
@@ -1357,29 +1355,20 @@
   return (double)gethrvtime() / (double)hrtime_hz;
 }
 
-// in-memory timestamp support - has update accuracy of 1ms
-typedef void (*_get_nsec_fromepoch_func_t)(hrtime_t*);
-static _get_nsec_fromepoch_func_t _get_nsec_fromepoch = NULL;
-
 // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis
 jlong os::javaTimeMillis() {
-  if (_get_nsec_fromepoch != NULL) {
-    hrtime_t now;
-    _get_nsec_fromepoch(&now);
-    return now / NANOSECS_PER_MILLISEC;
-  }
-  else {
-    timeval t;
-    if (gettimeofday(&t, NULL) == -1) {
-      fatal("os::javaTimeMillis: gettimeofday (%s)", os::strerror(errno));
-    }
-    return jlong(t.tv_sec) * 1000  +  jlong(t.tv_usec) / 1000;
-  }
-}
-
+  timeval t;
+  if (gettimeofday(&t, NULL) == -1) {
+    fatal("os::javaTimeMillis: gettimeofday (%s)", os::strerror(errno));
+  }
+  return jlong(t.tv_sec) * 1000  +  jlong(t.tv_usec) / 1000;
+}
+
+// Must return seconds+nanos since Jan 1 1970. This must use the same
+// time source as javaTimeMillis and can't use get_nsec_fromepoch as
+// we need better than 1ms accuracy
 void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) {
   timeval t;
-  // can't use get_nsec_fromepoch here as we need better accuracy than 1ms
   if (gettimeofday(&t, NULL) == -1) {
     fatal("os::javaTimeSystemUTC: gettimeofday (%s)", os::strerror(errno));
   }
@@ -4449,9 +4438,6 @@
   if (handle != NULL) {
     Solaris::_pthread_setname_np =  // from 11.3
         (Solaris::pthread_setname_np_func_t)dlsym(handle, "pthread_setname_np");
-
-    _get_nsec_fromepoch =           // from 11.3.6
-        (_get_nsec_fromepoch_func_t) dlsym(handle, "get_nsec_fromepoch");
   }
 }
 
--- a/src/os/windows/vm/os_windows.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/os/windows/vm/os_windows.cpp	Fri May 27 16:56:23 2016 +0300
@@ -5277,7 +5277,8 @@
         }
       }
       DWORD err = GetLastError();
-      if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
+      if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED &&
+         (err == ERROR_INVALID_FUNCTION && phe.lpData != NULL)) {
         HeapUnlock(heap);
         fatal("heap walk aborted with error %d", err);
       }
--- a/src/share/vm/ci/ciStreams.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/ci/ciStreams.cpp	Fri May 27 16:56:23 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -361,14 +361,14 @@
 ciMethod* ciBytecodeStream::get_method(bool& will_link, ciSignature* *declared_signature_result) {
   VM_ENTRY_MARK;
   ciEnv* env = CURRENT_ENV;
-  constantPoolHandle cpool(_method->get_Method()->constants());
+  constantPoolHandle cpool(THREAD, _method->get_Method()->constants());
   ciMethod* m = env->get_method_by_index(cpool, get_method_index(), cur_bc(), _holder);
   will_link = m->is_loaded();
 
   // Use the MethodType stored in the CP cache to create a signature
   // with correct types (in respect to class loaders).
   if (has_method_type()) {
-    ciSymbol*     sig_sym     = env->get_symbol(cpool->symbol_at(get_method_signature_index()));
+    ciSymbol*     sig_sym     = env->get_symbol(cpool->symbol_at(get_method_signature_index(cpool)));
     ciKlass*      pool_holder = env->get_klass(cpool->pool_holder());
     ciMethodType* method_type = get_method_type();
     ciSignature* declared_signature = new (env->arena()) ciSignature(pool_holder, sig_sym, method_type);
@@ -465,9 +465,8 @@
 // Get the constant pool index of the signature of the method
 // referenced by the current bytecode.  Used for generating
 // deoptimization information.
-int ciBytecodeStream::get_method_signature_index() {
+int ciBytecodeStream::get_method_signature_index(const constantPoolHandle& cpool) {
   GUARDED_VM_ENTRY(
-    ConstantPool* cpool = _holder->get_instanceKlass()->constants();
     const int method_index = get_method_index();
     const int name_and_type_index = cpool->name_and_type_ref_index_at(method_index);
     return cpool->signature_ref_index_at(name_and_type_index);
--- a/src/share/vm/ci/ciStreams.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/ci/ciStreams.hpp	Fri May 27 16:56:23 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -264,7 +264,7 @@
   ciMethodType* get_method_type();
   ciKlass*      get_declared_method_holder();
   int           get_method_holder_index();
-  int           get_method_signature_index();
+  int           get_method_signature_index(const constantPoolHandle& cpool);
 
   // Get the resolved references arrays from the constant pool
   ciObjArray* get_resolved_references();
--- a/src/share/vm/classfile/classFileParser.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/classfile/classFileParser.cpp	Fri May 27 16:56:23 2016 +0300
@@ -5704,8 +5704,10 @@
 
 #if INCLUDE_CDS
     if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
-      // Only dump the classes that can be stored into CDS archive
-      if (SystemDictionaryShared::is_sharing_possible(_loader_data)) {
+      // Only dump the classes that can be stored into CDS archive.
+      // Anonymous classes such as generated LambdaForm classes are also not included.
+      if (SystemDictionaryShared::is_sharing_possible(_loader_data) &&
+          _host_klass == NULL) {
         ResourceMark rm(THREAD);
         classlist_file->print_cr("%s", _class_name->as_C_string());
         classlist_file->flush();
--- a/src/share/vm/classfile/classLoaderData.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/classfile/classLoaderData.cpp	Fri May 27 16:56:23 2016 +0300
@@ -382,6 +382,10 @@
     }
     log->cr();
   }
+
+  // In some rare cases items added to this list will not be freed elsewhere.
+  // To keep it simple, just free everything in it here.
+  free_deallocate_list();
 }
 
 PackageEntryTable* ClassLoaderData::packages() {
--- a/src/share/vm/classfile/compactHashtable.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/classfile/compactHashtable.cpp	Fri May 27 16:56:23 2016 +0300
@@ -38,6 +38,7 @@
 CompactHashtableWriter::CompactHashtableWriter(int num_buckets,
                                                CompactHashtableStats* stats) {
   assert(DumpSharedSpaces, "dump-time only");
+  assert(num_buckets > 0, "no buckets");
   _num_buckets = num_buckets;
   _num_entries = 0;
   _buckets = NEW_C_HEAP_ARRAY(GrowableArray<Entry>*, _num_buckets, mtSymbol);
--- a/src/share/vm/classfile/stringTable.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/classfile/stringTable.cpp	Fri May 27 16:56:23 2016 +0300
@@ -740,7 +740,8 @@
     } else {
       int num_buckets = the_table()->number_of_entries() /
                              SharedSymbolTableBucketSize;
-      CompactStringTableWriter writer(num_buckets,
+      // calculation of num_buckets can result in zero buckets, we need at least one
+      CompactStringTableWriter writer(num_buckets > 1 ? num_buckets : 1,
                                       &MetaspaceShared::stats()->string);
 
       // Copy the interned strings into the "string space" within the java heap
--- a/src/share/vm/classfile/systemDictionary.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/classfile/systemDictionary.hpp	Fri May 27 16:56:23 2016 +0300
@@ -420,9 +420,9 @@
   // Initialization
   static void initialize(TRAPS);
 
-  // Fast access to commonly used classes (preloaded)
+  // Checked fast access to commonly used classes - mostly preloaded
   static InstanceKlass* check_klass(InstanceKlass* k) {
-    assert(k != NULL, "preloaded klass not initialized");
+    assert(k != NULL, "klass not loaded");
     return k;
   }
 
--- a/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp	Fri May 27 16:56:23 2016 +0300
@@ -545,6 +545,8 @@
   }
   assert((_conc_workers != NULL) == (ConcGCThreads > 1),
          "Inconsistency");
+  log_debug(gc)("ConcGCThreads: %u", ConcGCThreads);
+  log_debug(gc)("ParallelGCThreads: %u", ParallelGCThreads);
 
   // Parallel task queues; these are shared for the
   // concurrent and stop-world phases of CMS, but
@@ -6094,19 +6096,23 @@
           size = CompactibleFreeListSpace::adjustObjectSize(
                    p->oop_iterate_size(_scanningClosure));
         }
-        #ifdef ASSERT
-          size_t direct_size =
-            CompactibleFreeListSpace::adjustObjectSize(p->size());
-          assert(size == direct_size, "Inconsistency in size");
-          assert(size >= 3, "Necessary for Printezis marks to work");
-          if (!_bitMap->isMarked(addr+1)) {
-            _bitMap->verifyNoOneBitsInRange(addr+2, addr+size);
-          } else {
-            _bitMap->verifyNoOneBitsInRange(addr+2, addr+size-1);
-            assert(_bitMap->isMarked(addr+size-1),
-                   "inconsistent Printezis mark");
-          }
-        #endif // ASSERT
+      #ifdef ASSERT
+        size_t direct_size =
+          CompactibleFreeListSpace::adjustObjectSize(p->size());
+        assert(size == direct_size, "Inconsistency in size");
+        assert(size >= 3, "Necessary for Printezis marks to work");
+        HeapWord* start_pbit = addr + 1;
+        HeapWord* end_pbit = addr + size - 1;
+        assert(_bitMap->isMarked(start_pbit) == _bitMap->isMarked(end_pbit),
+               "inconsistent Printezis mark");
+        // Verify inner mark bits (between Printezis bits) are clear,
+        // but don't repeat if there are multiple dirty regions for
+        // the same object, to avoid potential O(N^2) performance.
+        if (addr != _last_scanned_object) {
+          _bitMap->verifyNoOneBitsInRange(start_pbit + 1, end_pbit);
+          _last_scanned_object = addr;
+        }
+      #endif // ASSERT
     } else {
       // An uninitialized object.
       assert(_bitMap->isMarked(addr+1), "missing Printezis mark?");
--- a/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp	Fri May 27 16:56:23 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1501,6 +1501,7 @@
   CMSBitMap*                     _bitMap;
   CMSMarkStack*                  _markStack;
   MarkRefsIntoAndScanClosure*    _scanningClosure;
+  DEBUG_ONLY(HeapWord*           _last_scanned_object;)
 
  public:
   ScanMarkedObjectsAgainCarefullyClosure(CMSCollector* collector,
@@ -1514,8 +1515,9 @@
     _yield(should_yield),
     _bitMap(bitMap),
     _markStack(markStack),
-    _scanningClosure(cl) {
-  }
+    _scanningClosure(cl)
+    DEBUG_ONLY(COMMA _last_scanned_object(NULL))
+  { }
 
   void do_object(oop p) {
     guarantee(false, "call do_object_careful instead");
--- a/src/share/vm/gc/g1/g1ConcurrentMark.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/g1/g1ConcurrentMark.cpp	Fri May 27 16:56:23 2016 +0300
@@ -438,6 +438,8 @@
   }
 
   assert(ConcGCThreads > 0, "Should have been set");
+  log_debug(gc)("ConcGCThreads: %u", ConcGCThreads);
+  log_debug(gc)("ParallelGCThreads: %u", ParallelGCThreads);
   _parallel_marking_threads = ConcGCThreads;
   _max_parallel_marking_threads = _parallel_marking_threads;
 
--- a/src/share/vm/gc/g1/g1HeapSizingPolicy_ext.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/g1/g1HeapSizingPolicy_ext.cpp	Fri May 27 16:56:23 2016 +0300
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/g1/g1HeapSizingPolicy.hpp"
+#include "memory/allocation.inline.hpp"
 
 G1HeapSizingPolicy* G1HeapSizingPolicy::create(const G1CollectedHeap* g1, const G1Analytics* analytics) {
   return new G1HeapSizingPolicy(g1, analytics);
--- a/src/share/vm/gc/g1/g1YoungGenSizer.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/g1/g1YoungGenSizer.cpp	Fri May 27 16:56:23 2016 +0300
@@ -56,7 +56,7 @@
                              MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
                                   1U);
       _sizer_kind = SizerMaxAndNewSize;
-      _adaptive_size = _min_desired_young_length == _max_desired_young_length;
+      _adaptive_size = _min_desired_young_length != _max_desired_young_length;
     } else {
       _sizer_kind = SizerNewSizeOnly;
     }
--- a/src/share/vm/gc/g1/g1YoungGenSizer.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/g1/g1YoungGenSizer.hpp	Fri May 27 16:56:23 2016 +0300
@@ -75,7 +75,11 @@
   SizerKind _sizer_kind;
   uint _min_desired_young_length;
   uint _max_desired_young_length;
+
+  // False when using a fixed young generation size due to command-line options,
+  // true otherwise.
   bool _adaptive_size;
+
   uint calculate_default_min_length(uint new_number_of_heap_regions);
   uint calculate_default_max_length(uint new_number_of_heap_regions);
 
--- a/src/share/vm/gc/parallel/psParallelCompact.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/parallel/psParallelCompact.cpp	Fri May 27 16:56:23 2016 +0300
@@ -394,13 +394,6 @@
   HeapWord* end_heap =
     (HeapWord*) heap->young_gen()->virtual_space()->high_boundary();
 
-  size_t end_index =
-    PSParallelCompact::summary_data().addr_to_region_idx(end_heap);
-  ParallelCompactData::RegionData* c = PSParallelCompact::summary_data().region(end_index);
-
-  // Initialize the end region with a bad destination.
-  c->set_destination(begin_heap - 1);
-
   print_generic_summary_data(PSParallelCompact::summary_data(),
     begin_heap, end_heap);
 }
--- a/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp	Fri May 27 16:56:23 2016 +0300
@@ -216,8 +216,10 @@
 
   _global_stats = new GlobalTLABStats();
 
-  // Need extra space at the end of TLAB, otherwise prefetching
-  // instructions will fault (due to accessing memory outside of heap).
+#ifdef COMPILER2
+  // If the C2 compiler is present, extra space is needed at the end of
+  // TLABs, otherwise prefetching instructions generated by the C2
+  // compiler will fault (due to accessing memory outside of heap).
   // The amount of space is the max of the number of lines to
   // prefetch for array and for instance allocations. (Extra space must be
   // reserved to accommodate both types of allocations.)
@@ -227,11 +229,14 @@
   // AllocatePrefetchInstr==1). To be on the safe side, however,
   // extra space is reserved for all combinations of
   // AllocatePrefetchStyle and AllocatePrefetchInstr.
+  //
+  // If the C2 compiler is not present, no space is reserved.
 
   // +1 for rounding up to next cache line, +1 to be safe
   int lines =  MAX2(AllocatePrefetchLines, AllocateInstancePrefetchLines) + 2;
   _reserve_for_allocation_prefetch = (AllocatePrefetchDistance + AllocatePrefetchStepSize * lines) /
                                      (int)HeapWordSize;
+#endif
 
   // During jvm startup, the main (primordial) thread is initialized
   // before the heap is initialized.  So reinitialize it now.
--- a/src/share/vm/logging/log.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/logging/log.cpp	Fri May 27 16:56:23 2016 +0300
@@ -578,11 +578,6 @@
 
   LogConfiguration::disable_logging();
   assert(Test_logconfiguration_subscribe_triggered == 3, "subscription not triggered (3)");
-
-  // We need to renable stderr error logging since "disable_logging" disable it all.
-  // TestLogSavedConfig log_cfg will only renable stdout for us.
-  LogConfiguration::parse_log_arguments("stderr", "all=warning", NULL, NULL, log.error_stream());
-  assert(Test_logconfiguration_subscribe_triggered == 4, "subscription not triggered (3)");
 }
 
 #define LOG_PREFIX_STR "THE_PREFIX "
--- a/src/share/vm/logging/logFileStreamOutput.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/logging/logFileStreamOutput.hpp	Fri May 27 16:56:23 2016 +0300
@@ -54,7 +54,7 @@
  private:
   static LogStdoutOutput _instance;
   LogStdoutOutput() : LogFileStreamOutput(stdout) {
-    set_config_string("all=off");
+    set_config_string("all=warning");
   }
   virtual bool initialize(const char* options, outputStream* errstream) {
     return false;
@@ -70,7 +70,7 @@
  private:
   static LogStderrOutput _instance;
   LogStderrOutput() : LogFileStreamOutput(stderr) {
-    set_config_string("all=warning");
+    set_config_string("all=off");
   }
   virtual bool initialize(const char* options, outputStream* errstream) {
     return false;
--- a/src/share/vm/logging/logTagSet.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/logging/logTagSet.cpp	Fri May 27 16:56:23 2016 +0300
@@ -50,7 +50,7 @@
   _ntagsets++;
 
   // Set the default output to warning and error level for all new tagsets.
-  _output_list.set_output_level(LogOutput::Stderr, LogLevel::Default);
+  _output_list.set_output_level(LogOutput::Stdout, LogLevel::Default);
 }
 
 void LogTagSet::update_decorators(const LogDecorators& decorator) {
--- a/src/share/vm/memory/metaspaceShared.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/memory/metaspaceShared.hpp	Fri May 27 16:56:23 2016 +0300
@@ -43,11 +43,11 @@
 // for the x64 platform
 #define DEFAULT_VTBL_COMMON_CODE_SIZE   (1*K) // conservative size of the "common_code" for the x64 platform
 
-#define DEFAULT_SHARED_READ_WRITE_SIZE  (NOT_LP64(9*M) LP64_ONLY(10*M))
-#define MIN_SHARED_READ_WRITE_SIZE      (NOT_LP64(7*M) LP64_ONLY(10*M))
+#define DEFAULT_SHARED_READ_WRITE_SIZE  (NOT_LP64(6*M) LP64_ONLY(10*M))
+#define MIN_SHARED_READ_WRITE_SIZE      (NOT_LP64(6*M) LP64_ONLY(10*M))
 
-#define DEFAULT_SHARED_READ_ONLY_SIZE   (NOT_LP64(9*M) LP64_ONLY(10*M))
-#define MIN_SHARED_READ_ONLY_SIZE       (NOT_LP64(9*M) LP64_ONLY(10*M))
+#define DEFAULT_SHARED_READ_ONLY_SIZE   (NOT_LP64(6*M) LP64_ONLY(10*M))
+#define MIN_SHARED_READ_ONLY_SIZE       (NOT_LP64(6*M) LP64_ONLY(10*M))
 
 // the MIN_SHARED_MISC_DATA_SIZE and MIN_SHARED_MISC_CODE_SIZE estimates are based on
 // the sizes required for dumping the archive using the default classlist. The sizes
--- a/src/share/vm/oops/instanceKlass.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/oops/instanceKlass.hpp	Fri May 27 16:56:23 2016 +0300
@@ -190,6 +190,7 @@
   // _is_marked_dependent can be set concurrently, thus cannot be part of the
   // _misc_flags.
   bool            _is_marked_dependent;  // used for marking during flushing and deoptimization
+  bool            _is_being_redefined;   // used for locking redefinition
 
   // The low two bits of _misc_flags contains the kind field.
   // This can be used to quickly discriminate among the four kinds of
@@ -694,6 +695,10 @@
   }
 
 #if INCLUDE_JVMTI
+  // Redefinition locking.  Class can only be redefined by one thread at a time.
+  bool is_being_redefined() const          { return _is_being_redefined; }
+  void set_is_being_redefined(bool value)  { _is_being_redefined = value; }
+
   // RedefineClasses() support for previous versions:
   void add_previous_version(instanceKlassHandle ikh, int emcp_method_count);
 
--- a/src/share/vm/oops/klass.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/oops/klass.hpp	Fri May 27 16:56:23 2016 +0300
@@ -309,10 +309,11 @@
     _lh_header_size_mask        = right_n_bits(BitsPerByte),  // shifted mask
     _lh_array_tag_bits          = 2,
     _lh_array_tag_shift         = BitsPerInt - _lh_array_tag_bits,
-    _lh_array_tag_type_value    = ~0x00,  // 0xC0000000 >> 30
     _lh_array_tag_obj_value     = ~0x01   // 0x80000000 >> 30
   };
 
+  static const unsigned int _lh_array_tag_type_value = 0Xffffffff; // ~0x00,  // 0xC0000000 >> 30
+
   static int layout_helper_size_in_bytes(jint lh) {
     assert(lh > (jint)_lh_neutral_value, "must be instance");
     return (int) lh & ~_lh_instance_slow_path_bit;
--- a/src/share/vm/opto/library_call.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/opto/library_call.cpp	Fri May 27 16:56:23 2016 +0300
@@ -3740,7 +3740,7 @@
   }
   // Now test the correct condition.
   jint  nval = (obj_array
-                ? ((jint)Klass::_lh_array_tag_type_value
+                ? (jint)(Klass::_lh_array_tag_type_value
                    <<    Klass::_lh_array_tag_shift)
                 : Klass::_lh_neutral_value);
   Node* cmp = _gvn.transform(new CmpINode(layout_val, intcon(nval)));
--- a/src/share/vm/opto/macroArrayCopy.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/opto/macroArrayCopy.cpp	Fri May 27 16:56:23 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -235,7 +235,6 @@
   return StubRoutines::select_arraycopy_function(t, aligned, disjoint, name, dest_uninitialized);
 }
 
-#define COMMA ,
 #define XTOP LP64_ONLY(COMMA top())
 
 // Generate an optimized call to arraycopy.
--- a/src/share/vm/prims/jni.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/prims/jni.cpp	Fri May 27 16:56:23 2016 +0300
@@ -163,8 +163,6 @@
 #define FP_SELECT(TypeName, intcode, fpcode) \
   FP_SELECT_##TypeName(intcode, fpcode)
 
-#define COMMA ,
-
 // Choose DT_RETURN_MARK macros  based on the type: float/double -> void
 // (dtrace doesn't do FP yet)
 #define DT_RETURN_MARK_DECL_FOR(TypeName, name, type, probe)    \
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri May 27 16:56:23 2016 +0300
@@ -69,6 +69,43 @@
   _res = JVMTI_ERROR_NONE;
 }
 
+static inline InstanceKlass* get_ik(jclass def) {
+  oop mirror = JNIHandles::resolve_non_null(def);
+  return InstanceKlass::cast(java_lang_Class::as_Klass(mirror));
+}
+
+// If any of the classes are being redefined, wait
+// Parallel constant pool merging leads to indeterminate constant pools.
+void VM_RedefineClasses::lock_classes() {
+  MutexLocker ml(RedefineClasses_lock);
+  bool has_redefined;
+  do {
+    has_redefined = false;
+    // Go through classes each time until none are being redefined.
+    for (int i = 0; i < _class_count; i++) {
+      if (get_ik(_class_defs[i].klass)->is_being_redefined()) {
+        RedefineClasses_lock->wait();
+        has_redefined = true;
+        break;  // for loop
+      }
+    }
+  } while (has_redefined);
+  for (int i = 0; i < _class_count; i++) {
+    get_ik(_class_defs[i].klass)->set_is_being_redefined(true);
+  }
+  RedefineClasses_lock->notify_all();
+}
+
+void VM_RedefineClasses::unlock_classes() {
+  MutexLocker ml(RedefineClasses_lock);
+  for (int i = 0; i < _class_count; i++) {
+    assert(get_ik(_class_defs[i].klass)->is_being_redefined(),
+           "should be being redefined to get here");
+    get_ik(_class_defs[i].klass)->set_is_being_redefined(false);
+  }
+  RedefineClasses_lock->notify_all();
+}
+
 bool VM_RedefineClasses::doit_prologue() {
   if (_class_count == 0) {
     _res = JVMTI_ERROR_NONE;
@@ -91,6 +128,14 @@
       _res = JVMTI_ERROR_NULL_POINTER;
       return false;
     }
+
+    oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass);
+    // classes for primitives and arrays cannot be redefined
+    // check here so following code can assume these classes are InstanceKlass
+    if (!is_modifiable_class(mirror)) {
+      _res = JVMTI_ERROR_UNMODIFIABLE_CLASS;
+      return false;
+    }
   }
 
   // Start timer after all the sanity checks; not quite accurate, but
@@ -99,6 +144,7 @@
     _timer_vm_op_prologue.start();
   }
 
+  lock_classes();
   // We first load new class versions in the prologue, because somewhere down the
   // call chain it is required that the current thread is a Java thread.
   _res = load_new_class_versions(Thread::current());
@@ -115,6 +161,7 @@
     // Free os::malloc allocated memory in load_new_class_version.
     os::free(_scratch_classes);
     _timer_vm_op_prologue.stop();
+    unlock_classes();
     return false;
   }
 
@@ -174,6 +221,8 @@
 }
 
 void VM_RedefineClasses::doit_epilogue() {
+  unlock_classes();
+
   // Free os::malloc allocated memory.
   os::free(_scratch_classes);
 
@@ -959,14 +1008,7 @@
     // versions are deleted. Constant pools are deallocated while merging
     // constant pools
     HandleMark hm(THREAD);
-
-    oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass);
-    // classes for primitives cannot be redefined
-    if (!is_modifiable_class(mirror)) {
-      return JVMTI_ERROR_UNMODIFIABLE_CLASS;
-    }
-    Klass* the_class_oop = java_lang_Class::as_Klass(mirror);
-    instanceKlassHandle the_class = instanceKlassHandle(THREAD, the_class_oop);
+    instanceKlassHandle the_class(THREAD, get_ik(_class_defs[i].klass));
     Symbol*  the_class_sym = the_class->name();
 
     log_debug(redefine, class, load)
@@ -3757,22 +3799,19 @@
     _timer_rsc_phase1.start();
   }
 
-  instanceKlassHandle scratch_class(scratch_class_oop);
-
-  oop the_class_mirror = JNIHandles::resolve_non_null(the_jclass);
-  Klass* the_class_oop = java_lang_Class::as_Klass(the_class_mirror);
-  instanceKlassHandle the_class = instanceKlassHandle(THREAD, the_class_oop);
+  instanceKlassHandle scratch_class(THREAD, scratch_class_oop);
+  instanceKlassHandle the_class(THREAD, get_ik(the_jclass));
 
   // Remove all breakpoints in methods of this class
   JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
-  jvmti_breakpoints.clearall_in_class_at_safepoint(the_class_oop);
+  jvmti_breakpoints.clearall_in_class_at_safepoint(the_class());
 
   // Deoptimize all compiled code that depends on this class
   flush_dependent_code(the_class, THREAD);
 
   _old_methods = the_class->methods();
   _new_methods = scratch_class->methods();
-  _the_class_oop = the_class_oop;
+  _the_class_oop = the_class();
   compute_added_deleted_matching_methods();
   update_jmethod_ids();
 
@@ -4002,10 +4041,10 @@
     increment_class_counter((InstanceKlass *)the_class(), THREAD);
     log_info(redefine, class, load)
       ("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
-       the_class->external_name(), java_lang_Class::classRedefinedCount(the_class_mirror), os::available_memory() >> 10);
+       the_class->external_name(), java_lang_Class::classRedefinedCount(the_class->java_mirror()), os::available_memory() >> 10);
     Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
                              the_class->external_name(),
-                             java_lang_Class::classRedefinedCount(the_class_mirror));
+                             java_lang_Class::classRedefinedCount(the_class->java_mirror()));
 
   }
   _timer_rsc_phase2.stop();
--- a/src/share/vm/prims/jvmtiRedefineClasses.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/prims/jvmtiRedefineClasses.hpp	Fri May 27 16:56:23 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -489,6 +489,10 @@
 
   void flush_dependent_code(instanceKlassHandle k_h, TRAPS);
 
+  // lock classes to redefine since constant pool merging isn't thread safe.
+  void lock_classes();
+  void unlock_classes();
+
   static void dump_methods();
 
   // Check that there are no old or obsolete methods
--- a/src/share/vm/runtime/arguments.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/runtime/arguments.cpp	Fri May 27 16:56:23 2016 +0300
@@ -1641,7 +1641,6 @@
   }
 
   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
-  log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
 }
 #endif // INCLUDE_ALL_GCS
 
@@ -1949,7 +1948,6 @@
   }
 
   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
-  log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
 }
 
 void Arguments::set_gc_specific_flags() {
--- a/src/share/vm/runtime/mutex.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/runtime/mutex.cpp	Fri May 27 16:56:23 2016 +0300
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/atomic.inline.hpp"
+#include "runtime/interfaceSupport.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/osThread.hpp"
--- a/src/share/vm/runtime/mutexLocker.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/runtime/mutexLocker.cpp	Fri May 27 16:56:23 2016 +0300
@@ -120,6 +120,7 @@
 Mutex*   Management_lock              = NULL;
 Monitor* Service_lock                 = NULL;
 Monitor* PeriodicTask_lock            = NULL;
+Monitor* RedefineClasses_lock         = NULL;
 
 #ifdef INCLUDE_TRACE
 Mutex*   JfrStacktrace_lock           = NULL;
@@ -264,6 +265,7 @@
   def(Debug3_lock                  , Mutex  , nonleaf+4,   true,  Monitor::_safepoint_check_never);
   def(CompileThread_lock           , Monitor, nonleaf+5,   false, Monitor::_safepoint_check_always);
   def(PeriodicTask_lock            , Monitor, nonleaf+5,   true,  Monitor::_safepoint_check_sometimes);
+  def(RedefineClasses_lock         , Monitor, nonleaf+5,   true,  Monitor::_safepoint_check_always);
   if (WhiteBoxAPI) {
     def(Compilation_lock           , Monitor, leaf,        false, Monitor::_safepoint_check_never);
   }
--- a/src/share/vm/runtime/mutexLocker.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/runtime/mutexLocker.hpp	Fri May 27 16:56:23 2016 +0300
@@ -121,6 +121,7 @@
 extern Mutex*   Management_lock;                 // a lock used to serialize JVM management
 extern Monitor* Service_lock;                    // a lock used for service thread operation
 extern Monitor* PeriodicTask_lock;               // protects the periodic task structure
+extern Monitor* RedefineClasses_lock;            // locks classes from parallel redefinition
 
 #ifdef INCLUDE_TRACE
 extern Mutex*   JfrStacktrace_lock;              // used to guard access to the JFR stacktrace table
--- a/src/share/vm/runtime/vm_operations.cpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/runtime/vm_operations.cpp	Fri May 27 16:56:23 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -201,10 +201,12 @@
 }
 
 bool VM_PrintThreads::doit_prologue() {
-  assert(Thread::current()->is_Java_thread(), "just checking");
-
   // Make sure AbstractOwnableSynchronizer is loaded
-  java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
+  JavaThread* jt = JavaThread::current();
+  java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
+  if (jt->has_pending_exception()) {
+    return false;
+  }
 
   // Get Heap_lock if concurrent locks will be dumped
   if (_print_concurrent_locks) {
@@ -240,11 +242,13 @@
 }
 
 bool VM_FindDeadlocks::doit_prologue() {
-  assert(Thread::current()->is_Java_thread(), "just checking");
-
-  // Load AbstractOwnableSynchronizer class
   if (_concurrent_locks) {
-    java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
+    // Make sure AbstractOwnableSynchronizer is loaded
+    JavaThread* jt = JavaThread::current();
+    java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
+    if (jt->has_pending_exception()) {
+      return false;
+    }
   }
 
   return true;
@@ -298,10 +302,12 @@
 }
 
 bool VM_ThreadDump::doit_prologue() {
-  assert(Thread::current()->is_Java_thread(), "just checking");
-
-  // Load AbstractOwnableSynchronizer class before taking thread snapshots
-  java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
+  // Make sure AbstractOwnableSynchronizer is loaded
+  JavaThread* jt = JavaThread::current();
+  java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
+  if (jt->has_pending_exception()) {
+    return false;
+  }
 
   if (_with_locked_synchronizers) {
     // Acquire Heap_lock to dump concurrent locks
--- a/src/share/vm/utilities/macros.hpp	Thu May 26 14:17:50 2016 +0200
+++ b/src/share/vm/utilities/macros.hpp	Fri May 27 16:56:23 2016 +0300
@@ -34,6 +34,9 @@
 // Makes a string of the macro expansion of a
 #define XSTR(a) STR(a)
 
+// Allow commas in macro arguments.
+#define COMMA ,
+
 // Apply pre-processor token pasting to the expansions of x and y.
 // The token pasting operator (##) prevents its arguments from being
 // expanded.  This macro allows expansion of its arguments before the
--- a/test/Makefile	Thu May 26 14:17:50 2016 +0200
+++ b/test/Makefile	Fri May 27 16:56:23 2016 +0300
@@ -306,7 +306,10 @@
 endif
 
 ifdef CONCURRENCY
-  EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
+  JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
+endif
+ifdef EXTRA_JTREG_OPTIONS
+  JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
 endif
 
 # Default JTREG to run
@@ -326,8 +329,6 @@
 # Multiply by 4 the timeout factor
 JTREG_TIMEOUT_OPTION =  -timeoutFactor:4
 JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
-# Add any extra options
-JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
 # Set other vm and test options
 JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
 
--- a/test/gc/g1/Test2GbHeap.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/Test2GbHeap.java	Fri May 27 16:56:23 2016 +0300
@@ -25,9 +25,9 @@
  * @test Test2GbHeap
  * @bug 8031686
  * @summary Regression test to ensure we can start G1 with 2gb heap.
- * Skip test on 32 bit Windows: it typically does not support the many and large virtual memory reservations needed.
+ * Skip test on 32 bit system: it typically does not support the many and large virtual memory reservations needed.
  * @requires (vm.gc == "G1" | vm.gc == "null")
- * @requires !((sun.arch.data.model == "32") & (os.family == "windows"))
+ * @requires vm.bits != "32"
  * @key gc
  * @key regression
  * @library /testlibrary
--- a/test/gc/g1/TestShrinkAuxiliaryData00.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/TestShrinkAuxiliaryData00.java	Fri May 27 16:56:23 2016 +0300
@@ -25,7 +25,6 @@
  * @test TestShrinkAuxiliaryData00
  * @bug 8038423 8061715
  * @summary Checks that decommitment occurs for JVM with different
- * @ignore 8155957
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
@@ -36,7 +35,7 @@
  *        TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run driver/timeout=720 TestShrinkAuxiliaryData00
+ * @run main/timeout=720 TestShrinkAuxiliaryData00
  */
 public class TestShrinkAuxiliaryData00 {
 
--- a/test/gc/g1/TestShrinkAuxiliaryData05.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/TestShrinkAuxiliaryData05.java	Fri May 27 16:56:23 2016 +0300
@@ -26,7 +26,6 @@
  * @bug 8038423 8061715 8078405
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
- * @ignore 8155957
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
  * @library /testlibrary /test/lib
@@ -36,7 +35,7 @@
  *        TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run driver/timeout=720 TestShrinkAuxiliaryData05
+ * @run main/timeout=720 TestShrinkAuxiliaryData05
  */
 public class TestShrinkAuxiliaryData05 {
 
--- a/test/gc/g1/TestShrinkAuxiliaryData10.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/TestShrinkAuxiliaryData10.java	Fri May 27 16:56:23 2016 +0300
@@ -26,7 +26,6 @@
  * @bug 8038423 8061715 8078405
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
- * @ignore 8155957
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
  * @library /testlibrary /test/lib
@@ -36,7 +35,7 @@
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run driver/timeout=720 TestShrinkAuxiliaryData10
+ * @run main/timeout=720 TestShrinkAuxiliaryData10
  */
 public class TestShrinkAuxiliaryData10 {
 
--- a/test/gc/g1/TestShrinkAuxiliaryData15.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/TestShrinkAuxiliaryData15.java	Fri May 27 16:56:23 2016 +0300
@@ -26,7 +26,6 @@
  * @bug 8038423 8061715 8078405
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
- * @ignore 8155957
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
  * @library /testlibrary /test/lib
@@ -36,7 +35,7 @@
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run driver/timeout=720 TestShrinkAuxiliaryData15
+ * @run main/timeout=720 TestShrinkAuxiliaryData15
  */
 public class TestShrinkAuxiliaryData15 {
 
--- a/test/gc/g1/TestShrinkAuxiliaryData20.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/TestShrinkAuxiliaryData20.java	Fri May 27 16:56:23 2016 +0300
@@ -26,7 +26,6 @@
  * @bug 8038423 8061715 8078405
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
- * @ignore 8155957
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
  * @library /testlibrary /test/lib
@@ -36,7 +35,7 @@
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run driver/timeout=720 TestShrinkAuxiliaryData20
+ * @run main/timeout=720 TestShrinkAuxiliaryData20
  */
 public class TestShrinkAuxiliaryData20 {
 
--- a/test/gc/g1/TestShrinkAuxiliaryData25.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/TestShrinkAuxiliaryData25.java	Fri May 27 16:56:23 2016 +0300
@@ -26,7 +26,6 @@
  * @bug 8038423 8061715 8078405
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
- * @ignore 8155957
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
  * @library /testlibrary /test/lib
@@ -36,7 +35,7 @@
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run driver/timeout=720 TestShrinkAuxiliaryData25
+ * @run main/timeout=720 TestShrinkAuxiliaryData25
  */
 public class TestShrinkAuxiliaryData25 {
 
--- a/test/gc/g1/TestShrinkAuxiliaryData30.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/gc/g1/TestShrinkAuxiliaryData30.java	Fri May 27 16:56:23 2016 +0300
@@ -26,7 +26,6 @@
  * @bug 8038423 8061715 8078405
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
- * @ignore 8155957
  * @requires vm.gc=="G1" | vm.gc=="null"
  * @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
  * @library /testlibrary /test/lib
@@ -36,7 +35,7 @@
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run driver/timeout=720 TestShrinkAuxiliaryData30
+ * @run main/timeout=720 TestShrinkAuxiliaryData30
  */
 public class TestShrinkAuxiliaryData30 {
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/native/GTestWrapper.java	Fri May 27 16:56:23 2016 +0300
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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
+ * @summary a jtreg wrapper for gtest tests
+ * @library /test/lib/share/classes
+ * @modules java.base/jdk.internal.misc
+ * @run main/native GTestWrapper
+ */
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+import java.util.stream.Collectors;
+
+import java.nio.file.Paths;
+import java.nio.file.Path;
+
+import jdk.test.lib.Platform;
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+
+public class GTestWrapper {
+    public static void main(String[] args) throws Throwable {
+        // gtestLauncher is located in <test_image>/hotspot/gtest/<vm_variant>/
+        // nativePath points either to <test_image>/hotspot/jtreg/native or to <test_image>/hotspot/gtest
+        Path nativePath = Paths.get(System.getProperty("test.nativepath"));
+        String jvmVariantDir = getJVMVariantSubDir();
+        // let's assume it's <test_image>/hotspot/gtest
+        Path path = nativePath.resolve(jvmVariantDir);
+        if (!path.toFile().exists()) {
+            // maybe it is <test_image>/hotspot/jtreg/native
+            path = nativePath.getParent()
+                             .getParent()
+                             .resolve("gtest")
+                             .resolve(jvmVariantDir);
+        }
+        if (!path.toFile().exists()) {
+            throw new Error("TESTBUG: the library has not been found in " + nativePath);
+        }
+        path = path.resolve("gtestLauncher" + (Platform.isWindows() ? ".exe" : ""));
+        Stream<String> launcherArgs = Stream.of(path.toString(), "-jdk",
+                System.getProperty("test.jdk"));
+        // JVM accepts only -X and -D flags
+        Stream<String> vmFLags = Arrays.stream(Utils.getTestJavaOpts())
+                                       .filter(s -> s.startsWith("-X") || s.startsWith("-D"));
+        String[] cmds = Stream.concat(launcherArgs, vmFLags)
+                              .toArray(String[]::new);
+        ProcessTools.executeCommand(cmds).shouldHaveExitValue(0);
+    }
+
+    private static String getJVMVariantSubDir() {
+        if (Platform.isServer()) {
+            return "server";
+        } else if (Platform.isClient()) {
+            return "client";
+        } else if (Platform.isMinimal()) {
+            return "minimal";
+        } else {
+            throw new Error("TESTBUG: unsuppported vm variant");
+        }
+    }
+}
--- a/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java	Fri May 27 16:56:23 2016 +0300
@@ -90,14 +90,6 @@
         excludeTestMaxRange("CICompilerCount");
 
         /*
-         * JDK-8156679
-         * Temporarily exclude from range testing as the range is not
-         * valid for all platforms
-         */
-        excludeTestRange("AllocatePrefetchLines");
-        excludeTestRange("AllocateInstancePrefetchLines");
-
-        /*
          * JDK-8136766
          * Temporarily remove ThreadStackSize from testing because Windows can set it to 0
          * (for default OS size) but other platforms insist it must be greater than 0
--- a/test/runtime/modules/AccessCheck/CheckRead.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/CheckRead.java	Fri May 27 16:56:23 2016 +0300
@@ -103,7 +103,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java	Fri May 27 16:56:23 2016 +0300
@@ -103,7 +103,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java	Fri May 27 16:56:23 2016 +0300
@@ -105,7 +105,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java	Fri May 27 16:56:23 2016 +0300
@@ -91,7 +91,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java	Fri May 27 16:56:23 2016 +0300
@@ -92,7 +92,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java	Fri May 27 16:56:23 2016 +0300
@@ -91,7 +91,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/DiffCL_Umod.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/DiffCL_Umod.java	Fri May 27 16:56:23 2016 +0300
@@ -92,7 +92,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@@ -141,7 +141,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@@ -190,7 +190,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
--- a/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java	Fri May 27 16:56:23 2016 +0300
@@ -87,7 +87,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@@ -136,7 +136,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
--- a/test/runtime/modules/AccessCheck/ExpQualOther.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/ExpQualOther.java	Fri May 27 16:56:23 2016 +0300
@@ -105,7 +105,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/ExpQualToM1.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/ExpQualToM1.java	Fri May 27 16:56:23 2016 +0300
@@ -81,7 +81,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/ExpUnqual.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/ExpUnqual.java	Fri May 27 16:56:23 2016 +0300
@@ -81,7 +81,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/ExportAllUnnamed.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/ExportAllUnnamed.java	Fri May 27 16:56:23 2016 +0300
@@ -93,7 +93,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/PkgNotExp.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/PkgNotExp.java	Fri May 27 16:56:23 2016 +0300
@@ -91,7 +91,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/Umod.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/Umod.java	Fri May 27 16:56:23 2016 +0300
@@ -92,7 +92,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      // map module m1 to class loader.
      // class c2 will be loaded in an unnamed module/loader.
@@ -138,7 +138,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MySameClassLoader loader = new MySameClassLoader();
      // map module m1 to class loader.
@@ -184,7 +184,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MySameClassLoader loader = new MySameClassLoader();
      // map module m1 to class loader.
--- a/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java	Fri May 27 16:56:23 2016 +0300
@@ -92,7 +92,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java	Fri May 27 16:56:23 2016 +0300
@@ -92,7 +92,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java	Fri May 27 16:56:23 2016 +0300
@@ -91,7 +91,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/UmodUPkg.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodUPkg.java	Fri May 27 16:56:23 2016 +0300
@@ -87,7 +87,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      // map module m1 to class loader.
      // class c4 will be loaded in an unnamed module/loader.
@@ -133,7 +133,7 @@
      // Resolves "m1"
      Configuration cf = Layer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
      MySameClassLoader loader = new MySameClassLoader();
      // map module m1 to class loader.
--- a/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java	Fri May 27 16:56:23 2016 +0300
@@ -92,7 +92,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java	Fri May 27 16:56:23 2016 +0300
@@ -91,7 +91,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java	Fri May 27 16:56:23 2016 +0300
@@ -101,7 +101,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java	Fri May 27 16:56:23 2016 +0300
@@ -89,7 +89,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java	Fri May 27 16:56:23 2016 +0300
@@ -101,7 +101,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java	Fri May 27 16:56:23 2016 +0300
@@ -91,7 +91,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- a/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java	Fri May 27 16:56:23 2016 +0300
@@ -89,7 +89,7 @@
         // Resolves "m1"
         Configuration cf = Layer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/serviceability/logging/TestDefaultLogOutput.java	Fri May 27 16:56:23 2016 +0300
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 TestDefaultLogOutput
+ * @summary Ensure logging is default on stdout.
+ * @modules java.base/jdk.internal.misc
+ * @library /testlibrary
+ */
+
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+
+public class TestDefaultLogOutput {
+
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:badTag");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.stdoutShouldMatch("\\[error *\\]\\[logging *\\]");
+        output.shouldHaveExitValue(1);
+    }
+}
+
--- a/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Thu May 26 14:17:50 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.hotspot;
-
-import java.lang.reflect.Executable;
-import java.util.Arrays;
-import java.util.List;
-import java.util.function.Function;
-import java.util.stream.Stream;
-import java.security.BasicPermission;
-
-import sun.hotspot.parser.DiagnosticCommand;
-
-public class WhiteBox {
-
-  @SuppressWarnings("serial")
-  public static class WhiteBoxPermission extends BasicPermission {
-    public WhiteBoxPermission(String s) {
-      super(s);
-    }
-  }
-
-  private WhiteBox() {}
-  private static final WhiteBox instance = new WhiteBox();
-  private static native void registerNatives();
-
-  /**
-   * Returns the singleton WhiteBox instance.
-   *
-   * The returned WhiteBox object should be carefully guarded
-   * by the caller, since it can be used to read and write data
-   * at arbitrary memory addresses. It must never be passed to
-   * untrusted code.
-   */
-  public synchronized static WhiteBox getWhiteBox() {
-    SecurityManager sm = System.getSecurityManager();
-    if (sm != null) {
-      sm.checkPermission(new WhiteBoxPermission("getInstance"));
-    }
-    return instance;
-  }
-
-  static {
-    registerNatives();
-  }
-
-  // Get the maximum heap size supporting COOPs
-  public native long getCompressedOopsMaxHeapSize();
-  // Arguments
-  public native void printHeapSizes();
-
-  // Memory
-  public native long getObjectAddress(Object o);
-  public native int  getHeapOopSize();
-  public native int  getVMPageSize();
-  public native boolean isObjectInOldGen(Object o);
-  public native long getObjectSize(Object o);
-
-  // Runtime
-  // Make sure class name is in the correct format
-  public boolean isClassAlive(String name) {
-    return isClassAlive0(name.replace('.', '/'));
-  }
-  private native boolean isClassAlive0(String name);
-
-  // JVMTI
-  public native void addToBootstrapClassLoaderSearch(String segment);
-  public native void addToSystemClassLoaderSearch(String segment);
-
-  // G1
-  public native boolean g1InConcurrentMark();
-  public native boolean g1IsHumongous(Object o);
-  public native long    g1NumFreeRegions();
-  public native int     g1RegionSize();
-  public native Object[]    parseCommandLine(String commandline, char delim, DiagnosticCommand[] args);
-
-  // NMT
-  public native long NMTMalloc(long size);
-  public native void NMTFree(long mem);
-  public native long NMTReserveMemory(long size);
-  public native void NMTCommitMemory(long addr, long size);
-  public native void NMTUncommitMemory(long addr, long size);
-  public native void NMTReleaseMemory(long addr, long size);
-  public native long NMTMallocWithPseudoStack(long size, int index);
-  public native boolean NMTIsDetailSupported();
-  public native boolean NMTChangeTrackingLevel();
-  public native int NMTGetHashSize();
-
-  // Compiler
-  public native void    deoptimizeAll();
-  public        boolean isMethodCompiled(Executable method) {
-    return isMethodCompiled(method, false /*not osr*/);
-  }
-  public native boolean isMethodCompiled(Executable method, boolean isOsr);
-  public        boolean isMethodCompilable(Executable method) {
-    return isMethodCompilable(method, -1 /*any*/);
-  }
-  public        boolean isMethodCompilable(Executable method, int compLevel) {
-    return isMethodCompilable(method, compLevel, false /*not osr*/);
-  }
-  public native boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr);
-  public native boolean isMethodQueuedForCompilation(Executable method);
-  public        int     deoptimizeMethod(Executable method) {
-    return deoptimizeMethod(method, false /*not osr*/);
-  }
-  public native int     deoptimizeMethod(Executable method, boolean isOsr);
-  public        void    makeMethodNotCompilable(Executable method) {
-    makeMethodNotCompilable(method, -1 /*any*/);
-  }
-  public        void    makeMethodNotCompilable(Executable method, int compLevel) {
-    makeMethodNotCompilable(method, compLevel, false /*not osr*/);
-  }
-  public native void    makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr);
-  public        int     getMethodCompilationLevel(Executable method) {
-    return getMethodCompilationLevel(method, false /*not ost*/);
-  }
-  public native int     getMethodCompilationLevel(Executable method, boolean isOsr);
-  public native boolean testSetDontInlineMethod(Executable method, boolean value);
-  public        int     getCompileQueuesSize() {
-    return getCompileQueueSize(-1 /*any*/);
-  }
-  public native int     getCompileQueueSize(int compLevel);
-  public native boolean testSetForceInlineMethod(Executable method, boolean value);
-  public        boolean enqueueMethodForCompilation(Executable method, int compLevel) {
-    return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
-  }
-  public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci);
-  public native void    clearMethodState(Executable method);
-  public native void    lockCompilation();
-  public native void    unlockCompilation();
-  public native int     getMethodEntryBci(Executable method);
-  public native Object[] getNMethod(Executable method, boolean isOsr);
-  public native long    allocateCodeBlob(int size, int type);
-  public        long    allocateCodeBlob(long size, int type) {
-      int intSize = (int) size;
-      if ((long) intSize != size || size < 0) {
-          throw new IllegalArgumentException(
-                "size argument has illegal value " + size);
-      }
-      return allocateCodeBlob( intSize, type);
-  }
-  public native void    freeCodeBlob(long addr);
-  public        void    forceNMethodSweep() {
-    try {
-        forceNMethodSweep0().join();
-    } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-    }
-  }
-  public native Thread  forceNMethodSweep0();
-  public native Object[] getCodeHeapEntries(int type);
-  public native int     getCompilationActivityMode();
-  public native Object[] getCodeBlob(long addr);
-
-  // Intered strings
-  public native boolean isInStringTable(String str);
-
-  // Memory
-  public native void readReservedMemory();
-  public native long allocateMetaspace(ClassLoader classLoader, long size);
-  public native void freeMetaspace(ClassLoader classLoader, long addr, long size);
-  public native long incMetaspaceCapacityUntilGC(long increment);
-  public native long metaspaceCapacityUntilGC();
-
-  // Force Young GC
-  public native void youngGC();
-
-  // Force Full GC
-  public native void fullGC();
-
-  // Method tries to start concurrent mark cycle.
-  // It returns false if CM Thread is always in concurrent cycle.
-  public native boolean g1StartConcMarkCycle();
-
-  // Tests on ReservedSpace/VirtualSpace classes
-  public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations);
-  public native void runMemoryUnitTests();
-  public native void readFromNoaccessArea();
-  public native long getThreadStackSize();
-  public native long getThreadRemainingStackSize();
-
-  // CPU features
-  public native String getCPUFeatures();
-
-  // Native extensions
-  public native long getHeapUsageForContext(int context);
-  public native long getHeapRegionCountForContext(int context);
-  public native int getContextForObject(Object obj);
-  public native void printRegionInfo(int context);
-
-  // VM flags
-  public native boolean isConstantVMFlag(String name);
-  public native boolean isLockedVMFlag(String name);
-  public native void    setBooleanVMFlag(String name, boolean value);
-  public native void    setIntxVMFlag(String name, long value);
-  public native void    setUintxVMFlag(String name, long value);
-  public native void    setUint64VMFlag(String name, long value);
-  public native void    setSizeTVMFlag(String name, long value);
-  public native void    setStringVMFlag(String name, String value);
-  public native void    setDoubleVMFlag(String name, double value);
-  public native Boolean getBooleanVMFlag(String name);
-  public native Long    getIntxVMFlag(String name);
-  public native Long    getUintxVMFlag(String name);
-  public native Long    getUint64VMFlag(String name);
-  public native Long    getSizeTVMFlag(String name);
-  public native String  getStringVMFlag(String name);
-  public native Double  getDoubleVMFlag(String name);
-  private final List<Function<String,Object>> flagsGetters = Arrays.asList(
-    this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag,
-    this::getUint64VMFlag, this::getSizeTVMFlag, this::getStringVMFlag,
-    this::getDoubleVMFlag);
-
-  public Object getVMFlag(String name) {
-    return flagsGetters.stream()
-                       .map(f -> f.apply(name))
-                       .filter(x -> x != null)
-                       .findAny()
-                       .orElse(null);
-  }
-
-  // Jigsaw
-  public native Object DefineModule(String name, Object loader, Object[] packages);
-  public native void AddModuleExports(Object from_module, String pkg, Object to_module);
-  public native void AddReadsModule(Object from_module, Object to_module);
-  public native boolean CanReadModule(Object asking_module, Object target_module);
-  public native boolean IsExportedToModule(Object from_module, String pkg, Object to_module);
-  public native Object GetModule(Class clazz);
-  public native void AddModulePackage(Object module, String pkg);
-
-  // Image File
-  public native boolean readImageFile(String imagefile);
-
-  public native int getOffsetForName0(String name);
-  public int getOffsetForName(String name) throws Exception {
-    int offset = getOffsetForName0(name);
-    if (offset == -1) {
-      throw new RuntimeException(name + " not found");
-    }
-    return offset;
-  }
-
-}
--- a/test/testlibrary_tests/SimpleClassFileLoadHookTest.java	Thu May 26 14:17:50 2016 +0200
+++ b/test/testlibrary_tests/SimpleClassFileLoadHookTest.java	Fri May 27 16:56:23 2016 +0300
@@ -24,7 +24,7 @@
 /*
  * @test
  * @library /testlibrary
- *
+ * @requires vm.flavor != "minimal"
  * @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY
  *      SimpleClassFileLoadHookTest
  */