|
|
@@ -363,7 +363,7 @@ LowererMD::LoadDynamicArgument(IR::Instr *instr, uint argNumber)
|
|
|
IR::Opnd* dst = GetOpndForArgSlot((Js::ArgSlot) (argNumber - 1));
|
|
|
instr->SetDst(dst);
|
|
|
instr->m_opcode = Js::OpCode::MOV;
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
return instr;
|
|
|
}
|
|
|
@@ -381,7 +381,7 @@ LowererMD::LoadDynamicArgumentUsingLength(IR::Instr *instr)
|
|
|
IR::IndirOpnd *actualsLocation = IR::IndirOpnd::New(stackPointer, add->GetDst()->AsRegOpnd(), GetDefaultIndirScale(), TyMachReg, this->m_func);
|
|
|
instr->SetDst(actualsLocation);
|
|
|
instr->m_opcode = Js::OpCode::LDR;
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
return instr;
|
|
|
}
|
|
|
@@ -980,7 +980,7 @@ LowererMD::GenerateStackDeallocation(IR::Instr *instr, uint32 allocSize)
|
|
|
spOpnd,
|
|
|
IR::IntConstOpnd::New(allocSize, TyMachReg, this->m_func, true), this->m_func);
|
|
|
instr->InsertBefore(spAdjustInstr);
|
|
|
- LegalizeMD::LegalizeInstr(spAdjustInstr, true);
|
|
|
+ LegalizeMD::LegalizeInstr(spAdjustInstr);
|
|
|
}
|
|
|
|
|
|
//------------------------------------------------------------------------------------------
|
|
|
@@ -2308,7 +2308,9 @@ LowererMD::ChangeToAssign(IR::Instr * instr, IRType type)
|
|
|
{
|
|
|
instr->m_opcode = LowererMD::GetMoveOp(type);
|
|
|
}
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+
|
|
|
+ AutoRestoreLegalize restore(instr->m_func, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
return instr;
|
|
|
}
|
|
|
@@ -2620,7 +2622,7 @@ LowererMD::LowerCondBranch(IR::Instr * instr)
|
|
|
instrPrev->SetSrc1(opndSrc1);
|
|
|
instrPrev->SetSrc2(opndSrc2);
|
|
|
instr->InsertBefore(instrPrev);
|
|
|
- LegalizeMD::LegalizeInstr(instrPrev, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrPrev);
|
|
|
|
|
|
//Transfer the result to ARM status register control register.
|
|
|
instrPrev = IR::Instr::New(Js::OpCode::VMRS, this->m_func);
|
|
|
@@ -2637,7 +2639,7 @@ LowererMD::LowerCondBranch(IR::Instr * instr)
|
|
|
instrPrev->SetSrc2(opndSrc2);
|
|
|
instr->InsertBefore(instrPrev);
|
|
|
|
|
|
- LegalizeMD::LegalizeInstr(instrPrev, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrPrev);
|
|
|
|
|
|
instr->m_opcode = MDBranchOpcode(instr->m_opcode);
|
|
|
}
|
|
|
@@ -2746,7 +2748,7 @@ LowererMD::GenerateFastDivByPow2(IR::Instr *instrDiv)
|
|
|
//// s1 = AND src1, 0x80000001 | ((src2Value - 1) << 1)
|
|
|
//instr = IR::Instr::New(Js::OpCode::AND, s1, src1, IR::IntConstOpnd::New((0x80000001 | ((src2Value - 1) << 1)), TyInt32, m_func), m_func);
|
|
|
//instrDiv->InsertBefore(instr);
|
|
|
- //LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ //LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
//// CMP s1, 1
|
|
|
//instr = IR::Instr::New(Js::OpCode::CMP, m_func);
|
|
|
@@ -2761,12 +2763,12 @@ LowererMD::GenerateFastDivByPow2(IR::Instr *instrDiv)
|
|
|
//// s1 = ASR src1, log2(src2Value) -- do the equal divide
|
|
|
//instr = IR::Instr::New(Js::OpCode::ASR, s1, src1, IR::IntConstOpnd::New(Math::Log2(src2Value), TyInt32, m_func), m_func);
|
|
|
//instrDiv->InsertBefore(instr);
|
|
|
- //LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ //LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
//// dst = ORR s1, 1 -- restore tagged int bit
|
|
|
//instr = IR::Instr::New(Js::OpCode::ORR, dst, s1, IR::IntConstOpnd::New(1, TyInt32, m_func), m_func);
|
|
|
//instrDiv->InsertBefore(instr);
|
|
|
- //LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ //LegalizeMD::LegalizeInstr(instr);
|
|
|
//
|
|
|
//// B $done
|
|
|
//instr = IR::BranchInstr::New(Js::OpCode::B, done, m_func);
|
|
|
@@ -2791,7 +2793,7 @@ LowererMD::GenerateFastDivByPow2(IR::Instr *instrDiv)
|
|
|
//// s1 = ASR src1, log2(src2Value) + 1 -- do the integer divide and also shift out the tagged int bit
|
|
|
//instr = IR::Instr::New(Js::OpCode::ASR, s1, src1, IR::IntConstOpnd::New(Math::Log2(src2Value) + 1, TyInt32, m_func), m_func);
|
|
|
//instrDiv->InsertBefore(instr);
|
|
|
- //LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ //LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
//// Arg2: scriptContext
|
|
|
//IR::JnHelperMethod helperMethod;
|
|
|
@@ -2803,7 +2805,7 @@ LowererMD::GenerateFastDivByPow2(IR::Instr *instrDiv)
|
|
|
// StackSym * tempNumberSym = this->m_lowerer->GetTempNumberSym(dst, instr->dstIsTempNumberTransferred);
|
|
|
|
|
|
// instr = this->m_lowerer->InsertLoadStackAddress(tempNumberSym, instrDiv);
|
|
|
- // LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ // LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// this->LoadHelperArgument(instrDiv, instr->GetDst());
|
|
|
//}
|
|
|
@@ -3021,7 +3023,7 @@ bool LowererMD::GenerateFastCmXxTaggedInt(IR::Instr *instr, bool isInHelper /*
|
|
|
instrCmp->SetSrc1(src1);
|
|
|
instrCmp->SetSrc2(src2);
|
|
|
instr->InsertBefore(instrCmp);
|
|
|
- LegalizeMD::LegalizeInstr(instrCmp,false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrCmp);
|
|
|
|
|
|
instr->InsertBefore(IR::BranchInstr::New(opcode, fallthru, m_func));
|
|
|
instr->InsertBefore(IR::Instr::New(Js::OpCode::LDIMM, dst, opndFalse, m_func));
|
|
|
@@ -3064,7 +3066,7 @@ IR::Instr * LowererMD::GenerateConvBool(IR::Instr *instr)
|
|
|
instrTst->SetSrc1(src1);
|
|
|
instrTst->SetSrc2(src1);
|
|
|
instr->InsertBefore(instrTst);
|
|
|
- LegalizeMD::LegalizeInstr(instrTst, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrTst);
|
|
|
|
|
|
// BNE fallthrough
|
|
|
instr->InsertBefore(IR::BranchInstr::New(Js::OpCode::BNE, fallthru, m_func));
|
|
|
@@ -3270,7 +3272,7 @@ LowererMD::GenerateFastSub(IR::Instr * instrSub)
|
|
|
// dst = ADD s1, 1 -- restore the var tag on the result
|
|
|
instr = IR::Instr::New(Js::OpCode::ADD, instrSub->GetDst(), opndReg, IR::IntConstOpnd::New(1, TyMachReg, this->m_func), this->m_func);
|
|
|
instrSub->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// B $fallthru
|
|
|
labelFallThru = IR::LabelInstr::New(Js::OpCode::Label, this->m_func);
|
|
|
@@ -3426,7 +3428,7 @@ LowererMD::GenerateFastMul(IR::Instr * instrMul)
|
|
|
// dst= ORR s1, AtomTag -- make sure var tag is set on the result
|
|
|
instr = IR::Instr::New(Js::OpCode::ORR, instrMul->GetDst(), opndReg1, IR::IntConstOpnd::New(Js::AtomTag, TyVar, this->m_func), this->m_func);
|
|
|
instrMul->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// B $fallthru
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::B, labelFallThru, this->m_func);
|
|
|
@@ -3506,7 +3508,7 @@ LowererMD::GenerateFastAnd(IR::Instr * instrAnd)
|
|
|
// dstReg = AND src1, src2
|
|
|
instr = IR::Instr::New(Js::OpCode::AND, dst, src1, src2, this->m_func);
|
|
|
instrAnd->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
if (isInt)
|
|
|
{
|
|
|
@@ -3620,7 +3622,7 @@ LowererMD::GenerateFastOr(IR::Instr * instrOr)
|
|
|
// dst = OR src1, src2
|
|
|
instr = IR::Instr::New(Js::OpCode::ORR, dst, src1, src2, this->m_func);
|
|
|
instrOr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
if (isInt)
|
|
|
{
|
|
|
@@ -4447,7 +4449,7 @@ LowererMD::GenerateStFldFromLocalInlineCache(
|
|
|
opndIndir = IR::IndirOpnd::New(opndBase, opndSlotIndex, LowererMD::GetDefaultIndirScale(), TyMachReg, instrStFld->m_func);
|
|
|
instr = IR::Instr::New(Js::OpCode::STR, opndIndir, opndSrc, instrStFld->m_func);
|
|
|
instrStFld->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -4455,7 +4457,7 @@ LowererMD::GenerateStFldFromLocalInlineCache(
|
|
|
opndIndir = IR::IndirOpnd::New(opndSlotArray, opndSlotIndex, LowererMD::GetDefaultIndirScale(), TyMachReg, instrStFld->m_func);
|
|
|
instr = IR::Instr::New(Js::OpCode::STR, opndIndir, opndSrc, instrStFld->m_func);
|
|
|
instrStFld->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
|
|
|
// B $done
|
|
|
@@ -4529,7 +4531,7 @@ LowererMD::GenerateUntagVar(IR::RegOpnd * opnd, IR::LabelInstr * instrFail, IR::
|
|
|
IR::Instr *instr = IR::Instr::New(Js::OpCode::ASRS, int32Opnd, opnd,
|
|
|
IR::IntConstOpnd::New(Js::VarTag_Shift, TyInt8, this->m_func), this->m_func);
|
|
|
insertBeforeInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// No need to check if we already know that it is a tagged int.
|
|
|
if (generateTagCheck)
|
|
|
@@ -4749,7 +4751,7 @@ bool LowererMD::TryGenerateFastMulAdd(IR::Instr * instrAdd, IR::Instr ** pInstrP
|
|
|
// BCC $helper -- if not tagged int, jmp to $helper
|
|
|
instr = IR::Instr::New(Js::OpCode::ASRS, s2, mulSrc2, IR::IntConstOpnd::New(Js::VarTag_Shift, TyVar, this->m_func), m_func);
|
|
|
instrAdd->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
if (!mulSrc2->IsTaggedInt()) // If we already pre-know it's tagged int, no need to check.
|
|
|
{
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::BCC, labelHelper, this->m_func);
|
|
|
@@ -4780,7 +4782,7 @@ bool LowererMD::TryGenerateFastMulAdd(IR::Instr * instrAdd, IR::Instr ** pInstrP
|
|
|
// Copy the result into dst
|
|
|
// dst = s3
|
|
|
Lowerer::InsertMove(instrAdd->GetDst(), s3, instrAdd);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// B $done
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::B, labelDone, this->m_func);
|
|
|
@@ -4862,7 +4864,7 @@ LowererMD::LoadCheckedFloat(
|
|
|
IR::IntConstOpnd::New(Js::AtomTag, TyMachReg, this->m_func),
|
|
|
this->m_func);
|
|
|
instrInsert->InsertBefore(instrFirst);
|
|
|
- LegalizeMD::LegalizeInstr(instrFirst, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrFirst);
|
|
|
|
|
|
IR::LabelInstr * labelVar = IR::LabelInstr::New(Js::OpCode::Label, this->m_func);
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::BCC, labelVar, this->m_func);
|
|
|
@@ -4987,7 +4989,7 @@ LowererMD::EmitLoadFloatFromNumber(IR::Opnd *dst, IR::Opnd *src, IR::Instr *inse
|
|
|
// VLDR dst, [pResult].f64
|
|
|
instr = IR::Instr::New(Js::OpCode::VLDR, dst, tempSymOpnd, this->m_func);
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -5011,7 +5013,7 @@ LowererMD::EmitLoadFloatCommon(IR::Opnd *dst, IR::Opnd *src, IR::Instr *insertIn
|
|
|
regFloatOpnd = IR::RegOpnd::New(TyFloat64, this->m_func);
|
|
|
instr = IR::Instr::New(Js::OpCode::VLDR, regFloatOpnd, memRef, this->m_func);
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
isFloatConst = true;
|
|
|
}
|
|
|
// Src is constant?
|
|
|
@@ -5039,7 +5041,7 @@ LowererMD::EmitLoadFloatCommon(IR::Opnd *dst, IR::Opnd *src, IR::Instr *insertIn
|
|
|
instr = IR::Instr::New(Js::OpCode::VMOV, dst, regFloatOpnd, this->m_func);
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
}
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
return nullptr;
|
|
|
}
|
|
|
Assert(src->IsRegOpnd());
|
|
|
@@ -5078,7 +5080,7 @@ LowererMD::EmitLoadFloatCommon(IR::Opnd *dst, IR::Opnd *src, IR::Instr *insertIn
|
|
|
instr = IR::Instr::New(Js::OpCode::VMOV, dst, reg2, this->m_func);
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
}
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// B $Done
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::B, labelDone, this->m_func);
|
|
|
@@ -5105,7 +5107,7 @@ LowererMD::EmitLoadFloat(IR::Opnd *dst, IR::Opnd *src, IR::Instr *insertInstr, I
|
|
|
|
|
|
if (dst->IsIndirOpnd())
|
|
|
{
|
|
|
- LegalizeMD::LegalizeIndirOpndForVFP(insertInstr, dst->AsIndirOpnd(), false);
|
|
|
+ LegalizeMD::LegalizeIndirOpndForVFP(insertInstr, dst->AsIndirOpnd());
|
|
|
}
|
|
|
|
|
|
labelDone = EmitLoadFloatCommon(dst, src, insertInstr, true);
|
|
|
@@ -5185,7 +5187,7 @@ LowererMD::EmitLoadFloat(IR::Opnd *dst, IR::Opnd *src, IR::Instr *insertInstr, I
|
|
|
Js::OpCode opcode = (dst->GetType() == TyFloat32)? Js::OpCode::VLDR32: Js::OpCode::VLDR;
|
|
|
instr = IR::Instr::New(opcode, dst , memAddress, this->m_func);
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
|
|
|
// $Done
|
|
|
@@ -5224,7 +5226,7 @@ LowererMD::GenerateNumberAllocation(IR::RegOpnd * opndDst, IR::Instr * instrInse
|
|
|
checkInstr->SetSrc1(nextMemBlockOpnd);
|
|
|
checkInstr->SetSrc2(endAddressOpnd);
|
|
|
instrInsert->InsertBefore(checkInstr);
|
|
|
- LegalizeMD::LegalizeInstr(checkInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(checkInstr);
|
|
|
|
|
|
// BHI $helper
|
|
|
IR::LabelInstr * helperLabel = IR::LabelInstr::New(Js::OpCode::Label, this->m_func, true);
|
|
|
@@ -5283,21 +5285,21 @@ LowererMD::GenerateFastRecyclerAlloc(size_t allocSize, IR::RegOpnd* newObjDst, I
|
|
|
// LDR newObjDst, allocator->freeObjectList
|
|
|
IR::Instr * loadMemBlockInstr = IR::Instr::New(Js::OpCode::LDR, newObjDst, freeObjectListOpnd, this->m_func);
|
|
|
insertionPointInstr->InsertBefore(loadMemBlockInstr);
|
|
|
- LegalizeMD::LegalizeInstr(loadMemBlockInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(loadMemBlockInstr);
|
|
|
|
|
|
// nextMemBlock = ADD newObjDst, allocSize
|
|
|
IR::RegOpnd * nextMemBlockOpnd = IR::RegOpnd::New(TyMachPtr, this->m_func);
|
|
|
IR::IntConstOpnd* allocSizeOpnd = IR::IntConstOpnd::New((int32)allocSize, TyInt32, this->m_func);
|
|
|
IR::Instr * loadNextMemBlockInstr = IR::Instr::New(Js::OpCode::ADD, nextMemBlockOpnd, newObjDst, allocSizeOpnd, this->m_func);
|
|
|
insertionPointInstr->InsertBefore(loadNextMemBlockInstr);
|
|
|
- LegalizeMD::LegalizeInstr(loadNextMemBlockInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(loadNextMemBlockInstr);
|
|
|
|
|
|
// CMP nextMemBlock, allocator->endAddress
|
|
|
IR::Instr * checkInstr = IR::Instr::New(Js::OpCode::CMP, this->m_func);
|
|
|
checkInstr->SetSrc1(nextMemBlockOpnd);
|
|
|
checkInstr->SetSrc2(endAddressOpnd);
|
|
|
insertionPointInstr->InsertBefore(checkInstr);
|
|
|
- LegalizeMD::LegalizeInstr(checkInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(checkInstr);
|
|
|
|
|
|
// BHI $allocHelper
|
|
|
IR::BranchInstr * branchToAllocHelperInstr = IR::BranchInstr::New(Js::OpCode::BHI, allocHelperLabel, this->m_func);
|
|
|
@@ -5306,7 +5308,7 @@ LowererMD::GenerateFastRecyclerAlloc(size_t allocSize, IR::RegOpnd* newObjDst, I
|
|
|
// LDR allocator->freeObjectList, nextMemBlock
|
|
|
IR::Instr * setFreeObjectListInstr = IR::Instr::New(Js::OpCode::LDR, freeObjectListOpnd, nextMemBlockOpnd, this->m_func);
|
|
|
insertionPointInstr->InsertBefore(setFreeObjectListInstr);
|
|
|
- LegalizeMD::LegalizeInstr(setFreeObjectListInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(setFreeObjectListInstr);
|
|
|
|
|
|
// B $allocDone
|
|
|
IR::BranchInstr * branchToAllocDoneInstr = IR::BranchInstr::New(Js::OpCode::B, allocDoneLabel, this->m_func);
|
|
|
@@ -5319,7 +5321,7 @@ LowererMD::GenerateClz(IR::Instr * instr)
|
|
|
Assert(instr->GetSrc1()->IsInt32() || instr->GetSrc1()->IsUInt32());
|
|
|
Assert(IRType_IsNativeInt(instr->GetDst()->GetType()));
|
|
|
instr->m_opcode = Js::OpCode::CLZ;
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
|
|
|
void
|
|
|
@@ -5340,7 +5342,7 @@ LowererMD::SaveDoubleToVar(IR::RegOpnd * dstOpnd, IR::RegOpnd *opndFloat, IR::In
|
|
|
IR::SymOpnd * symTempSrc = IR::SymOpnd::New(tempNumberSym, TyMachPtr, this->m_func);
|
|
|
newInstr = IR::Instr::New(Js::OpCode::LEA, dstOpnd, symTempSrc, this->m_func);
|
|
|
instrInsert->InsertBefore(newInstr);
|
|
|
- LegalizeMD::LegalizeInstr(newInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(newInstr);
|
|
|
|
|
|
symVTableDst = IR::SymOpnd::New(tempNumberSym, TyMachPtr, this->m_func);
|
|
|
symDblDst = IR::SymOpnd::New(tempNumberSym, (uint32)Js::JavascriptNumber::GetValueOffset(), TyFloat64, this->m_func);
|
|
|
@@ -5374,19 +5376,19 @@ LowererMD::SaveDoubleToVar(IR::RegOpnd * dstOpnd, IR::RegOpnd *opndFloat, IR::In
|
|
|
// STR dst->vtable, JavascriptNumber::vtable
|
|
|
newInstr = IR::Instr::New(Js::OpCode::STR, symVTableDst, jsNumberVTable, this->m_func);
|
|
|
numberInitInsertInstr->InsertBefore(newInstr);
|
|
|
- LegalizeMD::LegalizeInstr(newInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(newInstr);
|
|
|
|
|
|
// STR dst->type, JavascriptNumber_type
|
|
|
IR::Opnd *typeOpnd = m_lowerer->LoadLibraryValueOpnd(numberInitInsertInstr, LibraryValue::ValueNumberTypeStatic);
|
|
|
newInstr = IR::Instr::New(Js::OpCode::STR, symTypeDst, typeOpnd, this->m_func);
|
|
|
numberInitInsertInstr->InsertBefore(newInstr);
|
|
|
- LegalizeMD::LegalizeInstr(newInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(newInstr);
|
|
|
}
|
|
|
|
|
|
// VSTR dst->value, opndFloat ; copy the float result to the temp JavascriptNumber
|
|
|
newInstr = IR::Instr::New(Js::OpCode::VSTR, symDblDst, opndFloat, this->m_func);
|
|
|
instrInsert->InsertBefore(newInstr);
|
|
|
- LegalizeMD::LegalizeInstr(newInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(newInstr);
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -5450,7 +5452,7 @@ LowererMD::GenerateFastAbs(IR::Opnd *dst, IR::Opnd *src, IR::Instr *callInstr, I
|
|
|
IR::RegOpnd *regOpnd = IR::RegOpnd::New(TyVar, this->m_func);
|
|
|
instr = IR::Instr::New(Js::OpCode::MOV, regOpnd, src, this->m_func);
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
src = regOpnd;
|
|
|
}
|
|
|
|
|
|
@@ -5508,7 +5510,7 @@ LowererMD::GenerateFastAbs(IR::Opnd *dst, IR::Opnd *src, IR::Instr *callInstr, I
|
|
|
instr = IR::Instr::New(
|
|
|
Js::OpCode::ADD, dst, dst32, IR::IntConstOpnd::New(Js::AtomTag, TyMachReg, this->m_func), this->m_func);
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
|
|
|
if (labelFloat)
|
|
|
@@ -5529,7 +5531,7 @@ LowererMD::GenerateFastAbs(IR::Opnd *dst, IR::Opnd *src, IR::Instr *callInstr, I
|
|
|
instr->SetSrc1(opnd);
|
|
|
instr->SetSrc2(m_lowerer->LoadVTableValueOpnd(insertInstr, VTableValue::VtableJavascriptNumber));
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// BNE $helper
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::BNE, labelHelper, this->m_func);
|
|
|
@@ -5687,7 +5689,7 @@ br2_Common:
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
|
|
|
void
|
|
|
@@ -5876,7 +5878,7 @@ LowererMD::LowerInt4MulWithBailOut(
|
|
|
insertInstr->SetSrc1(src1);
|
|
|
insertInstr->SetSrc2(src2);
|
|
|
bailOutLabel->InsertBefore(insertInstr);
|
|
|
- LegalizeMD::LegalizeInstr(insertInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(insertInstr);
|
|
|
bailOutLabel->InsertBefore(IR::BranchInstr::New(Js::OpCode::BPL, skipBailOutLabel, instr->m_func));
|
|
|
|
|
|
// Fall through to bailOutLabel
|
|
|
@@ -6036,7 +6038,7 @@ LowererMD::EmitLoadVar(IR::Instr *instrLoad, bool isFromUint32, bool isHelper)
|
|
|
instr->SetSrc1(opnd32src1);
|
|
|
instr->SetSrc2(IR::IntConstOpnd::New((int32)0x80000000 >> Js::VarTag_Shift, TyInt32, this->m_func));
|
|
|
instrLoad->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// BNE $helper
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::BNE, labelToVar, this->m_func);
|
|
|
@@ -6340,7 +6342,7 @@ void LowererMD::GenerateFastInlineBuiltInCall(IR::Instr* instr, IR::JnHelperMeth
|
|
|
Assert(helperMethod == (IR::JnHelperMethod)0);
|
|
|
Assert(instr->GetSrc2() == nullptr);
|
|
|
instr->m_opcode = Js::OpCode::VSQRT;
|
|
|
- LegalizeMD::LegalizeInstr(instr, /* fPostRegAlloc = */ false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
break;
|
|
|
|
|
|
case Js::OpCode::InlineMathAbs:
|
|
|
@@ -6597,7 +6599,7 @@ LowererMD::GenerateFastInlineBuiltInMathFloor(IR::Instr* instr)
|
|
|
instrCmp->SetSrc1(floatOpnd);
|
|
|
instrCmp->SetSrc2(floatOpnd);
|
|
|
instr->InsertBefore(instrCmp);
|
|
|
- LegalizeMD::LegalizeInstr(instrCmp, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrCmp);
|
|
|
|
|
|
// VMRS APSR, FPSCR
|
|
|
// BVS $bailoutLabel
|
|
|
@@ -6695,7 +6697,7 @@ LowererMD::GenerateFastInlineBuiltInMathCeil(IR::Instr* instr)
|
|
|
instrCmp->SetSrc1(floatOpnd);
|
|
|
instrCmp->SetSrc2(floatOpnd);
|
|
|
instr->InsertBefore(instrCmp);
|
|
|
- LegalizeMD::LegalizeInstr(instrCmp, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrCmp);
|
|
|
|
|
|
// VMRS APSR, FPSCR
|
|
|
// BVS $bailoutLabel
|
|
|
@@ -6798,7 +6800,7 @@ LowererMD::GenerateFastInlineBuiltInMathRound(IR::Instr* instr)
|
|
|
instrCmp->SetSrc1(floatOpnd);
|
|
|
instrCmp->SetSrc2(floatOpnd);
|
|
|
instr->InsertBefore(instrCmp);
|
|
|
- LegalizeMD::LegalizeInstr(instrCmp, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrCmp);
|
|
|
|
|
|
// VMRS APSR, FPSCR
|
|
|
// BVS $bailoutLabel
|
|
|
@@ -6942,7 +6944,7 @@ LowererMD::LowerToFloat(IR::Instr *instr)
|
|
|
Assume(UNREACHED);
|
|
|
}
|
|
|
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
return instr;
|
|
|
}
|
|
|
|
|
|
@@ -6961,7 +6963,7 @@ LowererMD::LowerFloatCondBranch(IR::BranchInstr *instrBranch, bool ignoreNaN)
|
|
|
instrCmp->SetSrc1(src1);
|
|
|
instrCmp->SetSrc2(src2);
|
|
|
instrBranch->InsertBefore(instrCmp);
|
|
|
- LegalizeMD::LegalizeInstr(instrCmp, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instrCmp);
|
|
|
|
|
|
instrBranch->InsertBefore(IR::Instr::New(Js::OpCode::VMRS, func));
|
|
|
|
|
|
@@ -7113,7 +7115,7 @@ LowererMD::CheckOverflowOnFloatToInt32(IR::Instr* instrInsert, IR::Opnd* intOpnd
|
|
|
instr->SetSrc1(intOpnd);
|
|
|
instr->SetSrc2(IR::IntConstOpnd::New(0x80000000, TyInt32, this->m_func, true));
|
|
|
instrInsert->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// BEQ $helper
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::BEQ, labelHelper, this->m_func);
|
|
|
@@ -7128,13 +7130,13 @@ LowererMD::CheckOverflowOnFloatToInt32(IR::Instr* instrInsert, IR::Opnd* intOpnd
|
|
|
IR::IntConstOpnd::New(0x80000000, TyInt32, this->m_func, true),
|
|
|
this->m_func);
|
|
|
instrInsert->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
instr = IR::Instr::New(Js::OpCode::CMP, this->m_func);
|
|
|
instr->SetSrc1(intOpnd);
|
|
|
instr->SetSrc2(regOpnd);
|
|
|
instrInsert->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// BNE $done
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::BNE, labelDone, this->m_func);
|
|
|
@@ -7310,7 +7312,7 @@ LowererMD::LoadFloatValue(IR::Opnd * opndDst, double value, IR::Instr * instrIns
|
|
|
}
|
|
|
IR::Instr * instr = IR::Instr::New(Js::OpCode::VLDR, opndDst, opnd, instrInsert->m_func);
|
|
|
instrInsert->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr,false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
return instr;
|
|
|
}
|
|
|
|
|
|
@@ -7344,7 +7346,7 @@ void LowererMD::GenerateFloatTest(IR::RegOpnd * opndSrc, IR::Instr * insertInstr
|
|
|
instr->SetSrc1(vt);
|
|
|
instr->SetSrc2(m_lowerer->LoadVTableValueOpnd(insertInstr, VTableValue::VtableJavascriptNumber));
|
|
|
insertInstr->InsertBefore(instr);
|
|
|
- LegalizeMD::LegalizeInstr(instr,false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// BNE $helper
|
|
|
instr = IR::BranchInstr::New(Js::OpCode::BNE, labelHelper, this->m_func);
|
|
|
@@ -7367,7 +7369,7 @@ void LowererMD::LoadFloatValue(IR::RegOpnd * javascriptNumber, IR::RegOpnd * opn
|
|
|
|
|
|
template <bool verify>
|
|
|
void
|
|
|
-LowererMD::Legalize(IR::Instr *const instr, bool fPostRegAlloc)
|
|
|
+LowererMD::Legalize(IR::Instr *const instr)
|
|
|
{
|
|
|
Func *const func = instr->m_func;
|
|
|
|
|
|
@@ -7384,7 +7386,7 @@ LowererMD::Legalize(IR::Instr *const instr, bool fPostRegAlloc)
|
|
|
const IR::AutoReuseOpnd autoReuseFloat32Reg(float32Reg, func);
|
|
|
IR::Instr *const newInstr = IR::Instr::New(Js::OpCode::VCVTS32F64, float32Reg, instr->GetSrc1(), func);
|
|
|
instr->InsertBefore(newInstr);
|
|
|
- LegalizeMD::LegalizeInstr(newInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(newInstr);
|
|
|
instr->m_opcode = Js::OpCode::VMOVARMVFP;
|
|
|
instr->ReplaceSrc1(float32Reg);
|
|
|
}
|
|
|
@@ -7394,12 +7396,12 @@ LowererMD::Legalize(IR::Instr *const instr, bool fPostRegAlloc)
|
|
|
// NYI for the rest of legalization
|
|
|
return;
|
|
|
}
|
|
|
- LegalizeMD::LegalizeInstr(instr, fPostRegAlloc);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
}
|
|
|
|
|
|
-template void LowererMD::Legalize<false>(IR::Instr *const instr, bool fPostRegalloc);
|
|
|
+template void LowererMD::Legalize<false>(IR::Instr *const instr);
|
|
|
#if DBG
|
|
|
-template void LowererMD::Legalize<true>(IR::Instr *const instr, bool fPostRegalloc);
|
|
|
+template void LowererMD::Legalize<true>(IR::Instr *const instr);
|
|
|
#endif
|
|
|
|
|
|
void
|
|
|
@@ -7501,7 +7503,7 @@ LowererMD::FinalLowerAssign(IR::Instr * instr)
|
|
|
{
|
|
|
if (instr->m_opcode == Js::OpCode::LDIMM)
|
|
|
{
|
|
|
- LegalizeMD::LegalizeInstr(instr, true);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
|
|
|
// LDIMM can expand into MOV/MOVT when the immediate is more than 16 bytes,
|
|
|
// it can also expand into multiple different no-op (normally MOV) instrs when we obfuscate it, which is randomly.
|
|
|
@@ -7512,7 +7514,7 @@ LowererMD::FinalLowerAssign(IR::Instr * instr)
|
|
|
Assert(instr->GetDst()->IsRegOpnd());
|
|
|
if (!instr->GetSrc1()->IsRegOpnd())
|
|
|
{
|
|
|
- LegalizeMD::LegalizeSrc(instr, instr->GetSrc1(), 1, true);
|
|
|
+ LegalizeMD::LegalizeSrc(instr, instr->GetSrc1(), 1);
|
|
|
return true;
|
|
|
}
|
|
|
instr->m_opcode = (instr->GetSrc1()->GetType() == TyMachDouble) ? Js::OpCode::VMOV : Js::OpCode::MOV;
|
|
|
@@ -7522,7 +7524,7 @@ LowererMD::FinalLowerAssign(IR::Instr * instr)
|
|
|
Assert(instr->GetSrc1()->IsRegOpnd());
|
|
|
if (!instr->GetDst()->IsRegOpnd())
|
|
|
{
|
|
|
- LegalizeMD::LegalizeDst(instr, true);
|
|
|
+ LegalizeMD::LegalizeDst(instr);
|
|
|
return true;
|
|
|
}
|
|
|
instr->m_opcode = (instr->GetDst()->GetType() == TyMachDouble) ? Js::OpCode::VMOV : Js::OpCode::MOV;
|
|
|
@@ -7538,7 +7540,7 @@ LowererMD::FinalLowerAssign(IR::Instr * instr)
|
|
|
uint32 argOutSize = UInt32Math::Mul(this->m_func->m_argSlotsForFunctionsCalled, MachRegInt, Js::Throw::OutOfMemory);
|
|
|
instr->SetSrc1(IR::IntConstOpnd::New(argOutSize, TyMachReg, this->m_func));
|
|
|
instr->m_opcode = Js::OpCode::LDIMM;
|
|
|
- LegalizeMD::LegalizeInstr(instr, true);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
return true;
|
|
|
}
|
|
|
else if (instr->m_opcode == Js::OpCode::REM)
|
|
|
@@ -7586,8 +7588,8 @@ LowererMD::LowerDivI4AndBailOnReminder(IR::Instr * instr, IR::LabelInstr * bailO
|
|
|
|
|
|
// delay assigning to the final dst.
|
|
|
IR::Instr * sinkedInstr = instr->SinkDst(Js::OpCode::MOV);
|
|
|
- LegalizeMD::LegalizeInstr(instr, false);
|
|
|
- LegalizeMD::LegalizeInstr(sinkedInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(instr);
|
|
|
+ LegalizeMD::LegalizeInstr(sinkedInstr);
|
|
|
|
|
|
IR::Opnd * resultOpnd = instr->GetDst();
|
|
|
IR::Opnd * numerator = instr->GetSrc1();
|
|
|
@@ -7600,7 +7602,7 @@ LowererMD::LowerDivI4AndBailOnReminder(IR::Instr * instr, IR::LabelInstr * bailO
|
|
|
IR::RegOpnd * mulResult = IR::RegOpnd::New(TyInt32, m_func);
|
|
|
IR::Instr * mulInstr = IR::Instr::New(Js::OpCode::MUL, mulResult, resultOpnd, denominatorOpnd, m_func);
|
|
|
insertBeforeInstr->InsertBefore(mulInstr);
|
|
|
- LegalizeMD::LegalizeInstr(mulInstr, false);
|
|
|
+ LegalizeMD::LegalizeInstr(mulInstr);
|
|
|
|
|
|
this->m_lowerer->InsertCompareBranch(mulResult, numerator, Js::OpCode::BrNeq_A, bailOutLabel, insertBeforeInstr);
|
|
|
return insertBeforeInstr;
|