src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/graphKit.cpp	Mon Feb 15 10:17:34 2016
--- new/src/share/vm/opto/graphKit.cpp	Mon Feb 15 10:17:33 2016

*** 3147,3156 **** --- 3147,3169 ---- set_memory(_gvn.transform(new ProjNode(membar, TypeFunc::Memory)),alias_idx); } return membar; } + void GraphKit::insert_store_load_for_barrier() { + Node* mem = reset_memory(); + MemBarNode* mb = MemBarNode::make(C, Op_MemBarVolatile, Compile::AliasIdxBot); + mb->init_req(TypeFunc::Control, control()); + mb->init_req(TypeFunc::Memory, mem); + Node* membar = _gvn.transform(mb); + set_control(_gvn.transform(new ProjNode(membar, TypeFunc::Control))); + Node* newmem = _gvn.transform(new ProjNode(membar, TypeFunc::Memory)); + set_all_memory(mem); + set_memory(newmem, Compile::AliasIdxRaw); + } + + //------------------------------shared_lock------------------------------------ // Emit locking code. FastLockNode* GraphKit::shared_lock(Node* obj) { // bci is either a monitorenter bc or InvocationEntryBci // %%% SynchronizationEntryBCI is redundant; use InvocationEntryBci in interfaces
*** 3838,3848 **** --- 3851,3861 ---- int adr_type = Compile::AliasIdxRaw; Node* zero = __ ConI(0); // Dirty card value BasicType bt = T_BYTE; if (UseConcMarkSweepGC && UseCondCardMark) { ! insert_mem_bar(Op_MemBarVolatile); // StoreLoad barrier ! insert_store_load_for_barrier(); __ sync_kit(this); } if (UseCondCardMark) { // The classic GC reference write barrier is typically implemented
*** 4278,4289 **** --- 4291,4301 ---- // load the original value of the card Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); __ if_then(card_val, BoolTest::ne, young_card); { sync_kit(ideal); // Use Op_MemBarVolatile to achieve the effect of a StoreLoad barrier. insert_mem_bar(Op_MemBarVolatile, oop_store); + insert_store_load_for_barrier(); __ sync_kit(this); Node* card_val_reload = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); __ if_then(card_val_reload, BoolTest::ne, dirty_card); { g1_mark_card(ideal, card_adr, oop_store, alias_idx, index, index_adr, buffer, tf);

src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File