Changeset 156079 in webkit
- Timestamp:
- Sep 18, 2013 8:12:09 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSStringRefCF.cpp
r155734 r156079 32 32 #include "OpaqueJSString.h" 33 33 #include <runtime/JSCJSValue.h> 34 #include <wtf/ OwnArrayPtr.h>34 #include <wtf/StdLibExtras.h> 35 35 36 36 JSStringRef JSStringCreateWithCFString(CFStringRef string) … … 48 48 return OpaqueJSString::create(lcharBuffer.data(), length).leakRef(); 49 49 50 OwnArrayPtr<UniChar> buffer = adoptArrayPtr(new UniChar[length]);50 auto buffer = std::make_unique<UniChar[]>(length); 51 51 CFStringGetCharacters(string, CFRangeMake(0, length), buffer.get()); 52 52 COMPILE_ASSERT(sizeof(UniChar) == sizeof(UChar), unichar_and_uchar_must_be_same_size); -
trunk/Source/JavaScriptCore/API/JSStringRefQt.cpp
r146976 r156079 33 33 #include "OpaqueJSString.h" 34 34 #include <runtime/JSCJSValue.h> 35 #include <wtf/OwnArrayPtr.h>36 35 37 36 QString JSStringCopyQString(JSStringRef string) -
trunk/Source/JavaScriptCore/ChangeLog
r156067 r156079 1 2013-09-18 Sam Weinig <sam@webkit.org> 2 3 Replace use of OwnArrayPtr<Foo> with std::unique_ptr<Foo[]> in JavaScriptCore 4 https://bugs.webkit.org/show_bug.cgi?id=121583 5 6 Reviewed by Anders Carlsson. 7 8 * API/JSStringRefCF.cpp: 9 (JSStringCreateWithCFString): 10 * API/JSStringRefQt.cpp: 11 * bytecompiler/BytecodeGenerator.cpp: 12 (JSC::BytecodeGenerator::BytecodeGenerator): 13 * dfg/DFGByteCodeParser.cpp: 14 (JSC::DFG::ByteCodeParser::parseBlock): 15 * dfg/DFGDisassembler.cpp: 16 (JSC::DFG::Disassembler::dumpDisassembly): 17 * runtime/Arguments.cpp: 18 (JSC::Arguments::tearOff): 19 * runtime/Arguments.h: 20 (JSC::Arguments::isTornOff): 21 (JSC::Arguments::allocateSlowArguments): 22 * runtime/JSPropertyNameIterator.cpp: 23 (JSC::JSPropertyNameIterator::JSPropertyNameIterator): 24 * runtime/JSPropertyNameIterator.h: 25 * runtime/JSSegmentedVariableObject.h: 26 * runtime/JSVariableObject.h: 27 * runtime/PropertyNameArray.h: 28 * runtime/RegExp.cpp: 29 * runtime/StructureChain.h: 30 (JSC::StructureChain::finishCreation): 31 * runtime/SymbolTable.h: 32 (JSC::SharedSymbolTable::setSlowArguments): 33 1 34 2013-09-18 Brent Fulgham <bfulgham@apple.com> 2 35 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r155729 r156079 41 41 #include "StrongInlines.h" 42 42 #include "UnlinkedCodeBlock.h" 43 #include <wtf/StdLibExtras.h> 43 44 #include <wtf/text/WTFString.h> 44 45 … … 263 264 if (capturesAnyArgumentByName && !shouldTearOffArgumentsEagerly()) { 264 265 size_t parameterCount = m_symbolTable->parameterCount(); 265 OwnArrayPtr<SlowArgument> slowArguments = adoptArrayPtr(new SlowArgument[parameterCount]);266 auto slowArguments = std::make_unique<SlowArgument[]>(parameterCount); 266 267 for (size_t i = 0; i < parameterCount; ++i) { 267 268 if (!capturedArguments[i]) { -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r156047 r156079 43 43 #include <wtf/HashMap.h> 44 44 #include <wtf/MathExtras.h> 45 #include <wtf/StdLibExtras.h> 45 46 46 47 namespace JSC { namespace DFG { … … 2243 2244 const unsigned maxRopeArguments = 3; 2244 2245 #endif 2245 OwnArrayPtr<Node*> toStringNodes = adoptArrayPtr(new Node*[numOperands]);2246 auto toStringNodes = std::make_unique<Node*[]>(numOperands); 2246 2247 for (int i = 0; i < numOperands; i++) 2247 2248 toStringNodes[i] = addToGraph(ToString, get(startOperand - i)); -
trunk/Source/JavaScriptCore/dfg/DFGDisassembler.cpp
r153296 r156079 31 31 #include "CodeBlockWithJITType.h" 32 32 #include "DFGGraph.h" 33 #include <wtf/StdLibExtras.h> 33 34 34 35 namespace JSC { namespace DFG { … … 155 156 else 156 157 amountOfNodeWhiteSpace = Graph::amountOfNodeWhiteSpace(context); 157 OwnArrayPtr<char> prefixBuffer = adoptArrayPtr(new char[prefixLength + amountOfNodeWhiteSpace + 1]);158 auto prefixBuffer = std::make_unique<char[]>(prefixLength + amountOfNodeWhiteSpace + 1); 158 159 strcpy(prefixBuffer.get(), prefix); 159 160 for (int i = 0; i < amountOfNodeWhiteSpace; ++i) -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r156047 r156079 312 312 ASSERT(bitwise_cast<WriteBarrier<Unknown>*>(callFrame) == m_registers); 313 313 314 m_registerArray = adoptArrayPtr(new WriteBarrier<Unknown>[m_numArguments]);314 m_registerArray = std::make_unique<WriteBarrier<Unknown>[]>(m_numArguments); 315 315 m_registers = m_registerArray.get() - CallFrame::offsetFor(1) - 1; 316 316 … … 358 358 return; 359 359 360 m_registerArray = adoptArrayPtr(new WriteBarrier<Unknown>[m_numArguments]);360 m_registerArray = std::make_unique<WriteBarrier<Unknown>[]>(m_numArguments); 361 361 m_registers = m_registerArray.get() - CallFrame::offsetFor(1) - 1; 362 362 -
trunk/Source/JavaScriptCore/runtime/Arguments.h
r154422 r156079 32 32 #include "Interpreter.h" 33 33 #include "ObjectConstructor.h" 34 #include <wtf/StdLibExtras.h> 34 35 35 36 namespace JSC { … … 82 83 void tearOff(CallFrame*); 83 84 void tearOff(CallFrame*, InlineCallFrame*); 84 bool isTornOff() const { return m_registerArray ; }85 bool isTornOff() const { return m_registerArray.get(); } 85 86 void didTearOffActivation(ExecState*, JSActivation*); 86 87 … … 132 133 133 134 WriteBarrierBase<Unknown>* m_registers; 134 OwnArrayPtr<WriteBarrier<Unknown>> m_registerArray;135 136 OwnArrayPtr<SlowArgument> m_slowArguments;135 std::unique_ptr<WriteBarrier<Unknown>[]> m_registerArray; 136 137 std::unique_ptr<SlowArgument[]> m_slowArguments; 137 138 138 139 WriteBarrier<JSFunction> m_callee; … … 161 162 if (m_slowArguments) 162 163 return; 163 m_slowArguments = adoptArrayPtr(new SlowArgument[m_numArguments]);164 m_slowArguments = std::make_unique<SlowArgument[]>(m_numArguments); 164 165 for (size_t i = 0; i < m_numArguments; ++i) { 165 166 ASSERT(m_slowArguments[i].status == SlowArgument::Normal); -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
r155734 r156079 31 31 32 32 #include "JSGlobalObject.h" 33 #include <wtf/StdLibExtras.h> 33 34 34 35 namespace JSC { … … 40 41 , m_numCacheableSlots(numCacheableSlots) 41 42 , m_jsStringsSize(propertyNameArrayData->propertyNameVector().size()) 42 , m_jsStrings(m_jsStringsSize ? adoptArrayPtr(new WriteBarrier<Unknown>[m_jsStringsSize]) : nullptr)43 , m_jsStrings(m_jsStringsSize ? std::make_unique<WriteBarrier<Unknown>[]>(m_jsStringsSize) : nullptr) 43 44 { 44 45 } -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.h
r154038 r156079 34 34 #include "Operations.h" 35 35 #include "PropertyNameArray.h" 36 #include <memory> 36 37 37 38 namespace JSC { … … 96 97 uint32_t m_jsStringsSize; 97 98 unsigned m_cachedStructureInlineCapacity; 98 OwnArrayPtr<WriteBarrier<Unknown>> m_jsStrings;99 std::unique_ptr<WriteBarrier<Unknown>[]> m_jsStrings; 99 100 }; 100 101 -
trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
r153170 r156079 35 35 #include "Register.h" 36 36 #include "SymbolTable.h" 37 #include <wtf/OwnArrayPtr.h>38 37 #include <wtf/SegmentedVector.h> 39 38 -
trunk/Source/JavaScriptCore/runtime/JSVariableObject.h
r154038 r156079 34 34 #include "Register.h" 35 35 #include "SymbolTable.h" 36 #include <wtf/OwnArrayPtr.h>37 36 38 37 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/PropertyNameArray.h
r148696 r156079 25 25 #include "Identifier.h" 26 26 #include <wtf/HashSet.h> 27 #include <wtf/OwnArrayPtr.h>28 27 #include <wtf/Vector.h> 29 28 -
trunk/Source/JavaScriptCore/runtime/RegExp.cpp
r148696 r156079 33 33 #include <string.h> 34 34 #include <wtf/Assertions.h> 35 #include <wtf/OwnArrayPtr.h>36 35 37 36 #define REGEXP_FUNC_TEST_DATA_GEN 0 -
trunk/Source/JavaScriptCore/runtime/StructureChain.h
r154038 r156079 31 31 #include "Structure.h" 32 32 33 #include <wtf/OwnArrayPtr.h>34 33 #include <wtf/PassRefPtr.h> 35 34 #include <wtf/RefCounted.h> 36 35 #include <wtf/RefPtr.h> 36 #include <wtf/StdLibExtras.h> 37 37 38 38 namespace JSC { … … 72 72 ++size; 73 73 74 m_vector = adoptArrayPtr(new WriteBarrier<Structure>[size + 1]);74 m_vector = std::make_unique<WriteBarrier<Structure>[]>(size + 1); 75 75 76 76 size_t i = 0; … … 83 83 84 84 StructureChain(VM&, Structure*); 85 OwnArrayPtr<WriteBarrier<Structure>> m_vector;85 std::unique_ptr<WriteBarrier<Structure>[]> m_vector; 86 86 }; 87 87 -
trunk/Source/JavaScriptCore/runtime/SymbolTable.h
r155711 r156079 33 33 #include "JSObject.h" 34 34 #include "Watchpoint.h" 35 #include <memory> 35 36 #include <wtf/HashTraits.h> 36 37 #include <wtf/text/StringImpl.h> … … 473 474 // 0 if we don't capture any arguments; parameterCount() in length if we do. 474 475 const SlowArgument* slowArguments() { return m_slowArguments.get(); } 475 void setSlowArguments( OwnArrayPtr<SlowArgument> slowArguments) { m_slowArguments = std::move(slowArguments); }476 void setSlowArguments(std::unique_ptr<SlowArgument[]> slowArguments) { m_slowArguments = std::move(slowArguments); } 476 477 477 478 DECLARE_EXPORT_INFO; … … 493 494 int m_captureEnd; 494 495 495 OwnArrayPtr<SlowArgument> m_slowArguments;496 std::unique_ptr<SlowArgument[]> m_slowArguments; 496 497 }; 497 498
Note: See TracChangeset
for help on using the changeset viewer.