Changeset 176553 in webkit for trunk/Source/JavaScriptCore/yarr
- Timestamp:
- Nov 27, 2014, 4:51:32 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore/yarr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.