зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1174230 - Limit the complexity of regalloc bundles which can be merged together, r=sunfish.
This commit is contained in:
Родитель
009f55be08
Коммит
6c689a1566
|
@ -900,9 +900,17 @@ BacktrackingAllocator::tryMergeBundles(LiveBundle* bundle0, LiveBundle* bundle1)
|
|||
}
|
||||
}
|
||||
|
||||
// Limit the number of times we compare ranges if there are many ranges in
|
||||
// one of the bundles, to avoid quadratic behavior.
|
||||
static const size_t MAX_RANGES = 200;
|
||||
|
||||
// Make sure that ranges in the bundles do not overlap.
|
||||
LiveRange::BundleLinkIterator iter0 = bundle0->rangesBegin(), iter1 = bundle1->rangesBegin();
|
||||
size_t count = 0;
|
||||
while (iter0 && iter1) {
|
||||
if (++count >= MAX_RANGES)
|
||||
return true;
|
||||
|
||||
LiveRange* range0 = LiveRange::get(*iter0);
|
||||
LiveRange* range1 = LiveRange::get(*iter1);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче