changeset 54986:f12e86f1b0d6

Merge
author psadhukhan
date Tue, 19 Feb 2019 11:52:19 +0530
parents f42d42c1ebdc 6fb43030a1b4
children 3bd474c23ee4 2d8172254394
files
diffstat 31 files changed, 166 insertions(+), 126 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/s390/stubGenerator_s390.cpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/cpu/s390/stubGenerator_s390.cpp	Tue Feb 19 11:52:19 2019 +0530
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016, 2017, SAP SE. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, SAP SE. 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
@@ -1842,6 +1842,51 @@
   }
 
 
+  // Compute GHASH function.
+  address generate_ghash_processBlocks() {
+    __ align(CodeEntryAlignment);
+    StubCodeMark mark(this, "StubRoutines", "ghash_processBlocks");
+    unsigned int start_off = __ offset();   // Remember stub start address (is rtn value).
+
+    const Register state   = Z_ARG1;
+    const Register subkeyH = Z_ARG2;
+    const Register data    = Z_ARG3; // 1st of even-odd register pair.
+    const Register blocks  = Z_ARG4;
+    const Register len     = blocks; // 2nd of even-odd register pair.
+
+    const int param_block_size = 4 * 8;
+    const int frame_resize = param_block_size + 8; // Extra space for copy of fp.
+
+    // Reserve stack space for parameter block (R1).
+    __ z_lgr(Z_R1, Z_SP);
+    __ resize_frame(-frame_resize, Z_R0, true);
+    __ z_aghi(Z_R1, -param_block_size);
+
+    // Fill parameter block.
+    __ z_mvc(Address(Z_R1)    , Address(state)  , 16);
+    __ z_mvc(Address(Z_R1, 16), Address(subkeyH), 16);
+
+    // R4+5: data pointer + length
+    __ z_llgfr(len, blocks);  // Cast to 64-bit.
+
+    // R0: function code
+    __ load_const_optimized(Z_R0, (int)VM_Version::MsgDigest::_GHASH);
+
+    // Compute.
+    __ z_sllg(len, len, 4);  // In bytes.
+    __ kimd(data);
+
+    // Copy back result and free parameter block.
+    __ z_mvc(Address(state), Address(Z_R1), 16);
+    __ z_xc(Address(Z_R1), param_block_size, Address(Z_R1));
+    __ z_aghi(Z_SP, frame_resize);
+
+    __ z_br(Z_R14);
+
+    return __ addr_at(start_off);
+  }
+
+
   // Call interface for all SHA* stubs.
   //
   //   Z_ARG1 - source data block. Ptr to leftmost byte to be processed.
@@ -2305,6 +2350,11 @@
       StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_AES_decrypt("AES_decryptBlock_chaining");
     }
 
+    // Generate GHASH intrinsics code
+    if (UseGHASHIntrinsics) {
+      StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks();
+    }
+
     // Generate SHA1/SHA256/SHA512 intrinsics code.
     if (UseSHA1Intrinsics) {
       StubRoutines::_sha1_implCompress     = generate_SHA1_stub(false,   "SHA1_singleBlock");
--- a/src/hotspot/cpu/s390/vm_version_s390.cpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/cpu/s390/vm_version_s390.cpp	Tue Feb 19 11:52:19 2019 +0530
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016, 2018 SAP SE. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019 SAP SE. 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
@@ -165,8 +165,10 @@
     FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
   }
 
-  // TODO: implement GHASH intrinsics
-  if (UseGHASHIntrinsics) {
+  if (FLAG_IS_DEFAULT(UseGHASHIntrinsics) && has_Crypto_GHASH()) {
+    FLAG_SET_DEFAULT(UseGHASHIntrinsics, true);
+  }
+  if (UseGHASHIntrinsics && !has_Crypto_GHASH()) {
     warning("GHASH intrinsics are not available on this CPU");
     FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
   }
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp	Tue Feb 19 11:52:19 2019 +0530
@@ -2761,7 +2761,7 @@
 CMSPhaseAccounting::~CMSPhaseAccounting() {
   _collector->gc_timer_cm()->register_gc_concurrent_end();
   _collector->stopTimer();
-  log_debug(gc)("Concurrent active time: %.3fms", TimeHelper::counter_to_seconds(_collector->timerTicks()));
+  log_debug(gc)("Concurrent active time: %.3fms", TimeHelper::counter_to_millis(_collector->timerTicks()));
   log_trace(gc)(" (CMS %s yielded %d times)", _title, _collector->yields());
 }
 
--- a/src/hotspot/share/gc/shared/genOopClosures.hpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/gc/shared/genOopClosures.hpp	Tue Feb 19 11:52:19 2019 +0530
@@ -29,7 +29,6 @@
 #include "oops/oop.hpp"
 
 class Generation;
-class HeapWord;
 class CardTableRS;
 class CardTableBarrierSet;
 class DefNewGeneration;
--- a/src/hotspot/share/gc/shared/spaceDecorator.cpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/gc/shared/spaceDecorator.cpp	Tue Feb 19 11:52:19 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, 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
@@ -36,7 +36,7 @@
 // pattern.
 bool SpaceMangler::is_mangled(HeapWord* q) {
   // This test loses precision but is good enough
-  return badHeapWord == (max_juint & (uintptr_t) q->value());
+  return badHeapWord == (max_juint & reinterpret_cast<uintptr_t>(*q));
 }
 
 
--- a/src/hotspot/share/gc/shared/vmStructs_gc.hpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/gc/shared/vmStructs_gc.hpp	Tue Feb 19 11:52:19 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -156,8 +156,6 @@
   nonstatic_field(GenCollectedHeap,            _young_gen_spec,                               GenerationSpec*)                       \
   nonstatic_field(GenCollectedHeap,            _old_gen_spec,                                 GenerationSpec*)                       \
                                                                                                                                      \
-  nonstatic_field(HeapWord,                    i,                                             char*)                                 \
-                                                                                                                                     \
   nonstatic_field(MemRegion,                   _start,                                        HeapWord*)                             \
   nonstatic_field(MemRegion,                   _word_size,                                    size_t)                                \
                                                                                                                                      \
--- a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp	Tue Feb 19 11:52:19 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
  *
  * 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
@@ -29,8 +29,6 @@
 #include "memory/memRegion.hpp"
 #include "oops/oopsHierarchy.hpp"
 
-class HeapWord;
-
 /**
  * Encapsulate a marking bitmap with the top-at-mark-start and top-bitmaps array.
  */
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp	Tue Feb 19 11:52:19 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
  *
  * 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
@@ -27,7 +27,6 @@
 #include "memory/allocation.hpp"
 #include "oops/oopsHierarchy.hpp"
 
-class HeapWord;
 class JavaThread;
 class oopDesc;
 
--- a/src/hotspot/share/memory/memRegion.hpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/memory/memRegion.hpp	Tue Feb 19 11:52:19 2019 +0530
@@ -40,8 +40,6 @@
 // create MemRegions (in CardTableBarrierSet) in heap so operator
 // new and operator new [] added for this special case.
 
-class MetaWord;
-
 class MemRegion {
   friend class VMStructs;
 private:
--- a/src/hotspot/share/memory/metaspace.hpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/memory/metaspace.hpp	Tue Feb 19 11:52:19 2019 +0530
@@ -57,7 +57,6 @@
 
 class ClassLoaderData;
 class MetaspaceTracer;
-class MetaWord;
 class Mutex;
 class outputStream;
 
--- a/src/hotspot/share/utilities/globalDefinitions.hpp	Mon Feb 18 10:45:21 2019 +0530
+++ b/src/hotspot/share/utilities/globalDefinitions.hpp	Tue Feb 19 11:52:19 2019 +0530
@@ -165,29 +165,18 @@
 // Size of a char[] needed to represent a jint as a string in decimal.
 const int jintAsStringSize = 12;
 
-// An opaque struct of heap-word width, so that HeapWord* can be a generic
-// pointer into the heap.  We require that object sizes be measured in
-// units of heap words, so that that
-//   HeapWord* hw;
+// An opaque type, so that HeapWord* can be a generic pointer into the heap.
+// We require that object sizes be measured in units of heap words (e.g.
+// pointer-sized values), so that given HeapWord* hw,
 //   hw += oop(hw)->foo();
 // works, where foo is a method (like size or scavenge) that returns the
 // object size.
-class HeapWord {
-  friend class VMStructs;
- private:
-  char* i;
-#ifndef PRODUCT
- public:
-  char* value() { return i; }
-#endif
-};
+class HeapWordImpl;             // Opaque, never defined.
+typedef HeapWordImpl* HeapWord;
 
-// Analogous opaque struct for metadata allocated from
-// metaspaces.
-class MetaWord {
- private:
-  char* i;
-};
+// Analogous opaque struct for metadata allocated from metaspaces.
+class MetaWordImpl;             // Opaque, never defined.
+typedef MetaWordImpl* MetaWord;
 
 // HeapWordSize must be 2^LogHeapWordSize.
 const int HeapWordSize        = sizeof(HeapWord);
--- a/test/hotspot/jtreg/ProblemList.txt	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/ProblemList.txt	Tue Feb 19 11:52:19 2019 +0530
@@ -188,7 +188,7 @@
 vmTestbase/vm/mlvm/meth/stress/gc/callSequencesDuringGC/Test.java 8058176 generic-all
 vmTestbase/vm/mlvm/meth/stress/java/sequences/Test.java 8058176 generic-all
 vmTestbase/vm/mlvm/meth/stress/jdi/breakpointInCompiledCode/Test.java 8058176 generic-all
-vmTestbase/vm/mlvm/mixed/stress/java/findDeadlock/TestDescription.java 8208278 generic-all
+vmTestbase/vm/mlvm/mixed/stress/java/findDeadlock/TestDescription.java 8208278 macosx-all
 vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2none_a/TestDescription.java 8013267 generic-all
 vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_b/TestDescription.java 8013267 generic-all
 vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_b/TestDescription.java 8013267 generic-all
--- a/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java	Tue Feb 19 11:52:19 2019 +0530
@@ -120,19 +120,16 @@
 
   public static void main(String args[]) throws Exception {
     String gcName = args[0];
-    final int M32 = 32 * 1024 * 1024;
-    final int M64 = 64 * 1024 * 1024;
-    final int M96 = 96 * 1024 * 1024;
-    final int M128 = 128 * 1024 * 1024;
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M" }, M128);
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=5" }, M128);
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M" }, M128);
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:OldSize=96M" }, M128);
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:MaxNewSize=32M" }, M32);
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M", "-XX:MaxNewSize=32M" }, M32);
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=6", "-XX:MaxNewSize=32M" }, M32);
-    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-Xms96M" }, M128);
-    checkMaxNewSize(new String[] { gcName, "-Xmx96M", "-Xms96M" }, M96);
-    checkMaxNewSize(new String[] { gcName, "-XX:NewSize=128M", "-XX:MaxNewSize=50M"}, M128);
+    final int M = 1024 * 1024;
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M" }, 128 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=5" }, 128 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M" }, 128 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:OldSize=96M" }, 128 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:MaxNewSize=32M" }, 32 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewSize=32M", "-XX:MaxNewSize=32M" }, 32 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-XX:NewRatio=6", "-XX:MaxNewSize=32M" }, 32 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx128M", "-Xms96M" }, 128 * M);
+    checkMaxNewSize(new String[] { gcName, "-Xmx96M", "-Xms96M" }, 96 * M);
+    checkMaxNewSize(new String[] { gcName, "-XX:NewSize=128M", "-XX:MaxNewSize=50M"}, 128 * M);
   }
 }
