src/share/vm/opto/library_call.cpp

Print this page
rev 5728 : 8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes
Contributed-by: mdoerr

*** 2625,2636 **** // volatile membars (for stores; compare Parse::do_put_xxx), which // we cannot do effectively here because we probably only have a // rough approximation of type. need_mem_bar = true; // For Stores, place a memory ordering barrier now. ! if (is_store) insert_mem_bar(Op_MemBarRelease); } // Memory barrier to prevent normal and 'unsafe' accesses from // bypassing each other. Happens after null checks, so the // exception paths do not take memory state from the memory barrier, --- 2625,2641 ---- // volatile membars (for stores; compare Parse::do_put_xxx), which // we cannot do effectively here because we probably only have a // rough approximation of type. need_mem_bar = true; // For Stores, place a memory ordering barrier now. ! if (is_store) { insert_mem_bar(Op_MemBarRelease); + } else { + // Support ordering of "Independent Reads of Independent Writes" (see Parse::do_get_xxx). + // Solution: implement volatile read as sync-load-acquire + PPC64_ONLY(insert_mem_bar(Op_MemBarVolatile)); + } } // Memory barrier to prevent normal and 'unsafe' accesses from // bypassing each other. Happens after null checks, so the // exception paths do not take memory state from the memory barrier,
*** 2715,2728 **** } } } if (is_volatile) { ! if (!is_store) insert_mem_bar(Op_MemBarAcquire); ! else ! insert_mem_bar(Op_MemBarVolatile); } if (need_mem_bar) insert_mem_bar(Op_MemBarCPUOrder); return true; --- 2720,2735 ---- } } } if (is_volatile) { ! if (!is_store) { insert_mem_bar(Op_MemBarAcquire); ! } else { ! // Changed volatiles/Unsafe: lwsync-store, sync-load-acquire. ! NOT_PPC64(insert_mem_bar(Op_MemBarVolatile)); ! } } if (need_mem_bar) insert_mem_bar(Op_MemBarCPUOrder); return true;