2010-05-09 Geoffrey Garen <[email protected]>
Reviewed by Oliver Hunt.
Reserve a large-ish initial capacity for Lexer::m_buffer16.
SunSpider says 0.3% faster.
m_buffer16 is used when parsing complex strings -- for example, strings
with escape sequences in them. These kinds of strings can be really long,
and we want to avoid repeatedly copying as we grow m_buffer16.
The net memory cost is quite low, since it's proporitional to source
code we already have in memory, and we throw away m_buffer16 right when
we're done parsing.
- parser/Lexer.cpp:
(JSC::Lexer::Lexer): No need to reserve initial capacity in our constructor,
since setCode will be called before we're asked to lex anything.
(JSC::Lexer::setCode): Reserve enough space to lex half the source code
as a complex string without having to copy.
(JSC::Lexer::clear): No need to reserve initial capacity here either,
since setCode will be called before we're asked to lex anything.
2010-05-09 Oliver Hunt <[email protected]>
Reviewed by Gavin Barraclough.
REGRESSION(r57955): RegExp literals should not actually be cached, so r57955 should be rolled out.
https://bugs.webkit.org/show_bug.cgi?id=38828
Replace incorrect test for caching regexp literals with ones that tests that they are not cached.
- fast/js/regexp-literals-are-constants-expected.txt: Removed.
- fast/js/regexp-literals-are-constants.html: Removed.
- fast/js/regexp-literals-arent-constants-expected.txt: Added.
- fast/js/regexp-literals-arent-constants.html: Added.
- fast/js/script-tests/regexp-literals-are-constants.js: Removed.
- fast/js/script-tests/regexp-literals-arent-constants.js: Added.
(test1):
(returnRegExpLiteral):
(returnConditionalRegExpLiteral):