Changeset 162281 in webkit


Ignore:
Timestamp:
Jan 18, 2014 3:35:34 PM (10 years ago)
Author:
akling@apple.com
Message:

CodeBlock: Size m_function{Exprs,Decls} to fit from creation.
<https://webkit.org/b/127238>

Reviewed by Anders Carlsson.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

Use resizeToFit() instead of grow() for m_functionExprs and
m_functionDecls since we know they will never change size.

(JSC::CodeBlock::shrinkToFit):

No need to shrink them here anymore.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r162279 r162281  
     12014-01-18  Andreas Kling  <akling@apple.com>
     2
     3        CodeBlock: Size m_function{Exprs,Decls} to fit from creation.
     4        <https://webkit.org/b/127238>
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * bytecode/CodeBlock.cpp:
     9        (JSC::CodeBlock::CodeBlock):
     10
     11            Use resizeToFit() instead of grow() for m_functionExprs and
     12            m_functionDecls since we know they will never change size.
     13
     14        (JSC::CodeBlock::shrinkToFit):
     15
     16            No need to shrink them here anymore.
     17
    1182014-01-18  Andreas Kling  <akling@apple.com>
    219
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r162279 r162281  
    15591559    if (unlinkedCodeBlock->usesGlobalObject())
    15601560        m_constantRegisters[unlinkedCodeBlock->globalObjectRegister().offset()].set(*m_vm, ownerExecutable, m_globalObject.get());
    1561     m_functionDecls.grow(unlinkedCodeBlock->numberOfFunctionDecls());
     1561    m_functionDecls.resizeToFit(unlinkedCodeBlock->numberOfFunctionDecls());
    15621562    for (size_t count = unlinkedCodeBlock->numberOfFunctionDecls(), i = 0; i < count; ++i) {
    15631563        UnlinkedFunctionExecutable* unlinkedExecutable = unlinkedCodeBlock->functionDecl(i);
     
    15751575    }
    15761576
    1577     m_functionExprs.grow(unlinkedCodeBlock->numberOfFunctionExprs());
     1577    m_functionExprs.resizeToFit(unlinkedCodeBlock->numberOfFunctionExprs());
    15781578    for (size_t count = unlinkedCodeBlock->numberOfFunctionExprs(), i = 0; i < count; ++i) {
    15791579        UnlinkedFunctionExecutable* unlinkedExecutable = unlinkedCodeBlock->functionExpr(i);
     
    25912591   
    25922592    if (shrinkMode == EarlyShrink) {
    2593         m_functionDecls.shrinkToFit();
    2594         m_functionExprs.shrinkToFit();
    25952593        m_constantRegisters.shrinkToFit();
    25962594       
Note: See TracChangeset for help on using the changeset viewer.