changeset 53458:b50498b948df

Merge
author robm
date Mon, 01 Apr 2019 13:30:41 -0700
parents e1a6269ea44a 415b57a93dfb
children b6c02a742b40
files
diffstat 18 files changed, 292 insertions(+), 111 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Mon Apr 01 13:30:41 2019 -0700
@@ -1687,7 +1687,7 @@
 
 
   // Helper for generating a dynamic type check.
-  // Smashes rscratch1.
+  // Smashes rscratch1, rscratch2.
   void generate_type_check(Register sub_klass,
                            Register super_check_offset,
                            Register super_klass,
@@ -1979,6 +1979,10 @@
     const Register dst_pos    = c_rarg3;  // destination position
     const Register length     = c_rarg4;
 
+
+    // Registers used as temps
+    const Register dst_klass  = c_rarg5;
+
     __ align(CodeEntryAlignment);
 
     StubCodeMark mark(this, "StubRoutines", name);
@@ -2184,8 +2188,7 @@
       arraycopy_range_checks(src, src_pos, dst, dst_pos, scratch_length,
                              r18, L_failed);
 
-      const Register rscratch2_dst_klass = rscratch2;
-      __ load_klass(rscratch2_dst_klass, dst); // reload
+      __ load_klass(dst_klass, dst); // reload
 
       // Marshal the base address arguments now, freeing registers.
       __ lea(from, Address(src, src_pos, Address::lsl(LogBytesPerHeapOop)));
@@ -2195,24 +2198,25 @@
       __ movw(count, length);           // length (reloaded)
       Register sco_temp = c_rarg3;      // this register is free now
       assert_different_registers(from, to, count, sco_temp,
-                                 rscratch2_dst_klass, scratch_src_klass);
+                                 dst_klass, scratch_src_klass);
       // assert_clean_int(count, sco_temp);
 
       // Generate the type check.
       const int sco_offset = in_bytes(Klass::super_check_offset_offset());
-      __ ldrw(sco_temp, Address(rscratch2_dst_klass, sco_offset));
-      // assert_clean_int(sco_temp, r18);
-      generate_type_check(scratch_src_klass, sco_temp, rscratch2_dst_klass, L_plain_copy);
+      __ ldrw(sco_temp, Address(dst_klass, sco_offset));
+
+      // Smashes rscratch1, rscratch2
+      generate_type_check(scratch_src_klass, sco_temp, dst_klass, L_plain_copy);
 
       // Fetch destination element klass from the ObjArrayKlass header.
       int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
-      __ ldr(rscratch2_dst_klass, Address(rscratch2_dst_klass, ek_offset));
-      __ ldrw(sco_temp, Address(rscratch2_dst_klass, sco_offset));
+      __ ldr(dst_klass, Address(dst_klass, ek_offset));
+      __ ldrw(sco_temp, Address(dst_klass, sco_offset));
 
       // the checkcast_copy loop needs two extra arguments:
       assert(c_rarg3 == sco_temp, "#3 already in place");
       // Set up arguments for checkcast_copy_entry.
-      __ mov(c_rarg4, rscratch2_dst_klass);  // dst.klass.element_klass
+      __ mov(c_rarg4, dst_klass);  // dst.klass.element_klass
       __ b(RuntimeAddress(checkcast_copy_entry));
     }
 
--- a/src/hotspot/cpu/x86/crc32c.h	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/cpu/x86/crc32c.h	Mon Apr 01 13:30:41 2019 -0700
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2015, 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
@@ -22,6 +22,9 @@
 *
 */
 
