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/JITOpcodes.cpp

    r59056 r59064  
    964964}
    965965
     966void JIT::emit_op_new_regexp(Instruction* currentInstruction)
     967{
     968    JITStubCall stubCall(this, cti_op_new_regexp);
     969    stubCall.addArgument(ImmPtr(m_codeBlock->regexp(currentInstruction[2].u.operand)));
     970    stubCall.call(currentInstruction[1].u.operand);
     971}
     972
    966973void JIT::emit_op_bitor(Instruction* currentInstruction)
    967974{
     
    16301637}
    16311638
     1639void JIT::emit_op_new_regexp(Instruction* currentInstruction)
     1640{
     1641    JITStubCall stubCall(this, cti_op_new_regexp);
     1642    stubCall.addArgument(ImmPtr(m_codeBlock->regexp(currentInstruction[2].u.operand)));
     1643    stubCall.call(currentInstruction[1].u.operand);
     1644}
     1645
    16321646// For both JSValue32_64 and JSValue32
    16331647#if ENABLE(JIT_OPTIMIZE_MOD)
Note: See TracChangeset for help on using the changeset viewer.