зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1347489 - Give StringSegmentRange stack Vector some inline capacity to avoid malloc/free overhead. r=luke
--HG-- extra : rebase_source : 6ad96563e57af30665ac82bb75bb02b4a4d8a91f
This commit is contained in:
Родитель
585781cba0
Коммит
ceeedc0eb2
|
@ -1460,7 +1460,8 @@ class StringSegmentRange
|
|||
{
|
||||
// If malloc() shows up in any profiles from this vector, we can add a new
|
||||
// StackAllocPolicy which stashes a reusable freed-at-gc buffer in the cx.
|
||||
Rooted<StringVector> stack;
|
||||
using StackVector = JS::GCVector<JSString*, 16>;
|
||||
Rooted<StackVector> stack;
|
||||
RootedLinearString cur;
|
||||
|
||||
bool settle(JSString* str) {
|
||||
|
@ -1476,7 +1477,7 @@ class StringSegmentRange
|
|||
|
||||
public:
|
||||
explicit StringSegmentRange(JSContext* cx)
|
||||
: stack(cx, StringVector(cx)), cur(cx)
|
||||
: stack(cx, StackVector(cx)), cur(cx)
|
||||
{}
|
||||
|
||||
MOZ_MUST_USE bool init(JSString* str) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче