--- old/src/hotspot/cpu/sparc/c1_LIRGenerator_sparc.cpp 2018-03-16 09:52:22.442433945 +0100 +++ new/src/hotspot/cpu/sparc/c1_LIRGenerator_sparc.cpp 2018-03-16 09:52:22.266426433 +0100 @@ -663,7 +663,7 @@ __ add(obj.result(), offset.result(), addr); if (type == objectType) { // Write-barrier needed for Object fields. - if (UseLoadBarrier) { + if (UseZGC) { // Load barrier to make sure that cas_obj() sees a correct oop. LIR_Opr pre_val = new_register(T_OBJECT); __ load(new LIR_Address(addr, as_BasicType(type)), pre_val); @@ -1390,7 +1390,7 @@ { LIR_Address* addr = new LIR_Address(src, offset, type); __ load(addr, dst); - if (type == T_OBJECT && UseLoadBarrier) { + if (type == T_OBJECT && UseZGC) { load_barrier(dst, LIR_OprFact::address(addr)); } } @@ -1440,7 +1440,7 @@ } __ xchg(LIR_OprFact::address(addr), dst, dst, tmp); if (is_obj) { - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(dst); } --- old/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp 2018-03-16 09:52:22.765447732 +0100 +++ new/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp 2018-03-16 09:52:22.574439579 +0100 @@ -344,7 +344,7 @@ void MacroAssembler::restore_thread(const Register thread_cache) { - if (UseLoadBarrier) { + if (UseZGC) { AddressLiteral bad_mask((intptr_t)&ZAddressBadMask); load_ptr_contents(bad_mask, G6); } @@ -1282,7 +1282,7 @@ assert(_verify_oop_implicit_branch[0] == NULL, "set once"); _verify_oop_implicit_branch[0] = pc(); - if (UseLoadBarrier) { + if (UseZGC) { // Check if mask is good AddressLiteral bad_mask((intptr_t)&ZAddressBadMask); load_ptr_contents(bad_mask, O2); @@ -3929,7 +3929,7 @@ lduw(s, d); decode_heap_oop(d); } else { - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(d, s, on); } else { ld_ptr(s, d); @@ -3943,7 +3943,7 @@ lduw(s1, s2, d); decode_heap_oop(d, d); } else { - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(d, Address(s1, s2), on); } else { ld_ptr(s1, s2, d); @@ -3956,7 +3956,7 @@ lduw(s1, simm13a, d); decode_heap_oop(d, d); } else { - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(d, Address(s1, simm13a), on); } else { ld_ptr(s1, simm13a, d); @@ -4191,7 +4191,7 @@ } void MacroAssembler::reinit_heapbase() { - if (UseLoadBarrier) { + if (UseZGC) { AddressLiteral bad_mask((intptr_t)&ZAddressBadMask); load_ptr_contents(bad_mask, G6); } else if (UseCompressedOops || UseCompressedClassPointers) { --- old/src/hotspot/cpu/sparc/sparc.ad 2018-03-16 09:52:23.134463483 +0100 +++ new/src/hotspot/cpu/sparc/sparc.ad 2018-03-16 09:52:22.953455757 +0100 @@ -979,7 +979,7 @@ if (preserve_g2) __ mov(L7, G2); - if (preserve_g2 && UseLoadBarrier) { + if (preserve_g2 && UseZGC) { AddressLiteral bad_base((intptr_t)&ZAddressBadMask); __ load_ptr_contents(bad_base, G6); } --- old/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp 2018-03-16 09:52:23.558481581 +0100 +++ new/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp 2018-03-16 09:52:23.365473343 +0100 @@ -2418,7 +2418,7 @@ } // save arguments for barrier generation - if (UseLoadBarrier) { + if (UseZGC) { __ mov(from, G1); } else { __ mov(to, G1); @@ -2473,7 +2473,7 @@ array_overlap_test(nooverlap_target, LogBytesPerHeapOop); // save arguments for barrier generation - if (UseLoadBarrier) { + if (UseZGC) { __ mov(from, G1); } else { __ mov(to, G1); --- old/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp 2018-03-16 09:52:23.924497203 +0100 +++ new/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp 2018-03-16 09:52:23.742489435 +0100 @@ -1344,7 +1344,7 @@ __ decode_heap_oop(dest->as_register()); } #endif - if (!UseLoadBarrier) { + if (!UseZGC) { // Load barrier not yet applied, so a verification here would fail __ verify_oop(dest->as_register()); } --- old/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp 2018-03-16 09:52:24.261511588 +0100 +++ new/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp 2018-03-16 09:52:24.082503948 +0100 @@ -770,7 +770,7 @@ __ leal(LIR_OprFact::address(a), addr); if (type == objectType) { // Write-barrier needed for Object fields. - if (UseLoadBarrier) { + if (UseZGC) { // Load barrier to make sure that cas_obj() sees a correct oop. LIR_Opr pre_val = new_register(T_OBJECT); __ load(new LIR_Address(addr, as_BasicType(type)), pre_val); @@ -1619,7 +1619,7 @@ } else { LIR_Address* addr = new LIR_Address(src, offset, type); __ load(addr, dst); - if (type == T_OBJECT && UseLoadBarrier) { + if (type == T_OBJECT && UseZGC) { load_barrier(dst, LIR_OprFact::address(addr)); } } @@ -1700,7 +1700,7 @@ } __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); if (is_obj) { - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(dst); } --- old/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-03-16 09:52:24.599526015 +0100 +++ new/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-03-16 09:52:24.404517692 +0100 @@ -5252,7 +5252,7 @@ jcc(Assembler::zero, not_weak); // Resolve jweak. #if INCLUDE_ALL_GCS - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(value, Address(value, -JNIHandles::weak_tag_value), false /* expand call */, LoadBarrierOnPhantomOopRef); } else #endif @@ -6720,7 +6720,7 @@ void MacroAssembler::load_heap_oop(Register dst, Address src, bool expand_call, LoadBarrierOn on) { #ifdef _LP64 #if INCLUDE_ALL_GCS - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(dst, src, expand_call, on); } else #endif @@ -6745,7 +6745,7 @@ void MacroAssembler::store_heap_oop(Address dst, Register src) { #ifdef ASSERT - if (VerifyOops && UseLoadBarrier) { + if (VerifyOops && UseZGC) { // Check if mask is good Label done; testptr(src, Address(r15_thread, JavaThread::zaddress_bad_mask_offset())); --- old/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp 2018-03-16 09:52:25.047545138 +0100 +++ new/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp 2018-03-16 09:52:24.856536985 +0100 @@ -1132,7 +1132,7 @@ __ testptr(rax, rax); __ jcc(Assembler::zero, exit); // if obj is NULL it is OK - if (UseLoadBarrier) { + if (UseZGC) { // Check if metadata bits indicate a bad oop __ testptr(rax, Address(r15_thread, JavaThread::zaddress_bad_mask_offset())); __ jcc(Assembler::notZero, error); @@ -5308,7 +5308,7 @@ generate_arraycopy_stubs(); // Load barrier stubs - if (UseLoadBarrier) { + if (UseZGC) { address loadbarrier_address = CAST_FROM_FN_PTR(address, SharedRuntime::z_load_barrier_on_oop_field_preloaded); address loadbarrier_weak_address = CAST_FROM_FN_PTR(address, SharedRuntime::z_load_barrier_on_weak_oop_field_preloaded); Register rr = as_Register(0); --- old/src/hotspot/share/c1/c1_LIRGenerator.cpp 2018-03-16 09:52:25.443562041 +0100 +++ new/src/hotspot/share/c1/c1_LIRGenerator.cpp 2018-03-16 09:52:25.249553760 +0100 @@ -1251,7 +1251,7 @@ __ load(referent_field_adr, result, info); - if (UseLoadBarrier) { + if (UseZGC) { load_barrier(result, LIR_OprFact::address(referent_field_adr), lir_patch_none, NULL, true /* weak */); } @@ -1499,7 +1499,7 @@ } void LIRGenerator::load_barrier(LIR_Opr ref, LIR_Opr ref_addr, LIR_PatchCode patch_code, CodeEmitInfo* info, bool weak) { - assert(UseLoadBarrier, "invariant"); + assert(UseZGC, "invariant"); assert(ref->is_register(), "invariant"); __ load_barrier_test(ref); @@ -1898,7 +1898,7 @@ __ load(address, reg, info, patch_code); } - if (is_oop && UseLoadBarrier) { + if (is_oop && UseZGC) { LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none; load_barrier(reg, LIR_OprFact::address(address), patch_code, (info ? new CodeEmitInfo(info) : NULL)); @@ -2028,7 +2028,7 @@ LIR_Opr result = rlock_result(x, element_type); __ move(array_addr, result, null_check_info); - if (is_oop && UseLoadBarrier) { + if (is_oop && UseZGC) { load_barrier(result, LIR_OprFact::address(array_addr), lir_patch_none, (null_check_info ? new CodeEmitInfo(null_check_info) : NULL)); } --- old/src/hotspot/share/classfile/vmSymbols.cpp 2018-03-16 09:52:25.786576682 +0100 +++ new/src/hotspot/share/classfile/vmSymbols.cpp 2018-03-16 09:52:25.599568700 +0100 @@ -756,7 +756,7 @@ #endif // COMPILER1 #ifdef COMPILER2 case vmIntrinsics::_clone: - if (UseLoadBarrier || !InlineObjectCopy || !InlineArrayCopy) return true; + if (UseZGC || !InlineObjectCopy || !InlineArrayCopy) return true; break; case vmIntrinsics::_copyOf: case vmIntrinsics::_copyOfRange: --- old/src/hotspot/share/compiler/oopMap.cpp 2018-03-16 09:52:26.110590512 +0100 +++ new/src/hotspot/share/compiler/oopMap.cpp 2018-03-16 09:52:25.927582700 +0100 @@ -379,7 +379,7 @@ continue; } #ifdef ASSERT - if (!UseLoadBarrier && + if (!UseZGC && ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) || !Universe::heap()->is_in_or_null(*loc))) { tty->print_cr("# Found non oop pointer. Dumping state at failure"); --- old/src/hotspot/share/gc/z/zArguments.cpp 2018-03-16 09:52:27.087632214 +0100 +++ new/src/hotspot/share/gc/z/zArguments.cpp 2018-03-16 09:52:26.894623976 +0100 @@ -38,11 +38,6 @@ void ZArguments::initialize_flags() { GCArguments::initialize_flags(); - // Enable load barriers by default. Turn off only for debugging. - if (FLAG_IS_DEFAULT(UseLoadBarrier)) { - FLAG_SET_DEFAULT(UseLoadBarrier, true); - } - // Enable NUMA by default if (FLAG_IS_DEFAULT(UseNUMA)) { FLAG_SET_DEFAULT(UseNUMA, true); --- old/src/hotspot/share/gc/z/zFlags.hpp 2018-03-16 09:52:27.389645105 +0100 +++ new/src/hotspot/share/gc/z/zFlags.hpp 2018-03-16 09:52:27.207637337 +0100 @@ -43,9 +43,6 @@ product(bool, UseZGC, false, \ "Use the Z garbage collector") \ \ - product(bool, UseLoadBarrier, false, \ - "Use load barrier on all reference loads") \ - \ product(ccstr, ZPath, NULL, \ "Filesystem path for Java heap backing storage " \ "(must be a tmpfs or a hugetlbfs filesystem)") \ --- old/src/hotspot/share/opto/arraycopynode.cpp 2018-03-16 09:52:27.694658124 +0100 +++ new/src/hotspot/share/opto/arraycopynode.cpp 2018-03-16 09:52:27.503649971 +0100 @@ -190,7 +190,7 @@ ciType* field_klass = field->type(); type = TypeOopPtr::make_from_klass(field_klass->as_klass()); } - if (UseLoadBarrier) { + if (UseZGC) { if (can_reshape) { PhaseIterGVN* igvn = phase->is_IterGVN(); igvn->_worklist.push(mem); @@ -270,7 +270,7 @@ return false; } - if (dest_elem == T_OBJECT && UseLoadBarrier) { + if (dest_elem == T_OBJECT && UseZGC) { return false; } @@ -317,7 +317,7 @@ BasicType elem = ary_src->klass()->as_array_klass()->element_type()->basic_type(); if (elem == T_ARRAY) elem = T_OBJECT; - if (elem == T_OBJECT && UseLoadBarrier) { + if (elem == T_OBJECT && UseZGC) { return false; } @@ -376,7 +376,7 @@ BasicType copy_type, const Type* value_type, int count) { - guarantee(!UseLoadBarrier || copy_type != T_OBJECT, "Must be"); + guarantee(!UseZGC || copy_type != T_OBJECT, "Must be"); Node* mem = phase->C->top(); if (!forward_ctl->is_top()) { // copy forward @@ -419,7 +419,7 @@ BasicType copy_type, const Type* value_type, int count) { - guarantee(!UseLoadBarrier || copy_type != T_OBJECT, "Must be"); + guarantee(!UseZGC || copy_type != T_OBJECT, "Must be"); Node* mem = phase->C->top(); if (!backward_ctl->is_top()) { // copy backward --- old/src/hotspot/share/opto/graphKit.cpp 2018-03-16 09:52:28.015671826 +0100 +++ new/src/hotspot/share/opto/graphKit.cpp 2018-03-16 09:52:27.831663972 +0100 @@ -1698,7 +1698,7 @@ } Node* GraphKit::load_barrier(Node* val, Node* adr, bool weak, bool writeback, bool oop_reload_allowed) { - assert(UseLoadBarrier, "invariant"); + assert(UseZGC, "invariant"); Node* barrier = new LoadBarrierNode(C, control(), memory(TypeRawPtr::BOTTOM), val, adr, weak, writeback, oop_reload_allowed); Node* transformed_barrier = _gvn.transform(barrier); @@ -4415,7 +4415,7 @@ Node* adr = basic_plus_adr(str, str, value_offset); Node* load = make_load(ctrl, adr, value_type, T_OBJECT, value_field_idx, MemNode::unordered); - if (UseLoadBarrier) { + if (UseZGC) { load = load_barrier(load, adr); } --- old/src/hotspot/share/opto/library_call.cpp 2018-03-16 09:52:28.398688174 +0100 +++ new/src/hotspot/share/opto/library_call.cpp 2018-03-16 09:52:28.207680021 +0100 @@ -1058,7 +1058,7 @@ Node* thread = _gvn.transform(new ThreadLocalNode()); Node* p = basic_plus_adr(top()/*!oop*/, thread, in_bytes(JavaThread::threadObj_offset())); Node* threadObj = make_load(NULL, p, thread_type, T_OBJECT, MemNode::unordered); - if (UseLoadBarrier) { + if (UseZGC) { threadObj = load_barrier(threadObj, p); } @@ -2639,7 +2639,7 @@ // is set: the barriers would be emitted by us. insert_pre_barrier(heap_base_oop, offset, p, !need_mem_bar); } - if (UseLoadBarrier) { + if (UseZGC) { if (!VerifyLoadBarriers) { p = load_barrier(p, adr); } else { @@ -3131,7 +3131,7 @@ // CMH - Remove flags and simplify code when final variants are stable - if (UseLoadBarrier) { + if (UseZGC) { switch (kind) { case LS_get_set: break; @@ -3216,7 +3216,7 @@ load_store = _gvn.transform(new DecodeNNode(load_store, load_store->get_ptr_type())); } #endif - if (UseLoadBarrier && (kind == LS_get_set) && C->directive()->UseSwapLoadBarrierOption) { + if (UseZGC && (kind == LS_get_set) && C->directive()->UseSwapLoadBarrierOption) { load_store = load_barrier(load_store, adr, false, loadstore_requires_writeback_barrier(kind), false); } @@ -3254,7 +3254,7 @@ Node* LibraryCallKit::make_cas_loadbarrier(CompareAndSwapNode* cas) { - assert(UseLoadBarrier, "Must be turned on"); + assert(UseZGC, "Must be turned on"); assert(!UseCompressedOops, "Not allowed"); Node* in_ctrl = cas->in(MemNode::Control); @@ -3344,7 +3344,7 @@ Node* LibraryCallKit::make_cmpx_loadbarrier(CompareAndExchangePNode* cmpx) { - assert(UseLoadBarrier, "Must be turned on"); + assert(UseZGC, "Must be turned on"); assert(!UseCompressedOops, "Not allowed"); Node* in_ctrl = cmpx->in(MemNode::Control); @@ -6358,7 +6358,7 @@ Node* no_ctrl = NULL; Node* result = make_load(no_ctrl, adr, object_type, T_OBJECT, MemNode::unordered); - if (UseLoadBarrier) { + if (UseZGC) { result = load_barrier(result, adr, true /* weak */); } @@ -6427,7 +6427,7 @@ // Build the load. MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered; Node* loadedField = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol); - if (UseLoadBarrier) { + if (UseZGC) { loadedField = load_barrier(loadedField, adr); } --- old/src/hotspot/share/opto/macroArrayCopy.cpp 2018-03-16 09:52:28.824706357 +0100 +++ new/src/hotspot/share/opto/macroArrayCopy.cpp 2018-03-16 09:52:28.636698333 +0100 @@ -551,7 +551,7 @@ // At this point we know we do not need type checks on oop stores. // Let's see if we need card marks: - if (alloc != NULL && GraphKit::use_ReduceInitialCardMarks() && !UseLoadBarrier) { + if (alloc != NULL && GraphKit::use_ReduceInitialCardMarks() && !UseZGC) { // If we do not need card marks, copy using the jint or jlong stub. copy_type = LP64_ONLY(UseCompressedOops ? T_INT : T_LONG) NOT_LP64(T_INT); assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type), --- old/src/hotspot/share/opto/memnode.cpp 2018-03-16 09:52:29.164720870 +0100 +++ new/src/hotspot/share/opto/memnode.cpp 2018-03-16 09:52:28.972712675 +0100 @@ -1174,7 +1174,7 @@ // a load node that reads from the source array so we may be able to // optimize out the ArrayCopy node later. Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseGVN* phase) const { - if (UseLoadBarrier && bottom_type()->make_oopptr() != NULL) { + if (UseZGC && bottom_type()->make_oopptr() != NULL) { return NULL; } --- old/src/hotspot/share/opto/parse1.cpp 2018-03-16 09:52:29.545737133 +0100 +++ new/src/hotspot/share/opto/parse1.cpp 2018-03-16 09:52:29.357729108 +0100 @@ -117,7 +117,7 @@ case T_ADDRESS: l = new LoadPNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM, MemNode::unordered); break; case T_OBJECT: { l = new LoadPNode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeInstPtr::BOTTOM, MemNode::unordered); - if (UseLoadBarrier) { + if (UseZGC) { l = _gvn.transform(l); l = load_barrier(l, adr); return l; --- old/src/hotspot/share/opto/parse2.cpp 2018-03-16 09:52:29.874751176 +0100 +++ new/src/hotspot/share/opto/parse2.cpp 2018-03-16 09:52:29.684743066 +0100 @@ -58,7 +58,7 @@ dec_sp(2); // Pop array and index const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); Node* ld = make_load(control(), adr, elem, elem_type, adr_type, MemNode::unordered); - if (UseLoadBarrier && elem_type == T_OBJECT) { + if (UseZGC && elem_type == T_OBJECT) { ld = load_barrier(ld, adr); } push(ld); --- old/src/hotspot/share/opto/parse3.cpp 2018-03-16 09:52:30.218765859 +0100 +++ new/src/hotspot/share/opto/parse3.cpp 2018-03-16 09:52:30.027757707 +0100 @@ -207,7 +207,7 @@ bool needs_atomic_access = is_vol || AlwaysAtomicAccesses; Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, needs_atomic_access); - if (UseLoadBarrier && bt == T_OBJECT) { + if (UseZGC && bt == T_OBJECT) { ld = load_barrier(ld, adr); } --- old/src/hotspot/share/runtime/jniHandles.cpp 2018-03-16 09:52:30.547779903 +0100 +++ new/src/hotspot/share/runtime/jniHandles.cpp 2018-03-16 09:52:30.352771579 +0100 @@ -151,7 +151,7 @@ assert(handle != NULL, "precondition"); assert(is_jweak(handle), "precondition"); #if INCLUDE_ALL_GCS - if (UseLoadBarrier) { + if (UseZGC) { oop* ref_addr = jweak_ref_addr(handle); return RootAccess::oop_load(ref_addr); } --- old/src/hotspot/share/runtime/stackValue.cpp 2018-03-16 09:52:30.877793988 +0100 +++ new/src/hotspot/share/runtime/stackValue.cpp 2018-03-16 09:52:30.687785878 +0100 @@ -121,7 +121,7 @@ val = (oop)NULL; } // Deoptimization must make sure all oop have passed load barrier - if (UseLoadBarrier) { + if (UseZGC) { val = ZBarrier::load_barrier_on_oop_field_preloaded((oop*)value_addr, val); } #endif