Changeset 190843 in webkit
- Timestamp:
- Oct 10, 2015 2:14:56 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r190841 r190843 1 2015-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 1 17 2015-10-10 Dan Bernstein <mitz@apple.com> 2 18 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r190827 r190843 1887 1887 HashSet<JSModuleEnvironment*> stronglyReferencedModuleEnvironments; 1888 1888 1889 Vector<Instruction, 0, UnsafeVectorOverflow> instructions(instructionCount);1889 RefCountedArray<Instruction> instructions(instructionCount); 1890 1890 1891 1891 for (unsigned i = 0; !instructionReader.atEnd(); ) { … … 2184 2184 insertBasicBlockBoundariesForControlFlowProfiler(instructions); 2185 2185 2186 m_instructions = WTF:: RefCountedArray<Instruction>(instructions);2186 m_instructions = WTF::move(instructions); 2187 2187 2188 2188 // Set optimization thresholds only after m_instructions is initialized, since these … … 4081 4081 #endif 4082 4082 4083 void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler( Vector<Instruction, 0, UnsafeVectorOverflow>& instructions)4083 void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler(RefCountedArray<Instruction>& instructions) 4084 4084 { 4085 4085 const Vector<size_t>& bytecodeOffsets = unlinkedCodeBlock()->opProfileControlFlowBytecodeOffsets(); -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r190827 r190843 1001 1001 } 1002 1002 1003 void insertBasicBlockBoundariesForControlFlowProfiler( Vector<Instruction, 0, UnsafeVectorOverflow>&);1003 void insertBasicBlockBoundariesForControlFlowProfiler(RefCountedArray<Instruction>&); 1004 1004 1005 1005 WriteBarrier<UnlinkedCodeBlock> m_unlinkedCode;
Note: See TracChangeset
for help on using the changeset viewer.