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:
Jan de Mooij 2017-03-15 16:25:46 +01:00
Родитель 585781cba0
Коммит ceeedc0eb2
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -1460,7 +1460,8 @@ class StringSegmentRange
{ {
// If malloc() shows up in any profiles from this vector, we can add a new // 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. // 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; RootedLinearString cur;
bool settle(JSString* str) { bool settle(JSString* str) {
@ -1476,7 +1477,7 @@ class StringSegmentRange
public: public:
explicit StringSegmentRange(JSContext* cx) explicit StringSegmentRange(JSContext* cx)
: stack(cx, StringVector(cx)), cur(cx) : stack(cx, StackVector(cx)), cur(cx)
{} {}
MOZ_MUST_USE bool init(JSString* str) { MOZ_MUST_USE bool init(JSString* str) {