rsocket-branch: Merge with default rsocket-branch
authorchegar
Mon, 28 Jan 2019 13:56:39 +0000
branchrsocket-branch
changeset 57116 5e54d94c238a
parent 57115 512e7cc6ccce (current diff)
parent 53520 5178e4b58b17 (diff)
child 57117 7f1b415bfede
rsocket-branch: Merge with default
--- a/.hgtags	Sat Jan 26 14:02:35 2019 +0000
+++ b/.hgtags	Mon Jan 28 13:56:39 2019 +0000
@@ -536,5 +536,5 @@
 f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27
 a47b8125b7cc9ef59619745c163975fe935b57ed jdk-13+4
 659b004b6a1bd8c31e766cbdf328d8f8473fd4d7 jdk-12+28
-
 e3ed960609927b5fdfd0a797159835cd83a81a31 jdk-13+5
+44f41693631f9b5ac78ff4d2bfabd6734fe46df2 jdk-12+29
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -423,45 +423,14 @@
 }
 
 void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm, Register addr, Register expected, Register new_val,
-                                                bool acquire, bool release, bool weak, bool encode,
-                                                Register tmp1, Register tmp2, Register tmp3,
+                                                bool acquire, bool release, bool weak, bool is_cae,
                                                 Register result) {
 
-  if (!ShenandoahCASBarrier) {
-    if (UseCompressedOops) {
-      if (encode) {
-        __ encode_heap_oop(tmp1, expected);
-        expected = tmp1;
-        __ encode_heap_oop(tmp3, new_val);
-        new_val = tmp3;
-      }
-      __ cmpxchg(addr, expected, new_val, Assembler::word, /* acquire*/ true, /* release*/ true, /* weak*/ false, rscratch1);
-      __ membar(__ AnyAny);
-    } else {
-      __ cmpxchg(addr, expected, new_val, Assembler::xword, /* acquire*/ true, /* release*/ true, /* weak*/ false, rscratch1);
-      __ membar(__ AnyAny);
-    }
-    return;
-  }
-
-  if (encode) {
-    storeval_barrier(masm, new_val, tmp3);
-  }
-
-  if (UseCompressedOops) {
-    if (encode) {
-      __ encode_heap_oop(tmp1, expected);
-      expected = tmp1;
-      __ encode_heap_oop(tmp2, new_val);
-      new_val = tmp2;
-    }
-  }
-  bool is_cae = (result != noreg);
+  Register tmp = rscratch2;
   bool is_narrow = UseCompressedOops;
   Assembler::operand_size size = is_narrow ? Assembler::word : Assembler::xword;
-  if (! is_cae) result = rscratch1;
 
-  assert_different_registers(addr, expected, new_val, result, tmp3);
+  assert_different_registers(addr, expected, new_val, result, tmp);
 
   Label retry, done, fail;
 
@@ -474,35 +443,38 @@
     __ cmp(result, expected);
   }
   __ br(Assembler::NE, fail);
-  __ store_exclusive(tmp3, new_val, addr, size, release);
+  __ store_exclusive(tmp, new_val, addr, size, release);
   if (weak) {
-    __ cmpw(tmp3, 0u); // If the store fails, return NE to our caller
+    __ cmpw(tmp, 0u); // If the store fails, return NE to our caller
   } else {
-    __ cbnzw(tmp3, retry);
+    __ cbnzw(tmp, retry);
   }
   __ b(done);
 
  __  bind(fail);
   // Check if rb(expected)==rb(result)
   // Shuffle registers so that we have memory value ready for next expected.
-  __ mov(tmp3, expected);
+  __ mov(tmp, expected);
   __ mov(expected, result);
   if (is_narrow) {
     __ decode_heap_oop(result, result);
-    __ decode_heap_oop(tmp3, tmp3);
+    __ decode_heap_oop(tmp, tmp);
   }
   read_barrier_impl(masm, result);
-  read_barrier_impl(masm, tmp3);
-  __ cmp(result, tmp3);
+  read_barrier_impl(masm, tmp);
+  __ cmp(result, tmp);
   // Retry with expected now being the value we just loaded from addr.
   __ br(Assembler::EQ, retry);
-  if (is_narrow && is_cae) {
+  if (is_cae && is_narrow) {
     // For cmp-and-exchange and narrow oops, we need to restore
     // the compressed old-value. We moved it to 'expected' a few lines up.
     __ mov(result, expected);
   }
   __ bind(done);
 
+  if (!is_cae) {
+    __ cset(result, Assembler::EQ);
+  }
 }
 
 #ifdef COMPILER1
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp	Mon Jan 28 13:56:39 2019 +0000
@@ -60,7 +60,6 @@
   void read_barrier_not_null_impl(MacroAssembler* masm, Register dst);
   void write_barrier(MacroAssembler* masm, Register dst);
   void write_barrier_impl(MacroAssembler* masm, Register dst);
-  void storeval_barrier(MacroAssembler* masm, Register dst, Register tmp);
   void asm_acmp_barrier(MacroAssembler* masm, Register op1, Register op2);
 
   address generate_shenandoah_wb(StubCodeGenerator* cgen);
@@ -68,6 +67,8 @@
 public:
   static address shenandoah_wb();
 
+  void storeval_barrier(MacroAssembler* masm, Register dst, Register tmp);
+
 #ifdef COMPILER1
   void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);
   void gen_write_barrier_stub(LIR_Assembler* ce, ShenandoahWriteBarrierStub* stub);
@@ -92,9 +93,7 @@
                              Label& slow_case);
 
   void cmpxchg_oop(MacroAssembler* masm, Register addr, Register expected, Register new_val,
-                   bool acquire, bool release, bool weak, bool encode,
-                   Register tmp1, Register tmp2, Register tmp3 = rscratch2,
-                   Register result = noreg);
+                   bool acquire, bool release, bool weak, bool is_cae, Register result);
 
   virtual void barrier_stubs_init();
 };
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetC1_aarch64.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetC1_aarch64.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -28,15 +28,30 @@
 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
 
+#define __ masm->masm()->
+
 void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
   Register addr = _addr->as_register_lo();
   Register newval = _new_value->as_register();
   Register cmpval = _cmp_value->as_register();
   Register tmp1 = _tmp1->as_register();
   Register tmp2 = _tmp2->as_register();
-  ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), addr, cmpval, newval, /*acquire*/ false, /*release*/ true, /*weak*/ false, true, tmp1, tmp2);
+  Register result = result_opr()->as_register();
+
+  ShenandoahBarrierSet::assembler()->storeval_barrier(masm->masm(), newval, rscratch2);
+
+  if (UseCompressedOops) {
+    __ encode_heap_oop(tmp1, cmpval);
+    cmpval = tmp1;
+    __ encode_heap_oop(tmp2, newval);
+    newval = tmp2;
+  }
+
+  ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), addr, cmpval, newval, /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ false, result);
 }
 
+#undef __
+
 #ifdef ASSERT
 #define __ gen->lir(__FILE__, __LINE__)->
 #else
@@ -58,13 +73,9 @@
       LIR_Opr t1 = gen->new_register(T_OBJECT);
       LIR_Opr t2 = gen->new_register(T_OBJECT);
       LIR_Opr addr = access.resolved_addr()->as_address_ptr()->base();
-
-      __ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2,
-                                                   LIR_OprFact::illegalOpr));
+      LIR_Opr result = gen->new_register(T_INT);
 
-      LIR_Opr result = gen->new_register(T_INT);
-      __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
-               result, T_INT);
+      __ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, result));
       return result;
     }
   }
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad	Mon Jan 28 13:56:39 2019 +0000
@@ -26,22 +26,22 @@
 %}
 
 encode %{
-  enc_class aarch64_enc_cmpxchg_oop_shenandoah(memory mem, iRegP oldval, iRegP newval, iRegPNoSp tmp) %{
+  enc_class aarch64_enc_cmpxchg_oop_shenandoah(memory mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, iRegINoSp res) %{
     MacroAssembler _masm(&cbuf);
     guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ false, /*release*/ true, /*weak*/ false, /*encode*/ false, noreg, noreg);
+                                                   /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register);
   %}
 
-  enc_class aarch64_enc_cmpxchg_acq_oop_shenandoah(memory mem, iRegP oldval, iRegP newval, iRegPNoSp tmp) %{
+  enc_class aarch64_enc_cmpxchg_acq_oop_shenandoah(memory mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, iRegINoSp res) %{
     MacroAssembler _masm(&cbuf);
     guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding");
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ true, /*release*/ true, /*weak*/ false, /*encode*/ false, noreg, noreg);
+                                                   /*acquire*/ true, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register);
   %}
 %}
 
@@ -66,11 +66,9 @@
 
   format %{
     "cmpxchg_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
-    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
   %}
 
-  ins_encode(aarch64_enc_cmpxchg_oop_shenandoah(mem, oldval, newval, tmp),
-             aarch64_enc_cset_eq(res));
+  ins_encode(aarch64_enc_cmpxchg_oop_shenandoah(mem, oldval, newval, tmp, res));
 
   ins_pipe(pipe_slow);
 %}
@@ -84,14 +82,12 @@
 
   format %{
     "cmpxchgw_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
-    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
   %}
 
   ins_encode %{
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
-    ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ false, /*release*/ true, /*weak*/ false, /*encode*/ false, noreg, noreg);
-    __ cset($res$$Register, Assembler::EQ);
+    ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register);
   %}
 
   ins_pipe(pipe_slow);
@@ -107,11 +103,9 @@
 
   format %{
     "cmpxchg_acq_shenandoah_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
-    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
   %}
 
-  ins_encode(aarch64_enc_cmpxchg_acq_oop_shenandoah(mem, oldval, newval, tmp),
-             aarch64_enc_cset_eq(res));
+  ins_encode(aarch64_enc_cmpxchg_acq_oop_shenandoah(mem, oldval, newval, tmp, res));
 
   ins_pipe(pipe_slow);
 %}
@@ -126,14 +120,12 @@
 
  format %{
     "cmpxchgw_acq_shenandoah_narrow_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
-    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
  %}
 
   ins_encode %{
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
-    ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ true, /*release*/ true, /*weak*/ false, /*encode*/ false, noreg, noreg);
-    __ cset($res$$Register, Assembler::EQ);
+    ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, /*acquire*/ true, /*release*/ true, /*weak*/ false, /*is_cae*/ false, $res$$Register);
   %}
 
   ins_pipe(pipe_slow);
@@ -150,7 +142,7 @@
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ false, /*release*/ true, /*weak*/ false, /* encode*/ false, noreg, noreg, rscratch2, $res$$Register);
+                                                   /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ true, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
@@ -166,7 +158,7 @@
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ false, /*release*/ true, /*weak*/ false, /*encode*/ false, noreg, noreg, rscratch2, $res$$Register);
+                                                   /*acquire*/ false, /*release*/ true, /*weak*/ false, /*is_cae*/ true, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
@@ -183,7 +175,7 @@
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ true, /*release*/ true, /*weak*/ false, /* encode*/ false, noreg, noreg, rscratch2, $res$$Register);
+                                                   /*acquire*/ true, /*release*/ true, /*weak*/ false, /*is_cae*/ true, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
@@ -200,7 +192,7 @@
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ true, /*release*/ true, /*weak*/ false, /*encode*/ false, noreg, noreg, rscratch2, $res$$Register);
+                                                   /*acquire*/ true, /*release*/ true, /*weak*/ false, /*is_cae*/ true, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
@@ -217,8 +209,7 @@
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ false, /*release*/ true, /*weak*/ true, /*encode*/ false, noreg, noreg);
-    __ csetw($res$$Register, Assembler::EQ);
+                                                   /*acquire*/ false, /*release*/ true, /*weak*/ true, /*is_cae*/ false, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
@@ -229,14 +220,12 @@
   effect(TEMP tmp, KILL cr);
   format %{
     "cmpxchg_shenandoah $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval"
-    "csetw $res, EQ\t# $res <-- (EQ ? 1 : 0)"
   %}
   ins_encode %{
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ false, /*release*/ true, /*weak*/ true, /*encode*/ false, noreg, noreg);
-    __ csetw($res$$Register, Assembler::EQ);
+                                                   /*acquire*/ false, /*release*/ true, /*weak*/ true, /*is_cae*/ false, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
@@ -254,8 +243,7 @@
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ true, /*release*/ true, /*weak*/ true, /*encode*/ false, noreg, noreg);
-    __ csetw($res$$Register, Assembler::EQ);
+                                                   /*acquire*/ true, /*release*/ true, /*weak*/ true, /*is_cae*/ false, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
@@ -273,9 +261,7 @@
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register,
-                                                   /*acquire*/ true, /*release*/ true, /*weak*/ true, /*encode*/ false, noreg, noreg);
-    __ csetw($res$$Register, Assembler::EQ);
+                                                   /*acquire*/ true, /*release*/ true, /*weak*/ true, /*is_cae*/ false, $res$$Register);
   %}
   ins_pipe(pipe_slow);
 %}
-
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -592,64 +592,19 @@
 #ifndef _LP64
 void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm,
                                                 Register res, Address addr, Register oldval, Register newval,
-                                                bool exchange, bool encode, Register tmp1, Register tmp2) {
+                                                bool exchange, Register tmp1, Register tmp2) {
   // Shenandoah has no 32-bit version for this.
   Unimplemented();
 }
 #else
 void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm,
                                                 Register res, Address addr, Register oldval, Register newval,
-                                                bool exchange, bool encode, Register tmp1, Register tmp2) {
-  if (!ShenandoahCASBarrier) {
-#ifdef _LP64
-    if (UseCompressedOops) {
-      if (encode) {
-        __ encode_heap_oop(oldval);
-        __ mov(rscratch1, newval);
-        __ encode_heap_oop(rscratch1);
-        newval = rscratch1;
-      }
-      if (os::is_MP()) {
-        __ lock();
-      }
-      // oldval (rax) is implicitly used by this instruction
-      __ cmpxchgl(newval, addr);
-    } else
-#endif
-      {
-        if (os::is_MP()) {
-          __ lock();
-        }
-        __ cmpxchgptr(newval, addr);
-      }
-
-    if (!exchange) {
-      assert(res != NULL, "need result register");
-      __ setb(Assembler::equal, res);
-      __ movzbl(res, res);
-    }
-    return;
-  }
-
+                                                bool exchange, Register tmp1, Register tmp2) {
   assert(ShenandoahCASBarrier, "Should only be used when CAS barrier is enabled");
   assert(oldval == rax, "must be in rax for implicit use in cmpxchg");
 
   Label retry, done;
 
-  // Apply storeval barrier to newval.
-  if (encode) {
-    storeval_barrier(masm, newval, tmp1);
-  }
-
-  if (UseCompressedOops) {
-    if (encode) {
-      __ encode_heap_oop(oldval);
-      __ mov(rscratch1, newval);
-      __ encode_heap_oop(rscratch1);
-      newval = rscratch1;
-    }
-  }
-
   // Remember oldval for retry logic below
   if (UseCompressedOops) {
     __ movl(tmp1, oldval);
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp	Mon Jan 28 13:56:39 2019 +0000
@@ -64,7 +64,6 @@
   void write_barrier(MacroAssembler* masm, Register dst);
   void write_barrier_impl(MacroAssembler* masm, Register dst);
 
-  void storeval_barrier(MacroAssembler* masm, Register dst, Register tmp);
   void storeval_barrier_impl(MacroAssembler* masm, Register dst, Register tmp);
 
   address generate_shenandoah_wb(StubCodeGenerator* cgen);
@@ -75,6 +74,7 @@
 public:
   static address shenandoah_wb();
 
+  void storeval_barrier(MacroAssembler* masm, Register dst, Register tmp);
 #ifdef COMPILER1
   void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);
   void gen_write_barrier_stub(LIR_Assembler* ce, ShenandoahWriteBarrierStub* stub);
@@ -83,7 +83,7 @@
 
   void cmpxchg_oop(MacroAssembler* masm,
                    Register res, Address addr, Register oldval, Register newval,
-                   bool exchange, bool encode, Register tmp1, Register tmp2);
+                   bool exchange, Register tmp1, Register tmp2);
   virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
                                   Register src, Register dst, Register count);
   virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetC1_x86.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetC1_x86.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -28,20 +28,36 @@
 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
 
+#define __ masm->masm()->
+
 void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
   Register addr = _addr->as_register_lo();
   Register newval = _new_value->as_register();
   Register cmpval = _cmp_value->as_register();
   Register tmp1 = _tmp1->as_register();
   Register tmp2 = _tmp2->as_register();
+  Register result = result_opr()->as_register();
   assert(cmpval == rax, "wrong register");
   assert(newval != NULL, "new val must be register");
   assert(cmpval != newval, "cmp and new values must be in different registers");
   assert(cmpval != addr, "cmp and addr must be in different registers");
   assert(newval != addr, "new value and addr must be in different registers");
-  ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), NULL, Address(addr, 0), cmpval, newval, true, true, tmp1, tmp2);
+
+  // Apply storeval barrier to newval.
+  ShenandoahBarrierSet::assembler()->storeval_barrier(masm->masm(), newval, tmp1);
+
+  if (UseCompressedOops) {
+    __ encode_heap_oop(cmpval);
+    __ mov(rscratch1, newval);
+    __ encode_heap_oop(rscratch1);
+    newval = rscratch1;
+  }
+
+  ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), result, Address(addr, 0), cmpval, newval, false, tmp1, tmp2);
 }
 
+#undef __
+
 #ifdef ASSERT
 #define __ gen->lir(__FILE__, __LINE__)->
 #else
@@ -63,12 +79,9 @@
       LIR_Opr t1 = gen->new_register(T_OBJECT);
       LIR_Opr t2 = gen->new_register(T_OBJECT);
       LIR_Opr addr = access.resolved_addr()->as_address_ptr()->base();
-
-      __ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, LIR_OprFact::illegalOpr));
+      LIR_Opr result = gen->new_register(T_INT);
 
-      LIR_Opr result = gen->new_register(T_INT);
-      __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
-               result, T_INT);
+      __ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, result));
       return result;
     }
   }
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoah_x86_64.ad	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoah_x86_64.ad	Mon Jan 28 13:56:39 2019 +0000
@@ -83,7 +83,7 @@
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
                                                    $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
                                                    false, // swap
-                                                   false, $tmp1$$Register, $tmp2$$Register
+                                                   $tmp1$$Register, $tmp2$$Register
                                                    );
   %}
   ins_pipe( pipe_cmpxchg );
@@ -104,7 +104,7 @@
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
                                                    $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
                                                    false, // swap
-                                                   false, $tmp1$$Register, $tmp2$$Register
+                                                   $tmp1$$Register, $tmp2$$Register
                                                    );
   %}
   ins_pipe( pipe_cmpxchg );
@@ -123,7 +123,7 @@
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
                                                    NULL, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
                                                    true, // exchange
-                                                   false, $tmp1$$Register, $tmp2$$Register
+                                                   $tmp1$$Register, $tmp2$$Register
                                                    );
   %}
   ins_pipe( pipe_cmpxchg );
@@ -145,7 +145,7 @@
     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
                                                    NULL, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
                                                    true,  // exchange
-                                                   false, $tmp1$$Register, $tmp2$$Register
+                                                   $tmp1$$Register, $tmp2$$Register
                                                    );
   %}
   ins_pipe( pipe_cmpxchg );
--- a/src/hotspot/share/code/nmethod.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/code/nmethod.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -1100,7 +1100,11 @@
          "must be at safepoint");
 
   // Unregister must be done before the state change
-  Universe::heap()->unregister_nmethod(this);
+  {
+    MutexLockerEx ml(SafepointSynchronize::is_at_safepoint() ? NULL : CodeCache_lock,
+                     Mutex::_no_safepoint_check_flag);
+    Universe::heap()->unregister_nmethod(this);
+  }
 
   // Log the unloading.
   log_state_change();
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -777,11 +777,19 @@
     if (adr->bottom_type()->is_ptr_to_narrowoop()) {
       Node *newval_enc = kit->gvn().transform(new EncodePNode(new_val, new_val->bottom_type()->make_narrowoop()));
       Node *oldval_enc = kit->gvn().transform(new EncodePNode(expected_val, expected_val->bottom_type()->make_narrowoop()));
-      load_store = kit->gvn().transform(new ShenandoahCompareAndExchangeNNode(kit->control(), mem, adr, newval_enc, oldval_enc, adr_type, value_type->make_narrowoop(), mo));
+      if (ShenandoahCASBarrier) {
+        load_store = kit->gvn().transform(new ShenandoahCompareAndExchangeNNode(kit->control(), mem, adr, newval_enc, oldval_enc, adr_type, value_type->make_narrowoop(), mo));
+      } else {
+        load_store = kit->gvn().transform(new CompareAndExchangeNNode(kit->control(), mem, adr, newval_enc, oldval_enc, adr_type, value_type->make_narrowoop(), mo));
+      }
     } else
 #endif
     {
-      load_store = kit->gvn().transform(new ShenandoahCompareAndExchangePNode(kit->control(), mem, adr, new_val, expected_val, adr_type, value_type->is_oopptr(), mo));
+      if (ShenandoahCASBarrier) {
+        load_store = kit->gvn().transform(new ShenandoahCompareAndExchangePNode(kit->control(), mem, adr, new_val, expected_val, adr_type, value_type->is_oopptr(), mo));
+      } else {
+        load_store = kit->gvn().transform(new CompareAndExchangePNode(kit->control(), mem, adr, new_val, expected_val, adr_type, value_type->is_oopptr(), mo));
+      }
     }
 
     access.set_raw_access(load_store);
@@ -815,18 +823,34 @@
     if (adr->bottom_type()->is_ptr_to_narrowoop()) {
       Node *newval_enc = kit->gvn().transform(new EncodePNode(new_val, new_val->bottom_type()->make_narrowoop()));
       Node *oldval_enc = kit->gvn().transform(new EncodePNode(expected_val, expected_val->bottom_type()->make_narrowoop()));
-      if (is_weak_cas) {
-        load_store = kit->gvn().transform(new ShenandoahWeakCompareAndSwapNNode(kit->control(), mem, adr, newval_enc, oldval_enc, mo));
+      if (ShenandoahCASBarrier) {
+        if (is_weak_cas) {
+          load_store = kit->gvn().transform(new ShenandoahWeakCompareAndSwapNNode(kit->control(), mem, adr, newval_enc, oldval_enc, mo));
+        } else {
+          load_store = kit->gvn().transform(new ShenandoahCompareAndSwapNNode(kit->control(), mem, adr, newval_enc, oldval_enc, mo));
+        }
       } else {
-        load_store = kit->gvn().transform(new ShenandoahCompareAndSwapNNode(kit->control(), mem, adr, newval_enc, oldval_enc, mo));
+        if (is_weak_cas) {
+          load_store = kit->gvn().transform(new WeakCompareAndSwapNNode(kit->control(), mem, adr, newval_enc, oldval_enc, mo));
+        } else {
+          load_store = kit->gvn().transform(new CompareAndSwapNNode(kit->control(), mem, adr, newval_enc, oldval_enc, mo));
+        }
       }
     } else
 #endif
     {
-      if (is_weak_cas) {
-        load_store = kit->gvn().transform(new ShenandoahWeakCompareAndSwapPNode(kit->control(), mem, adr, new_val, expected_val, mo));
+      if (ShenandoahCASBarrier) {
+        if (is_weak_cas) {
+          load_store = kit->gvn().transform(new ShenandoahWeakCompareAndSwapPNode(kit->control(), mem, adr, new_val, expected_val, mo));
+        } else {
+          load_store = kit->gvn().transform(new ShenandoahCompareAndSwapPNode(kit->control(), mem, adr, new_val, expected_val, mo));
+        }
       } else {
-        load_store = kit->gvn().transform(new ShenandoahCompareAndSwapPNode(kit->control(), mem, adr, new_val, expected_val, mo));
+        if (is_weak_cas) {
+          load_store = kit->gvn().transform(new WeakCompareAndSwapPNode(kit->control(), mem, adr, new_val, expected_val, mo));
+        } else {
+          load_store = kit->gvn().transform(new CompareAndSwapPNode(kit->control(), mem, adr, new_val, expected_val, mo));
+        }
       }
     }
     access.set_raw_access(load_store);
--- a/src/hotspot/share/gc/z/zNMethodTable.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/gc/z/zNMethodTable.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -264,21 +264,17 @@
   }
 }
 
-bool ZNMethodTable::unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm) {
+void ZNMethodTable::unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm) {
   if (size == 0) {
     // Table is empty
-    return false;
+    return;
   }
 
   size_t index = first_index(nm, size);
 
   for (;;) {
     const ZNMethodTableEntry table_entry = table[index];
-
-    if (!table_entry.registered() && !table_entry.unregistered()) {
-      // Entry not found
-      return false;
-    }
+    assert(table_entry.registered() || table_entry.unregistered(), "Entry not found");
 
     if (table_entry.registered() && table_entry.method() == nm) {
       // Remove entry
@@ -287,7 +283,7 @@
       // Destroy GC data
       ZNMethodData::destroy(gc_data(nm));
       set_gc_data(nm, NULL);
-      return true;
+      return;
     }
 
     index = next_index(index, size);
@@ -451,8 +447,6 @@
     return;
   }
 
-  assert(CodeCache_lock->owned_by_self(), "Lock must be held");
-
   while (_iter_table != NULL) {
     MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
     os::naked_short_sleep(1);
@@ -460,6 +454,7 @@
 }
 
 void ZNMethodTable::unregister_nmethod(nmethod* nm) {
+  assert(CodeCache_lock->owned_by_self(), "Lock must be held");
   ResourceMark rm;
 
   sweeper_wait_for_iteration();
@@ -467,14 +462,9 @@
   log_unregister(nm);
 
   // Remove entry
-  if (unregister_entry(_table, _size, nm)) {
-    // Entry was unregistered. When unregister_entry() instead returns
-    // false the nmethod was not in the table (because it didn't have
-    // any oops) so we do not want to decrease the number of registered
-    // entries in that case.
-    _nregistered--;
-    _nunregistered++;
-  }
+  unregister_entry(_table, _size, nm);
+  _nunregistered++;
+  _nregistered--;
 }
 
 void ZNMethodTable::disarm_nmethod(nmethod* nm) {
--- a/src/hotspot/share/gc/z/zNMethodTable.hpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/gc/z/zNMethodTable.hpp	Mon Jan 28 13:56:39 2019 +0000
@@ -57,7 +57,7 @@
   static void sweeper_wait_for_iteration();
 
   static bool register_entry(ZNMethodTableEntry* table, size_t size, ZNMethodTableEntry entry);
-  static bool unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm);
+  static void unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm);
 
   static void rebuild(size_t new_size);
   static void rebuild_if_needed();
--- a/src/hotspot/share/opto/callGenerator.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/callGenerator.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -46,9 +46,17 @@
   return TypeFunc::make(method());
 }
 
-bool CallGenerator::is_inlined_method_handle_intrinsic(JVMState* jvms, ciMethod* callee) {
-  ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci());
-  return symbolic_info->is_method_handle_intrinsic() && !callee->is_method_handle_intrinsic();
+bool CallGenerator::is_inlined_method_handle_intrinsic(JVMState* jvms, ciMethod* m) {
+  return is_inlined_method_handle_intrinsic(jvms->method(), jvms->bci(), m);
+}
+
+bool CallGenerator::is_inlined_method_handle_intrinsic(ciMethod* caller, int bci, ciMethod* m) {
+  ciMethod* symbolic_info = caller->get_method_at_bci(bci);
+  return is_inlined_method_handle_intrinsic(symbolic_info, m);
+}
+
+bool CallGenerator::is_inlined_method_handle_intrinsic(ciMethod* symbolic_info, ciMethod* m) {
+  return symbolic_info->is_method_handle_intrinsic() && !m->is_method_handle_intrinsic();
 }
 
 //-----------------------------ParseGenerator---------------------------------
@@ -888,7 +896,8 @@
           const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr();
           const Type*       sig_type = TypeOopPtr::make_from_klass(signature->accessing_klass());
           if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
-            Node* cast_obj = gvn.transform(new CheckCastPPNode(kit.control(), arg, sig_type));
+            const Type* recv_type = arg_type->join_speculative(sig_type); // keep speculative part
+            Node* cast_obj = gvn.transform(new CheckCastPPNode(kit.control(), arg, recv_type));
             kit.set_argument(0, cast_obj);
           }
         }
@@ -900,7 +909,8 @@
             const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr();
             const Type*       sig_type = TypeOopPtr::make_from_klass(t->as_klass());
             if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
-              Node* cast_obj = gvn.transform(new CheckCastPPNode(kit.control(), arg, sig_type));
+              const Type* narrowed_arg_type = arg_type->join_speculative(sig_type); // keep speculative part
+              Node* cast_obj = gvn.transform(new CheckCastPPNode(kit.control(), arg, narrowed_arg_type));
               kit.set_argument(receiver_skip + j, cast_obj);
             }
           }
--- a/src/hotspot/share/opto/callGenerator.hpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/callGenerator.hpp	Mon Jan 28 13:56:39 2019 +0000
@@ -176,6 +176,8 @@
   }
 
   static bool is_inlined_method_handle_intrinsic(JVMState* jvms, ciMethod* m);
+  static bool is_inlined_method_handle_intrinsic(ciMethod* caller, int bci, ciMethod* m);
+  static bool is_inlined_method_handle_intrinsic(ciMethod* symbolic_info, ciMethod* m);
 };
 
 
--- a/src/hotspot/share/opto/callnode.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/callnode.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -967,6 +967,21 @@
   return CallNode::cmp(call) && _method == call._method &&
          _override_symbolic_info == call._override_symbolic_info;
 }
+#ifdef ASSERT
+bool CallJavaNode::validate_symbolic_info() const {
+  if (method() == NULL) {
+    return true; // call into runtime or uncommon trap
+  }
+  ciMethod* symbolic_info = jvms()->method()->get_method_at_bci(_bci);
+  ciMethod* callee = method();
+  if (symbolic_info->is_method_handle_intrinsic() && !callee->is_method_handle_intrinsic()) {
+    assert(override_symbolic_info(), "should be set");
+  }
+  assert(ciMethod::is_consistent_info(symbolic_info, callee), "inconsistent info");
+  return true;
+}
+#endif
+
 #ifndef PRODUCT
 void CallJavaNode::dump_spec(outputStream *st) const {
   if( _method ) _method->print_short_name(st);
--- a/src/hotspot/share/opto/callnode.hpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/callnode.hpp	Mon Jan 28 13:56:39 2019 +0000
@@ -683,6 +683,8 @@
   void  set_override_symbolic_info(bool f) { _override_symbolic_info = f; }
   bool  override_symbolic_info() const     { return _override_symbolic_info; }
 
+  DEBUG_ONLY( bool validate_symbolic_info() const; )
+
 #ifndef PRODUCT
   virtual void  dump_spec(outputStream *st) const;
   virtual void  dump_compact_spec(outputStream *st) const;
--- a/src/hotspot/share/opto/chaitin.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/chaitin.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -756,6 +756,16 @@
           lrg._is_float = 1;
         }
 
