mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1174230 - Limit the complexity of regalloc bundles which can be merged together, r=sunfish.
This commit is contained in:
parent
daff2bcdc0
commit
563944c0c2
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user