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/runtime/SmallStrings.cpp

    r169316 r176508  
    114114{
    115115    if (!m_storage)
    116         m_storage = adoptPtr(new SmallStringsStorage);
     116        m_storage = std::make_unique<SmallStringsStorage>();
    117117    ASSERT(!m_singleCharacterStrings[character]);
    118118    m_singleCharacterStrings[character] = JSString::createHasOtherOwner(*vm, PassRefPtr<StringImpl>(m_storage->rep(character)));
     
    122122{
    123123    if (!m_storage)
    124         m_storage = adoptPtr(new SmallStringsStorage);
     124        m_storage = std::make_unique<SmallStringsStorage>();
    125125    return m_storage->rep(character);
    126126}
Note: See TracChangeset for help on using the changeset viewer.