--- a/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/arguments/TestTargetSurvivorRatioFlag.java	Tue Feb 19 11:52:19 2019 +0530
@@ -23,6 +23,8 @@
 
 package gc.arguments;
 
+import static java.lang.ref.Reference.reachabilityFence;
+
 /*
  * @test TestTargetSurvivorRatioFlag
  * @key gc
@@ -297,7 +299,7 @@
 
             // force minor GC
             while (youngGCBean.getCollectionCount() <= initialGcId + MAX_TENURING_THRESHOLD * 2) {
-                byte b[] = new byte[ARRAY_LENGTH];
+                reachabilityFence(new byte[ARRAY_LENGTH]);
             }
 
             allocator.release();
--- a/test/hotspot/jtreg/gc/cms/DisableResizePLAB.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/cms/DisableResizePLAB.java	Tue Feb 19 11:52:19 2019 +0530
@@ -23,6 +23,8 @@
 
 package gc.cms;
 
+import static java.lang.ref.Reference.reachabilityFence;
+
 /*
  * @test DisableResizePLAB
  * @key gc
@@ -41,7 +43,7 @@
         }
         long startTime = System.currentTimeMillis();
         while (System.currentTimeMillis() - startTime < 10_000) {
-            Object o = new byte[1024];
+            reachabilityFence(new byte[1024]);
         }
     }
 }
--- a/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java	Tue Feb 19 11:52:19 2019 +0530
@@ -23,6 +23,8 @@
 
 package gc.cslocker;
 
+import static java.lang.ref.Reference.reachabilityFence;
+
 /*
  * @test TestCSLocker
  * @key gc
@@ -73,8 +75,7 @@
 
         while (isRunning) {
             try {
-                int[] arr = null;
-                arr = new int[size];
+                reachabilityFence(new int[size]);
                 sleep(sleepTime);
             } catch (InterruptedException e) {
                 isRunning = false;
--- a/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java	Tue Feb 19 11:52:19 2019 +0530
@@ -57,8 +57,8 @@
         MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
         long heapInit = memoryMXBean.getHeapMemoryUsage().getInit();
         long heapMax = memoryMXBean.getHeapMemoryUsage().getMax();
-        long nonHeapInit = memoryMXBean.getNonHeapMemoryUsage().getInit();
-        long nonHeapMax = memoryMXBean.getNonHeapMemoryUsage().getMax();
+        memoryMXBean.getNonHeapMemoryUsage().getInit(); // value not used
+        memoryMXBean.getNonHeapMemoryUsage().getMax();  // value not used
 
         if (initSize > 0 && heapInit != initSize) {
             throw new IllegalStateException("Init heap size is wrong: " + heapInit + " vs " + initSize);
--- a/test/hotspot/jtreg/gc/g1/TestFromCardCacheIndex.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/g1/TestFromCardCacheIndex.java	Tue Feb 19 11:52:19 2019 +0530
@@ -130,7 +130,7 @@
             if (target == null) {
                 continue;
             }
-            final long startAddress = WB.getObjectAddress(target);
+            WB.getObjectAddress(target); // startAddress not used
             final long lastAddress = getObjectLastAddress(target);
             final int card = getCardIndex32bit(lastAddress);
             if (card == -1) {
--- a/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java	Tue Feb 19 11:52:19 2019 +0530
@@ -23,6 +23,8 @@
 
 package gc.g1;
 
+import static java.lang.ref.Reference.reachabilityFence;
+
 /*
  * @test TestHumongousAllocNearlyFullRegion
  * @bug 8143587
@@ -62,7 +64,7 @@
             for (int i = 0; i < heapSize; i++) {
                 // 131069 is the number of longs it takes to fill a heapRegion except
                 // for 8 bytes on 64 bit.
-                long[] largeObect = new long[131069];
+                reachabilityFence(new long[131069]);
             }
         }
     }
--- a/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/g1/TestRemsetLoggingThreads.java	Tue Feb 19 11:52:19 2019 +0530
@@ -54,10 +54,6 @@
 
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
 
-    // a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used.
-    // Additionally use at least one thread.
-    int expectedNumRefinementThreads = refinementThreads;
-
     String pattern = "Concurrent RS threads times \\(s\\)$";
     Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout());
 
--- a/test/hotspot/jtreg/gc/g1/humongousObjects/TestHumongousClassLoader.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/g1/humongousObjects/TestHumongousClassLoader.java	Tue Feb 19 11:52:19 2019 +0530
@@ -156,6 +156,7 @@
         URLClassLoader urlLoader = new URLClassLoader(url);
 
         Class<?> simpleClassLoaderClass = urlLoader.loadClass(SIMPLE_CLASSLOADER_NAME);
+        urlLoader.close();
 
         ClassLoader simpleClassLoader = (ClassLoader) simpleClassLoaderClass
                 .getConstructor(java.lang.ClassLoader.class)
--- a/test/hotspot/jtreg/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java	Tue Feb 19 11:52:19 2019 +0530
@@ -26,6 +26,8 @@
 import jdk.test.lib.Utils;
 import sun.hotspot.WhiteBox;
 
+import static java.lang.ref.Reference.reachabilityFence;
+
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
@@ -139,7 +141,7 @@
                     // Dead object allocation
                     () -> {
                         int size = RND.nextInt(DEAD_OBJECT_MAX_SIZE);
-                        byte[] deadObject = new byte[size];
+                        reachabilityFence(new byte[size]);
                     },
 
                     // Check
--- a/test/hotspot/jtreg/gc/g1/plab/lib/LogParser.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/g1/plab/lib/LogParser.java	Tue Feb 19 11:52:19 2019 +0530
@@ -95,36 +95,37 @@
     }
 
     private PlabReport parseLines() throws NumberFormatException {
-        Scanner lineScanner = new Scanner(log);
-        PlabReport plabReport = new PlabReport();
-        Optional<Long> gc_id;
-        while (lineScanner.hasNextLine()) {
-            String line = lineScanner.nextLine();
-            gc_id = getGcId(line, GC_ID_PATTERN);
-            if (gc_id.isPresent()) {
-                Matcher matcher = PAIRS_PATTERN.matcher(line);
-                if (matcher.find()) {
-                    if (!plabReport.containsKey(gc_id.get())) {
-                        plabReport.put(gc_id.get(), new PlabGCStatistics());
+        try (Scanner lineScanner = new Scanner(log)) {
+            PlabReport plabReport = new PlabReport();
+            Optional<Long> gc_id;
+            while (lineScanner.hasNextLine()) {
+                String line = lineScanner.nextLine();
+                gc_id = getGcId(line, GC_ID_PATTERN);
+                if (gc_id.isPresent()) {
+                    Matcher matcher = PAIRS_PATTERN.matcher(line);
+                    if (matcher.find()) {
+                        if (!plabReport.containsKey(gc_id.get())) {
+                            plabReport.put(gc_id.get(), new PlabGCStatistics());
+                        }
+                        ReportType reportType = line.contains("Young") ? ReportType.SURVIVOR_STATS : ReportType.OLD_STATS;
+
+                        PlabGCStatistics gcStat = plabReport.get(gc_id.get());
+                        if (!gcStat.containsKey(reportType)) {
+                            gcStat.put(reportType, new PlabInfo());
+                        }
+
+                        // Extract all pairs from log.
+                        PlabInfo plabInfo = gcStat.get(reportType);
+                        do {
+                            String pair = matcher.group();
+                            String[] nameValue = pair.replaceAll(": ", ":").split(":");
+                            plabInfo.put(nameValue[0].trim(), Long.parseLong(nameValue[1]));
+                        } while (matcher.find());
                     }
-                    ReportType reportType = line.contains("Young") ? ReportType.SURVIVOR_STATS : ReportType.OLD_STATS;
-
-                    PlabGCStatistics gcStat = plabReport.get(gc_id.get());
-                    if (!gcStat.containsKey(reportType)) {
-                        gcStat.put(reportType, new PlabInfo());
-                    }
-
-                    // Extract all pairs from log.
-                    PlabInfo plabInfo = gcStat.get(reportType);
-                    do {
-                        String pair = matcher.group();
-                        String[] nameValue = pair.replaceAll(": ", ":").split(":");
-                        plabInfo.put(nameValue[0].trim(), Long.parseLong(nameValue[1]));
-                    } while (matcher.find());
                 }
             }
+            return plabReport;
         }
-        return plabReport;
     }
 
     private static Optional<Long> getGcId(String line, Pattern pattern) {
--- a/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java	Tue Feb 19 11:52:19 2019 +0530
@@ -27,7 +27,6 @@
 import java.io.File;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.function.Predicate;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 
@@ -67,8 +66,6 @@
   }
 
   private static void verifyContainsMetaSpaceUpdate(OutputAnalyzer output) {
-    Predicate<String> collectedMetaSpace = line -> check(line);
-
     // At least one metaspace line from GC should show GC being collected.
     boolean foundCollectedMetaSpace = output.asLines().stream()
         .filter(s -> s.contains("[gc,metaspace"))
--- a/test/hotspot/jtreg/gc/logging/TestPrintReferences.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/logging/TestPrintReferences.java	Tue Feb 19 11:52:19 2019 +0530
@@ -131,7 +131,6 @@
 
     // Find the first Reference Processing log and check its format.
     private static void checkLogFormat(OutputAnalyzer output, boolean parallelRefProcEnabled) {
-        String countRegex = "[0-9]+";
         String timeRegex = doubleRegex + "ms";
 
         /* Total Reference processing time */
--- a/test/hotspot/jtreg/gc/logging/TestUnifiedLoggingSwitchStress.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/logging/TestUnifiedLoggingSwitchStress.java	Tue Feb 19 11:52:19 2019 +0530
@@ -31,6 +31,9 @@
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
+
+import static java.lang.ref.Reference.reachabilityFence;
+
 import java.lang.management.ManagementFactory;
 import java.util.LinkedList;
 import java.util.List;
@@ -128,7 +131,7 @@
             // Dead object allocation
             () -> {
                 int size = RND.nextInt(DEAD_OBJECT_MAX_SIZE);
-                byte[] deadObject = new byte[size];
+                reachabilityFence(new byte[size]);
             }
     };
 
--- a/test/hotspot/jtreg/gc/metaspace/G1AddMetaspaceDependency.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/metaspace/G1AddMetaspaceDependency.java	Tue Feb 19 11:52:19 2019 +0530
@@ -111,13 +111,12 @@
     Loader f_loader = new Loader(b_name, b_bytes, a_name, a_loader);
     Loader g_loader = new Loader(b_name, b_bytes, a_name, a_loader);
 
-    Class<?> c;
-    c = b_loader.loadClass(b_name);
-    c = c_loader.loadClass(b_name);
-    c = d_loader.loadClass(b_name);
-    c = e_loader.loadClass(b_name);
-    c = f_loader.loadClass(b_name);
-    c = g_loader.loadClass(b_name);
+    b_loader.loadClass(b_name);
+    c_loader.loadClass(b_name);
+    d_loader.loadClass(b_name);
+    e_loader.loadClass(b_name);
+    f_loader.loadClass(b_name);
+    g_loader.loadClass(b_name);
   }
   public class A {
   }
