@@ -756,11 +756,17 @@ IR::Instr* LowererMD::ChangeToHelperCallMem(IR::Instr * instr, IR::JnHelperMeth
756756// /----------------------------------------------------------------------------
757757
758758IR::Instr *
759- LowererMD::ChangeToAssign (IR::Instr * instr)
759+ LowererMD::ChangeToAssignNoBarrierCheck (IR::Instr * instr)
760760{
761761 return ChangeToAssign (instr, instr->GetDst ()->GetType ());
762762}
763763
764+ IR::Instr *
765+ LowererMD::ChangeToAssign (IR::Instr * instr)
766+ {
767+ return ChangeToWriteBarrierAssign (instr, instr->m_func );
768+ }
769+
764770IR::Instr *
765771LowererMD::ChangeToAssign (IR::Instr * instr, IRType type)
766772{
@@ -4712,7 +4718,7 @@ LowererMD::GenerateLoadPolymorphicInlineCacheSlot(IR::Instr * instrLdSt, IR::Reg
47124718 instrLdSt->InsertBefore (instr);
47134719}
47144720
4715- void
4721+ IR::Instr *
47164722LowererMD::ChangeToWriteBarrierAssign (IR::Instr * assignInstr, const Func* func)
47174723{
47184724#ifdef RECYCLER_WRITE_BARRIER_JIT
@@ -4747,17 +4753,19 @@ LowererMD::ChangeToWriteBarrierAssign(IR::Instr * assignInstr, const Func* func)
47474753 }
47484754#endif
47494755
4750- ChangeToAssign (assignInstr);
4756+ IR::Instr * instr = ChangeToAssignNoBarrierCheck (assignInstr);
47514757
47524758 // Now insert write barrier if necessary
47534759#ifdef RECYCLER_WRITE_BARRIER_JIT
47544760 if (isPossibleBarrieredDest
47554761 && assignInstr->m_opcode == Js::OpCode::MOV // ignore SSE instructions like MOVSD
47564762 && assignInstr->GetSrc1 ()->IsWriteBarrierTriggerableValue ())
47574763 {
4758- func-> GetTopFunc ()-> m_lowerer -> GetLowererMD ()-> GenerateWriteBarrier (assignInstr);
4764+ LowererMD:: GenerateWriteBarrier (assignInstr);
47594765 }
47604766#endif
4767+
4768+ return instr;
47614769}
47624770
47634771void
@@ -4826,18 +4834,6 @@ LowererMD::GenerateWriteBarrier(IR::Instr * assignInstr)
48264834 IR::RegOpnd * indexOpnd = IR::RegOpnd::New (TyMachPtr, assignInstr->m_func );
48274835 IR::Instr * loadIndexInstr = IR::Instr::New (Js::OpCode::LEA, indexOpnd, assignInstr->GetDst (), assignInstr->m_func );
48284836 assignInstr->InsertBefore (loadIndexInstr);
4829-
4830- #if DBG
4831- // CALL Recycler::WBSetBitJIT
4832- if (CONFIG_FLAG (ForceSoftwareWriteBarrier) && CONFIG_FLAG (RecyclerVerifyMark))
4833- {
4834- this ->LoadHelperArgument (assignInstr, indexOpnd);
4835- IR::Instr* instrCall = IR::Instr::New (Js::OpCode::Call, m_func);
4836- assignInstr->InsertBefore (instrCall);
4837- this ->ChangeToHelperCall (instrCall, IR::HelperWriteBarrierSetVerifyBit);
4838- }
4839- #endif
4840-
48414837 IR::Instr * shiftBitInstr = IR::Instr::New (Js::OpCode::SHR, indexOpnd, indexOpnd,
48424838 IR::IntConstOpnd::New (12 /* 1 << 12 = 4096 */ , TyInt8, assignInstr->m_func ), assignInstr->m_func );
48434839 assignInstr->InsertBefore (shiftBitInstr);
0 commit comments