Skip to content

Commit f7ea832

Browse files
MikeHolmanpleath
authored andcommitted
1 parent 6d9d2d6 commit f7ea832

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/Backend/GlobOpt.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2903,7 +2903,12 @@ GlobOpt::OptTagChecks(IR::Instr *instr)
29032903
// the byteCodeUse fields...
29042904
TrackByteCodeUsesForInstrAddedInOptInstr(bailOutInstr, [&]()
29052905
{
2906-
TryHoistInvariant(bailOutInstr, this->currentBlock, nullptr, value, nullptr, true, false, false, IR::BailOutOnTaggedValue);
2906+
if (TryHoistInvariant(bailOutInstr, this->currentBlock, nullptr, value, nullptr, true, false, false, IR::BailOutOnTaggedValue))
2907+
{
2908+
Value* landingPadValue = this->currentBlock->loop->landingPad->globOptData.FindValue(stackSym);
2909+
ValueType newLandingPadValueType = landingPadValue->GetValueInfo()->Type().SetCanBeTaggedValue(false);
2910+
ChangeValueType(nullptr, landingPadValue, newLandingPadValueType, false);
2911+
}
29072912
});
29082913
}
29092914
if (symOpnd)

lib/Backend/GlobOptArrays.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,13 @@ void GlobOpt::ArraySrcOpt::CheckLoops()
498498
if (doArrayChecks)
499499
{
500500
hoistChecksOutOfLoop = loop;
501+
502+
// If BailOnNotObject isn't hoisted, the value may still be tagged in the landing pad
503+
if (baseValueInLoopLandingPad->GetValueInfo()->Type().CanBeTaggedValue())
504+
{
505+
baseValueType = baseValueType.SetCanBeTaggedValue(true);
506+
baseOpnd->SetValueType(baseValueType);
507+
}
501508
}
502509

503510
if (isLikelyJsArray && loopKills.KillsArrayHeadSegments())

0 commit comments

Comments
 (0)