+        // Check for twice prior spilling.  Once prior spilling might have
+        // spilled 'soft', 2nd prior spill should have spilled 'hard' and
+        // further spilling is unlikely to make progress.
+        if (_spilled_once.test(n->_idx)) {
+          lrg._was_spilled1 = 1;
+          if (_spilled_twice.test(n->_idx)) {
+            lrg._was_spilled2 = 1;
+          }
+        }
+
 #ifndef PRODUCT
         // Collect bits not used by product code, but which may be useful for
         // debugging.
@@ -768,16 +778,6 @@
           copy_src._has_copy = 1;
         }
 
-        // Check for twice prior spilling.  Once prior spilling might have
-        // spilled 'soft', 2nd prior spill should have spilled 'hard' and
-        // further spilling is unlikely to make progress.
-        if (_spilled_once.test(n->_idx)) {
-          lrg._was_spilled1 = 1;
-          if (_spilled_twice.test(n->_idx)) {
-            lrg._was_spilled2 = 1;
-          }
-        }
-
         if (trace_spilling() && lrg._def != NULL) {
           // collect defs for MultiDef printing
           if (lrg._defs == NULL) {
--- a/src/hotspot/share/opto/doCall.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/doCall.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -202,9 +202,9 @@
     }
 
     // Try using the type profile.
-    if (call_does_dispatch && site_count > 0 && receiver_count > 0) {
+    if (call_does_dispatch && site_count > 0 && UseTypeProfile) {
       // The major receiver's count >= TypeProfileMajorReceiverPercent of site_count.
-      bool have_major_receiver = (100.*profile.receiver_prob(0) >= (float)TypeProfileMajorReceiverPercent);
+      bool have_major_receiver = profile.has_receiver(0) && (100.*profile.receiver_prob(0) >= (float)TypeProfileMajorReceiverPercent);
       ciMethod* receiver_method = NULL;
 
       int morphism = profile.morphism();
@@ -258,8 +258,9 @@
             }
           }
           CallGenerator* miss_cg;
-          Deoptimization::DeoptReason reason = morphism == 2 ?
-            Deoptimization::Reason_bimorphic : Deoptimization::reason_class_check(speculative_receiver_type != NULL);
+          Deoptimization::DeoptReason reason = (morphism == 2
+                                               ? Deoptimization::Reason_bimorphic
+                                               : Deoptimization::reason_class_check(speculative_receiver_type != NULL));
           if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) &&
               !too_many_traps(caller, bci, reason)
              ) {
@@ -281,8 +282,8 @@
               miss_cg = CallGenerator::for_predicted_call(profile.receiver(1), miss_cg, next_hit_cg, PROB_MAX);
             }
             if (miss_cg != NULL) {
-              trace_type_profile(C, jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count);
               ciKlass* k = speculative_receiver_type != NULL ? speculative_receiver_type : profile.receiver(0);
+              trace_type_profile(C, jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, k, site_count, receiver_count);
               float hit_prob = speculative_receiver_type != NULL ? 1.0 : profile.receiver_prob(0);
               CallGenerator* cg = CallGenerator::for_predicted_call(k, miss_cg, hit_cg, hit_prob);
               if (cg != NULL)  return cg;
--- a/src/hotspot/share/opto/library_call.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/library_call.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -3850,6 +3850,13 @@
                                 method, bci());
     slow_call->set_optimized_virtual(true);
   }
+  if (CallGenerator::is_inlined_method_handle_intrinsic(this->method(), bci(), callee())) {
+    // To be able to issue a direct call (optimized virtual or virtual)
+    // and skip a call to MH.linkTo*/invokeBasic adapter, additional information
+    // about the method being invoked should be attached to the call site to
+    // make resolution logic work (see SharedRuntime::resolve_{virtual,opt_virtual}_call_C).
+    slow_call->set_override_symbolic_info(true);
+  }
   set_arguments_for_java_call(slow_call);
   set_edges_for_java_call(slow_call);
   return slow_call;
--- a/src/hotspot/share/opto/matcher.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/matcher.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -1170,6 +1170,7 @@
     if( mcall->is_MachCallJava() ) {
       MachCallJavaNode *mcall_java  = mcall->as_MachCallJava();
       const CallJavaNode *call_java =  call->as_CallJava();
+      assert(call_java->validate_symbolic_info(), "inconsistent info");
       method = call_java->method();
       mcall_java->_method = method;
       mcall_java->_bci = call_java->_bci;
--- a/src/hotspot/share/opto/memnode.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/opto/memnode.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -1532,10 +1532,14 @@
   Node* address = in(MemNode::Address);
   bool progress = false;
 
+  bool addr_mark = ((phase->type(address)->isa_oopptr() || phase->type(address)->isa_narrowoop()) &&
+         phase->type(address)->is_ptr()->offset() == oopDesc::mark_offset_in_bytes());
+
   // Skip up past a SafePoint control.  Cannot do this for Stores because
   // pointer stores & cardmarks must stay on the same side of a SafePoint.
   if( ctrl != NULL && ctrl->Opcode() == Op_SafePoint &&
-      phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw ) {
+      phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw  &&
+      !addr_mark ) {
     ctrl = ctrl->in(0);
     set_req(MemNode::Control,ctrl);
     progress = true;
--- a/src/hotspot/share/prims/whitebox.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/prims/whitebox.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -93,6 +93,9 @@
 #include "services/memTracker.hpp"
 #include "utilities/nativeCallStack.hpp"
 #endif // INCLUDE_NMT
+#if INCLUDE_AOT
+#include "aot/aotLoader.hpp"
+#endif // INCLUDE_AOT
 
 #ifdef LINUX
 #include "osContainer_linux.hpp"
@@ -2118,6 +2121,14 @@
   return (jint) SystemDictionary::pd_cache_table()->removed_entries_count();
 WB_END
 
+WB_ENTRY(jint, WB_AotLibrariesCount(JNIEnv* env, jobject o))
+  jint result = 0;
+#if INCLUDE_AOT
+  result = (jint) AOTLoader::heaps_count();
+#endif
+  return result;
+WB_END
+
 #define CC (char*)
 
 static JNINativeMethod methods[] = {
@@ -2350,6 +2361,7 @@
   {CC"disableElfSectionCache",    CC"()V",            (void*)&WB_DisableElfSectionCache },
   {CC"resolvedMethodRemovedCount",     CC"()I",       (void*)&WB_ResolvedMethodRemovedCount },
   {CC"protectionDomainRemovedCount",   CC"()I",       (void*)&WB_ProtectionDomainRemovedCount },
+  {CC"aotLibrariesCount", CC"()I",                    (void*)&WB_AotLibrariesCount },
 };
 
 
--- a/src/hotspot/share/runtime/globals.hpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/runtime/globals.hpp	Mon Jan 28 13:56:39 2019 +0000
@@ -140,8 +140,8 @@
 // notproduct flags are settable / visible only during development and are not declared in the PRODUCT version
 
 // A flag must be declared with one of the following types:
-// bool, int, uint, intx, uintx, size_t, ccstr, double, or uint64_t.
-// The type "ccstr" is an alias for "const char*" and is used
+// bool, int, uint, intx, uintx, size_t, ccstr, ccstrlist, double, or uint64_t.
+// The type "ccstr" and "ccstrlist" are an alias for "const char*" and is used
 // only in this file, because the macrology requires single-token type names.
 
 // Note: Diagnostic options not meant for VM tuning or for product modes.
--- a/src/hotspot/share/runtime/thread.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/runtime/thread.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -2392,8 +2392,19 @@
     }
   }
 
-  VM_ThreadSuspend vm_suspend;
-  VMThread::execute(&vm_suspend);
+  if (Thread::current() == this) {
+    // Safely self-suspend.
+    // If we don't do this explicitly it will implicitly happen
+    // before we transition back to Java, and on some other thread-state
+    // transition paths, but not as we exit a JVM TI SuspendThread call.
+    // As SuspendThread(current) must not return (until resumed) we must
+    // self-suspend here.
+    ThreadBlockInVM tbivm(this);
+    java_suspend_self();
+  } else {
+    VM_ThreadSuspend vm_suspend;
+    VMThread::execute(&vm_suspend);
+  }
 }
 
 // Part II of external suspension.
--- a/src/hotspot/share/runtime/timer.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/runtime/timer.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -118,59 +118,3 @@
   assert(is_updated(), "must not be clear");
   return os::elapsed_counter() - _counter;
 }
-
-TraceCPUTime::TraceCPUTime(bool doit,
-               bool print_cr,
-               outputStream *logfile) :
-  _active(doit),
-  _print_cr(print_cr),
-  _starting_user_time(0.0),
-  _starting_system_time(0.0),
-  _starting_real_time(0.0),
-  _logfile(logfile),
-  _error(false) {
-  if (_active) {
-    if (logfile != NULL) {
-      _logfile = logfile;
-    } else {
-      _logfile = tty;
-    }
-
-    _error = !os::getTimesSecs(&_starting_real_time,
-                               &_starting_user_time,
-                               &_starting_system_time);
-  }
-}
-
-TraceCPUTime::~TraceCPUTime() {
-  if (_active) {
-    bool valid = false;
-    if (!_error) {
-      double real_secs;                 // walk clock time
-      double system_secs;               // system time
-      double user_secs;                 // user time for all threads
-
-      double real_time, user_time, system_time;
-      valid = os::getTimesSecs(&real_time, &user_time, &system_time);
-      if (valid) {
-
-        user_secs = user_time - _starting_user_time;
-        system_secs = system_time - _starting_system_time;
-        real_secs = real_time - _starting_real_time;
-
-        _logfile->print(" [Times: user=%3.2f sys=%3.2f real=%3.2f secs] ",
-          user_secs, system_secs, real_secs);
-
-      } else {
-        _logfile->print("[Invalid result in TraceCPUTime]");
-      }
-    } else {
-      _logfile->print("[Error in TraceCPUTime]");
-    }
-    if (_print_cr) {
-      _logfile->cr();
-    }
-    _logfile->flush();
-  }
-}
-
--- a/src/hotspot/share/runtime/timer.hpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/hotspot/share/runtime/timer.hpp	Mon Jan 28 13:56:39 2019 +0000
@@ -72,23 +72,6 @@
   jlong ticks_since_update() const;
 };
 
-class TraceCPUTime: public StackObj {
- private:
-  bool _active;                 // true if times will be measured and printed
-  bool _print_cr;               // if true print carriage return at end
-  double _starting_user_time;   // user time at start of measurement
-  double _starting_system_time; // system time at start of measurement
-  double _starting_real_time;   // real time at start of measurement
-  outputStream* _logfile;       // output is printed to this stream
-  bool _error;                  // true if an error occurred, turns off output
-
- public:
-  TraceCPUTime(bool doit = true,
-               bool print_cr = true,
-               outputStream *logfile = NULL);
-  ~TraceCPUTime();
-};
-
 class TimeHelper {
  public:
   static double counter_to_seconds(jlong counter);
--- a/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/java.base/share/classes/javax/net/ssl/SSLSocket.java	Mon Jan 28 13:56:39 2019 +0000
@@ -135,7 +135,7 @@
  * applications should each close both sides of their respective connection.
  * For {@code SSLSocket} objects, for example, an application can call
  * {@link Socket#shutdownOutput()} or {@link java.io.OutputStream#close()}
- * for output strean close and call {@link Socket#shutdownInput()} or
+ * for output stream close and call {@link Socket#shutdownInput()} or
  * {@link java.io.InputStream#close()} for input stream close.  Note that
  * in some cases, closing the input stream may depend on the peer's output
  * stream being closed first.  If the connection is not closed in an orderly
--- a/src/java.base/share/classes/sun/security/util/ECUtil.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/java.base/share/classes/sun/security/util/ECUtil.java	Mon Jan 28 13:56:39 2019 +0000
@@ -31,7 +31,6 @@
 import java.security.interfaces.*;
 import java.security.spec.*;
 import java.util.Arrays;
-import sun.security.x509.X509Key;
 
 public class ECUtil {
 
@@ -103,7 +102,7 @@
             ECParameterSpec params) throws InvalidKeySpecException {
         KeyFactory keyFactory = getKeyFactory();
         ECPublicKeySpec keySpec = new ECPublicKeySpec(w, params);
-        X509Key key = (X509Key)keyFactory.generatePublic(keySpec);
+        Key key = keyFactory.generatePublic(keySpec);
 
         return key.getEncoded();
     }
--- a/src/java.base/share/lib/security/default.policy	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/java.base/share/lib/security/default.policy	Mon Jan 28 13:56:39 2019 +0000
@@ -201,6 +201,7 @@
     permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
     permission java.lang.RuntimePermission "fileSystemProvider";
     permission java.util.PropertyPermission "os.name", "read";
+    permission java.util.PropertyPermission "user.dir", "read";
 };
 
 // permissions needed by applications using java.desktop module
--- a/src/java.net.http/share/classes/java/net/http/HttpResponse.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/java.net.http/share/classes/java/net/http/HttpResponse.java	Mon Jan 28 13:56:39 2019 +0000
@@ -47,6 +47,7 @@
 import java.util.concurrent.Flow.Subscription;
 import java.util.function.Consumer;
 import java.util.function.Function;
+import java.util.function.Supplier;
 import java.util.stream.Stream;
 import javax.net.ssl.SSLSession;
 import jdk.internal.net.http.BufferingSubscriber;
@@ -1282,17 +1283,26 @@
          *
          * <p> The mapping function is executed using the client's {@linkplain
          * HttpClient#executor() executor}, and can therefore be used to map any
-         * response body type, including blocking {@link InputStream}, as shown
-         * in the following example which uses a well-known JSON parser to
+         * response body type, including blocking {@link InputStream}.
+         * However, performing any blocking operation in the mapper function
+         * runs the risk of blocking the executor's thread for an unknown
+         * amount of time (at least until the blocking operation finishes),
+         * which may end up starving the executor of available threads.
+         * Therefore, in the case where mapping to the desired type might
+         * block (e.g. by reading on the {@code InputStream}), then mapping
+         * to a {@link java.util.function.Supplier Supplier} of the desired
+         * type and deferring the blocking operation until {@link Supplier#get()
+         * Supplier::get} is invoked by the caller's thread should be preferred,
+         * as shown in the following example which uses a well-known JSON parser to
          * convert an {@code InputStream} into any annotated Java type.
          *
          * <p>For example:
-         * <pre> {@code  public static <W> BodySubscriber<W> asJSON(Class<W> targetType) {
+         * <pre> {@code  public static <W> BodySubscriber<Supplier<W>> asJSON(Class<W> targetType) {
          *     BodySubscriber<InputStream> upstream = BodySubscribers.ofInputStream();
          *
-         *     BodySubscriber<W> downstream = BodySubscribers.mapping(
+         *     BodySubscriber<Supplier<W>> downstream = BodySubscribers.mapping(
          *           upstream,
-         *           (InputStream is) -> {
+         *           (InputStream is) -> () -> {
          *               try (InputStream stream = is) {
          *                   ObjectMapper objectMapper = new ObjectMapper();
          *                   return objectMapper.readValue(stream, targetType);
@@ -1301,7 +1311,7 @@
          *               }
          *           });
          *    return downstream;
-         * } }</pre>
+         *  } }</pre>
          *
          * @param <T> the upstream body type
          * @param <U> the type of the body subscriber returned
--- a/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/java.xml/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -44,6 +44,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Random;
 import java.util.Set;
 import javax.xml.XMLConstants;
@@ -1729,12 +1730,7 @@
      */
     private boolean isDefaultNamespace(String uri) {
         String defaultNamespace = fInternalNamespaceContext.getURI(DEFAULT_PREFIX);
-
-        if (uri.equals(defaultNamespace)) {
-            return true;
-        }
-
-        return false;
+        return Objects.equals(uri, defaultNamespace);
     }
 
     /**
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -896,7 +896,7 @@
             if (moreInfo && bound != null && !isPrintingBound)
                 try {
                     isPrintingBound = true;
-                    s.append("{:").append(bound.bound).append(":}");
+                    s.append("{:").append(bound.getUpperBound()).append(":}");
                 } finally {
                     isPrintingBound = false;
                 }
@@ -1607,7 +1607,7 @@
          *  itself. Furthermore, the erasure_field of the class
          *  points to the first class or interface bound.
          */
-        public Type bound = null;
+        private Type _bound = null;
 
         /** The lower bound of this type variable.
          *  TypeVars don't normally have a lower bound, so it is normally set
@@ -1620,7 +1620,7 @@
             super(null, TypeMetadata.EMPTY);
             Assert.checkNonNull(lower);
             tsym = new TypeVariableSymbol(0, name, this, owner);
-            this.bound = null;
+            this.setUpperBound(null);
             this.lower = lower;
         }
 
@@ -1632,15 +1632,20 @@
                        TypeMetadata metadata) {
             super(tsym, metadata);
             Assert.checkNonNull(lower);
-            this.bound = bound;
+            this.setUpperBound(bound);
             this.lower = lower;
         }
 
         @Override
         public TypeVar cloneWithMetadata(TypeMetadata md) {
-            return new TypeVar(tsym, bound, lower, md) {
+            return new TypeVar(tsym, getUpperBound(), lower, md) {
                 @Override
                 public Type baseType() { return TypeVar.this.baseType(); }
+
+                @Override @DefinedBy(Api.LANGUAGE_MODEL)
+                public Type getUpperBound() { return TypeVar.this.getUpperBound(); }
+
+                public void setUpperBound(Type bound) { TypeVar.this.setUpperBound(bound); }
             };
         }
 
@@ -1655,12 +1660,9 @@
         }
 
         @Override @DefinedBy(Api.LANGUAGE_MODEL)
-        public Type getUpperBound() {
-            if ((bound == null || bound.hasTag(NONE)) && this != tsym.type) {
-                bound = tsym.type.getUpperBound();
-            }
-            return bound;
-        }
+        public Type getUpperBound() { return _bound; }
+
+        public void setUpperBound(Type bound) { this._bound = bound; }
 
         int rank_field = -1;
 
@@ -1709,7 +1711,7 @@
                             WildcardType wildcard) {
             super(name, owner, lower);
             this.lower = Assert.checkNonNull(lower);
-            this.bound = upper;
+            this.setUpperBound(upper);
             this.wildcard = wildcard;
         }
 
@@ -1725,9 +1727,14 @@
 
         @Override
         public CapturedType cloneWithMetadata(TypeMetadata md) {
-            return new CapturedType(tsym, bound, bound, lower, wildcard, md) {
+            return new CapturedType(tsym, getUpperBound(), getUpperBound(), lower, wildcard, md) {
                 @Override
                 public Type baseType() { return CapturedType.this.baseType(); }
+
+                @Override @DefinedBy(Api.LANGUAGE_MODEL)
+                public Type getUpperBound() { return CapturedType.this.getUpperBound(); }
+
+                public void setUpperBound(Type bound) { CapturedType.this.setUpperBound(bound); }
             };
         }
 
@@ -1832,7 +1839,7 @@
 
         public void complete() {
             for (List<Type> l = tvars; l.nonEmpty(); l = l.tail) {
-                ((TypeVar)l.head).bound.complete();
+                ((TypeVar)l.head).getUpperBound().complete();
             }
             qtype.complete();
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, 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
@@ -132,7 +132,7 @@
         if (t.hasTag(WILDCARD)) {
             WildcardType w = (WildcardType) t;
             if (w.isSuperBound())
-                return w.bound == null ? syms.objectType : w.bound.bound;
+                return w.bound == null ? syms.objectType : w.bound.getUpperBound();
             else
                 return wildUpperBound(w.type);
         }
@@ -146,7 +146,7 @@
     public Type cvarUpperBound(Type t) {
         if (t.hasTag(TYPEVAR)) {
             TypeVar v = (TypeVar) t;
-            return v.isCaptured() ? cvarUpperBound(v.bound) : v;
+            return v.isCaptured() ? cvarUpperBound(v.getUpperBound()) : v;
         }
         else return t;
     }
@@ -1821,14 +1821,14 @@
                 case TYPEVAR:
                     if (isSubtype(t, s)) {
                         return true;
-                    } else if (isCastable(t.bound, s, noWarnings)) {
+                    } else if (isCastable(t.getUpperBound(), s, noWarnings)) {
                         warnStack.head.warn(LintCategory.UNCHECKED);
                         return true;
                     } else {
                         return false;
                     }
                 default:
-                    return isCastable(t.bound, s, warnStack.head);
+                    return isCastable(t.getUpperBound(), s, warnStack.head);
                 }
             }
 
@@ -1954,7 +1954,7 @@
         if (t == s) return false;
         if (t.hasTag(TYPEVAR)) {
             TypeVar tv = (TypeVar) t;
-            return !isCastable(tv.bound,
+            return !isCastable(tv.getUpperBound(),
                                relaxBound(s),
                                noWarnings);
         }
@@ -2150,7 +2150,7 @@
                 if (t.tsym == sym)
                     return t;
                 else
-                    return asSuper(t.bound, sym);
+                    return asSuper(t.getUpperBound(), sym);
             }
 
             @Override
@@ -2269,7 +2269,7 @@
 
             @Override
             public Type visitTypeVar(TypeVar t, Symbol sym) {
-                return memberType(t.bound, sym);
+                return memberType(t.getUpperBound(), sym);
             }
 
             @Override
@@ -2392,7 +2392,7 @@
 
             @Override
             public Type visitTypeVar(TypeVar t, Boolean recurse) {
-                Type erased = erasure(t.bound, recurse);
+                Type erased = erasure(t.getUpperBound(), recurse);
                 return combineMetadata(erased, t);
             }
         };
@@ -2498,11 +2498,11 @@
              */
             @Override
             public Type visitTypeVar(TypeVar t, Void ignored) {
-                if (t.bound.hasTag(TYPEVAR) ||
-                    (!t.bound.isCompound() && !t.bound.isInterface())) {
-                    return t.bound;
+                if (t.getUpperBound().hasTag(TYPEVAR) ||
+                    (!t.getUpperBound().isCompound() && !t.getUpperBound().isInterface())) {
+                    return t.getUpperBound();
                 } else {
-                    return supertype(t.bound);
+                    return supertype(t.getUpperBound());
                 }
             }
 
@@ -2573,11 +2573,11 @@
 
             @Override
             public List<Type> visitTypeVar(TypeVar t, Void ignored) {
-                if (t.bound.isCompound())
-                    return interfaces(t.bound);
-
-                if (t.bound.isInterface())
-                    return List.of(t.bound);
+                if (t.getUpperBound().isCompound())
+                    return interfaces(t.getUpperBound());
+
+                if (t.getUpperBound().isInterface())
+                    return List.of(t.getUpperBound());
 
                 return List.nil();
             }
@@ -2662,9 +2662,9 @@
      * @param allInterfaces are all bounds interface types?
      */
     public void setBounds(TypeVar t, List<Type> bounds, boolean allInterfaces) {
-        t.bound = bounds.tail.isEmpty() ?
+        t.setUpperBound( bounds.tail.isEmpty() ?
                 bounds.head :
-                makeIntersectionType(bounds, allInterfaces);
+                makeIntersectionType(bounds, allInterfaces) );
         t.rank_field = -1;
     }
     // </editor-fold>
@@ -2674,10 +2674,10 @@
      * Return list of bounds of the given type variable.
      */
     public List<Type> getBounds(TypeVar t) {
-        if (t.bound.hasTag(NONE))
+        if (t.getUpperBound().hasTag(NONE))
             return List.nil();
-        else if (t.bound.isErroneous() || !t.bound.isCompound())
-            return List.of(t.bound);
+        else if (t.getUpperBound().isErroneous() || !t.getUpperBound().isCompound())
+            return List.of(t.getUpperBound());
         else if ((erasure(t).tsym.flags() & INTERFACE) == 0)
             return interfaces(t).prepend(supertype(t));
         else
@@ -3361,8 +3361,8 @@
         // calculate new bounds
         for (Type t : tvars) {
             TypeVar tv = (TypeVar) t;
-            Type bound = subst(tv.bound, from, to);
-            if (bound != tv.bound)
+            Type bound = subst(tv.getUpperBound(), from, to);
+            if (bound != tv.getUpperBound())
                 changed = true;
             newBoundsBuf.append(bound);
         }
@@ -3386,15 +3386,15 @@
         // set the bounds of new type variables to the new bounds
         for (Type t : newTvars.toList()) {
             TypeVar tv = (TypeVar) t;
-            tv.bound = newBounds.head;
+            tv.setUpperBound( newBounds.head );
             newBounds = newBounds.tail;
         }
         return newTvars.toList();
     }
 
     public TypeVar substBound(TypeVar t, List<Type> from, List<Type> to) {
-        Type bound1 = subst(t.bound, from, to);
-        if (bound1 == t.bound)
+        Type bound1 = subst(t.getUpperBound(), from, to);
+        if (bound1 == t.getUpperBound())
             return t;
         else {
             // create new type variable without bounds
@@ -3402,7 +3402,7 @@
                                      t.getMetadata());
             // the new bound should use the new type variable in place
             // of the old
-            tv.bound = subst(bound1, List.of(t), List.of(tv));
+            tv.setUpperBound( subst(bound1, List.of(t), List.of(tv)) );
             return tv;
         }
     }
@@ -3435,7 +3435,7 @@
         List<Type> tvars1 = tvars.map(newInstanceFun);
         for (List<Type> l = tvars1; l.nonEmpty(); l = l.tail) {
             TypeVar tv = (TypeVar) l.head;
-            tv.bound = subst(tv.bound, tvars, tvars1);
+            tv.setUpperBound( subst(tv.getUpperBound(), tvars, tvars1) );
         }
         return tvars1;
     }
@@ -3614,11 +3614,11 @@
         }
         private void appendTyparamString(TypeVar t, StringBuilder buf) {
             buf.append(t);
-            if (t.bound == null ||
-                t.bound.tsym.getQualifiedName() == names.java_lang_Object)
+            if (t.getUpperBound() == null ||
+                t.getUpperBound().tsym.getQualifiedName() == names.java_lang_Object)
                 return;
             buf.append(" extends "); // Java syntax; no need for i18n
-            Type bound = t.bound;
+            Type bound = t.getUpperBound();
             if (!bound.isCompound()) {
                 buf.append(bound);
             } else if ((erasure(t).tsym.flags() & INTERFACE) == 0) {
@@ -4375,24 +4375,24 @@
                     Ui = syms.objectType;
                 switch (Ti.kind) {
                 case UNBOUND:
-                    Si.bound = subst(Ui, A, S);
+                    Si.setUpperBound( subst(Ui, A, S) );
                     Si.lower = syms.botType;
                     break;
                 case EXTENDS:
-                    Si.bound = glb(Ti.getExtendsBound(), subst(Ui, A, S));
+                    Si.setUpperBound( glb(Ti.getExtendsBound(), subst(Ui, A, S)) );
                     Si.lower = syms.botType;
                     break;
                 case SUPER:
-                    Si.bound = subst(Ui, A, S);
+                    Si.setUpperBound( subst(Ui, A, S) );
                     Si.lower = Ti.getSuperBound();
                     break;
                 }
-                Type tmpBound = Si.bound.hasTag(UNDETVAR) ? ((UndetVar)Si.bound).qtype : Si.bound;
+                Type tmpBound = Si.getUpperBound().hasTag(UNDETVAR) ? ((UndetVar)Si.getUpperBound()).qtype : Si.getUpperBound();
                 Type tmpLower = Si.lower.hasTag(UNDETVAR) ? ((UndetVar)Si.lower).qtype : Si.lower;
-                if (!Si.bound.hasTag(ERROR) &&
+                if (!Si.getUpperBound().hasTag(ERROR) &&
                     !Si.lower.hasTag(ERROR) &&
                     isSameType(tmpBound, tmpLower)) {
-                    currentS.head = Si.bound;
+                    currentS.head = Si.getUpperBound();
                 }
             }
             currentA = currentA.tail;
@@ -4720,9 +4720,9 @@
         @Override
         public Type visitTypeVar(TypeVar t, Void s) {
             if (rewriteTypeVars) {
-                Type bound = t.bound.contains(t) ?
-                        erasure(t.bound) :
-                        visit(t.bound);
+                Type bound = t.getUpperBound().contains(t) ?
+                        erasure(t.getUpperBound()) :
+                        visit(t.getUpperBound());
                 return rewriteAsWildcardType(bound, t, EXTENDS);
             } else {
                 return t;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jan 28 13:56:39 2019 +0000
@@ -798,7 +798,7 @@
         for (JCTypeParameter tvar : typarams) {
             TypeVar a = (TypeVar)tvar.type;
             a.tsym.flags_field |= UNATTRIBUTED;
-            a.bound = Type.noType;
+            a.setUpperBound(Type.noType);
             if (!tvar.bounds.isEmpty()) {
                 List<Type> bounds = List.of(attribType(tvar.bounds.head, env));
                 for (JCExpression bound : tvar.bounds.tail)
@@ -4520,9 +4520,9 @@
             annotate.annotateTypeParameterSecondStage(tree, tree.annotations);
         }
 
-        if (!typeVar.bound.isErroneous()) {
+        if (!typeVar.getUpperBound().isErroneous()) {
             //fixup type-parameter bound computed in 'attribTypeVariables'
-            typeVar.bound = checkIntersection(tree, tree.bounds);
+            typeVar.setUpperBound(checkIntersection(tree, tree.bounds));
         }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Mon Jan 28 13:56:39 2019 +0000
@@ -2285,7 +2285,7 @@
             return;
         if (seen.contains(t)) {
             tv = (TypeVar)t;
-            tv.bound = types.createErrorType(t);
+            tv.setUpperBound(types.createErrorType(t));
             log.error(pos, Errors.CyclicInheritance(t));
         } else if (t.hasTag(TYPEVAR)) {
             tv = (TypeVar)t;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -537,8 +537,8 @@
         for (Type t : todo) {
             UndetVar uv = (UndetVar)t;
             TypeVar ct = (TypeVar)uv.getInst();
-            ct.bound = types.glb(inferenceContext.asInstTypes(types.getBounds(ct)));
-            if (ct.bound.isErroneous()) {
+            ct.setUpperBound( types.glb(inferenceContext.asInstTypes(types.getBounds(ct))) );
+            if (ct.getUpperBound().isErroneous()) {
                 //report inference error if glb fails
                 reportBoundError(uv, InferenceBound.UPPER);
             }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -989,7 +989,7 @@
                 // use the SAM parameter type
                 if (checkForIntersection && descPTypes.head.getKind() == TypeKind.TYPEVAR) {
                     TypeVar tv = (TypeVar) descPTypes.head;
-                    if (tv.bound.getKind() == TypeKind.INTERSECTION) {
+                    if (tv.getUpperBound().getKind() == TypeKind.INTERSECTION) {
                         parmType = samPTypes.head;
                     }
                 }
@@ -2375,7 +2375,7 @@
                         return true;
                     case TYPEVAR:
                         TypeVar tv = (TypeVar) t;
-                        return isIntersectionOrUnionType(tv.bound);
+                        return isIntersectionOrUnionType(tv.getUpperBound());
                 }
                 return false;
             }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -506,11 +506,11 @@
         public Void visitCapturedType(CapturedType t, Void ignored) {
             if (indexOf(t, WhereClauseKind.CAPTURED) == -1) {
                 String suffix = t.lower == syms.botType ? ".1" : "";
-                JCDiagnostic d = diags.fragment("where.captured"+ suffix, t, t.bound, t.lower, t.wildcard);
+                JCDiagnostic d = diags.fragment("where.captured"+ suffix, t, t.getUpperBound(), t.lower, t.wildcard);
                 whereClauses.get(WhereClauseKind.CAPTURED).put(t, d);
                 visit(t.wildcard);
                 visit(t.lower);
-                visit(t.bound);
+                visit(t.getUpperBound());
             }
             return null;
         }
@@ -555,7 +555,7 @@
             t = (TypeVar)t.stripMetadataIfNeeded();
             if (indexOf(t, WhereClauseKind.TYPEVAR) == -1) {
                 //access the bound type and skip error types
-                Type bound = t.bound;
+                Type bound = t.getUpperBound();
                 while ((bound instanceof ErrorType))
                     bound = ((ErrorType)bound).getOriginalType();
                 //retrieve the bound list - if the type variable
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -130,6 +130,7 @@
   private static Type intxType;
   private static Type uintxType;
   private static Type sizetType;
+  private static Type uint64tType;
   private static CIntegerType boolType;
   private Boolean sharingEnabled;
   private Boolean compressedOopsEnabled;
@@ -231,6 +232,50 @@
         return addr.getCIntegerAt(0, sizetType.getSize(), true);
      }
 
+     public boolean isCcstr() {
+        return type.equals("ccstr");
+     }
+
+     public String getCcstr() {
+        if (Assert.ASSERTS_ENABLED) {
+           Assert.that(isCcstr(), "not a ccstr flag!");
+        }
+        return CStringUtilities.getString(addr.getAddressAt(0));
+     }
+
+     public boolean isCcstrlist() {
+        return type.equals("ccstrlist");
+     }
+
+     public String getCcstrlist() {
+        if (Assert.ASSERTS_ENABLED) {
+           Assert.that(isCcstrlist(), "not a ccstrlist flag!");
+        }
+        return CStringUtilities.getString(addr.getAddressAt(0));
+     }
+
+     public boolean isDouble() {
+        return type.equals("double");
+     }
+
+     public double getDouble() {
+        if (Assert.ASSERTS_ENABLED) {
+           Assert.that(isDouble(), "not a double flag!");
+        }
+        return addr.getJDoubleAt(0);
+     }
+
+     public boolean isUint64t() {
+        return type.equals("uint64_t");
+     }
+
+     public long getUint64t() {
+        if (Assert.ASSERTS_ENABLED) {
+           Assert.that(isUint64t(), "not an uint64_t flag!");
+        }
+        return addr.getCIntegerAt(0, uint64tType.getSize(), true);
+     }
+
      public String getValue() {
         if (isBool()) {
            return Boolean.toString(getBool());
@@ -241,11 +286,27 @@
         } else if (isIntx()) {
            return Long.toString(getIntx());
         } else if (isUIntx()) {
-           return Long.toString(getUIntx());
+           return Long.toUnsignedString(getUIntx());
         } else if (isSizet()) {
-            return Long.toString(getSizet());
+           return Long.toUnsignedString(getSizet());
+        } else if (isCcstr()) {
+           var str = getCcstr();
+           if (str != null) {
+               str = "\"" + str + "\"";
+           }
+           return str;
+        } else if (isCcstrlist()) {
+           var str = getCcstrlist();
+           if (str != null) {
+               str = "\"" + str + "\"";
+           }
+           return str;
+        } else if (isDouble()) {
+           return Double.toString(getDouble());
+        } else if (isUint64t()) {
+           return Long.toUnsignedString(getUint64t());
         } else {
-           return null;
+           throw new WrongTypeException("Unknown type: " + type + " (" + name + ")");
         }
      }
   };
@@ -383,6 +444,7 @@
     intxType = db.lookupType("intx");
     uintxType = db.lookupType("uintx");
     sizetType = db.lookupType("size_t");
+    uint64tType = db.lookupType("uint64_t");
     boolType = (CIntegerType) db.lookupType("bool");
 
     minObjAlignmentInBytes = getObjectAlignmentInBytes();
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, 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
@@ -294,6 +294,8 @@
       if (f != null) {
          if (f.isBool()) {
             return f.getBool()? 1L : 0L;
+         } else if (f.isUIntx() || f.isSizet() || f.isUint64t()) {
+            return Long.parseUnsignedLong(f.getValue());
          } else {
             return Long.parseLong(f.getValue());
          }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactExceptionTest.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactExceptionTest.java	Mon Jan 28 13:56:39 2019 +0000
@@ -98,6 +98,10 @@
         }
     }
 
+    public void testIntegerExactOverflowWithoutUse3() {
+        Math.addExact(Integer.MAX_VALUE, 1);
+    }
+
     @Test
     public void testIntegerExactWithoutUse1() throws InvalidInstalledCodeException {
         ResolvedJavaMethod method = getResolvedJavaMethod("testIntegerExactOverflowWithoutUse1");
@@ -126,6 +130,20 @@
         assertTrue(gotException);
     }
 
+    @Test
+    public void testIntegerExactWithoutUse3() throws InvalidInstalledCodeException {
+        ResolvedJavaMethod method = getResolvedJavaMethod("testIntegerExactOverflowWithoutUse3");
+        InstalledCode code = getCode(method);
+
+        boolean gotException = false;
+        try {
+            code.executeVarargs(this);
+        } catch (ArithmeticException e) {
+            gotException = true;
+        }
+        assertTrue(gotException);
+    }
+
     static long longCounter = 10;
 
     public void testLongExactOverflowSnippet(long input) {
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Mon Jan 28 13:56:39 2019 +0000
@@ -560,19 +560,14 @@
     }
 
     private static boolean createIntegerExactOperation(GraphBuilderContext b, JavaKind kind, ValueNode x, ValueNode y, IntegerExactOp op) {
-        if (x.isConstant() && y.isConstant()) {
-            b.addPush(kind, createIntegerExactArithmeticNode(x, y, null, op));
+        BytecodeExceptionKind exceptionKind = kind == JavaKind.Int ? BytecodeExceptionKind.INTEGER_EXACT_OVERFLOW : BytecodeExceptionKind.LONG_EXACT_OVERFLOW;
+        AbstractBeginNode exceptionEdge = b.genExplicitExceptionEdge(exceptionKind);
+        if (exceptionEdge != null) {
+            IntegerExactArithmeticSplitNode split = b.addPush(kind, createIntegerExactSplit(x, y, exceptionEdge, op));
+            split.setNext(b.add(new BeginNode()));
             return true;
-        } else {
-            BytecodeExceptionKind exceptionKind = kind == JavaKind.Int ? BytecodeExceptionKind.INTEGER_EXACT_OVERFLOW : BytecodeExceptionKind.LONG_EXACT_OVERFLOW;
-            AbstractBeginNode exceptionEdge = b.genExplicitExceptionEdge(exceptionKind);
-            if (exceptionEdge != null) {
-                IntegerExactArithmeticSplitNode split = b.addPush(kind, createIntegerExactSplit(x, y, exceptionEdge, op));
-                split.setNext(b.add(new BeginNode()));
-                return true;
-            }
-            return false;
         }
+        return false;
     }
 
     private static void registerMathPlugins(InvocationPlugins plugins, boolean allowDeoptimization) {
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java	Mon Jan 28 13:56:39 2019 +0000
@@ -39,6 +39,9 @@
 import java.nio.file.attribute.FileAttribute;
 import java.nio.file.attribute.FileAttributeView;
 import java.nio.file.spi.FileSystemProvider;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -317,7 +320,13 @@
     //////////////////////////////////////////////////////////////
     void removeFileSystem(Path zfpath, ZipFileSystem zfs) throws IOException {
         synchronized (filesystems) {
-            zfpath = zfpath.toRealPath();
+            Path tempPath = zfpath;
+            PrivilegedExceptionAction<Path> action = tempPath::toRealPath;
+            try {
+                zfpath = AccessController.doPrivileged(action);
+            } catch (PrivilegedActionException e) {
+                throw (IOException) e.getException();
+            }
             if (filesystems.get(zfpath) == zfs)
                 filesystems.remove(zfpath);
         }
--- a/test/hotspot/gtest/memory/test_virtualSpaceNode.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/gtest/memory/test_virtualSpaceNode.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -28,6 +28,9 @@
 #include "utilities/formatBuffer.hpp"
 #include "unittest.hpp"
 
+// include as last, or otherwise we pull in an incompatible "assert" macro
+#include <vector>
+
 using namespace metaspace;
 
 namespace {
@@ -71,24 +74,55 @@
 
 // removes all the chunks added to the ChunkManager since creation of ChunkManagerRestorer
 class ChunkManagerRestorer {
-  ChunkManager* const _cm;
-  Metachunk* _chunks[NumberOfFreeLists];
- public:
-  ChunkManagerRestorer(ChunkManager* cm) : _cm(cm) {
-    for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) {
-      ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
-      _chunks[i] = l->tail();
+  metaspace::ChunkManager* const _cm;
+  std::vector<metaspace::Metachunk*>* _free_chunks[metaspace::NumberOfFreeLists];
+  int _count_pre_existing;
+public:
+  ChunkManagerRestorer(metaspace::ChunkManager* cm) : _cm(cm), _count_pre_existing(0) {
+    _cm->locked_verify();
+    for (metaspace::ChunkIndex i = metaspace::ZeroIndex; i < metaspace::NumberOfFreeLists; i = next_chunk_index(i)) {
+      metaspace::ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
+      _count_pre_existing += l->count();
+      std::vector<metaspace::Metachunk*> *v = new std::vector<metaspace::Metachunk*>(l->count());
+      metaspace::Metachunk* c = l->head();
+      while (c) {
+        v->push_back(c);
+        c = c->next();
+      }
+      _free_chunks[i] = v;
     }
   }
   ~ChunkManagerRestorer() {
+    _cm->locked_verify();
+    for (metaspace::ChunkIndex i = metaspace::ZeroIndex; i < metaspace::NumberOfFreeLists; i = next_chunk_index(i)) {
+      metaspace::ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
+      std::vector<metaspace::Metachunk*> *v = _free_chunks[i];
+      ssize_t count = l->count();
+      for (ssize_t j = 0; j < count; j++) {
+        metaspace::Metachunk* c = l->head();
+        while (c) {
+          bool found = false;
+          for (size_t k = 0; k < v->size() && !found; k++) {
+            found = (c == v->at(k));
+          }
+          if (found) {
+            c = c->next();
+          } else {
+            _cm->remove_chunk(c);
+            break;
+          }
+        }
+      }
+      delete _free_chunks[i];
+      _free_chunks[i] = NULL;
+   }
+    int count_after_cleanup = 0;
     for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) {
       ChunkList* l = ChunkManagerTest::free_chunks(_cm, i);
-      Metachunk* t = l->tail();
-      while (t != _chunks[i]) {
-        _cm->remove_chunk(t);
-        t = l->tail();
-      }
+      count_after_cleanup += l->count();
     }
+    EXPECT_EQ(_count_pre_existing, count_after_cleanup);
+    _cm->locked_verify();
   }
 };
 
@@ -121,7 +155,6 @@
 
   // committed - used = words left to retire
   const size_t words_left = page_chunks - SmallChunk - SpecializedChunk;
-
   size_t num_medium_chunks, num_small_chunks, num_spec_chunks;
   chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks);
 
@@ -155,7 +188,6 @@
 
 TEST_VM(VirtualSpaceNodeTest, all_vsn_is_committed_half_is_used_by_chunks) {
   MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
-
   ChunkManager cm(false);
   VirtualSpaceNode vsn(false, vsn_test_size_bytes);
   ChunkManagerRestorer c(Metaspace::get_chunk_manager(false));
@@ -165,6 +197,7 @@
   vsn.get_chunk_vs(MediumChunk);
   vsn.get_chunk_vs(MediumChunk);
   vsn.retire(&cm);
+
   // DISABLED: checks started to fail after 8198423
   // EXPECT_EQ(2UL, ChunkManagerTest::sum_free_chunks_count(&cm)) << "should have been memory left for 2 chunks";
   // EXPECT_EQ(2UL * MediumChunk, ChunkManagerTest::sum_free_chunks(&cm)) << "sizes should add up";
@@ -172,13 +205,13 @@
 
 TEST_VM(VirtualSpaceNodeTest, no_committed_memory) {
   MutexLockerEx ml(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
-
   ChunkManager cm(false);
   VirtualSpaceNode vsn(false, vsn_test_size_bytes);
   ChunkManagerRestorer c(Metaspace::get_chunk_manager(false));
 
   vsn.initialize();
   vsn.retire(&cm);
+
   ASSERT_EQ(0UL, ChunkManagerTest::sum_free_chunks_count(&cm)) << "did not commit any memory in the VSN";
 }
 
--- a/test/hotspot/jtreg/ProblemList-graal.txt	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/ProblemList-graal.txt	Mon Jan 28 13:56:39 2019 +0000
@@ -39,6 +39,8 @@
 
 compiler/graalunit/JttThreadsTest.java                          8208066   generic-all
 
+compiler/intrinsics/mathexact/LongMulOverflowTest.java          8217796   generic-all
+
 compiler/jvmci/SecurityRestrictionsTest.java                    8181837   generic-all
 
 compiler/unsafe/UnsafeGetConstantField.java                     8181833   generic-all
@@ -145,6 +147,7 @@
 org.graalvm.compiler.core.test.OptionsVerifierTest                               8205081
 org.graalvm.compiler.hotspot.test.CompilationWrapperTest                         8205081
 org.graalvm.compiler.replacements.test.classfile.ClassfileBytecodeProviderTest   8205081
+org.graalvm.compiler.debug.test.DebugContextTest                                 8205081
 
 org.graalvm.compiler.core.test.deopt.CompiledMethodTest          8202955
 
--- a/test/hotspot/jtreg/TEST.ROOT	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/TEST.ROOT	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 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
@@ -59,6 +59,7 @@
     vm.rtm.cpu \
     vm.rtm.compiler \
     vm.aot \
+    vm.aot.enabled \
     vm.cds \
     vm.cds.custom.loaders \
     vm.cds.archived.java.heap \
--- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -71,6 +71,11 @@
         "-XX:+ReplayCompiles", REPLAY_FILE_OPTION};
     protected final Optional<Boolean> runServer;
 
+    public static class EmptyMain {
+        public static void main(String[] args) {
+        }
+    }
+
     static {
         try {
             CLIENT_VM_AVAILABLE = ProcessTools.executeTestJvm(CLIENT_VM_OPTION, VERSION_OPTION)
@@ -135,7 +140,7 @@
             options.addAll(Arrays.asList(REPLAY_GENERATION_OPTIONS));
             options.addAll(Arrays.asList(vmopts));
             options.add(needCoreDump ? ENABLE_COREDUMP_ON_CRASH : DISABLE_COREDUMP_ON_CRASH);
-            options.add(VERSION_OPTION);
+            options.add(EmptyMain.class.getName());
             if (needCoreDump) {
                 crashOut = ProcessTools.executeProcess(getTestJavaCommandlineWithPrefix(
                         RUN_SHELL_NO_LIMIT, options.toArray(new String[0])));
--- a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -25,6 +25,8 @@
  * @test
  * @bug 8081778
  * @summary Add C2 x86 intrinsic for BigInteger::mulAdd() method
+ * @comment the test disables intrinsics, so it can't be run w/ AOT'ed java.base
+ * @requires !vm.aot.enabled
  *
  * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch
  *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-UseSquareToLenIntrinsic -XX:-UseMultiplyToLenIntrinsic
--- a/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/InvokeTest.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/InvokeTest.java	Mon Jan 28 13:56:39 2019 +0000
@@ -60,6 +60,8 @@
     static final MethodHandle privateMH; // invokespecial   I.f4 T
     static final MethodHandle basicMH;
 
+    static final MethodHandle intrinsicMH; // invokevirtual Object.hashCode
+
     static final WhiteBox WB = WhiteBox.getWhiteBox();
 
     static volatile boolean doDeopt = false;
@@ -75,6 +77,7 @@
             specialMH  = LOOKUP.findSpecial(T.class, "f4", mtype, T.class);
             privateMH  = LOOKUP.findSpecial(I.class, "f4", mtype, I.class);
             basicMH    = NonInlinedReinvoker.make(staticMH);
+            intrinsicMH = LOOKUP.findVirtual(Object.class, "hashCode", MethodType.methodType(int.class));
         } catch (Exception e) {
             throw new Error(e);
         }
@@ -117,6 +120,10 @@
     static class Q2 extends T implements J2 {}
     static class Q3 extends T implements J3 {}
 
+    static class H {
+        public int hashCode() { return 0; }
+    }
+
     @DontInline
     static void linkToVirtual(T recv, Class<?> expected) {
         try {
@@ -138,6 +145,16 @@
     }
 
     @DontInline
+    static void linkToVirtualIntrinsic(Object recv, int expected) {
+        try {
+            int v = (int)intrinsicMH.invokeExact(recv);
+            assertEquals(v, expected);
+        } catch (Throwable e) {
+            throw new Error(e);
+        }
+    }
+
+    @DontInline
     static void linkToInterface(I recv, Class<?> expected) {
         try {
             Class<?> cls = (Class<?>)intfMH.invokeExact(recv);
@@ -177,7 +194,6 @@
         }
     }
 
-
     @DontInline
     static void invokeBasic() {
         try {
@@ -215,6 +231,8 @@
         run(() -> linkToVirtual(new T(), T.class));
         run(() -> linkToVirtualDefault(new T(), I.class));
 
+        run(() -> linkToVirtualIntrinsic(new H(), 0));
+
         // Megamorphic case (optimized virtual call)
         run(() -> {
             linkToVirtual(new T() {}, T.class);
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, 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
@@ -24,9 +24,13 @@
 /*
  * @test
  * @bug 8136421
+ *
  * @requires vm.jvmci
- *         & (vm.compMode != "Xcomp" | vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true)
- * @summary no "-Xcomp -XX:-TieredCompilation" combination allowed until JDK-8140018 is resolved
+ * @requires vm.opt.final.EliminateAllocations == true
+ *
+ * @comment no "-Xcomp -XX:-TieredCompilation" combination allowed until JDK-8140018 is resolved
+ * @requires vm.compMode != "Xcomp" | vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true
+ *
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
--- a/test/hotspot/jtreg/gc/epsilon/TestClasses.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/gc/epsilon/TestClasses.java	Mon Jan 28 13:56:39 2019 +0000
@@ -30,7 +30,7 @@
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.misc
  *
- * @run main/othervm -Xmx128m -XX:MetaspaceSize=1m -XX:MaxMetaspaceSize=32m -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -Xlog:gc+metaspace TestClasses
+ * @run main/othervm -Xmx128m -XX:MetaspaceSize=1m -XX:MaxMetaspaceSize=64m -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -Xlog:gc+metaspace TestClasses
  */
 
 import jdk.internal.org.objectweb.asm.ClassWriter;
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -33,6 +33,7 @@
 /**
  * @test
  * @bug 8190198
+ * @bug 8217612
  * @summary Test clhsdb flags command
  * @requires vm.hasSA
  * @library /test/lib
@@ -41,8 +42,8 @@
 
 public class ClhsdbFlags {
 
-    public static void main(String[] args) throws Exception {
-        System.out.println("Starting ClhsdbFlags test");
+    public static void runBasicTest() throws Exception {
+        System.out.println("Starting ClhsdbFlags basic test");
 
         LingeredApp theApp = null;
         try {
@@ -88,4 +89,54 @@
         }
         System.out.println("Test PASSED");
     }
+
+    public static void runAllTypesTest() throws Exception {
+        System.out.println("Starting ClhsdbFlags all types test");
+
+        LingeredApp theApp = null;
+        try {
+            ClhsdbLauncher test = new ClhsdbLauncher();
+            List<String> vmArgs = new ArrayList<String>();
+            vmArgs.add("-XX:+UnlockDiagnosticVMOptions");   // bool
+            vmArgs.add("-XX:ActiveProcessorCount=1");       // int
+            vmArgs.add("-XX:ParallelGCThreads=1");          // uint
+            vmArgs.add("-XX:MaxJavaStackTraceDepth=1024");  // intx
+            vmArgs.add("-XX:LogEventsBufferEntries=10");    // uintx
+            vmArgs.add("-XX:HeapSizePerGCThread=32m");      // size_t
+            vmArgs.add("-XX:NativeMemoryTracking=off");     // ccstr
+            vmArgs.add("-XX:OnError='echo error'");         // ccstrlist
+            vmArgs.add("-XX:CompileThresholdScaling=1.0");  // double
+            vmArgs.add("-XX:ErrorLogTimeout=120");          // uint64_t
+            vmArgs.addAll(Utils.getVmOptions());
+            theApp = LingeredApp.startApp(vmArgs);
+            System.out.println("Started LingeredApp with pid " + theApp.getPid());
+
+            List<String> cmds = List.of("flags");
+
+            Map<String, List<String>> expStrMap = new HashMap<>();
+            expStrMap.put("flags", List.of(
+                    "UnlockDiagnosticVMOptions = true",
+                    "ActiveProcessorCount = 1",
+                    "ParallelGCThreads = 1",
+                    "MaxJavaStackTraceDepth = 1024",
+                    "LogEventsBufferEntries = 10",
+                    "HeapSizePerGCThread = 3",
+                    "NativeMemoryTracking = \"off\"",
+                    "OnError = \"'echo error'\"",
+                    "CompileThresholdScaling = 1.0",
+                    "ErrorLogTimeout = 120"));
+
+            test.run(theApp.getPid(), cmds, expStrMap, null);
+        } catch (Exception ex) {
+            throw new RuntimeException("Test ERROR " + ex, ex);
+        } finally {
+            LingeredApp.stopApp(theApp);
+        }
+        System.out.println("Test PASSED");
+    }
+
+    public static void main(String[] args) throws Exception {
+        runBasicTest();
+        runAllTypesTest();
+    }
 }
--- a/test/hotspot/jtreg/testlibrary/jittester/Makefile	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/Makefile	Mon Jan 28 13:56:39 2019 +0000
@@ -83,9 +83,9 @@
 
 .PHONY: cleantmp
 
-all: JAR
+all: $(DIST_JAR)
 
-JAR: INIT COMPILE manifest
+$(DIST_JAR): INIT COMPILE manifest
 	$(JAR) cfm $(DIST_JAR) $(MANIFEST) -C $(CLASSES_DIR) .
 
 manifest:
@@ -107,7 +107,7 @@
 INIT: $(DIST_DIR)
 	$(shell if [ ! -d $(CLASSES_DIR) ]; then mkdir -p $(CLASSES_DIR); fi)
 
-install: clean_testbase testgroup testroot copytestlibrary copyaot JAR cleantmp
+install: clean_testbase testgroup testroot copytestlibrary copyaot $(DIST_JAR) cleantmp
 	$(JAVA) --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -ea -jar $(DIST_JAR) $(APPLICATION_ARGS)
 
 clean_testbase:
--- a/test/hotspot/jtreg/testlibrary/jittester/conf/default.properties	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/conf/default.properties	Mon Jan 28 13:56:39 2019 +0000
@@ -1,6 +1,6 @@
 seed=SEED2
 number-of-tests=1000
-testbase-dir=ws/hotspot/test
+testbase-dir=testbase
 fp-precision=7
 min-cfg-depth=5
 max-cfg-depth=5
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/AotTestGeneratorsFactory.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/AotTestGeneratorsFactory.java	Mon Jan 28 13:56:39 2019 +0000
@@ -32,7 +32,7 @@
     private static final String AOT_COMPILER_BUILD_ACTION
             = "@build compiler.aot.AotCompiler";
     private static final String AOT_COMPILER_RUN_ACTION_PREFIX
-            = "@run driver compiler.aot.AotCompiler -libname aottest.so -class ";
+            = "@run driver compiler.aot.AotCompiler -extraopt -Xmixed -libname aottest.so -class ";
 
     @Override
     public List<TestsGenerator> apply(String[] input) {
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/Automatic.java	Mon Jan 28 13:56:39 2019 +0000
@@ -110,6 +110,7 @@
     public static void main(String[] args) {
         initializeTestGenerator(args);
         int counter = 0;
+        System.out.printf("Generating %d tests...%n",  ProductionParams.numberOfTests.value());
         System.out.printf(" %13s | %8s | %8s | %8s |%n", "start time", "count", "generat",
                 "running");
         System.out.printf(" %13s | %8s | %8s | %8s |%n", "---", "---", "---", "---");
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java	Mon Jan 28 13:56:39 2019 +0000
@@ -39,7 +39,7 @@
     private static final String DEFAULT_SUFFIX = "bytecode_tests";
 
     ByteCodeGenerator() {
-        super(DEFAULT_SUFFIX);
+        super(DEFAULT_SUFFIX, s -> new String[0], "-Xcomp");
     }
 
     ByteCodeGenerator(String suffix, Function<String, String[]> preRunActions, String jtDriverOptions) {
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/JavaCodeGenerator.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/JavaCodeGenerator.java	Mon Jan 28 13:56:39 2019 +0000
@@ -34,7 +34,7 @@
     private static final String DEFAULT_SUFFIX = "java_tests";
 
     JavaCodeGenerator() {
-        this(DEFAULT_SUFFIX, JavaCodeGenerator::generatePrerunAction, "");
+        this(DEFAULT_SUFFIX, JavaCodeGenerator::generatePrerunAction, "-Xcomp");
     }
 
     JavaCodeGenerator(String prefix, Function<String, String[]> preRunActions, String jtDriverOptions) {
@@ -64,13 +64,16 @@
     }
 
     private void compileJavaFile(String mainClassName) {
-        String classPath = getRoot().resolve(generatorDir)
-                                    .toAbsolutePath()
-                                    .toString();
-        ProcessBuilder pb = new ProcessBuilder(JAVAC, "-cp", classPath,
+        String classPath = tmpDir.toString();
+        ProcessBuilder pb = new ProcessBuilder(JAVAC,
+                "-d", classPath,
+                "-cp", classPath,
                 generatorDir.resolve(mainClassName + ".java").toString());
         try {
-            runProcess(pb, generatorDir.resolve(mainClassName).toString());
+            int r = runProcess(pb, tmpDir.resolve(mainClassName + ".javac").toString());
+            if (r != 0) {
+                throw new Error("Can't compile sources, exit code = " + r);
+            }
         } catch (IOException | InterruptedException e) {
             throw new Error("Can't compile sources ", e);
         }
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java	Mon Jan 28 13:56:39 2019 +0000
@@ -42,6 +42,7 @@
     protected static final String JAVAC = Paths.get(JAVA_BIN, "javac").toString();
     protected static final String JAVA = Paths.get(JAVA_BIN, "java").toString();
     protected final Path generatorDir;
+    protected final Path tmpDir;
     protected final Function<String, String[]> preRunActions;
     protected final String jtDriverOptions;
     private static final String DISABLE_WARNINGS = "-XX:-PrintWarnings";
@@ -52,15 +53,19 @@
 
     protected TestsGenerator(String suffix, Function<String, String[]> preRunActions,
             String jtDriverOptions) {
-        generatorDir = getRoot().resolve(suffix);
+        generatorDir = getRoot().resolve(suffix).toAbsolutePath();
+        try {
+            tmpDir = Files.createTempDirectory(suffix).toAbsolutePath();
+        } catch (IOException e) {
+            throw new Error("Can't get a tmp dir for " + suffix, e);
+        }
         this.preRunActions = preRunActions;
         this.jtDriverOptions = jtDriverOptions;
     }
 
     protected void generateGoldenOut(String mainClassName) {
-        String classPath = getRoot().resolve(generatorDir)
-                                    .toAbsolutePath()
-                                    .toString();
+        String classPath = tmpDir.toString() + File.pathSeparator
+                + generatorDir.toString();
         ProcessBuilder pb = new ProcessBuilder(JAVA, "-Xint", DISABLE_WARNINGS, "-Xverify",
                 "-cp", classPath, mainClassName);
         String goldFile = mainClassName + ".gold";
@@ -89,9 +94,10 @@
         return -1;
     }
 
-    protected static void compilePrinter() {
+    protected void compilePrinter() {
         Path root = getRoot();
         ProcessBuilder pbPrinter = new ProcessBuilder(JAVAC,
+                "-d", tmpDir.toString(),
                 root.resolve("jdk")
                     .resolve("test")
                     .resolve("lib")
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TypeList.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TypeList.java	Mon Jan 28 13:56:39 2019 +0000
@@ -23,11 +23,6 @@
 
 package jdk.test.lib.jittester;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.function.Predicate;
-
 import jdk.test.lib.jittester.types.TypeBoolean;
 import jdk.test.lib.jittester.types.TypeByte;
 import jdk.test.lib.jittester.types.TypeChar;
@@ -39,6 +34,11 @@
 import jdk.test.lib.jittester.types.TypeShort;
 import jdk.test.lib.jittester.types.TypeVoid;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.function.Predicate;
+
 public class TypeList {
     public static final TypeVoid VOID = new TypeVoid();
     public static final TypeBoolean BOOLEAN = new TypeBoolean();
@@ -56,7 +56,7 @@
     private static final List<Type> BUILTIN_TYPES = new ArrayList<>();
     private static final List<Type> BUILTIN_INT_TYPES = new ArrayList<>();
     private static final List<Type> BUILTIN_FP_TYPES = new ArrayList<>();
-    private static final List<Type> REFERENCE_TYPES = new ArrayList<>();
+    private static final List<TypeKlass> REFERENCE_TYPES = new ArrayList<>();
 
     static {
         BUILTIN_INT_TYPES.add(BOOLEAN);
@@ -99,7 +99,7 @@
         return BUILTIN_FP_TYPES;
     }
 
-    protected static Collection<Type> getReferenceTypes() {
+    protected static Collection<TypeKlass> getReferenceTypes() {
         return REFERENCE_TYPES;
     }
 
@@ -148,7 +148,7 @@
         return null;
     }
 
-    public static void add(Type t) {
+    public static void add(TypeKlass t) {
         REFERENCE_TYPES.add(t);
         TYPES.add(t);
     }
@@ -159,8 +159,12 @@
     }
 
     public static void removeAll() {
-        Predicate<? super Type> isNotBasic = t -> t.getName().startsWith("Test_");
-        TYPES.removeIf(isNotBasic);
-        REFERENCE_TYPES.removeIf(isNotBasic);
+        Predicate<? super String> isNotBasic = s -> s.startsWith("Test_");
+        Predicate<? super Type> isNotBasicType = t -> isNotBasic.test(t.getName());
+        REFERENCE_TYPES.stream()
+                       .map(TypeKlass::getChildrenNames)
+                       .forEach(l -> l.removeIf(isNotBasic));
+        TYPES.removeIf(isNotBasicType);
+        REFERENCE_TYPES.removeIf(isNotBasicType);
     }
 }
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CastOperatorFactory.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/factories/CastOperatorFactory.java	Mon Jan 28 13:56:39 2019 +0000
@@ -67,7 +67,7 @@
                     SymbolTable.merge();
                     return castOperator;
                 }
-                throw new ProductionFailedException();
+                SymbolTable.pop();
             } catch (ProductionFailedException e) {
                 SymbolTable.pop();
             }
--- a/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/types/TypeKlass.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/types/TypeKlass.java	Mon Jan 28 13:56:39 2019 +0000
@@ -25,6 +25,7 @@
 
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Objects;
 import java.util.TreeSet;
 import jdk.test.lib.jittester.ProductionParams;
 import jdk.test.lib.jittester.Symbol;
@@ -124,26 +125,28 @@
         TreeSet<TypeKlass> result = new TreeSet<>();
         parentsList.stream()
                 .map(TypeList::find)
-                .filter(parentKlass -> parentKlass != null)
-                .map(parentKlass -> (TypeKlass) parentKlass)
-                .forEach(parentKlass -> {
-                    result.add(parentKlass);
-                    result.addAll(parentKlass.getAllParents());
+                .filter(Objects::nonNull)
+                .map(k -> (TypeKlass) k)
+                .forEach(k -> {
+                    if (result.add(k)) {
+                        result.addAll(k.getAllParents());
+                    }
         });
         return result;
     }
 
     public TreeSet<TypeKlass> getAllChildren() {
-        TreeSet<TypeKlass> r = new TreeSet<>();
+        TreeSet<TypeKlass> result = new TreeSet<>();
         childrenList.stream()
                 .map(TypeList::find)
-                .filter(childKlass -> childKlass != null)
-                .map(childKlass -> (TypeKlass) childKlass)
-                .forEach(childKlass -> {
-                    r.add(childKlass);
-                    r.addAll(childKlass.getAllChildren());
+                .filter(Objects::nonNull)
+                .map(k -> (TypeKlass) k)
+                .forEach(k -> {
+                    if (result.add(k)) {
+                        result.addAll(k.getAllChildren());
+                    }
         });
-        return r;
+        return result;
     }
 
     @Override
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t002/hs202t002.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t002/hs202t002.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -43,13 +43,7 @@
 static jint redefineNumber = 0;
 static jvmtiEnv * jvmti = NULL;
 
-typedef enum {
-  suspend_error = -1,
-  not_suspended,
-  suspended
-} thread_suspend_status_t;
-
-static volatile thread_suspend_status_t thread_suspend_status = not_suspended;
+static volatile bool thread_suspend_error = false;
 
 void JNICALL callbackMethodExit(jvmtiEnv *jvmti_env,
                                 JNIEnv* jni_env,
@@ -75,10 +69,10 @@
                 nsk_printf("Agent::SUSPENDING>> \n");
                 err=jvmti_env->SuspendThread(thread);
                 if (err == JVMTI_ERROR_NONE) {
-                    thread_suspend_status = suspended;
-                    nsk_printf("Agent:: Thread successfully suspended..\n");
-                } else if (err == JVMTI_ERROR_THREAD_SUSPENDED) {
-                    thread_suspend_status = suspend_error;
+                  // we don't get here until we are resumed
+                    nsk_printf("Agent:: Thread successfully suspended and was resumed\n");
+                } else {
+                    thread_suspend_error = true;
                     nsk_printf(" ## Error occured %s \n",TranslateError(err));
                 }
             }
@@ -175,7 +169,6 @@
 
     err = jvmti->ResumeThread(thread);
     if (err == JVMTI_ERROR_NONE) {
-        thread_suspend_status = not_suspended;
         retvalue = JNI_TRUE;
         nsk_printf(" Agent:: Thread Resumed.. \n");
     } else {
@@ -189,13 +182,21 @@
 Java_nsk_jvmti_scenarios_hotswap_HS202_hs202t002_hs202t002_isThreadSuspended(JNIEnv* jni,
                                                                              jclass clas,
                                                                              jthread thread) {
-    if (suspend_error == thread_suspend_status) {
+    if (thread_suspend_error) {
         jclass ex_class = jni->FindClass("java/lang/IllegalThreadStateException");
         jni->ThrowNew(ex_class, "Thread has failed to self suspend");
         return JNI_FALSE;
     }
 
-    return suspended == thread_suspend_status;
+    // There is an inherent race here if the suspend fails for some reason but
+    // thread_suspend_error is not yet set. But as long as we report the suspend
+    // state correctly there is no problem as the Java code will simply loop and call
+    // this again until we see thread_suspend_error is true.
+
+    jint state = 0;
+    // No errors possible here: thread is valid, and state is not NULL
+    jvmti->GetThreadState(thread, &state);
+    return (state & JVMTI_THREAD_STATE_SUSPENDED) != 0;
 }
 
-}
+} // extern C
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/sp05t003.cpp	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/sp05t003.cpp	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2018, 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
@@ -65,7 +65,7 @@
 /* references to tested threads */
 static jthread threadsList[THREADS_COUNT];
 
-/* events conunts */
+/* events counts */
 static volatile int eventsStart = 0;
 static volatile int eventsEnd   = 0;
 
@@ -371,17 +371,18 @@
     /* check if event is for tested thread */
     for (i = 0; i < THREADS_COUNT; i++) {
         if (jni->IsSameObject(threadsList[i], thread)) {
-                NSK_DISPLAY0("SUCCESS: expected THREAD_START event\n");
+            NSK_DISPLAY0("SUCCESS: expected THREAD_START event\n");
 
             /* suspend thread */
             NSK_DISPLAY3("  suspend starting thread #%d (%s): %p\n",
                                 i, threadsName[i], (void*)thread);
+            /* must bump the count before we suspend */
+            eventsStart++;
 
             if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread))) {
                 nsk_jvmti_setFailStatus();
                 return;
             }
-            eventsStart++;
 
             break;
         }
@@ -406,6 +407,8 @@
     for (i = 0; i < THREADS_COUNT; i++) {
         if (jni->IsSameObject(threadsList[i], thread)) {
                 NSK_DISPLAY0("SUCCESS: expected THREAD_END event\n");
+            /* must bump the count before we suspend */
+            eventsEnd++;
 
             /* suspend thread */
             NSK_DISPLAY3("  suspend finishing thread #%d (%s): %p\n",
@@ -415,7 +418,6 @@
                 nsk_jvmti_setFailStatus();
                 return;
             }
-            eventsEnd++;
 
             break;
         }
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -27,8 +27,7 @@
  * @bug 6969574
  *
  * @summary converted from VM Testbase vm/mlvm/mixed/stress/regression/b6969574.
- * VM Testbase keywords: [feature_mlvm, nonconcurrent, quarantine]
- * VM Testbase comments: 8079650
+ * VM Testbase keywords: [feature_mlvm, nonconcurrent]
  *
  * @library /vmTestbase
  *          /test/lib
@@ -313,10 +312,8 @@
     private final static int REFLECTION_CALL = 1;
     private final static int INVOKE_EXACT = 2;
     private final static int INVOKE = 3;
-    private final static int INVOKE_WITHARG = 4;
-    private final static int INVOKE_WITHARG_TYPECONV = 5;
-    private final static int INDY = 6;
-    private final static int BENCHMARK_COUNT = 7;
+    private final static int INDY = 4;
+    private final static int BENCHMARK_COUNT = 5;
 
     //
     // Test body
@@ -356,18 +353,6 @@
                     }
                 });
 
-        benchmarks[INVOKE_WITHARG] = new Benchmark("MH.invokeWithArguments(), exact types", new T() {
-                    public void run() throws Throwable {
-                        mhTestee.invokeWithArguments(testData, TESTEE_ARG2, TESTEE_ARG3);
-                    }
-                });
-
-        benchmarks[INVOKE_WITHARG_TYPECONV] = new Benchmark("MH.invokeWithArguments() + type conv.", new T() {
-                    public void run() throws Throwable {
-                        mhTestee.invokeWithArguments((Object) testData, null, (Short) Short.MAX_VALUE);
-                    }
-                });
-
         benchmarks[INDY] = new Benchmark("invokedynamic instruction", new T() {
                     public void run() throws Throwable {
                         indyWrapper(testData);
@@ -415,8 +400,6 @@
         verifyTimeOrder(results[REFLECTION_CALL],         results[INVOKE_EXACT]);
         verifyTimeOrder(results[INVOKE_EXACT],            results[DIRECT_CALL]);
         verifyTimeOrder(results[INVOKE],                  results[DIRECT_CALL]);
-        verifyTimeOrder(results[INVOKE_WITHARG],          results[INVOKE_EXACT]);
-        verifyTimeOrder(results[INVOKE_WITHARG_TYPECONV], results[INVOKE_EXACT]);
         verifyTimeOrder(results[INVOKE_EXACT],            results[INDY]);
 
         return true;
--- a/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/XMLStreamWriterTest.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/jaxp/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/XMLStreamWriterTest.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -42,11 +42,11 @@
 
 /*
  * @test
- * @bug 6347190 8139584
+ * @bug 6347190 8139584 8216408
  * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
  * @run testng/othervm -DrunSecMngr=true stream.XMLStreamWriterTest.XMLStreamWriterTest
  * @run testng/othervm stream.XMLStreamWriterTest.XMLStreamWriterTest
- * @summary Test StAX Writer won't insert comment into element inside.
+ * @summary Tests XMLStreamWriter.
  */
 @Listeners({jaxp.library.BasePolicy.class})
 public class XMLStreamWriterTest {
@@ -94,12 +94,14 @@
     }
 
     /**
-     * Test of main method, of class TestXMLStreamWriter.
+     * Verifies that the StAX Writer won't insert comment into the element tag.
      */
     @Test
     public void testWriteComment() {
         try {
-            String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a:html href=\"http://java.sun.com\"><!--This is comment-->java.sun.com</a:html>";
+            String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                    + "<a:html href=\"http://java.sun.com\">"
+                    + "<!--This is comment-->java.sun.com</a:html>";
             XMLOutputFactory f = XMLOutputFactory.newInstance();
             // f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES,
             // Boolean.TRUE);
@@ -122,4 +124,18 @@
         }
     }
 
+    /**
+     * @bug 8216408
+     * Verifies that setDefaultNamespace accepts null.
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testSetDefaultNamespace() throws Exception {
+        XMLOutputFactory f = XMLOutputFactory.newFactory();
+        f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
+        StringWriter sw = new StringWriter();
+        XMLStreamWriter xsw = f.createXMLStreamWriter(sw);
+        xsw.setDefaultNamespace(null);
+    }
 }
--- a/test/jdk/ProblemList-Xcomp.txt	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/jdk/ProblemList-Xcomp.txt	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -28,3 +28,4 @@
 #############################################################################
 
 java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all
+java/util/concurrent/CountDownLatch/Basic.java 8195057 generic-all
--- a/test/jdk/java/net/Socket/ExceptionText.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/jdk/java/net/Socket/ExceptionText.java	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -25,12 +25,10 @@
  * @test
  * @library /test/lib
  * @build jdk.test.lib.Utils
- * @bug 8204233 8207846 8208691
+ * @bug 8204233
  * @summary Add configurable option for enhanced socket IOException messages
  * @run main/othervm
  *       ExceptionText
- * @run main/othervm
- *       ExceptionText
  *       WITHOUT_Enhanced_Text
  * @run main/othervm
  *       -Djdk.includeInExceptions=
@@ -64,7 +62,6 @@
 import java.nio.channels.AsynchronousSocketChannel;
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.SocketChannel;
-import java.security.Security;
 import java.util.concurrent.ExecutionException;
 import jdk.test.lib.Utils;
 
@@ -73,33 +70,20 @@
     enum TestTarget {SOCKET, CHANNEL, ASYNC_CHANNEL};
 
     public static void main(String args[]) throws Exception {
-        if (args.length == 0) {
-            testSecProp();
+        String passOrFail = args[0];
+        boolean expectEnhancedText;
+        if (passOrFail.equals("expectEnhancedText")) {
+            expectEnhancedText = true;
         } else {
-            String passOrFail = args[0];
-            boolean expectEnhancedText;
-            if (passOrFail.equals("expectEnhancedText")) {
-                expectEnhancedText = true;
-            } else {
-                expectEnhancedText = false;
-            }
-            test(expectEnhancedText);
+            expectEnhancedText = false;
         }
+        test(expectEnhancedText);
     }
 
     static final InetSocketAddress dest  = Utils.refusingEndpoint();
     static final String PORT = ":" + Integer.toString(dest.getPort());
     static final String HOST = dest.getHostString();
 
-    static void testSecProp() {
-        String incInExc = Security.getProperty("jdk.includeInExceptions");
-        if (incInExc != null) {
-            throw new RuntimeException("Test failed: default value of " +
-                "jdk.includeInExceptions security property is not null: " +
-                incInExc);
-        }
-    }
-
     static void test(boolean withProperty) {
         // Socket
         IOException e = getException(TestTarget.SOCKET);
@@ -132,10 +116,11 @@
     static IOException getException(TestTarget target) {
         try {
             if (target == TestTarget.SOCKET) {
-                Socket s = new Socket();
-                s.connect(dest);
+                try (Socket s = new Socket()) {
+                    s.connect(dest);
+                }
             } else if (target == TestTarget.CHANNEL) {
-                SocketChannel c = SocketChannel.open(dest);
+                SocketChannel.open(dest);
             } else if (target == TestTarget.ASYNC_CHANNEL) {
                 AsynchronousSocketChannel c = AsynchronousSocketChannel.open();
                 try {
--- a/test/jdk/java/net/httpclient/examples/JavadocExamples.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/jdk/java/net/httpclient/examples/JavadocExamples.java	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -24,6 +24,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
+import java.io.UncheckedIOException;
+import java.lang.reflect.UndeclaredThrowableException;
 import java.net.Authenticator;
 import java.net.InetSocketAddress;
 import java.net.ProxySelector;
@@ -36,6 +38,7 @@
 import java.net.http.HttpResponse;
 import java.net.http.HttpResponse.BodyHandler;
 import java.net.http.HttpResponse.BodyHandlers;
+import java.net.http.HttpResponse.BodySubscriber;
 import java.net.http.HttpResponse.BodySubscribers;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -44,6 +47,7 @@
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.Flow;
+import java.util.function.Supplier;
 import java.util.regex.Pattern;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
@@ -177,6 +181,11 @@
                 .send(request, responseInfo ->
                         BodySubscribers.mapping(BodySubscribers.ofString(UTF_8), String::getBytes));
 
+        // Maps an InputStream to a Foo object.
+        HttpResponse<Supplier<Foo>> response9 = client.send(request,
+                (resp) -> FromMappingSubscriber.asJSON(Foo.class));
+        String resp = response9.body().get().asString();
+
     }
 
     /**
@@ -290,4 +299,51 @@
         }
     }
 
+    public static class Foo {
+        byte[] bytes;
+        public Foo(byte[] bytes) {
+            this.bytes = bytes;
+        }
+        public String asString() {
+            return new String(bytes, UTF_8);
+        }
+    }
+
+    static class ObjectMapper {
+        <W> W readValue(InputStream is, Class<W> targetType)
+            throws IOException
+        {
+                byte[] bytes = is.readAllBytes();
+                return map(bytes, targetType);
+        }
+
+        static <W> W map(byte[] bytes, Class<W> targetType) {
+            try {
+                return targetType.getConstructor(byte[].class).newInstance(bytes);
+            } catch (RuntimeException | Error x) {
+                throw x;
+            } catch (Exception x) {
+                throw new UndeclaredThrowableException(x);
+            }
+        }
+    }
+
+    static class FromMappingSubscriber {
+        public static <W> BodySubscriber<Supplier<W>> asJSON(Class<W> targetType) {
+            BodySubscriber<InputStream> upstream = BodySubscribers.ofInputStream();
+
+            BodySubscriber<Supplier<W>> downstream = BodySubscribers.mapping(
+                    upstream, (InputStream is) -> () -> {
+                        try (InputStream stream = is) {
+                            ObjectMapper objectMapper = new ObjectMapper();
+                            return objectMapper.readValue(stream, targetType);
+                        } catch (IOException e) {
+                            throw new UncheckedIOException(e);
+                        }
+                    });
+            return downstream;
+        }
+
+    }
+
 }
--- a/test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/HandlersOnComplexResetUpdate.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/HandlersOnComplexResetUpdate.java	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -80,6 +80,14 @@
         }
     }
 
+    public static final double TIMEOUT_FACTOR;
+    static {
+        String toFactor = System.getProperty("test.timeout.factor", "1.0");
+        TIMEOUT_FACTOR = Double.parseDouble(toFactor);
+    }
+    static int adjustCount(int count) {
+        return (int) Math.ceil(TIMEOUT_FACTOR * count);
+    }
 
     private static final String PREFIX =
             "FileHandler-" + UUID.randomUUID() + ".log";
@@ -213,11 +221,11 @@
                     + barChild.getParent() +"\n\texpected: " + barRef.get());
         }
         Reference<? extends Logger> ref2;
-        int max = 3;
+        int max = adjustCount(3);
         barChild = null;
         while ((ref2 = queue.poll()) == null) {
             System.gc();
-            Thread.sleep(100);
+            Thread.sleep(1000);
             if (--max == 0) break;
         }
 
@@ -328,21 +336,25 @@
                     throw new RuntimeException(x);
                 }
             });
-            fooChild = null;
-            System.out.println("Setting fooChild to: " + fooChild);
-            while ((ref2 = queue.poll()) == null) {
-                System.gc();
-                Thread.sleep(1000);
-            }
-            if (ref2 != fooRef) {
-                throw new RuntimeException("Unexpected reference: "
-                        + ref2 +"\n\texpected: " + fooRef);
-            }
-            if (ref2.get() != null) {
-                throw new RuntimeException("Referent not cleared: " + ref2.get());
-            }
-            System.out.println("Got fooRef after reset(), fooChild is " + fooChild);
-
+            try {
+                fooChild = null;
+                System.out.println("Setting fooChild to: " + fooChild);
+                while ((ref2 = queue.poll()) == null) {
+                    System.gc();
+                    Thread.sleep(1000);
+                }
+                if (ref2 != fooRef) {
+                    throw new RuntimeException("Unexpected reference: "
+                            + ref2 +"\n\texpected: " + fooRef);
+                }
+                if (ref2.get() != null) {
+                    throw new RuntimeException("Referent not cleared: " + ref2.get());
+                }
+                System.out.println("Got fooRef after reset(), fooChild is " + fooChild);
+             } catch(Throwable t) {
+                if (failed != null) t.addSuppressed(failed);
+                throw t;
+             }
         }
         if (failed != null) {
             // should rarely happen...
--- a/test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/HandlersOnComplexUpdate.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/HandlersOnComplexUpdate.java	Mon Jan 28 13:56:39 2019 +0000
@@ -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
@@ -80,6 +80,14 @@
         }
     }
 
+    public static final double TIMEOUT_FACTOR;
+    static {
+        String toFactor = System.getProperty("test.timeout.factor", "1.0");
+        TIMEOUT_FACTOR = Double.parseDouble(toFactor);
+    }
+    static int adjustCount(int count) {
+        return (int) Math.ceil(TIMEOUT_FACTOR * count);
+    }
 
     private static final String PREFIX =
             "FileHandler-" + UUID.randomUUID() + ".log";
@@ -213,11 +221,11 @@
                     + barChild.getParent() +"\n\texpected: " + barRef.get());
         }
         Reference<? extends Logger> ref2;
-        int max = 3;
+        int max = adjustCount(3);
         barChild = null;
         while ((ref2 = queue.poll()) == null) {
             System.gc();
-            Thread.sleep(100);
+            Thread.sleep(1000);
             if (--max == 0) break;
         }
 
@@ -316,21 +324,25 @@
                     throw new RuntimeException(x);
                 }
             });
-            fooChild = null;
-            System.out.println("Setting fooChild to: " + fooChild);
-            while ((ref2 = queue.poll()) == null) {
-                System.gc();
-                Thread.sleep(1000);
-            }
-            if (ref2 != fooRef) {
-                throw new RuntimeException("Unexpected reference: "
-                        + ref2 +"\n\texpected: " + fooRef);
-            }
-            if (ref2.get() != null) {
-                throw new RuntimeException("Referent not cleared: " + ref2.get());
-            }
-            System.out.println("Got fooRef after reset(), fooChild is " + fooChild);
-
+            try {
+                fooChild = null;
+                System.out.println("Setting fooChild to: " + fooChild);
+                while ((ref2 = queue.poll()) == null) {
+                    System.gc();
+                    Thread.sleep(1000);
+                }
+                if (ref2 != fooRef) {
+                    throw new RuntimeException("Unexpected reference: "
+                            + ref2 +"\n\texpected: " + fooRef);
+                }
+                if (ref2.get() != null) {
+                    throw new RuntimeException("Referent not cleared: " + ref2.get());
+                }
+                System.out.println("Got fooRef after reset(), fooChild is " + fooChild);
+           } catch (Throwable t) {
+               if (failed != null) t.addSuppressed(failed);
+               throw t;
+           }
         }
         if (failed != null) {
             // should rarely happen...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jdk/nio/zipfs/PropertyPermissionTests.java	Mon Jan 28 13:56:39 2019 +0000
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 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
+ * 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.
+ */
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.io.IOException;
+import java.nio.file.FileSystem;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.spi.FileSystemProvider;
+import java.util.Map;
+
+/**
+ * @test
+ * @bug 8210469
+ * @summary Verify ZIP FileSystem works with a Security Manager
+ * @modules jdk.zipfs
+ * @compile PropertyPermissionTests.java
+ * @run testng/othervm/java.security.policy=PropertyPermissions.policy  PropertyPermissionTests
+ */
+public class PropertyPermissionTests {
+
+    // Map to used for creating a ZIP archive
+    private static final Map<String, String> ZIPFS_OPTIONS = Map.of("create", "true");
+
+    // The ZIP file system provider
+    private static final FileSystemProvider ZIPFS_PROVIDER = getZipFSProvider();
+
+    // Primary jar file used for testing
+    private static Path jarFile;
+
+    /**
+     * Create the JAR files used by the tests
+     */
+    @BeforeClass
+    public void setUp()  throws Exception {
+        jarFile = Utils.createJarFile("basic.jar",
+                "META-INF/services/java.nio.file.spi.FileSystemProvider");
+    }
+
+    /**
+     * Remove JAR files used by test as part of clean-up
+     */
+    @AfterClass
+    public void tearDown() throws Exception {
+        Files.deleteIfExists(jarFile);
+    }
+
+    /**
+     * Validate that the ZIP File System can be successfully closed when a Security Manager
+     * has been enabled.
+     */
+    @Test
+    public void test0000() throws IOException {
+        FileSystem zipfs = ZIPFS_PROVIDER.newFileSystem(
+                Paths.get("basic.jar"), ZIPFS_OPTIONS);
+        zipfs.close();
+    }
+
+    /**
+     * Returns the Zip FileSystem Provider
+     */
+    private static FileSystemProvider getZipFSProvider() {
+        for (FileSystemProvider fsProvider : FileSystemProvider.installedProviders()) {
+            if ("jar".equals(fsProvider.getScheme())) {
+                return fsProvider;
+            }
+        }
+        return null;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jdk/nio/zipfs/PropertyPermissions.policy	Mon Jan 28 13:56:39 2019 +0000
@@ -0,0 +1,4 @@
+grant {
+    permission java.io.FilePermission "<<ALL FILES>>","read,write,delete";
+
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/jdk/security/JavaDotSecurity/TestJDKIncludeInExceptions.java	Mon Jan 28 13:56:39 2019 +0000
@@ -0,0 +1,45 @@
+/*
+ * 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
+ * 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.
+ */
+
+import java.security.Security;
+
+/**
+ * @test
+ * @bug 8207846 8208691
+ * @summary Test the default setting of the jdk.net.includeInExceptions
+ *          security property
+ * @comment In OpenJDK, this property is empty by default and on purpose.
+ *          This test assures the default is not changed.
+ * @run main TestJDKIncludeInExceptions
+ */
+public class TestJDKIncludeInExceptions {
+
+    public static void main(String args[]) throws Exception {
+        String incInExc = Security.getProperty("jdk.includeInExceptions");
+        if (incInExc != null) {
+            throw new RuntimeException("Test failed: default value of " +
+                "jdk.includeInExceptions security property is not null: " +
+                incInExc);
+        }
+    }
+}
--- a/test/jtreg-ext/requires/VMProps.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/jtreg-ext/requires/VMProps.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, 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
@@ -86,6 +86,7 @@
         map.put("vm.rtm.cpu", vmRTMCPU());
         map.put("vm.rtm.compiler", vmRTMCompiler());
         map.put("vm.aot", vmAOT());
+        map.put("vm.aot.enabled", vmAotEnabled());
         // vm.cds is true if the VM is compiled with cds support.
         map.put("vm.cds", vmCDS());
         map.put("vm.cds.custom.loaders", vmCDSForCustomLoaders());
@@ -266,6 +267,7 @@
         vmOptFinalFlag(map, "ClassUnloading");
         vmOptFinalFlag(map, "UseCompressedOops");
         vmOptFinalFlag(map, "EnableJVMCI");
+        vmOptFinalFlag(map, "EliminateAllocations");
     }
 
     /**
@@ -334,6 +336,13 @@
         return "" + Files.exists(jaotc);
     }
 
+    /*
+     * @return true if there is at least one loaded AOT'ed library.
+     */
+    protected String vmAotEnabled() {
+        return "" + (WB.aotLibrariesCount() > 0);
+    }
+
     /**
      * Check for CDS support.
      *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/generics/typevars/AnnoTypeVarBounds.java	Mon Jan 28 13:56:39 2019 +0000
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 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
+ * 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     8193367
+ * @summary Annotated type variable bounds crash javac
+ * @compile AnnoTypeVarBounds.java
+ */
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+class AnnoTypeVarBounds {
+    @Target(value = {ElementType.TYPE_USE})
+    @interface A{}
+    class Sup<X, Y> { }
+    class Sub<U extends @A V, @A V extends String> extends Sup<U, V> { }
+}
--- a/test/langtools/tools/javac/lib/DPrinter.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/langtools/tools/javac/lib/DPrinter.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -1336,8 +1336,8 @@
             // null or bot. So, only print the bound for subtypes of TypeVar,
             // or if the bound is (erroneously) not null or bot.
             if (!type.hasTag(TypeTag.TYPEVAR)
-                    || !(type.bound == null || type.bound.hasTag(TypeTag.BOT))) {
-                printType("bound", type.bound, Details.FULL);
+                    || !(type.getUpperBound() == null || type.getUpperBound().hasTag(TypeTag.BOT))) {
+                printType("bound", type.getUpperBound(), Details.FULL);
             }
             printType("lower", type.lower, Details.FULL);
             return visitType(type, null);
--- a/test/langtools/tools/javac/types/GenericTypeWellFormednessTest.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/langtools/tools/javac/types/GenericTypeWellFormednessTest.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -144,7 +144,7 @@
         typeVars[typeVars.length - 1] = new InstantiableType(null) {
             Type inst(Type clazz) {
                 TypeVar tvar = fac.TypeVariable();
-                tvar.bound = subst(clazz, Mapping(clazz.getTypeArguments().head, tvar));
+                tvar.setUpperBound( subst(clazz, Mapping(clazz.getTypeArguments().head, tvar)) );
                 return tvar;
             }
         };
@@ -204,20 +204,20 @@
 
         TypeVar tv4 = fac.TypeVariable();
         Type decl4 = fac.Class(tv4);
-        tv4.bound = decl4;
+        tv4.setUpperBound(decl4);
         tv4.tsym.name = predef.exceptionType.tsym.name;
 
         TypeVar tv5 = fac.TypeVariable();
         Type decl5 = fac.Class(tv5);
-        tv5.bound = subst(decl5, Mapping(tv5, fac.Wildcard(BoundKind.EXTENDS, tv5)));
+        tv5.setUpperBound( subst(decl5, Mapping(tv5, fac.Wildcard(BoundKind.EXTENDS, tv5))) );
 
         TypeVar tv6 = fac.TypeVariable();
         Type decl6 = fac.Class(tv6);
-        tv6.bound = subst(decl6, Mapping(tv6, fac.Wildcard(BoundKind.SUPER, tv6)));
+        tv6.setUpperBound( subst(decl6, Mapping(tv6, fac.Wildcard(BoundKind.SUPER, tv6))) );
 
         TypeVar tv7 = fac.TypeVariable();
         Type decl7 = fac.Class(tv7);
-        tv7.bound = subst(decl7, Mapping(tv7, fac.Wildcard(BoundKind.UNBOUND, predef.objectType)));
+        tv7.setUpperBound( subst(decl7, Mapping(tv7, fac.Wildcard(BoundKind.UNBOUND, predef.objectType))) );
 
         columns = new Type[] {
             decl1, decl2, decl3, decl4, decl5, decl6, decl7
--- a/test/lib/sun/hotspot/WhiteBox.java	Sat Jan 26 14:02:35 2019 +0000
+++ b/test/lib/sun/hotspot/WhiteBox.java	Mon Jan 28 13:56:39 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -549,4 +549,7 @@
 
   // Protection Domain Table
   public native int protectionDomainRemovedCount();
+
+  // Number of loaded AOT libraries
+  public native int aotLibrariesCount();
 }