зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1752870 - Filter code ranges before searching. r=rhunt
When searching a lazy stub segment for the code range that holds a particular PC value, we can quickly exclude segments that are guaranteed not to match by comparing the PC to the values at the segment's endpoints - the code ranges in a segment are sorted, and this filtering will cause the search to skip most segments. This very significantly reduces the time spent in the search. Differential Revision: https://phabricator.services.mozilla.com/D137518
This commit is contained in:
Родитель
7e909fb3ff
Коммит
0e05bd1298
|
@ -680,6 +680,11 @@ bool LazyStubSegment::addIndirectStubs(
|
|||
}
|
||||
|
||||
const CodeRange* LazyStubSegment::lookupRange(const void* pc) const {
|
||||
// Do not search if the search will not find anything. There can be many
|
||||
// segments, each with many entries.
|
||||
if (pc < base() || pc >= base() + length()) {
|
||||
return nullptr;
|
||||
}
|
||||
return LookupInSorted(codeRanges_,
|
||||
CodeRange::OffsetInCode((uint8_t*)pc - base()));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче