Changeset 176553 in webkit
- Timestamp:
- Nov 27, 2014 4:51:32 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r176533 r176553 1 2014-11-27 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 3 Use std::unique_ptr instead of OwnPtr in JSC classes 4 https://bugs.webkit.org/show_bug.cgi?id=139009 5 6 Reviewed by Filip Pizlo. 7 8 As a step of using std::unique_ptr<>, this patch replaces OwnPtr with 9 std::unique_ptr<>|std::make_unique<>. 10 11 * bytecode/DFGExitProfile.cpp: 12 (JSC::DFG::ExitProfile::add): 13 * bytecode/DFGExitProfile.h: 14 * bytecode/LazyOperandValueProfile.cpp: 15 (JSC::CompressedLazyOperandValueProfileHolder::add): 16 * bytecode/LazyOperandValueProfile.h: 17 * heap/MarkedBlock.cpp: 18 (JSC::MarkedBlock::specializedSweep): 19 (JSC::MarkedBlock::stopAllocating): 20 * heap/MarkedBlock.h: 21 (JSC::MarkedBlock::clearNewlyAllocated): 22 * inspector/ContentSearchUtilities.cpp: 23 (Inspector::ContentSearchUtilities::findMagicComment): 24 * runtime/RegExp.cpp: 25 (JSC::RegExp::invalidateCode): 26 * runtime/RegExp.h: 27 * yarr/RegularExpression.cpp: 28 (JSC::Yarr::RegularExpression::Private::compile): 29 (JSC::Yarr::RegularExpression::isValid): 30 * yarr/YarrInterpreter.cpp: 31 (JSC::Yarr::ByteCompiler::compile): 32 (JSC::Yarr::ByteCompiler::regexBegin): 33 (JSC::Yarr::byteCompile): 34 * yarr/YarrInterpreter.h: 35 (JSC::Yarr::BytecodePattern::BytecodePattern): 36 1 37 2014-11-24 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 38 -
trunk/Source/JavaScriptCore/bytecode/DFGExitProfile.h
r176533 r176553 33 33 #include "ExitingJITType.h" 34 34 #include <wtf/HashSet.h> 35 #include <wtf/OwnPtr.h>36 35 #include <wtf/Vector.h> 37 36 -
trunk/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp
r163844 r176553 47 47 { 48 48 if (!m_data) 49 m_data = adoptPtr(new LazyOperandValueProfile::List());49 m_data = std::make_unique<LazyOperandValueProfile::List>(); 50 50 else { 51 51 for (unsigned i = 0; i < m_data->size(); ++i) { -
trunk/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.h
r161364 r176553 32 32 #include <wtf/HashMap.h> 33 33 #include <wtf/Noncopyable.h> 34 #include <wtf/OwnPtr.h>35 34 #include <wtf/SegmentedVector.h> 36 35 … … 162 161 private: 163 162 friend class LazyOperandValueProfileParser; 164 OwnPtr<LazyOperandValueProfile::List> m_data;163 std::unique_ptr<LazyOperandValueProfile::List> m_data; 165 164 }; 166 165 -
trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp
r171953 r176553 103 103 // otherwise we would lose information on what's currently alive. 104 104 if (sweepMode == SweepToFreeList && m_newlyAllocated) 105 m_newlyAllocated .clear();105 m_newlyAllocated = nullptr; 106 106 107 107 m_state = ((sweepMode == SweepToFreeList) ? FreeListed : Marked); … … 191 191 192 192 ASSERT(!m_newlyAllocated); 193 m_newlyAllocated = adoptPtr(new WTF::Bitmap<atomsPerBlock>());193 m_newlyAllocated = std::make_unique<WTF::Bitmap<atomsPerBlock>>(); 194 194 195 195 SetNewlyAllocatedFunctor functor(this); -
trunk/Source/JavaScriptCore/heap/MarkedBlock.h
r169284 r176553 210 210 WTF::Bitmap<atomsPerBlock, WTF::BitmapNotAtomic, uint8_t> m_rememberedSet; 211 211 #endif 212 OwnPtr<WTF::Bitmap<atomsPerBlock>> m_newlyAllocated;212 std::unique_ptr<WTF::Bitmap<atomsPerBlock>> m_newlyAllocated; 213 213 214 214 DestructorType m_destructorType; … … 401 401 { 402 402 if (m_newlyAllocated) { 403 m_newlyAllocated .clear();403 m_newlyAllocated = nullptr; 404 404 return true; 405 405 } -
trunk/Source/JavaScriptCore/runtime/RegExp.cpp
r173370 r176553 503 503 m_regExpJITCode.clear(); 504 504 #endif 505 m_regExpBytecode .clear();505 m_regExpBytecode = nullptr; 506 506 } 507 507 -
trunk/Source/JavaScriptCore/runtime/RegExp.h
r173269 r176553 131 131 Yarr::YarrCodeBlock m_regExpJITCode; 132 132 #endif 133 OwnPtr<Yarr::BytecodePattern> m_regExpBytecode;133 std::unique_ptr<Yarr::BytecodePattern> m_regExpBytecode; 134 134 }; 135 135 -
trunk/Source/JavaScriptCore/yarr/RegularExpression.cpp
r165676 r176553 1 1 2 /* 2 3 * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved. … … 45 46 46 47 unsigned m_numSubpatterns; 47 OwnPtr<JSC::Yarr::BytecodePattern> m_regExpByteCode;48 std::unique_ptr<JSC::Yarr::BytecodePattern> m_regExpByteCode; 48 49 49 50 private: … … 55 56 } 56 57 57 PassOwnPtr<JSC::Yarr::BytecodePattern> compile(const String& patternString, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode)58 std::unique_ptr<JSC::Yarr::BytecodePattern> compile(const String& patternString, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) 58 59 { 59 60 JSC::Yarr::YarrPattern pattern(patternString, (caseSensitivity == TextCaseInsensitive), (multilineMode == MultilineEnabled), &m_constructionError); … … 179 180 bool RegularExpression::isValid() const 180 181 { 181 return d->m_regExpByteCode ;182 return d->m_regExpByteCode.get(); 182 183 } 183 184 -
trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp
r174455 r176553 1473 1473 } 1474 1474 1475 PassOwnPtr<BytecodePattern> compile(BumpPointerAllocator* allocator)1475 std::unique_ptr<BytecodePattern> compile(BumpPointerAllocator* allocator) 1476 1476 { 1477 1477 regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize, m_pattern.m_body->m_alternatives[0]->onceThrough()); … … 1479 1479 regexEnd(); 1480 1480 1481 return adoptPtr(new BytecodePattern(m_bodyDisjunction.release(), m_allParenthesesInfo, m_pattern, allocator));1481 return std::make_unique<BytecodePattern>(WTF::move(m_bodyDisjunction), m_allParenthesesInfo, m_pattern, allocator); 1482 1482 } 1483 1483 … … 1779 1779 void regexBegin(unsigned numSubpatterns, unsigned callFrameSize, bool onceThrough) 1780 1780 { 1781 m_bodyDisjunction = adoptPtr(new ByteDisjunction(numSubpatterns, callFrameSize));1781 m_bodyDisjunction = std::make_unique<ByteDisjunction>(numSubpatterns, callFrameSize); 1782 1782 m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeBegin(onceThrough)); 1783 1783 m_bodyDisjunction->terms[0].frameLocation = 0; … … 1921 1921 private: 1922 1922 YarrPattern& m_pattern; 1923 OwnPtr<ByteDisjunction> m_bodyDisjunction;1923 std::unique_ptr<ByteDisjunction> m_bodyDisjunction; 1924 1924 unsigned m_currentAlternativeIndex; 1925 1925 Vector<ParenthesesStackEntry> m_parenthesesStack; … … 1927 1927 }; 1928 1928 1929 PassOwnPtr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator)1929 std::unique_ptr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator) 1930 1930 { 1931 1931 return ByteCompiler(pattern).compile(allocator); -
trunk/Source/JavaScriptCore/yarr/YarrInterpreter.h
r163310 r176553 337 337 WTF_MAKE_FAST_ALLOCATED; 338 338 public: 339 BytecodePattern( PassOwnPtr<ByteDisjunction> body, Vector<OwnPtr<ByteDisjunction>>& parenthesesInfoToAdopt, YarrPattern& pattern, BumpPointerAllocator* allocator)340 : m_body( body)339 BytecodePattern(std::unique_ptr<ByteDisjunction> body, Vector<OwnPtr<ByteDisjunction>>& parenthesesInfoToAdopt, YarrPattern& pattern, BumpPointerAllocator* allocator) 340 : m_body(WTF::move(body)) 341 341 , m_ignoreCase(pattern.m_ignoreCase) 342 342 , m_multiline(pattern.m_multiline) … … 355 355 } 356 356 357 OwnPtr<ByteDisjunction> m_body;357 std::unique_ptr<ByteDisjunction> m_body; 358 358 bool m_ignoreCase; 359 359 bool m_multiline; … … 370 370 }; 371 371 372 JS_EXPORT_PRIVATE PassOwnPtr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*);372 JS_EXPORT_PRIVATE std::unique_ptr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*); 373 373 JS_EXPORT_PRIVATE unsigned interpret(BytecodePattern*, const String& input, unsigned start, unsigned* output); 374 374 unsigned interpret(BytecodePattern*, const LChar* input, unsigned length, unsigned start, unsigned* output);
Note: See TracChangeset
for help on using the changeset viewer.