Changeset 190843 in webkit


Ignore:
Timestamp:
Oct 10, 2015 2:14:56 PM (9 years ago)
Author:
akling@apple.com
Message:

Reduce pointless malloc traffic in CodeBlock construction.
<https://webkit.org/b/149999>

Reviewed by Antti Koivisto.

Create the RefCountedArray<Instruction> for CodeBlock's m_instructions directly
instead of first creating a Vector<Instruction> and then creating a RefCountedArray
from that. None of the Vector functionality is needed here anyway.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):

  • bytecode/CodeBlock.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r190841 r190843  
     12015-10-10  Andreas Kling  <akling@apple.com>
     2
     3        Reduce pointless malloc traffic in CodeBlock construction.
     4        <https://webkit.org/b/149999>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Create the RefCountedArray<Instruction> for CodeBlock's m_instructions directly
     9        instead of first creating a Vector<Instruction> and then creating a RefCountedArray
     10        from that. None of the Vector functionality is needed here anyway.
     11
     12        * bytecode/CodeBlock.cpp:
     13        (JSC::CodeBlock::finishCreation):
     14        (JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
     15        * bytecode/CodeBlock.h:
     16
    1172015-10-10  Dan Bernstein  <mitz@apple.com>
    218
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r190827 r190843  
    18871887    HashSet<JSModuleEnvironment*> stronglyReferencedModuleEnvironments;
    18881888
    1889     Vector<Instruction, 0, UnsafeVectorOverflow> instructions(instructionCount);
     1889    RefCountedArray<Instruction> instructions(instructionCount);
    18901890
    18911891    for (unsigned i = 0; !instructionReader.atEnd(); ) {
     
    21842184        insertBasicBlockBoundariesForControlFlowProfiler(instructions);
    21852185
    2186     m_instructions = WTF::RefCountedArray<Instruction>(instructions);
     2186    m_instructions = WTF::move(instructions);
    21872187
    21882188    // Set optimization thresholds only after m_instructions is initialized, since these
     
    40814081#endif
    40824082
    4083 void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler(Vector<Instruction, 0, UnsafeVectorOverflow>& instructions)
     4083void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler(RefCountedArray<Instruction>& instructions)
    40844084{
    40854085    const Vector<size_t>& bytecodeOffsets = unlinkedCodeBlock()->opProfileControlFlowBytecodeOffsets();
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r190827 r190843  
    10011001    }
    10021002
    1003     void insertBasicBlockBoundariesForControlFlowProfiler(Vector<Instruction, 0, UnsafeVectorOverflow>&);
     1003    void insertBasicBlockBoundariesForControlFlowProfiler(RefCountedArray<Instruction>&);
    10041004
    10051005    WriteBarrier<UnlinkedCodeBlock> m_unlinkedCode;
Note: See TracChangeset for help on using the changeset viewer.