зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1039667 - IonMonkey: Clear the Guard flag when folding away MBoundsCheck instructions r=jandem
This commit is contained in:
Родитель
9790960ef1
Коммит
6bb064a728
|
@ -3225,9 +3225,13 @@ MBoundsCheck::foldsTo(TempAllocator &alloc)
|
||||||
if (index()->isConstant() && length()->isConstant()) {
|
if (index()->isConstant() && length()->isConstant()) {
|
||||||
uint32_t len = length()->toConstant()->value().toInt32();
|
uint32_t len = length()->toConstant()->value().toInt32();
|
||||||
uint32_t idx = index()->toConstant()->value().toInt32();
|
uint32_t idx = index()->toConstant()->value().toInt32();
|
||||||
if (idx + uint32_t(minimum()) < len && idx + uint32_t(maximum()) < len)
|
if (idx + uint32_t(minimum()) < len && idx + uint32_t(maximum()) < len) {
|
||||||
|
// This bounds check will never fail, so we can clear the Guard flag
|
||||||
|
// and allow it to be deleted.
|
||||||
|
setNotGuard();
|
||||||
return index();
|
return index();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче