Ignore:
Timestamp:
Nov 22, 2014, 8:37:15 PM (11 years ago)
Author:
[email protected]
Message:

Clean up OwnPtr and PassOwnPtr in some of JS classes
https://bugs.webkit.org/show_bug.cgi?id=138724

Reviewed by Filip Pizlo.

As a step to use std::unique_ptr<> and std::make_unique<>, this patch replaces
OwnPtr with std::unique_ptr<>. Besides create() factory function is removed as well.

  • builtins/BuiltinExecutables.h:

(JSC::BuiltinExecutables::create): Deleted.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::createRareDataIfNecessary):

  • bytecode/StructureStubInfo.h:
  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedCodeBlock::hasRareData):
(JSC::UnlinkedCodeBlock::createRareDataIfNecessary):

  • runtime/CodeCache.cpp:

(JSC::CodeCache::getGlobalCodeBlock):

  • runtime/CodeCache.h:

(JSC::CodeCache::create): Deleted.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::clearRareData):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::createRareDataIfNeeded):

  • runtime/RegExpConstructor.h:
  • runtime/SmallStrings.cpp:

(JSC::SmallStrings::createSingleCharacterString):
(JSC::SmallStrings::singleCharacterStringRep):

  • runtime/SmallStrings.h:
  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r176479 r176508  
    955955    bool isKnownToBeLiveDuringGC(); // Will only return valid results when called during GC. Assumes that you've already established that the owner executable is live.
    956956
     957    struct RareData {
     958        WTF_MAKE_FAST_ALLOCATED;
     959    public:
     960        Vector<HandlerInfo> m_exceptionHandlers;
     961
     962        // Buffers used for large array literals
     963        Vector<Vector<JSValue>> m_constantBuffers;
     964
     965        // Jump Tables
     966        Vector<SimpleJumpTable> m_switchJumpTables;
     967        Vector<StringJumpTable> m_stringSwitchJumpTables;
     968
     969        EvalCodeCache m_evalCodeCache;
     970    };
    957971
    958972protected:
     
    10221036    {
    10231037        if (!m_rareData)
    1024             m_rareData = adoptPtr(new RareData);
     1038            m_rareData = std::make_unique<RareData>();
    10251039    }
    10261040
     
    11051119    std::unique_ptr<BytecodeLivenessAnalysis> m_livenessAnalysis;
    11061120
    1107     struct RareData {
    1108         WTF_MAKE_FAST_ALLOCATED;
    1109     public:
    1110         Vector<HandlerInfo> m_exceptionHandlers;
    1111 
    1112         // Buffers used for large array literals
    1113         Vector<Vector<JSValue>> m_constantBuffers;
    1114 
    1115         // Jump Tables
    1116         Vector<SimpleJumpTable> m_switchJumpTables;
    1117         Vector<StringJumpTable> m_stringSwitchJumpTables;
    1118 
    1119         EvalCodeCache m_evalCodeCache;
    1120     };
    1121 #if COMPILER(MSVC)
    1122     friend void WTF::deleteOwnedPtr<RareData>(RareData*);
    1123 #endif
    1124     OwnPtr<RareData> m_rareData;
     1121    std::unique_ptr<RareData> m_rareData;
    11251122#if ENABLE(JIT)
    11261123    DFG::CapabilityLevel m_capabilityLevelState;
Note: See TracChangeset for help on using the changeset viewer.