|
|
@@ -160,7 +160,7 @@ BackwardPass::DoTrackNegativeZero() const
|
|
|
bool
|
|
|
BackwardPass::DoTrackBitOpsOrNumber() const
|
|
|
{
|
|
|
-#if _WIN64
|
|
|
+#if defined(_WIN32) && defined(TARGET_64)
|
|
|
return
|
|
|
!PHASE_OFF1(Js::TypedArrayVirtualPhase) &&
|
|
|
tag == Js::BackwardPhase &&
|
|
|
@@ -316,8 +316,8 @@ BackwardPass::ProcessBailOnStackArgsOutOfActualsRange()
|
|
|
{
|
|
|
IR::Instr * instr = this->currentInstr;
|
|
|
|
|
|
- if (tag == Js::DeadStorePhase &&
|
|
|
- (instr->m_opcode == Js::OpCode::LdElemI_A || instr->m_opcode == Js::OpCode::TypeofElem) &&
|
|
|
+ if (tag == Js::DeadStorePhase &&
|
|
|
+ (instr->m_opcode == Js::OpCode::LdElemI_A || instr->m_opcode == Js::OpCode::TypeofElem) &&
|
|
|
instr->HasBailOutInfo() && !IsPrePass())
|
|
|
{
|
|
|
if (instr->DoStackArgsOpt(this->func))
|
|
|
@@ -1735,7 +1735,7 @@ BackwardPass::ProcessBailOutCopyProps(BailOutInfo * bailOutInfo, BVSparse<JitAre
|
|
|
StackSym * float64StackSym = nullptr;
|
|
|
StackSym * simd128StackSym = nullptr;
|
|
|
|
|
|
- // If the sym is type specialized, we need to check for upward exposed uses of the specialized sym and not the equivalent var sym. If there are no
|
|
|
+ // If the sym is type specialized, we need to check for upward exposed uses of the specialized sym and not the equivalent var sym. If there are no
|
|
|
// uses and we use the copy prop sym to restore, we'll need to find the type specialize sym for that sym as well.
|
|
|
StackSym * typeSpecSym = nullptr;
|
|
|
auto findTypeSpecSym = [&]()
|
|
|
@@ -2590,7 +2590,7 @@ BackwardPass::ProcessBlock(BasicBlock * block)
|
|
|
|
|
|
this->currentInstr = instr;
|
|
|
this->currentRegion = this->currentBlock->GetFirstInstr()->AsLabelInstr()->GetRegion();
|
|
|
-
|
|
|
+
|
|
|
IR::Instr * insertedInstr = TryChangeInstrForStackArgOpt();
|
|
|
if (insertedInstr != nullptr)
|
|
|
{
|
|
|
@@ -2600,7 +2600,7 @@ BackwardPass::ProcessBlock(BasicBlock * block)
|
|
|
|
|
|
MarkScopeObjSymUseForStackArgOpt();
|
|
|
ProcessBailOnStackArgsOutOfActualsRange();
|
|
|
-
|
|
|
+
|
|
|
if (ProcessNoImplicitCallUses(instr) || this->ProcessBailOutInfo(instr))
|
|
|
{
|
|
|
continue;
|
|
|
@@ -2943,7 +2943,7 @@ BackwardPass::ProcessBlock(BasicBlock * block)
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
-bool
|
|
|
+bool
|
|
|
BackwardPass::CanDeadStoreInstrForScopeObjRemoval(Sym *sym) const
|
|
|
{
|
|
|
if (tag == Js::DeadStorePhase && this->currentInstr->m_func->IsStackArgsEnabled())
|
|
|
@@ -3099,7 +3099,7 @@ BackwardPass::DeadStoreOrChangeInstrForScopeObjRemoval(IR::Instr ** pInstrPrev)
|
|
|
case Js::OpCode::GetCachedFunc:
|
|
|
{
|
|
|
// <dst> = GetCachedFunc <scopeObject>, <functionNum>
|
|
|
- // is converted to
|
|
|
+ // is converted to
|
|
|
// <dst> = NewScFunc <functionNum>, <env: FrameDisplay>
|
|
|
|
|
|
if (instr->GetSrc1()->IsScopeObjOpnd(currFunc))
|
|
|
@@ -3161,8 +3161,8 @@ BackwardPass::TryChangeInstrForStackArgOpt()
|
|
|
* -This is to facilitate Bailout to record the live Scope object Sym, whenever required.
|
|
|
* -Reason for doing is this because - Scope object has to be implicitly live whenever Heap Arguments object is live.
|
|
|
* -When we restore HeapArguments object in the bail out path, it expects the scope object also to be restored - if one was created.
|
|
|
- * -We do not know detailed information about Heap arguments obj syms(aliasing etc.) until we complete Forward Pass.
|
|
|
- * -And we want to avoid dead sym clean up (in this case, scope object though not explicitly live, it is live implicitly) during Block merging in the forward pass.
|
|
|
+ * -We do not know detailed information about Heap arguments obj syms(aliasing etc.) until we complete Forward Pass.
|
|
|
+ * -And we want to avoid dead sym clean up (in this case, scope object though not explicitly live, it is live implicitly) during Block merging in the forward pass.
|
|
|
* -Hence this is the optimal spot to do this.
|
|
|
*/
|
|
|
|
|
|
@@ -3196,10 +3196,10 @@ bool
|
|
|
BackwardPass::IsFormalParamSym(Func * func, Sym * sym) const
|
|
|
{
|
|
|
Assert(sym);
|
|
|
-
|
|
|
+
|
|
|
if (sym->IsPropertySym())
|
|
|
{
|
|
|
- //If the sym is a propertySym, then see if the propertyId is within the range of the formals
|
|
|
+ //If the sym is a propertySym, then see if the propertyId is within the range of the formals
|
|
|
//We can have other properties stored in the scope object other than the formals (following the formals).
|
|
|
PropertySym * propSym = sym->AsPropertySym();
|
|
|
IntConstType value = propSym->m_propertyId;
|
|
|
@@ -4250,8 +4250,8 @@ bool
|
|
|
BackwardPass::ProcessSymUse(Sym * sym, bool isRegOpndUse, BOOLEAN isNonByteCodeUse)
|
|
|
{
|
|
|
BasicBlock * block = this->currentBlock;
|
|
|
-
|
|
|
- if (CanDeadStoreInstrForScopeObjRemoval(sym))
|
|
|
+
|
|
|
+ if (CanDeadStoreInstrForScopeObjRemoval(sym))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
@@ -4537,7 +4537,7 @@ BackwardPass::TrackObjTypeSpecProperties(IR::PropertySymOpnd *opnd, BasicBlock *
|
|
|
}
|
|
|
bucket->SetMonoGuardType(nullptr);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!opnd->IsTypeAvailable())
|
|
|
{
|
|
|
// Stop tracking the guarded properties if there's not another type check upstream.
|
|
|
@@ -5651,7 +5651,7 @@ BackwardPass::TrackIntUsage(IR::Instr *const instr)
|
|
|
SetNegativeZeroDoesNotMatterIfLastUse(instr->GetSrc2());
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// -0 + -0 == -0. As long as one src is guaranteed to not be -0, -0 does not matter for the other src. Pick a
|
|
|
// src for which to ignore negative zero, based on which sym is last-use. If both syms are last-use, src2 is
|
|
|
// picked arbitrarily.
|
|
|
@@ -6741,9 +6741,9 @@ BackwardPass::DeadStoreInstr(IR::Instr *instr)
|
|
|
tempBv.Copy(this->currentBlock->byteCodeUpwardExposedUsed);
|
|
|
#endif
|
|
|
PropertySym *unusedPropertySym = nullptr;
|
|
|
-
|
|
|
+
|
|
|
GlobOpt::TrackByteCodeSymUsed(instr, this->currentBlock->byteCodeUpwardExposedUsed, &unusedPropertySym);
|
|
|
-
|
|
|
+
|
|
|
#if DBG
|
|
|
BVSparse<JitArenaAllocator> tempBv2(this->tempAlloc);
|
|
|
tempBv2.Copy(this->currentBlock->byteCodeUpwardExposedUsed);
|
|
|
@@ -6781,7 +6781,7 @@ BackwardPass::DeadStoreInstr(IR::Instr *instr)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if (instr->m_opcode == Js::OpCode::ArgIn_A)
|
|
|
{
|
|
|
//Ignore tracking ArgIn for "this", as argInsCount only tracks other params - unless it is a asmjs function(which doesn't have a "this").
|
|
|
@@ -6793,7 +6793,7 @@ BackwardPass::DeadStoreInstr(IR::Instr *instr)
|
|
|
}
|
|
|
|
|
|
TraceDeadStoreOfInstrsForScopeObjectRemoval();
|
|
|
-
|
|
|
+
|
|
|
block->RemoveInstr(instr);
|
|
|
return true;
|
|
|
}
|