, m_globalData(globalData)
, m_keywordTable(JSC::mainTable)
{
- m_buffer8.reserveInitialCapacity(initialReadBufferCapacity);
- m_buffer16.reserveInitialCapacity(initialReadBufferCapacity);
}
Lexer::~Lexer()
m_error = false;
m_atLineStart = true;
+ m_buffer8.reserveInitialCapacity(initialReadBufferCapacity);
+ m_buffer16.reserveInitialCapacity((m_codeEnd - m_code) / 2);
+
// ECMA-262 calls for stripping all Cf characters, but we only strip BOM characters.
// See <https://bugs.webkit.org/show_bug.cgi?id=4931> for details.
if (source.provider()->hasBOMs()) {
m_codeWithoutBOMs.clear();
Vector<char> newBuffer8;
- newBuffer8.reserveInitialCapacity(initialReadBufferCapacity);
m_buffer8.swap(newBuffer8);
Vector<UChar> newBuffer16;
- newBuffer16.reserveInitialCapacity(initialReadBufferCapacity);
m_buffer16.swap(newBuffer16);
m_isReparsing = false;