+#ifndef CPU_X86_CRC32C_H
+#define CPU_X86_CRC32C_H
+
 enum {
   // S. Gueron / Information Processing Letters 112 (2012) 184
   // shows than anything above 6K and below 32K is a good choice
@@ -64,3 +67,5 @@
 // a) constants table generation (hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp)
 // b) constant fetch from that table (macroAssembler_x86.cpp)
 // c) unrolled for loop (macroAssembler_x86.cpp)
+
+#endif /* !CPU_X86_CRC32C_H */
--- a/src/hotspot/share/c1/c1_LIRGenerator.cpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp	Mon Apr 01 13:30:41 2019 -0700
@@ -3285,7 +3285,14 @@
 
 void LIRGenerator::increment_backedge_counter_conditionally(LIR_Condition cond, LIR_Opr left, LIR_Opr right, CodeEmitInfo* info, int left_bci, int right_bci, int bci) {
   if (compilation()->count_backedges()) {
+#if defined(X86) && !defined(_LP64)
+    // BEWARE! On 32-bit x86 cmp clobbers its left argument so we need a temp copy.
+    LIR_Opr left_copy = new_register(left->type());
+    __ move(left, left_copy);
+    __ cmp(cond, left_copy, right);
+#else
     __ cmp(cond, left, right);
+#endif
     LIR_Opr step = new_register(T_INT);
     LIR_Opr plus_one = LIR_OprFact::intConst(InvocationCounter::count_increment);
     LIR_Opr zero = LIR_OprFact::intConst(0);
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Mon Apr 01 13:30:41 2019 -0700
@@ -226,7 +226,10 @@
 
     template <typename T>
     static void oop_store_in_heap(T* addr, oop value) {
-      ShenandoahBarrierSet::barrier_set()->write_ref_field_pre_work(addr, value);
+      const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
+      if (keep_alive) {
+        ShenandoahBarrierSet::barrier_set()->write_ref_field_pre_work(addr, value);
+      }
       Raw::oop_store(addr, value);
     }
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Mon Apr 01 13:30:41 2019 -0700
@@ -58,7 +58,8 @@
     expected = res;
   } while ((! oopDesc::equals_raw(compare_value, expected)) && oopDesc::equals_raw(resolve_forwarded(compare_value), resolve_forwarded(expected)));
   if (oopDesc::equals_raw(expected, compare_value)) {
-    if (ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value)) {
+    const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
+    if (keep_alive && ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value)) {
       ShenandoahBarrierSet::barrier_set()->enqueue(compare_value);
     }
   }
@@ -70,7 +71,8 @@
 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_xchg_in_heap(oop new_value, T* addr) {
   oop previous = Raw::oop_atomic_xchg(new_value, addr);
   if (ShenandoahSATBBarrier) {
-    if (!CompressedOops::is_null(previous)) {
+    const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
+    if (keep_alive && !CompressedOops::is_null(previous)) {
       ShenandoahBarrierSet::barrier_set()->enqueue(previous);
     }
   }
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp	Mon Apr 01 13:30:41 2019 -0700
@@ -47,7 +47,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 
-template<UpdateRefsMode UPDATE_REFS, StringDedupMode STRING_DEDUP>
+template<UpdateRefsMode UPDATE_REFS>
 class ShenandoahInitMarkRootsClosure : public OopClosure {
 private:
   ShenandoahObjToScanQueue* _queue;
@@ -56,7 +56,7 @@
 
   template <class T>
   inline void do_oop_work(T* p) {
-    ShenandoahConcurrentMark::mark_through_ref<T, UPDATE_REFS, STRING_DEDUP>(p, _heap, _queue, _mark_context);
+    ShenandoahConcurrentMark::mark_through_ref<T, UPDATE_REFS, NO_DEDUP>(p, _heap, _queue, _mark_context);
   }
 
 public:
@@ -98,13 +98,8 @@
 
     ShenandoahObjToScanQueue* q = queues->queue(worker_id);
 
-    if (ShenandoahStringDedup::is_enabled()) {
-      ShenandoahInitMarkRootsClosure<UPDATE_REFS, ENQUEUE_DEDUP> mark_cl(q);
-      do_work(heap, &mark_cl, worker_id);
-    } else {
-      ShenandoahInitMarkRootsClosure<UPDATE_REFS, NO_DEDUP> mark_cl(q);
-      do_work(heap, &mark_cl, worker_id);
-    }
+    ShenandoahInitMarkRootsClosure<UPDATE_REFS> mark_cl(q);
+    do_work(heap, &mark_cl, worker_id);
   }
 
 private:
--- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp	Mon Apr 01 13:30:41 2019 -0700
@@ -48,7 +48,10 @@
   f(scan_string_table_roots,                        "    S: String Table Roots")        \
   f(scan_universe_roots,                            "    S: Universe Roots")            \
   f(scan_jni_roots,                                 "    S: JNI Roots")                 \
+  f(scan_jvmti_weak_roots,                          "    S: JVMTI Weak Roots")          \
+  f(scan_jfr_weak_roots,                            "    S: JFR Weak Roots")            \
   f(scan_jni_weak_roots,                            "    S: JNI Weak Roots")            \
+  f(scan_vm_weak_roots,                             "    S: VM Weak Roots")             \
   f(scan_synchronizer_roots,                        "    S: Synchronizer Roots")        \
   f(scan_management_roots,                          "    S: Management Roots")          \
   f(scan_system_dictionary_roots,                   "    S: System Dict Roots")         \
@@ -70,7 +73,10 @@
   f(update_string_table_roots,                      "    U: String Table Roots")        \
   f(update_universe_roots,                          "    U: Universe Roots")            \
   f(update_jni_roots,                               "    U: JNI Roots")                 \
+  f(update_jvmti_weak_roots,                        "    U: JVMTI Weak Roots")          \
+  f(update_jfr_weak_roots,                          "    U: JFR Weak Roots")            \
   f(update_jni_weak_roots,                          "    U: JNI Weak Roots")            \
+  f(update_vm_weak_roots,                           "    U: VM Weak Roots")             \
   f(update_synchronizer_roots,                      "    U: Synchronizer Roots")        \
   f(update_management_roots,                        "    U: Management Roots")          \
   f(update_system_dictionary_roots,                 "    U: System Dict Roots")         \
@@ -100,7 +106,10 @@
   f(evac_string_table_roots,                        "    E: String Table Roots")        \
   f(evac_universe_roots,                            "    E: Universe Roots")            \
   f(evac_jni_roots,                                 "    E: JNI Roots")                 \
+  f(evac_jvmti_weak_roots,                          "    E: JVMTI Weak Roots")          \
+  f(evac_jfr_weak_roots,                            "    E: JFR Weak Roots")            \
   f(evac_jni_weak_roots,                            "    E: JNI Weak Roots")            \
+  f(evac_vm_weak_roots,                             "    E: VM Weak Roots")             \
   f(evac_synchronizer_roots,                        "    E: Synchronizer Roots")        \
   f(evac_management_roots,                          "    E: Management Roots")          \
   f(evac_system_dictionary_roots,                   "    E: System Dict Roots")         \
@@ -127,7 +136,10 @@
   f(final_update_refs_string_table_roots,            "    UR: String Table Roots")      \
   f(final_update_refs_universe_roots,                "    UR: Universe Roots")          \
   f(final_update_refs_jni_roots,                     "    UR: JNI Roots")               \
-  f(final_update_refs_jni_weak_roots,                "    UR: JNI Weak Roots")          \
+  f(final_update_jvmti_weak_roots,                   "    UR: JVMTI Weak Roots")        \
+  f(final_update_jfr_weak_roots,                     "    UR: JFR Weak Roots")          \
+  f(final_update_jni_weak_roots,                     "    UR: JNI Weak Roots")          \
+  f(final_update_vm_weak_roots,                      "    UR: VM Weak Roots")           \
   f(final_update_refs_synchronizer_roots,            "    UR: Synchronizer Roots")      \
   f(final_update_refs_management_roots,              "    UR: Management Roots")        \
   f(final_update_refs_system_dict_roots,             "    UR: System Dict Roots")       \
@@ -149,7 +161,10 @@
   f(degen_gc_update_string_table_roots,              "    DU: String Table Roots")      \
   f(degen_gc_update_universe_roots,                  "    DU: Universe Roots")          \
   f(degen_gc_update_jni_roots,                       "    DU: JNI Roots")               \
+  f(degen_gc_update_jvmti_weak_roots,                "    DU: JVMTI Weak Roots")        \
+  f(degen_gc_update_jfr_weak_roots,                  "    DU: JFR Weak Roots")          \
   f(degen_gc_update_jni_weak_roots,                  "    DU: JNI Weak Roots")          \
+  f(degen_gc_update_vm_weak_roots,                   "    DU: VM Weak Roots")           \
   f(degen_gc_update_synchronizer_roots,              "    DU: Synchronizer Roots")      \
   f(degen_gc_update_management_roots,                "    DU: Management Roots")        \
   f(degen_gc_update_system_dict_roots,               "    DU: System Dict Roots")       \
@@ -172,7 +187,10 @@
   f(init_traversal_gc_string_table_roots,            "    TI: String Table Roots")      \
   f(init_traversal_gc_universe_roots,                "    TI: Universe Roots")          \
   f(init_traversal_gc_jni_roots,                     "    TI: JNI Roots")               \
+  f(init_traversal_gc_jvmti_weak_roots,              "    TI: JVMTI Weak Roots")        \
+  f(init_traversal_gc_jfr_weak_roots,                "    TI: JFR Weak Roots")          \
   f(init_traversal_gc_jni_weak_roots,                "    TI: JNI Weak Roots")          \
+  f(init_traversal_gc_vm_weak_roots,                 "    TI: VM Weak Roots")           \
   f(init_traversal_gc_synchronizer_roots,            "    TI: Synchronizer Roots")      \
   f(init_traversal_gc_management_roots,              "    TI: Management Roots")        \
   f(init_traversal_gc_system_dict_roots,             "    TI: System Dict Roots")       \
@@ -192,7 +210,10 @@
   f(final_traversal_gc_string_table_roots,           "    TF: String Table Roots")      \
   f(final_traversal_gc_universe_roots,               "    TF: Universe Roots")          \
   f(final_traversal_gc_jni_roots,                    "    TF: JNI Roots")               \
+  f(final_traversal_gc_jvmti_weak_roots,             "    TF: JVMTI Weak Roots")        \
+  f(final_traversal_gc_jfr_weak_roots,               "    TF: JFR Weak Roots")          \
   f(final_traversal_gc_jni_weak_roots,               "    TF: JNI Weak Roots")          \
+  f(final_traversal_gc_vm_weak_roots,                "    TF: VM Weak Roots")           \
   f(final_traversal_gc_synchronizer_roots,           "    TF: Synchronizer Roots")      \
   f(final_traversal_gc_management_roots,             "    TF: Management Roots")        \
   f(final_traversal_gc_system_dict_roots,            "    TF: System Dict Roots")       \
@@ -210,7 +231,10 @@
   f(final_traversal_update_string_table_roots,       "    TU: String Table Roots")      \
   f(final_traversal_update_universe_roots,           "    TU: Universe Roots")          \
   f(final_traversal_update_jni_roots,                "    TU: JNI Roots")               \
+  f(final_traversal_update_jvmti_weak_roots,         "    TU: JVMTI Weak Roots")        \
+  f(final_traversal_update_jfr_weak_roots,           "    TU: JFR Weak Roots")          \
   f(final_traversal_update_jni_weak_roots,           "    TU: JNI Weak Roots")          \
+  f(final_traversal_update_vm_weak_roots,            "    TU: VM Weak Roots")           \
   f(final_traversal_update_synchronizer_roots,       "    TU: Synchronizer Roots")      \
   f(final_traversal_update_management_roots,         "    TU: Management Roots")        \
   f(final_traversal_update_system_dict_roots,        "    TU: System Dict Roots")       \
@@ -234,7 +258,10 @@
   f(full_gc_string_table_roots,                      "    F: String Table Roots")       \
   f(full_gc_universe_roots,                          "    F: Universe Roots")           \
   f(full_gc_jni_roots,                               "    F: JNI Roots")                \
+  f(full_gc_jvmti_weak_roots,                        "    F: JVMTI Weak Roots")         \
+  f(full_gc_jfr_weak_roots,                          "    F: JFR Weak Roots")           \
   f(full_gc_jni_weak_roots,                          "    F: JNI Weak Roots")           \
+  f(full_gc_vm_weak_roots,                           "    F: VM Weak Roots")            \
   f(full_gc_synchronizer_roots,                      "    F: Synchronizer Roots")       \
   f(full_gc_management_roots,                        "    F: Management Roots")         \
   f(full_gc_system_dictionary_roots,                 "    F: System Dict Roots")        \
@@ -289,7 +316,10 @@
   f(StringTableRoots,        "StringTable Roots (ms):")         \
   f(UniverseRoots,           "Universe Roots (ms):")            \
   f(JNIRoots,                "JNI Handles Roots (ms):")         \
+  f(JVMTIWeakRoots,          "JVMTI Weak Roots (ms):")          \
+  f(JFRWeakRoots,            "JFR Weak Roots (ms):")            \
   f(JNIWeakRoots,            "JNI Weak Roots (ms):")            \
+  f(VMWeakRoots,             "VM Weak Roots(ms)")               \
   f(ObjectSynchronizerRoots, "ObjectSynchronizer Roots (ms):")  \
   f(ManagementRoots,         "Management Roots (ms):")          \
   f(SystemDictionaryRoots,   "SystemDictionary Roots (ms):")    \
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Mon Apr 01 13:30:41 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -41,6 +41,24 @@
 #include "runtime/thread.hpp"
 #include "services/management.hpp"
 
+struct PhaseMap {
+  WeakProcessorPhases::Phase            _weak_processor_phase;
+  ShenandoahPhaseTimings::GCParPhases   _shenandoah_phase;
+};
+
+static const struct PhaseMap phase_mapping[] = {
+#if INCLUDE_JVMTI
+  {WeakProcessorPhases::jvmti,       ShenandoahPhaseTimings::JVMTIWeakRoots},
+#endif
+#if INCLUDE_JFR
+  {WeakProcessorPhases::jfr,         ShenandoahPhaseTimings::JFRWeakRoots},
+#endif
+  {WeakProcessorPhases::jni,         ShenandoahPhaseTimings::JNIWeakRoots},
+  {WeakProcessorPhases::vm,          ShenandoahPhaseTimings::VMWeakRoots}
+};
+
+STATIC_ASSERT(sizeof(phase_mapping) / sizeof(PhaseMap) == WeakProcessorPhases::phase_count);
+
 ShenandoahRootProcessor::ShenandoahRootProcessor(ShenandoahHeap* heap, uint n_workers,
                                                  ShenandoahPhaseTimings::Phase phase) :
   _process_strong_tasks(new SubTasksDone(SHENANDOAH_RP_PS_NumElements)),
@@ -48,8 +66,9 @@
   _par_state_string(StringTable::weak_storage()),
   _phase(phase),
   _coderoots_all_iterator(ShenandoahCodeRoots::iterator()),
-  _weak_processor_task(n_workers)
-{
+  _weak_processor_timings(n_workers),
+  _weak_processor_task(&_weak_processor_timings, n_workers),
+  _processed_weak_roots(false) {
   heap->phase_timings()->record_workers_start(_phase);
 
   if (ShenandoahStringDedup::is_enabled()) {
@@ -63,9 +82,32 @@
     StringDedup::gc_epilogue();
   }
 
+  ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
+
+  if (_processed_weak_roots) {
+    assert(_weak_processor_timings.max_threads() == n_workers(), "Must match");
+    for (uint index = 0; index < WeakProcessorPhases::phase_count; index ++) {
+      weak_processor_timing_to_shenandoah_timing(phase_mapping[index]._weak_processor_phase,
+                                                 phase_mapping[index]._shenandoah_phase,
+                                                 worker_times);
+    }
+  }
+
   ShenandoahHeap::heap()->phase_timings()->record_workers_end(_phase);
 }
 
+void ShenandoahRootProcessor::weak_processor_timing_to_shenandoah_timing(const WeakProcessorPhases::Phase wpp,
+                                                                         const ShenandoahPhaseTimings::GCParPhases spp,
+                                                                         ShenandoahWorkerTimings* worker_times) const {
+  if (WeakProcessorPhases::is_serial(wpp)) {
+    worker_times->record_time_secs(spp, 0, _weak_processor_timings.phase_time_sec(wpp));
+  } else {
+    for (uint index = 0; index < _weak_processor_timings.max_threads(); index ++) {
+      worker_times->record_time_secs(spp, index, _weak_processor_timings.worker_time_sec(index, wpp));
+    }
+  }
+}
+
 void ShenandoahRootProcessor::process_all_roots_slow(OopClosure* oops) {
   CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong);
   CodeBlobToOopClosure blobs(oops, !CodeBlobToOopClosure::FixRelocations);
@@ -194,9 +236,9 @@
     SystemDictionary::oops_do(strong_roots);
   }
   if (jni_weak_roots != NULL) {
-      ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::JNIWeakRoots, worker_id);
-      AlwaysTrueClosure always_true;
-      _weak_processor_task.work<AlwaysTrueClosure, OopClosure>(worker_id, &always_true, jni_weak_roots);
+    AlwaysTrueClosure always_true;
+    _weak_processor_task.work<AlwaysTrueClosure, OopClosure>(worker_id, &always_true, jni_weak_roots);
+    _processed_weak_roots = true;
   }
 
   if (ShenandoahStringDedup::is_enabled() && weak_roots != NULL) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Mon Apr 01 13:30:41 2019 -0700
@@ -31,6 +31,7 @@
 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
 #include "gc/shared/strongRootsScope.hpp"
 #include "gc/shared/weakProcessor.hpp"
+#include "gc/shared/weakProcessorPhaseTimes.hpp"
 #include "gc/shared/workgroup.hpp"
 #include "memory/allocation.hpp"
 #include "memory/iterator.hpp"
@@ -60,7 +61,9 @@
   ParallelCLDRootIterator   _cld_iterator;
   ShenandoahAllCodeRootsIterator _coderoots_all_iterator;
   CodeBlobClosure* _threads_nmethods_cl;
-  WeakProcessor::Task _weak_processor_task;
+  WeakProcessorPhaseTimes _weak_processor_timings;
+  WeakProcessor::Task     _weak_processor_task;
+  bool                    _processed_weak_roots;
 
   void process_java_roots(OopClosure* scan_non_heap_roots,
                           CLDClosure* scan_strong_clds,
@@ -74,6 +77,10 @@
                         OopClosure* weak_jni_roots,
                         uint worker_i);
 
+  void weak_processor_timing_to_shenandoah_timing(const WeakProcessorPhases::Phase wpp,
+                                                  const ShenandoahPhaseTimings::GCParPhases spp,
+                                                  ShenandoahWorkerTimings* worker_times) const;
+
 public:
   ShenandoahRootProcessor(ShenandoahHeap* heap, uint n_workers,
                           ShenandoahPhaseTimings::Phase phase);
--- a/src/hotspot/share/opto/escape.cpp	Sun Mar 31 16:57:21 2019 -0700
+++ b/src/hotspot/share/opto/escape.cpp	Mon Apr 01 13:30:41 2019 -0700
@@ -1726,6 +1726,18 @@
     // access its field since the field value is unknown after it.
     //
     Node* n = field->ideal_node();
+
+    // Test for an unsafe access that was parsed as maybe off heap
+    // (with a CheckCastPP to raw memory).
+    assert(n->is_AddP(), "expect an address computation");
+    if (n->in(AddPNode::Base)->is_top() &&
+        n->in(AddPNode::Address)->Opcode() == Op_CheckCastPP) {
+      assert(n->in(AddPNode::Address)->bottom_type()->isa_rawptr(), "raw address so raw cast expected");
+      assert(_igvn->type(n->in(AddPNode::Address)->in(1))->isa_oopptr(), "cast pattern at unsafe access expected");
+      jobj->set_scalar_replaceable(false);
+      return;
+    }
+
     for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
       Node* u = n->fast_out(i);
       if (u->is_LoadStore() || (u->is_Mem() && u->as_Mem()->is_mismatched_access())) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/c1/Test8211100.java	Mon Apr 01 13:30:41 2019 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8211100
+ * @summary hotspot C1 issue with comparing long numbers on x86 32-bit
+ *
+ * @run main/othervm -XX:+PrintCompilation -XX:CompileOnly=compiler.c1.Test8211100::test
+ *                   -XX:CompileCommand=quiet compiler.c1.Test8211100
+ */
+
+package compiler.c1;
+
+public class Test8211100 {
+    private static final int ITERATIONS = 100_000;
+
+    public static void main(String[] args) {
+        for (int i = 0; i < ITERATIONS; i++) {
+            test(4558828911L,
+                 4294967296L);
+        }
+    }
+
+    private static void test(long one, long two) {
+        while (true) {
+            if (one >= two) {
+                break;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/unsafe/MaybeOffHeapUnsafeAccessToNewObject.java	Mon Apr 01 13:30:41 2019 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8219335
+ * @summary "failed: unexpected type" assert failure in ConnectionGraph::split_unique_types() with unsafe accesses
+ *
+ * @modules java.base/jdk.internal.misc
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation -Xcomp -XX:CompileOnly=MaybeOffHeapUnsafeAccessToNewObject::test1 -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline MaybeOffHeapUnsafeAccessToNewObject
+ */
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+public class MaybeOffHeapUnsafeAccessToNewObject {
+    public volatile int f_int = -1;
+
+
+    public static Unsafe unsafe = Unsafe.getUnsafe();
+    public static final long f_int_off;
+
+    static {
+        Field f_int_field = null;
+        try {
+            f_int_field = MaybeOffHeapUnsafeAccessToNewObject.class.getField("f_int");
+        } catch (Exception e) {
+            System.out.println("reflection failed " + e);
+            e.printStackTrace();
+        }
+        f_int_off = unsafe.objectFieldOffset(f_int_field);
+    }
+
+    static public void main(String[] args) {
+        MaybeOffHeapUnsafeAccessToNewObject o = new MaybeOffHeapUnsafeAccessToNewObject();
+        test1();
+    }
+
+    static Object test1_helper1(Object t) {
+        return t;
+    }
+
+    static long test1_helper2(long off) {
+        return off;
+    }
+
+    static int test1() {
+        MaybeOffHeapUnsafeAccessToNewObject t = new MaybeOffHeapUnsafeAccessToNewObject();
+        Object o = test1_helper1(t);
+        long off = test1_helper2(f_int_off);
+        return unsafe.getInt(o, off);
+    }
+
+}
--- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestMaybeNullUnsafeAccess.java	Sun Mar 31 16:57:21 2019 -0700
+++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestMaybeNullUnsafeAccess.java	Mon Apr 01 13:30:41 2019 -0700
@@ -28,7 +28,12 @@
  * @requires vm.gc.Shenandoah
  * @modules java.base/jdk.internal.misc:+open
  *
- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation TestMaybeNullUnsafeAccess
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation
+ *                   TestMaybeNullUnsafeAccess
+ *
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation
+ *                   -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC
+ *                   TestMaybeNullUnsafeAccess
  *
  */
 
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java	Sun Mar 31 16:57:21 2019 -0700
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestLoopMiningArguments.java	Mon Apr 01 13:30:41 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -53,50 +53,6 @@
     }
 
     public static void main(String[] args) throws Exception {
-        testDefaultGC();
-        testShenandoah();
-    }
-
-    public static void testDefaultGC() throws Exception {
-        testWith("Default GC should have CLS enabled, LSM = 1000",
-                true, 1000);
-
-        testWith("Default GC with +CLS should set LSM = 1",
-                true, 1,
-                "-XX:+UseCountedLoopSafepoints"
-        );
-
-        testWith("Default GC with +CLS should not override LSM>1",
-                true, 10,
-                "-XX:LoopStripMiningIter=10",
-                "-XX:+UseCountedLoopSafepoints"
-        );
-
-        testWith("Default GC with +CLS should not override LSM=1",
-                true, 1,
-                "-XX:LoopStripMiningIter=1",
-                "-XX:+UseCountedLoopSafepoints"
-        );
-
-        testWith("Default GC with +CLS should override LSM=0 to 1",
-                true, 1,
-                "-XX:LoopStripMiningIter=0",
-                "-XX:+UseCountedLoopSafepoints"
-        );
-
-        testWith("Default GC with -CLS should set LSM = 0",
-                false, 0,
-                "-XX:-UseCountedLoopSafepoints"
-        );
-
-        testWith("Default GC with -CLS should override LSM to 0",
-                false, 0,
-                "-XX:LoopStripMiningIter=10",
-                "-XX:-UseCountedLoopSafepoints"
-        );
-    }
-
-    public static void testShenandoah() throws Exception {
         testWith("Shenandoah should have CLS and LSM enabled",
                 true, 1000,
                 "-XX:+UnlockExperimentalVMOptions",
--- a/test/jdk/java/lang/String/StringRepeat.java	Sun Mar 31 16:57:21 2019 -0700
+++ b/test/jdk/java/lang/String/StringRepeat.java	Mon Apr 01 13:30:41 2019 -0700
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary This exercises String#repeat patterns and limits.
- * @run main/othervm -Xmx4G StringRepeat
+ * @run main/othervm -Xmx2g StringRepeat
  */
 
 import java.nio.CharBuffer;
--- a/test/jdk/java/math/BigInteger/LargeValueExceptions.java	Sun Mar 31 16:57:21 2019 -0700
+++ b/test/jdk/java/math/BigInteger/LargeValueExceptions.java	Mon Apr 01 13:30:41 2019 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 8200698
  * @summary Tests that exceptions are thrown for ops which would overflow
- * @requires os.maxMemory >= 4g
+ * @requires (sun.arch.data.model == "64" & os.maxMemory >= 4g)
  * @run testng/othervm -Xmx4g LargeValueExceptions
  */
 import java.math.BigInteger;
--- a/test/jdk/java/util/Scanner/ScanTest.java	Sun Mar 31 16:57:21 2019 -0700
+++ b/test/jdk/java/util/Scanner/ScanTest.java	Mon Apr 01 13:30:41 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -24,7 +24,7 @@
 /**
  * @test
  * @bug 4313885 4926319 4927634 5032610 5032622 5049968 5059533 6223711 6277261 6269946 6288823
- *      8072722 8139414 8166261
+ *      8072722 8139414 8166261 8172695
  * @summary Basic tests of java.util.Scanner methods
  * @key randomness
  * @modules jdk.localedata
@@ -49,26 +49,12 @@
     private static File inputFile = new File(System.getProperty("test.src", "."), "input.txt");
 
     public static void main(String[] args) throws Exception {
+        Locale defaultLocale = Locale.getDefault();
+        try {
+            // Before we have resource to improve the test to be ready for
+            // arbitrary locale, force the default locale to be ROOT for now.
+            Locale.setDefault(Locale.US);
 
-        Locale reservedLocale = Locale.getDefault();
-        String lang = reservedLocale.getLanguage();
-        try {
-            if (!"en".equals(lang) &&
-                !"zh".equals(lang) &&
-                !"ko".equals(lang) &&
-                !"ja".equals(lang)) {
-                //Before we have resource to improve the test to be ready for
-                //arbitrary locale, force the default locale to be "English"
-                //for now. First we check whether the "English" locale is
-                //available on the system as it could be absent due to varying
-                //configurations.
-                if (!Arrays.asList(Locale.getAvailableLocales())
-                    .contains(Locale.ENGLISH)) {
-                    throw new RuntimeException
-                       ("The \"English\" Locale is unavailable on this system");
-                }
-                Locale.setDefault(Locale.ENGLISH);
-            }
             skipTest();
             findInLineTest();
             findWithinHorizonTest();
@@ -128,7 +114,7 @@
                 System.err.println("OKAY: All tests passed.");
         } finally {
             // restore the default locale
-            Locale.setDefault(reservedLocale);
+            Locale.setDefault(defaultLocale);
         }
     }
 
--- a/test/langtools/tools/javac/modules/MOptionTest.java	Sun Mar 31 16:57:21 2019 -0700
+++ b/test/langtools/tools/javac/modules/MOptionTest.java	Mon Apr 01 13:30:41 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8146946 8176743
+ * @bug 8146946 8176743 8200286
  * @summary implement javac -m option
  * @library /tools/lib
  * @modules
@@ -39,7 +39,6 @@
 
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class MOptionTest extends ModuleTestBase {
     public static void main(String... args) throws Exception {
@@ -93,9 +92,10 @@
             throw new AssertionError("Classfile update!");
         }
 
-        Thread.sleep(2000); //timestamps
-
-        Files.setLastModifiedTime(testTest, FileTime.fromMillis(System.currentTimeMillis()));
+        // Date back the source file by one second compared to the current time.
+        // Cases have been observed where the resulting class file had an earlier
+        // timestamp than the java source.
+        Files.setLastModifiedTime(testTest, FileTime.fromMillis(System.currentTimeMillis() - 1000));
 
         new JavacTask(tb)
                 .options("-m", "m1x", "--module-source-path", src.toString(), "-d", build.toString())
@@ -235,10 +235,11 @@
             throw new AssertionError("Classfile update!");
         }
 
-        Thread.sleep(2000); //timestamps
-
-        Files.setLastModifiedTime(C1Source, FileTime.fromMillis(System.currentTimeMillis()));
-        Files.setLastModifiedTime(C2Source, FileTime.fromMillis(System.currentTimeMillis()));
+        // Date back the source file by one second compared to the current time.
+        // Cases have been observed where the resulting class file had an earlier
+        // timestamp than the java source.
+        Files.setLastModifiedTime(C1Source, FileTime.fromMillis(System.currentTimeMillis() - 1000));
+        Files.setLastModifiedTime(C2Source, FileTime.fromMillis(System.currentTimeMillis() - 1000));
 
         new JavacTask(tb)
                 .options("-m", "m1x,m2x", "--module-source-path", src.toString(), "-d", build.toString())