Skip to content

Commit 1d7964d

Browse files
committed
Update logic to restore copy-prop'd sym
If a symbol is used for copy-prop, then it is removed from bytecode upward exposed bitvector. So we also need to use `usedCapturedValues` to get the right symbols to restore.
1 parent a4719f7 commit 1d7964d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/Backend/LinearScan.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,16 +5086,24 @@ void LinearScan::GeneratorBailIn::BuildBailInSymbolList(
50865086
{
50875087
Sym* key = copyPropSym.Key();
50885088
Sym* value = copyPropSym.Value();
5089-
if (unrestorableSymbols.Test(value->m_id))
5089+
if (unrestorableSymbols.TestAndClear(value->m_id))
50905090
{
50915091
Assert(key->IsStackSym() && (key->AsStackSym()->HasByteCodeRegSlot() || key->AsStackSym()->IsFromByteCodeConstantTable()));
5092-
unrestorableSymbols.Clear(value->m_id);
50935092
if (this->NeedsReloadingSymWhenBailingIn(copyPropSym.Key()))
50945093
{
50955094
BailInSymbol bailInSym(key->m_id /* fromByteCodeRegSlot */, value->m_id /* toBackendId */);
50965095
bailInSymbols->PrependNode(this->func->m_alloc, bailInSym);
50975096
}
50985097
}
5098+
else if (unrestorableSymbols.TestAndClear(key->m_id))
5099+
{
5100+
Assert(key->IsStackSym() && (key->AsStackSym()->HasByteCodeRegSlot() || key->AsStackSym()->IsFromByteCodeConstantTable()));
5101+
if (this->NeedsReloadingSymWhenBailingIn(copyPropSym.Key()))
5102+
{
5103+
BailInSymbol bailInSym(key->m_id /* fromByteCodeRegSlot */, key->m_id /* toBackendId */);
5104+
bailInSymbols->PrependNode(this->func->m_alloc, bailInSym);
5105+
}
5106+
}
50995107
}
51005108
NEXT_SLISTBASE_ENTRY;
51015109

0 commit comments

Comments
 (0)