--- a/test/hotspot/jtreg/gc/metaspace/TestMetaspaceInitialization.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/metaspace/TestMetaspaceInitialization.java	Tue Feb 19 11:52:19 2019 +0530
@@ -33,6 +33,7 @@
  */
 public class TestMetaspaceInitialization {
     private class Internal {
+        @SuppressWarnings("unused")
         public int x;
         public Internal(int x) {
             this.x = x;
--- a/test/hotspot/jtreg/gc/stress/gcbasher/Decompiler.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/stress/gcbasher/Decompiler.java	Tue Feb 19 11:52:19 2019 +0530
@@ -132,7 +132,7 @@
                             byteCodeIndex++;
                         }
 
-                        int def = cursor.readIntAt(byteCodeIndex);
+                        cursor.readIntAt(byteCodeIndex); // def
                         byteCodeIndex +=4;
 
                         int npairs = cursor.readIntAt(byteCodeIndex);
@@ -149,7 +149,7 @@
                             byteCodeIndex++;
                         }
 
-                        int def = cursor.readIntAt(byteCodeIndex);
+                        cursor.readIntAt(byteCodeIndex); // def
                         byteCodeIndex +=4;
 
                         int low = cursor.readIntAt(byteCodeIndex);
@@ -245,7 +245,7 @@
 
     private ConstantPoolEntry[] decodeConstantPool() {
         final int CONSTANT_Utf8 = 1;
-        final int CONSTANT_Unicode = 2;
+        // final int CONSTANT_Unicode = 2;
         final int CONSTANT_Integer = 3;
         final int CONSTANT_Float = 4;
         final int CONSTANT_Long = 5;
--- a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasher.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasher.java	Tue Feb 19 11:52:19 2019 +0530
@@ -38,14 +38,15 @@
         HashMap<String, ClassInfo> deps = new HashMap<>();
 
         FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
-        Stream<Path> s = Files.walk(fs.getPath("/"));
-        for (Path p : (Iterable<Path>)s::iterator) {
-            if (p.toString().endsWith(".class") &&
-                !p.getFileName().toString().equals("module-info.class")) {
-                byte[] data = Files.readAllBytes(p);
-                Decompiler d = new Decompiler(data);
-                ClassInfo ci = d.getClassInfo();
-                deps.put(ci.getName(), ci);
+        try (Stream<Path> s = Files.walk(fs.getPath("/"))) {
+            for (Path p : (Iterable<Path>)s::iterator) {
+                if (p.toString().endsWith(".class") &&
+                    !p.getFileName().toString().equals("module-info.class")) {
+                    byte[] data = Files.readAllBytes(p);
+                    Decompiler d = new Decompiler(data);
+                    ClassInfo ci = d.getClassInfo();
+                    deps.put(ci.getName(), ci);
+                }
             }
         }
     }
--- a/test/jdk/com/sun/java/swing/plaf/windows/AltFocusIssueTest.java	Mon Feb 18 10:45:21 2019 +0530
+++ b/test/jdk/com/sun/java/swing/plaf/windows/AltFocusIssueTest.java	Tue Feb 19 11:52:19 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,13 +21,15 @@
  * questions.
  */
 
-/* @test
-   @bug 8211987
-   @requires (os.family == "windows")
-   @summary Verify if Menu bar gets input focus even if Alt-released event is consumed.
-   @modules java.desktop/com.sun.java.swing.plaf.windows
-   @run main AltFocusIssueTest
-*/
+/**
+ * @test
+ * @bug 8211987
+ * @key headful
+ * @requires (os.family == "windows")
+ * @summary Verify if Menu bar gets input focus even if Alt-released event is consumed.
+ * @modules java.desktop/com.sun.java.swing.plaf.windows
+ * @run main AltFocusIssueTest
+ */
 
 import java.awt.event.KeyAdapter;
 import java.awt.event.KeyEvent;
@@ -145,7 +147,9 @@
         try {
             testAltEvents();
         } finally {
-            SwingUtilities.invokeAndWait(() -> frame.dispose());
+            if (frame != null) {
+                SwingUtilities.invokeAndWait(() -> frame.dispose());
+            }
         }
     }
 }