Ignore:
Timestamp:
May 9, 2010, 6:41:07 PM (15 years ago)
Author:
[email protected]
Message:

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):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITStubs.cpp

    r59055 r59064  
    28712871}
    28722872
     2873DEFINE_STUB_FUNCTION(JSObject*, op_new_regexp)
     2874{
     2875    STUB_INIT_STACK_FRAME(stackFrame);
     2876
     2877    return new (stackFrame.globalData) RegExpObject(stackFrame.callFrame->lexicalGlobalObject()->regExpStructure(), stackFrame.args[0].regExp());
     2878}
     2879
    28732880DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitor)
    28742881{
Note: See TracChangeset for help on using the changeset viewer.