Bug 1087207 - Use a smaller initial size for the srcnotes vector. r=jorendorff.

--HG--
extra : rebase_source : 49c9ad1698e473ebdea601c5764949a08c1636d1
This commit is contained in:
Nicholas Nethercote 2014-10-27 15:37:47 -07:00
Родитель c1c3635c59
Коммит 478bcf52ea
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -160,6 +160,7 @@ EmitCheck(ExclusiveContext *cx, BytecodeEmitter *bce, ptrdiff_t delta)
ptrdiff_t offset = bce->code().length();
// Start it off moderately large to avoid repeated resizings early on.
// ~98% of cases fit within 1024 bytes.
if (bce->code().capacity() == 0 && !bce->code().reserve(1024))
return -1;
@ -7082,7 +7083,8 @@ static int
AllocSrcNote(ExclusiveContext *cx, SrcNotesVector &notes)
{
// Start it off moderately large to avoid repeated resizings early on.
if (notes.capacity() == 0 && !notes.reserve(1024))
// ~99% of cases fit within 256 bytes.
if (notes.capacity() == 0 && !notes.reserve(256))
return -1;
jssrcnote dummy = 0;