| Differences between
and this patch
- a/Source/JavaScriptCore/ChangeLog +43 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2014-12-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        Final clean up OwnPtr in JSC - runtime, ftl, and tool directories
4
        https://bugs.webkit.org/show_bug.cgi?id=139532
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Final remove OwnPtr, PassOwnPtr in runtime, ftl, and tools directories of JSC.
9
10
        * builtins/BuiltinExecutables.h:
11
        * bytecode/CodeBlock.h:
12
        * bytecode/UnlinkedCodeBlock.cpp:
13
        (JSC::generateFunctionCodeBlock):
14
        * ftl/FTLAbstractHeap.cpp:
15
        (JSC::FTL::IndexedAbstractHeap::atSlow):
16
        * ftl/FTLAbstractHeap.h:
17
        * ftl/FTLCompile.cpp:
18
        (JSC::FTL::mmAllocateDataSection):
19
        * ftl/FTLJITFinalizer.h:
20
        * jsc.cpp:
21
        (jscmain):
22
        * parser/Lexer.h:
23
        * runtime/PropertyMapHashTable.h:
24
        (JSC::PropertyTable::clearDeletedOffsets):
25
        (JSC::PropertyTable::addDeletedOffset):
26
        * runtime/PropertyTable.cpp:
27
        (JSC::PropertyTable::PropertyTable):
28
        * runtime/RegExpObject.cpp:
29
        * runtime/SmallStrings.cpp:
30
        * runtime/Structure.cpp:
31
        * runtime/StructureIDTable.cpp:
32
        (JSC::StructureIDTable::StructureIDTable):
33
        (JSC::StructureIDTable::resize):
34
        * runtime/StructureIDTable.h:
35
        * runtime/StructureTransitionTable.h:
36
        * runtime/VM.cpp:
37
        (JSC::VM::VM):
38
        (JSC::VM::~VM):
39
        * runtime/VM.h:
40
        * tools/CodeProfile.h:
41
        (JSC::CodeProfile::CodeProfile):
42
        (JSC::CodeProfile::addChild):
43
1
2014-12-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
44
2014-12-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
45
3
        Use std::unique_ptr instead of OwnPtr in JSC - heap, jit, runtime, and parser directories
46
        Use std::unique_ptr instead of OwnPtr in JSC - heap, jit, runtime, and parser directories
- a/Source/JavaScriptCore/builtins/BuiltinExecutables.h -1 lines
Lines 29-35 a/Source/JavaScriptCore/builtins/BuiltinExecutables.h_sec1
29
#include "JSCBuiltins.h"
29
#include "JSCBuiltins.h"
30
#include "SourceCode.h"
30
#include "SourceCode.h"
31
#include "Weak.h"
31
#include "Weak.h"
32
#include <wtf/PassOwnPtr.h>
33
32
34
namespace JSC {
33
namespace JSC {
35
34
- a/Source/JavaScriptCore/bytecode/CodeBlock.h -1 lines
Lines 70-76 a/Source/JavaScriptCore/bytecode/CodeBlock.h_sec1
70
#include "Watchpoint.h"
70
#include "Watchpoint.h"
71
#include <wtf/Bag.h>
71
#include <wtf/Bag.h>
72
#include <wtf/FastMalloc.h>
72
#include <wtf/FastMalloc.h>
73
#include <wtf/PassOwnPtr.h>
74
#include <wtf/RefCountedArray.h>
73
#include <wtf/RefCountedArray.h>
75
#include <wtf/RefPtr.h>
74
#include <wtf/RefPtr.h>
76
#include <wtf/SegmentedVector.h>
75
#include <wtf/SegmentedVector.h>
- a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp -1 / +1 lines
Lines 62-68 static UnlinkedFunctionCodeBlock* generateFunctionCodeBlock(VM& vm, UnlinkedFunc a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp_sec1
62
    executable->recordParse(function->features(), function->hasCapturedVariables());
62
    executable->recordParse(function->features(), function->hasCapturedVariables());
63
    
63
    
64
    UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&vm, FunctionCode, ExecutableInfo(function->needsActivation(), function->usesEval(), function->isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction));
64
    UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&vm, FunctionCode, ExecutableInfo(function->needsActivation(), function->usesEval(), function->isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction));
65
    OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(vm, function.get(), result, debuggerMode, profilerMode)));
65
    auto generator(std::make_unique<BytecodeGenerator>(vm, function.get(), result, debuggerMode, profilerMode));
66
    error = generator->generate();
66
    error = generator->generate();
67
    if (error.m_type != ParserError::ErrorNone)
67
    if (error.m_type != ParserError::ErrorNone)
68
        return 0;
68
        return 0;
- a/Source/JavaScriptCore/ftl/FTLAbstractHeap.cpp -1 / +1 lines
Lines 102-108 const AbstractField& IndexedAbstractHeap::atSlow(ptrdiff_t index) a/Source/JavaScriptCore/ftl/FTLAbstractHeap.cpp_sec1
102
    ASSERT(static_cast<size_t>(index) >= m_smallIndices.size());
102
    ASSERT(static_cast<size_t>(index) >= m_smallIndices.size());
103
    
103
    
104
    if (UNLIKELY(!m_largeIndices))
104
    if (UNLIKELY(!m_largeIndices))
105
        m_largeIndices = adoptPtr(new MapType());
105
        m_largeIndices = std::make_unique<MapType>();
106
106
107
    std::unique_ptr<AbstractField>& field = m_largeIndices->add(index, nullptr).iterator->value;
107
    std::unique_ptr<AbstractField>& field = m_largeIndices->add(index, nullptr).iterator->value;
108
    if (!field) {
108
    if (!field) {
- a/Source/JavaScriptCore/ftl/FTLAbstractHeap.h -2 / +1 lines
Lines 34-40 a/Source/JavaScriptCore/ftl/FTLAbstractHeap.h_sec1
34
#include <wtf/FastMalloc.h>
34
#include <wtf/FastMalloc.h>
35
#include <wtf/HashMap.h>
35
#include <wtf/HashMap.h>
36
#include <wtf/Noncopyable.h>
36
#include <wtf/Noncopyable.h>
37
#include <wtf/OwnPtr.h>
38
#include <wtf/Vector.h>
37
#include <wtf/Vector.h>
39
#include <wtf/text/CString.h>
38
#include <wtf/text/CString.h>
40
39
Lines 183-189 private: a/Source/JavaScriptCore/ftl/FTLAbstractHeap.h_sec2
183
    };
182
    };
184
    typedef HashMap<ptrdiff_t, std::unique_ptr<AbstractField>, WTF::IntHash<ptrdiff_t>, WithoutZeroOrOneHashTraits> MapType;
183
    typedef HashMap<ptrdiff_t, std::unique_ptr<AbstractField>, WTF::IntHash<ptrdiff_t>, WithoutZeroOrOneHashTraits> MapType;
185
    
184
    
186
    OwnPtr<MapType> m_largeIndices;
185
    std::unique_ptr<MapType> m_largeIndices;
187
    Vector<CString, 16> m_largeIndexNames;
186
    Vector<CString, 16> m_largeIndexNames;
188
};
187
};
189
188
- a/Source/JavaScriptCore/ftl/FTLCompile.cpp -5 / +4 lines
Lines 322-329 static void fixFunctionBasedOnStackMaps( a/Source/JavaScriptCore/ftl/FTLCompile.cpp_sec1
322
        RELEASE_ASSERT(state.finalizer->osrExit.size());
322
        RELEASE_ASSERT(state.finalizer->osrExit.size());
323
        RELEASE_ASSERT(didSeeUnwindInfo);
323
        RELEASE_ASSERT(didSeeUnwindInfo);
324
        
324
        
325
        OwnPtr<LinkBuffer> linkBuffer = adoptPtr(new LinkBuffer(
325
        auto linkBuffer = std::make_unique<LinkBuffer>(
326
            vm, exitThunkGenerator, codeBlock, JITCompilationMustSucceed));
326
            vm, exitThunkGenerator, codeBlock, JITCompilationMustSucceed);
327
        
327
        
328
        RELEASE_ASSERT(state.finalizer->osrExit.size() == state.jitCode->osrExit.size());
328
        RELEASE_ASSERT(state.finalizer->osrExit.size() == state.jitCode->osrExit.size());
329
        
329
        
Lines 359-365 static void fixFunctionBasedOnStackMaps( a/Source/JavaScriptCore/ftl/FTLCompile.cpp_sec2
359
            }
359
            }
360
        }
360
        }
361
        
361
        
362
        state.finalizer->exitThunksLinkBuffer = linkBuffer.release();
362
        state.finalizer->exitThunksLinkBuffer = WTF::move(linkBuffer);
363
    }
363
    }
364
364
365
    if (!state.getByIds.isEmpty() || !state.putByIds.isEmpty() || !state.checkIns.isEmpty()) {
365
    if (!state.getByIds.isEmpty() || !state.putByIds.isEmpty() || !state.checkIns.isEmpty()) {
Lines 483-490 static void fixFunctionBasedOnStackMaps( a/Source/JavaScriptCore/ftl/FTLCompile.cpp_sec3
483
        exceptionTarget.link(&slowPathJIT);
483
        exceptionTarget.link(&slowPathJIT);
484
        MacroAssembler::Jump exceptionJump = slowPathJIT.jump();
484
        MacroAssembler::Jump exceptionJump = slowPathJIT.jump();
485
        
485
        
486
        state.finalizer->sideCodeLinkBuffer = adoptPtr(
486
        state.finalizer->sideCodeLinkBuffer = std::make_unique<LinkBuffer>(vm, slowPathJIT, codeBlock, JITCompilationMustSucceed);
487
            new LinkBuffer(vm, slowPathJIT, codeBlock, JITCompilationMustSucceed));
488
        state.finalizer->sideCodeLinkBuffer->link(
487
        state.finalizer->sideCodeLinkBuffer->link(
489
            exceptionJump, state.finalizer->handleExceptionsLinkBuffer->entrypoint());
488
            exceptionJump, state.finalizer->handleExceptionsLinkBuffer->entrypoint());
490
        
489
        
- a/Source/JavaScriptCore/ftl/FTLJITFinalizer.h -2 / +2 lines
Lines 48-56 public: a/Source/JavaScriptCore/ftl/FTLJITFinalizer.h_sec1
48
    bool finalize() override;
48
    bool finalize() override;
49
    bool finalizeFunction() override;
49
    bool finalizeFunction() override;
50
50
51
    OwnPtr<LinkBuffer> exitThunksLinkBuffer;
51
    std::unique_ptr<LinkBuffer> exitThunksLinkBuffer;
52
    std::unique_ptr<LinkBuffer> entrypointLinkBuffer;
52
    std::unique_ptr<LinkBuffer> entrypointLinkBuffer;
53
    OwnPtr<LinkBuffer> sideCodeLinkBuffer;
53
    std::unique_ptr<LinkBuffer> sideCodeLinkBuffer;
54
    std::unique_ptr<LinkBuffer> handleExceptionsLinkBuffer;
54
    std::unique_ptr<LinkBuffer> handleExceptionsLinkBuffer;
55
    Vector<SlowPathCall> slowPathCalls; // Calls inside the side code.
55
    Vector<SlowPathCall> slowPathCalls; // Calls inside the side code.
56
    Vector<OSRExitCompilationInfo> osrExit;
56
    Vector<OSRExitCompilationInfo> osrExit;
- a/Source/JavaScriptCore/jsc.cpp -1 / +1 lines
Lines 1451-1457 int jscmain(int argc, char** argv) a/Source/JavaScriptCore/jsc.cpp_sec1
1451
        JSLockHolder locker(vm);
1451
        JSLockHolder locker(vm);
1452
1452
1453
        if (options.m_profile && !vm->m_perBytecodeProfiler)
1453
        if (options.m_profile && !vm->m_perBytecodeProfiler)
1454
            vm->m_perBytecodeProfiler = adoptPtr(new Profiler::Database(*vm));
1454
            vm->m_perBytecodeProfiler = std::make_unique<Profiler::Database>(*vm);
1455
    
1455
    
1456
        GlobalObject* globalObject = GlobalObject::create(*vm, GlobalObject::createStructure(*vm, jsNull()), options.m_arguments);
1456
        GlobalObject* globalObject = GlobalObject::create(*vm, GlobalObject::createStructure(*vm, jsNull()), options.m_arguments);
1457
        bool success = runWithScripts(globalObject, options.m_scripts, options.m_dump);
1457
        bool success = runWithScripts(globalObject, options.m_scripts, options.m_dump);
- a/Source/JavaScriptCore/parser/Lexer.h -3 / +3 lines
Lines 44-50 public: a/Source/JavaScriptCore/parser/Lexer.h_sec1
44
    {
44
    {
45
        return m_keywordTable.entry(ident);
45
        return m_keywordTable.entry(ident);
46
    }
46
    }
47
    
47
48
    explicit Keywords(VM&);
49
48
    ~Keywords()
50
    ~Keywords()
49
    {
51
    {
50
        m_keywordTable.deleteTable();
52
        m_keywordTable.deleteTable();
Lines 53-60 public: a/Source/JavaScriptCore/parser/Lexer.h_sec2
53
private:
55
private:
54
    friend class VM;
56
    friend class VM;
55
    
57
    
56
    explicit Keywords(VM&);
57
    
58
    VM& m_vm;
58
    VM& m_vm;
59
    const HashTable m_keywordTable;
59
    const HashTable m_keywordTable;
60
};
60
};
- a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h -4 / +3 lines
Lines 28-34 a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h_sec1
28
#include <wtf/CryptographicallyRandomNumber.h>
28
#include <wtf/CryptographicallyRandomNumber.h>
29
#include <wtf/HashTable.h>
29
#include <wtf/HashTable.h>
30
#include <wtf/MathExtras.h>
30
#include <wtf/MathExtras.h>
31
#include <wtf/PassOwnPtr.h>
32
#include <wtf/Vector.h>
31
#include <wtf/Vector.h>
33
#include <wtf/text/AtomicStringImpl.h>
32
#include <wtf/text/AtomicStringImpl.h>
34
33
Lines 243-249 private: a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h_sec2
243
    unsigned* m_index;
242
    unsigned* m_index;
244
    unsigned m_keyCount;
243
    unsigned m_keyCount;
245
    unsigned m_deletedCount;
244
    unsigned m_deletedCount;
246
    OwnPtr< Vector<PropertyOffset>> m_deletedOffsets;
245
    std::unique_ptr< Vector<PropertyOffset>> m_deletedOffsets;
247
246
248
    static const unsigned MinimumTableSize = 16;
247
    static const unsigned MinimumTableSize = 16;
249
    static const unsigned EmptyEntryIndex = 0;
248
    static const unsigned EmptyEntryIndex = 0;
Lines 421-427 inline unsigned PropertyTable::propertyStorageSize() const a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h_sec3
421
420
422
inline void PropertyTable::clearDeletedOffsets()
421
inline void PropertyTable::clearDeletedOffsets()
423
{
422
{
424
    m_deletedOffsets.clear();
423
    m_deletedOffsets = nullptr;
425
}
424
}
426
425
427
inline bool PropertyTable::hasDeletedOffset()
426
inline bool PropertyTable::hasDeletedOffset()
Lines 439-445 inline PropertyOffset PropertyTable::getDeletedOffset() a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h_sec4
439
inline void PropertyTable::addDeletedOffset(PropertyOffset offset)
438
inline void PropertyTable::addDeletedOffset(PropertyOffset offset)
440
{
439
{
441
    if (!m_deletedOffsets)
440
    if (!m_deletedOffsets)
442
        m_deletedOffsets = adoptPtr(new Vector<PropertyOffset>);
441
        m_deletedOffsets = std::make_unique<Vector<PropertyOffset>>();
443
    m_deletedOffsets->append(offset);
442
    m_deletedOffsets->append(offset);
444
}
443
}
445
444
- a/Source/JavaScriptCore/runtime/PropertyTable.cpp -2 / +2 lines
Lines 88-94 PropertyTable::PropertyTable(VM& vm, const PropertyTable& other) a/Source/JavaScriptCore/runtime/PropertyTable.cpp_sec1
88
    // Copy the m_deletedOffsets vector.
88
    // Copy the m_deletedOffsets vector.
89
    Vector<PropertyOffset>* otherDeletedOffsets = other.m_deletedOffsets.get();
89
    Vector<PropertyOffset>* otherDeletedOffsets = other.m_deletedOffsets.get();
90
    if (otherDeletedOffsets)
90
    if (otherDeletedOffsets)
91
        m_deletedOffsets = adoptPtr(new Vector<PropertyOffset>(*otherDeletedOffsets));
91
        m_deletedOffsets = std::make_unique<Vector<PropertyOffset>>(*otherDeletedOffsets);
92
}
92
}
93
93
94
PropertyTable::PropertyTable(VM& vm, unsigned initialCapacity, const PropertyTable& other)
94
PropertyTable::PropertyTable(VM& vm, unsigned initialCapacity, const PropertyTable& other)
Lines 112-118 PropertyTable::PropertyTable(VM& vm, unsigned initialCapacity, const PropertyTab a/Source/JavaScriptCore/runtime/PropertyTable.cpp_sec2
112
    // Copy the m_deletedOffsets vector.
112
    // Copy the m_deletedOffsets vector.
113
    Vector<PropertyOffset>* otherDeletedOffsets = other.m_deletedOffsets.get();
113
    Vector<PropertyOffset>* otherDeletedOffsets = other.m_deletedOffsets.get();
114
    if (otherDeletedOffsets)
114
    if (otherDeletedOffsets)
115
        m_deletedOffsets = adoptPtr(new Vector<PropertyOffset>(*otherDeletedOffsets));
115
        m_deletedOffsets = std::make_unique<Vector<PropertyOffset>>(*otherDeletedOffsets);
116
}
116
}
117
117
118
void PropertyTable::destroy(JSCell* cell)
118
void PropertyTable::destroy(JSCell* cell)
- a/Source/JavaScriptCore/runtime/RegExpObject.cpp -1 lines
Lines 34-40 a/Source/JavaScriptCore/runtime/RegExpObject.cpp_sec1
34
#include "RegExpConstructor.h"
34
#include "RegExpConstructor.h"
35
#include "RegExpMatchesArray.h"
35
#include "RegExpMatchesArray.h"
36
#include "RegExpPrototype.h"
36
#include "RegExpPrototype.h"
37
#include <wtf/PassOwnPtr.h>
38
#include <wtf/text/StringBuilder.h>
37
#include <wtf/text/StringBuilder.h>
39
38
40
namespace JSC {
39
namespace JSC {
- a/Source/JavaScriptCore/runtime/SmallStrings.cpp -1 lines
Lines 31-37 a/Source/JavaScriptCore/runtime/SmallStrings.cpp_sec1
31
#include "JSString.h"
31
#include "JSString.h"
32
#include "JSCInlines.h"
32
#include "JSCInlines.h"
33
#include <wtf/Noncopyable.h>
33
#include <wtf/Noncopyable.h>
34
#include <wtf/PassOwnPtr.h>
35
#include <wtf/text/StringImpl.h>
34
#include <wtf/text/StringImpl.h>
36
35
37
namespace JSC {
36
namespace JSC {
- a/Source/JavaScriptCore/runtime/Structure.cpp +1 lines
Lines 37-42 a/Source/JavaScriptCore/runtime/Structure.cpp_sec1
37
#include "StructureChain.h"
37
#include "StructureChain.h"
38
#include "StructureRareDataInlines.h"
38
#include "StructureRareDataInlines.h"
39
#include <wtf/CommaPrinter.h>
39
#include <wtf/CommaPrinter.h>
40
#include <wtf/PassOwnPtr.h>
40
#include <wtf/ProcessID.h>
41
#include <wtf/ProcessID.h>
41
#include <wtf/RefCountedLeakCounter.h>
42
#include <wtf/RefCountedLeakCounter.h>
42
#include <wtf/RefPtr.h>
43
#include <wtf/RefPtr.h>
- a/Source/JavaScriptCore/runtime/StructureIDTable.cpp -3 / +2 lines
Lines 29-41 a/Source/JavaScriptCore/runtime/StructureIDTable.cpp_sec1
29
#include <limits.h>
29
#include <limits.h>
30
#include <wtf/Atomics.h>
30
#include <wtf/Atomics.h>
31
#include <wtf/DataLog.h>
31
#include <wtf/DataLog.h>
32
#include <wtf/PassOwnPtr.h>
33
32
34
namespace JSC {
33
namespace JSC {
35
34
36
StructureIDTable::StructureIDTable()
35
StructureIDTable::StructureIDTable()
37
    : m_firstFreeOffset(0)
36
    : m_firstFreeOffset(0)
38
    , m_table(adoptPtr(new StructureOrOffset[s_initialSize]))
37
    , m_table(std::make_unique<StructureOrOffset[]>(s_initialSize))
39
    , m_size(0)
38
    , m_size(0)
40
    , m_capacity(s_initialSize)
39
    , m_capacity(s_initialSize)
41
{
40
{
Lines 47-53 StructureIDTable::StructureIDTable() a/Source/JavaScriptCore/runtime/StructureIDTable.cpp_sec2
47
void StructureIDTable::resize(size_t newCapacity)
46
void StructureIDTable::resize(size_t newCapacity)
48
{
47
{
49
    // Create the new table.
48
    // Create the new table.
50
    OwnPtr<StructureOrOffset> newTable = adoptPtr(new StructureOrOffset[newCapacity]);
49
    auto newTable = std::make_unique<StructureOrOffset[]>(newCapacity);
51
50
52
    // Copy the contents of the old table to the new table.
51
    // Copy the contents of the old table to the new table.
53
    memcpy(newTable.get(), table(), m_capacity * sizeof(StructureOrOffset));
52
    memcpy(newTable.get(), table(), m_capacity * sizeof(StructureOrOffset));
- a/Source/JavaScriptCore/runtime/StructureIDTable.h -3 / +2 lines
Lines 27-33 a/Source/JavaScriptCore/runtime/StructureIDTable.h_sec1
27
#define StructureIDTable_h
27
#define StructureIDTable_h
28
28
29
#include "UnusedPointer.h"
29
#include "UnusedPointer.h"
30
#include <wtf/OwnPtr.h>
31
#include <wtf/Vector.h>
30
#include <wtf/Vector.h>
32
31
33
namespace JSC {
32
namespace JSC {
Lines 67-76 private: a/Source/JavaScriptCore/runtime/StructureIDTable.h_sec2
67
    
66
    
68
    static const size_t s_initialSize = 256;
67
    static const size_t s_initialSize = 256;
69
68
70
    Vector<OwnPtr<StructureOrOffset>> m_oldTables;
69
    Vector<std::unique_ptr<StructureOrOffset>> m_oldTables;
71
70
72
    uint32_t m_firstFreeOffset;
71
    uint32_t m_firstFreeOffset;
73
    OwnPtr<StructureOrOffset> m_table;
72
    std::unique_ptr<StructureOrOffset[]> m_table;
74
73
75
    size_t m_size;
74
    size_t m_size;
76
    size_t m_capacity;
75
    size_t m_capacity;
- a/Source/JavaScriptCore/runtime/StructureTransitionTable.h -1 lines
Lines 29-35 a/Source/JavaScriptCore/runtime/StructureTransitionTable.h_sec1
29
#include "IndexingType.h"
29
#include "IndexingType.h"
30
#include "WeakGCMap.h"
30
#include "WeakGCMap.h"
31
#include <wtf/HashFunctions.h>
31
#include <wtf/HashFunctions.h>
32
#include <wtf/OwnPtr.h>
33
#include <wtf/text/AtomicStringImpl.h>
32
#include <wtf/text/AtomicStringImpl.h>
34
33
35
namespace JSC {
34
namespace JSC {
- a/Source/JavaScriptCore/runtime/VM.cpp -6 / +6 lines
Lines 153-159 VM::VM(VMType vmType, HeapType heapType) a/Source/JavaScriptCore/runtime/VM.cpp_sec1
153
    , m_atomicStringTable(vmType == Default ? wtfThreadData().atomicStringTable() : new AtomicStringTable)
153
    , m_atomicStringTable(vmType == Default ? wtfThreadData().atomicStringTable() : new AtomicStringTable)
154
    , propertyNames(nullptr)
154
    , propertyNames(nullptr)
155
    , emptyList(new MarkedArgumentBuffer)
155
    , emptyList(new MarkedArgumentBuffer)
156
    , keywords(adoptPtr(new Keywords(*this)))
156
    , keywords(std::make_unique<Keywords>(*this))
157
    , interpreter(0)
157
    , interpreter(0)
158
    , jsArrayClassInfo(JSArray::info())
158
    , jsArrayClassInfo(JSArray::info())
159
    , jsFinalObjectClassInfo(JSFinalObject::info())
159
    , jsFinalObjectClassInfo(JSFinalObject::info())
Lines 241-247 VM::VM(VMType vmType, HeapType heapType) a/Source/JavaScriptCore/runtime/VM.cpp_sec2
241
    wtfThreadData().setCurrentAtomicStringTable(existingEntryAtomicStringTable);
241
    wtfThreadData().setCurrentAtomicStringTable(existingEntryAtomicStringTable);
242
242
243
#if ENABLE(JIT)
243
#if ENABLE(JIT)
244
    jitStubs = adoptPtr(new JITThunks());
244
    jitStubs = std::make_unique<JITThunks>();
245
    arityCheckFailReturnThunks = std::make_unique<ArityCheckFailReturnThunks>();
245
    arityCheckFailReturnThunks = std::make_unique<ArityCheckFailReturnThunks>();
246
#endif
246
#endif
247
    arityCheckData = std::make_unique<CommonSlowPaths::ArityCheckData>();
247
    arityCheckData = std::make_unique<CommonSlowPaths::ArityCheckData>();
Lines 261-267 VM::VM(VMType vmType, HeapType heapType) a/Source/JavaScriptCore/runtime/VM.cpp_sec3
261
    LLInt::Data::performAssertions(*this);
261
    LLInt::Data::performAssertions(*this);
262
    
262
    
263
    if (Options::enableProfiler()) {
263
    if (Options::enableProfiler()) {
264
        m_perBytecodeProfiler = adoptPtr(new Profiler::Database(*this));
264
        m_perBytecodeProfiler = std::make_unique<Profiler::Database>(*this);
265
265
266
        StringPrintStream pathOut;
266
        StringPrintStream pathOut;
267
        const char* profilerPath = getenv("JSC_PROFILER_PATH");
267
        const char* profilerPath = getenv("JSC_PROFILER_PATH");
Lines 273-279 VM::VM(VMType vmType, HeapType heapType) a/Source/JavaScriptCore/runtime/VM.cpp_sec4
273
273
274
#if ENABLE(DFG_JIT)
274
#if ENABLE(DFG_JIT)
275
    if (canUseJIT())
275
    if (canUseJIT())
276
        dfgState = adoptPtr(new DFG::LongLivedState());
276
        dfgState = std::make_unique<DFG::LongLivedState>();
277
#endif
277
#endif
278
    
278
    
279
    // Initialize this last, as a free way of asserting that VM initialization itself
279
    // Initialize this last, as a free way of asserting that VM initialization itself
Lines 303-310 VM::~VM() a/Source/JavaScriptCore/runtime/VM.cpp_sec5
303
#endif // ENABLE(DFG_JIT)
303
#endif // ENABLE(DFG_JIT)
304
    
304
    
305
    // Clear this first to ensure that nobody tries to remove themselves from it.
305
    // Clear this first to ensure that nobody tries to remove themselves from it.
306
    m_perBytecodeProfiler.clear();
306
    m_perBytecodeProfiler = nullptr;
307
    
307
308
    ASSERT(m_apiLock->currentThreadIsHoldingLock());
308
    ASSERT(m_apiLock->currentThreadIsHoldingLock());
309
    m_apiLock->willDestroyVM(this);
309
    m_apiLock->willDestroyVM(this);
310
    heap.lastChanceToFinalize();
310
    heap.lastChanceToFinalize();
- a/Source/JavaScriptCore/runtime/VM.h -4 / +4 lines
Lines 235-241 public: a/Source/JavaScriptCore/runtime/VM.h_sec1
235
    Heap heap;
235
    Heap heap;
236
236
237
#if ENABLE(DFG_JIT)
237
#if ENABLE(DFG_JIT)
238
    OwnPtr<DFG::LongLivedState> dfgState;
238
    std::unique_ptr<DFG::LongLivedState> dfgState;
239
#endif // ENABLE(DFG_JIT)
239
#endif // ENABLE(DFG_JIT)
240
240
241
    std::unique_ptr<CallEdgeLog> callEdgeLog;
241
    std::unique_ptr<CallEdgeLog> callEdgeLog;
Lines 328-337 public: a/Source/JavaScriptCore/runtime/VM.h_sec2
328
328
329
    typedef HashMap<RefPtr<SourceProvider>, RefPtr<SourceProviderCache>> SourceProviderCacheMap;
329
    typedef HashMap<RefPtr<SourceProvider>, RefPtr<SourceProviderCache>> SourceProviderCacheMap;
330
    SourceProviderCacheMap sourceProviderCacheMap;
330
    SourceProviderCacheMap sourceProviderCacheMap;
331
    OwnPtr<Keywords> keywords;
331
    std::unique_ptr<Keywords> keywords;
332
    Interpreter* interpreter;
332
    Interpreter* interpreter;
333
#if ENABLE(JIT)
333
#if ENABLE(JIT)
334
    OwnPtr<JITThunks> jitStubs;
334
    std::unique_ptr<JITThunks> jitStubs;
335
    MacroAssemblerCodeRef getCTIStub(ThunkGenerator generator)
335
    MacroAssemblerCodeRef getCTIStub(ThunkGenerator generator)
336
    {
336
    {
337
        return jitStubs->ctiStub(this, generator);
337
        return jitStubs->ctiStub(this, generator);
Lines 458-464 public: a/Source/JavaScriptCore/runtime/VM.h_sec3
458
    String cachedDateString;
458
    String cachedDateString;
459
    double cachedDateStringValue;
459
    double cachedDateStringValue;
460
460
461
    OwnPtr<Profiler::Database> m_perBytecodeProfiler;
461
    std::unique_ptr<Profiler::Database> m_perBytecodeProfiler;
462
    RefPtr<TypedArrayController> m_typedArrayController;
462
    RefPtr<TypedArrayController> m_typedArrayController;
463
    RegExpCache* m_regExpCache;
463
    RegExpCache* m_regExpCache;
464
    BumpPointerAllocator m_regExpAllocator;
464
    BumpPointerAllocator m_regExpAllocator;
- a/Source/JavaScriptCore/tools/CodeProfile.h -4 / +4 lines
Lines 41-47 public: a/Source/JavaScriptCore/tools/CodeProfile.h_sec1
41
        , m_parent(parent)
41
        , m_parent(parent)
42
    {
42
    {
43
        if (parent)
43
        if (parent)
44
            parent->addChild(this);
44
            parent->addChild(std::make_unique<CodeProfile>(source, parent));
45
    }
45
    }
46
46
47
    void sample(void* pc, void** framePointer);
47
    void sample(void* pc, void** framePointer);
Lines 52-60 public: a/Source/JavaScriptCore/tools/CodeProfile.h_sec2
52
        return m_parent;
52
        return m_parent;
53
    }
53
    }
54
    
54
    
55
    void addChild(CodeProfile* child)
55
    void addChild(std::unique_ptr<CodeProfile> child)
56
    {
56
    {
57
        m_children.append(adoptPtr(child));
57
        m_children.append(WTF::move(child));
58
    }
58
    }
59
59
60
private:
60
private:
Lines 82-88 private: a/Source/JavaScriptCore/tools/CodeProfile.h_sec3
82
    CString m_file;
82
    CString m_file;
83
    unsigned m_lineNo;
83
    unsigned m_lineNo;
84
    CodeProfile* m_parent;
84
    CodeProfile* m_parent;
85
    Vector< OwnPtr<CodeProfile>> m_children;
85
    Vector<std::unique_ptr<CodeProfile>> m_children;
86
    TieredMMapArray<CodeRecord> m_samples;
86
    TieredMMapArray<CodeRecord> m_samples;
87
87
88
    static const char* s_codeTypeNames[NumberOfCodeTypes];
88
    static const char* s_codeTypeNames[NumberOfCodeTypes];

Return to Bug 139532