Ignore:
Timestamp:
Nov 27, 2014, 4:51:32 PM (10 years ago)
Author:
[email protected]
Message:

Use std::unique_ptr instead of OwnPtr in JSC classes
https://bugs.webkit.org/show_bug.cgi?id=139009

Reviewed by Filip Pizlo.

As a step of using std::unique_ptr<>, this patch replaces OwnPtr with
std::unique_ptr<>|std::make_unique<>.

  • bytecode/DFGExitProfile.cpp:

(JSC::DFG::ExitProfile::add):

  • bytecode/DFGExitProfile.h:
  • bytecode/LazyOperandValueProfile.cpp:

(JSC::CompressedLazyOperandValueProfileHolder::add):

  • bytecode/LazyOperandValueProfile.h:
  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::specializedSweep):
(JSC::MarkedBlock::stopAllocating):

  • heap/MarkedBlock.h:

(JSC::MarkedBlock::clearNewlyAllocated):

  • inspector/ContentSearchUtilities.cpp:

(Inspector::ContentSearchUtilities::findMagicComment):

  • runtime/RegExp.cpp:

(JSC::RegExp::invalidateCode):

  • runtime/RegExp.h:
  • yarr/RegularExpression.cpp:

(JSC::Yarr::RegularExpression::Private::compile):
(JSC::Yarr::RegularExpression::isValid):

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::ByteCompiler::compile):
(JSC::Yarr::ByteCompiler::regexBegin):
(JSC::Yarr::byteCompile):

  • yarr/YarrInterpreter.h:

(JSC::Yarr::BytecodePattern::BytecodePattern):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp

    r174455 r176553  
    14731473    }
    14741474
    1475     PassOwnPtr<BytecodePattern> compile(BumpPointerAllocator* allocator)
     1475    std::unique_ptr<BytecodePattern> compile(BumpPointerAllocator* allocator)
    14761476    {
    14771477        regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize, m_pattern.m_body->m_alternatives[0]->onceThrough());
     
    14791479        regexEnd();
    14801480
    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);
    14821482    }
    14831483
     
    17791779    void regexBegin(unsigned numSubpatterns, unsigned callFrameSize, bool onceThrough)
    17801780    {
    1781         m_bodyDisjunction = adoptPtr(new ByteDisjunction(numSubpatterns, callFrameSize));
     1781        m_bodyDisjunction = std::make_unique<ByteDisjunction>(numSubpatterns, callFrameSize);
    17821782        m_bodyDisjunction->terms.append(ByteTerm::BodyAlternativeBegin(onceThrough));
    17831783        m_bodyDisjunction->terms[0].frameLocation = 0;
     
    19211921private:
    19221922    YarrPattern& m_pattern;
    1923     OwnPtr<ByteDisjunction> m_bodyDisjunction;
     1923    std::unique_ptr<ByteDisjunction> m_bodyDisjunction;
    19241924    unsigned m_currentAlternativeIndex;
    19251925    Vector<ParenthesesStackEntry> m_parenthesesStack;
     
    19271927};
    19281928
    1929 PassOwnPtr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator)
     1929std::unique_ptr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator)
    19301930{
    19311931    return ByteCompiler(pattern).compile(allocator);
Note: See TracChangeset for help on using the changeset viewer.