Skip to content

Commit c86df3f

Browse files
committed
Disable BailOnNoProfile in Generators/Asyncs
- BailOnNoProfile marks all code after it as dead - if variable is used in a yield BUT incremented after BailOnNoProfile - Jit would delete the increment and mark variable as constant - interpreter would increment BUT JIT would reload as const - would yield same value multiple times Ideally should introduce Generator/Async specific version of BailOnNoProfile That doesn't mark code after it as dead - but that would be larger work. For now disable BailOnNoProfile for generators/Asyncs.
1 parent c7ca1c2 commit c86df3f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Backend/IRBuilder.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ IRBuilder::DoBailOnNoProfile()
118118
return false;
119119
}
120120

121+
if (m_func->GetTopFunc()->GetJITFunctionBody()->IsCoroutine())
122+
{
123+
return false;
124+
}
125+
121126
return true;
122127
}
123128

0 commit comments

Comments
 (0)