| Differences between
and this patch
- a/Source/JavaScriptCore/ChangeLog +28 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2014-12-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        Move JavaScriptCore/dfg to std::unique_ptr
4
        https://bugs.webkit.org/show_bug.cgi?id=139169
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Use std::unique_ptr<>|std::make_unique<> in JavaScriptCore/dfg directory.
9
10
        * dfg/DFGBasicBlock.h:
11
        * dfg/DFGJITCompiler.cpp:
12
        (JSC::DFG::JITCompiler::JITCompiler):
13
        (JSC::DFG::JITCompiler::compile):
14
        (JSC::DFG::JITCompiler::link):
15
        (JSC::DFG::JITCompiler::compileFunction):
16
        (JSC::DFG::JITCompiler::linkFunction):
17
        * dfg/DFGJITCompiler.h:
18
        * dfg/DFGPlan.cpp:
19
        (JSC::DFG::Plan::compileInThreadImpl):
20
        (JSC::DFG::Plan::cancel):
21
        * dfg/DFGPlan.h:
22
        * dfg/DFGSlowPathGenerator.h:
23
        * dfg/DFGWorklist.h:
24
        * ftl/FTLFail.cpp:
25
        (JSC::FTL::fail):
26
        * ftl/FTLState.cpp:
27
        (JSC::FTL::State::State):
28
1
2014-12-01  Michael Saboff  <msaboff@apple.com>
29
2014-12-01  Michael Saboff  <msaboff@apple.com>
2
30
3
        Remove GetMyScope node from DFG
31
        Remove GetMyScope node from DFG
- a/Source/JavaScriptCore/dfg/DFGBasicBlock.h -1 lines
Lines 39-45 a/Source/JavaScriptCore/dfg/DFGBasicBlock.h_sec1
39
#include "Operands.h"
39
#include "Operands.h"
40
#include <wtf/HashMap.h>
40
#include <wtf/HashMap.h>
41
#include <wtf/HashSet.h>
41
#include <wtf/HashSet.h>
42
#include <wtf/OwnPtr.h>
43
#include <wtf/Vector.h>
42
#include <wtf/Vector.h>
44
43
45
namespace JSC { namespace DFG {
44
namespace JSC { namespace DFG {
- a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp -9 / +9 lines
Lines 55-61 JITCompiler::JITCompiler(Graph& dfg) a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec1
55
    , m_blockHeads(dfg.numBlocks())
55
    , m_blockHeads(dfg.numBlocks())
56
{
56
{
57
    if (shouldShowDisassembly() || m_graph.m_vm.m_perBytecodeProfiler)
57
    if (shouldShowDisassembly() || m_graph.m_vm.m_perBytecodeProfiler)
58
        m_disassembler = adoptPtr(new Disassembler(dfg));
58
        m_disassembler = std::make_unique<Disassembler>(dfg);
59
}
59
}
60
60
61
JITCompiler::~JITCompiler()
61
JITCompiler::~JITCompiler()
Lines 291-297 void JITCompiler::compile() a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec2
291
291
292
    setStartOfCode();
292
    setStartOfCode();
293
    compileEntry();
293
    compileEntry();
294
    m_speculative = adoptPtr(new SpeculativeJIT(*this));
294
    m_speculative = std::make_unique<SpeculativeJIT>(*this);
295
    addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
295
    addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
296
    checkStackPointerAlignment();
296
    checkStackPointerAlignment();
297
    compileBody();
297
    compileBody();
Lines 312-318 void JITCompiler::link() a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec3
312
{
312
{
313
    auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail);
313
    auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail);
314
    if (linkBuffer->didFailToAllocate()) {
314
    if (linkBuffer->didFailToAllocate()) {
315
        m_graph.m_plan.finalizer = adoptPtr(new FailedFinalizer(m_graph.m_plan));
315
        m_graph.m_plan.finalizer = std::make_unique<FailedFinalizer>(m_graph.m_plan);
316
        return;
316
        return;
317
    }
317
    }
318
    
318
    
Lines 324-331 void JITCompiler::link() a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec4
324
324
325
    disassemble(*linkBuffer);
325
    disassemble(*linkBuffer);
326
    
326
    
327
    m_graph.m_plan.finalizer = adoptPtr(new JITFinalizer(
327
    m_graph.m_plan.finalizer = std::make_unique<JITFinalizer>(
328
        m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer)));
328
        m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer));
329
}
329
}
330
330
331
void JITCompiler::compileFunction()
331
void JITCompiler::compileFunction()
Lines 349-355 void JITCompiler::compileFunction() a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec5
349
    checkStackPointerAlignment();
349
    checkStackPointerAlignment();
350
350
351
    // === Function body code generation ===
351
    // === Function body code generation ===
352
    m_speculative = adoptPtr(new SpeculativeJIT(*this));
352
    m_speculative = std::make_unique<SpeculativeJIT>(*this);
353
    compileBody();
353
    compileBody();
354
    setEndOfMainPath();
354
    setEndOfMainPath();
355
355
Lines 414-420 void JITCompiler::linkFunction() a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec6
414
    // === Link ===
414
    // === Link ===
415
    auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail);
415
    auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail);
416
    if (linkBuffer->didFailToAllocate()) {
416
    if (linkBuffer->didFailToAllocate()) {
417
        m_graph.m_plan.finalizer = adoptPtr(new FailedFinalizer(m_graph.m_plan));
417
        m_graph.m_plan.finalizer = std::make_unique<FailedFinalizer>(m_graph.m_plan);
418
        return;
418
        return;
419
    }
419
    }
420
    link(*linkBuffer);
420
    link(*linkBuffer);
Lines 429-436 void JITCompiler::linkFunction() a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec7
429
429
430
    MacroAssemblerCodePtr withArityCheck = linkBuffer->locationOf(m_arityCheck);
430
    MacroAssemblerCodePtr withArityCheck = linkBuffer->locationOf(m_arityCheck);
431
431
432
    m_graph.m_plan.finalizer = adoptPtr(new JITFinalizer(
432
    m_graph.m_plan.finalizer = std::make_unique<JITFinalizer>(
433
        m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer), withArityCheck));
433
        m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer), withArityCheck);
434
}
434
}
435
435
436
void JITCompiler::disassemble(LinkBuffer& linkBuffer)
436
void JITCompiler::disassemble(LinkBuffer& linkBuffer)
- a/Source/JavaScriptCore/dfg/DFGJITCompiler.h -2 / +2 lines
Lines 336-342 private: a/Source/JavaScriptCore/dfg/DFGJITCompiler.h_sec1
336
    // The dataflow graph currently being generated.
336
    // The dataflow graph currently being generated.
337
    Graph& m_graph;
337
    Graph& m_graph;
338
338
339
    OwnPtr<Disassembler> m_disassembler;
339
    std::unique_ptr<Disassembler> m_disassembler;
340
    
340
    
341
    RefPtr<JITCode> m_jitCode;
341
    RefPtr<JITCode> m_jitCode;
342
    
342
    
Lines 372-378 private: a/Source/JavaScriptCore/dfg/DFGJITCompiler.h_sec2
372
    
372
    
373
    Call m_callArityFixup;
373
    Call m_callArityFixup;
374
    Label m_arityCheck;
374
    Label m_arityCheck;
375
    OwnPtr<SpeculativeJIT> m_speculative;
375
    std::unique_ptr<SpeculativeJIT> m_speculative;
376
};
376
};
377
377
378
} } // namespace JSC::DFG
378
} } // namespace JSC::DFG
- a/Source/JavaScriptCore/dfg/DFGPlan.cpp -5 / +5 lines
Lines 207-213 Plan::CompilationPath Plan::compileInThreadImpl(LongLivedState& longLivedState) a/Source/JavaScriptCore/dfg/DFGPlan.cpp_sec1
207
    Graph dfg(vm, *this, longLivedState);
207
    Graph dfg(vm, *this, longLivedState);
208
    
208
    
209
    if (!parse(dfg)) {
209
    if (!parse(dfg)) {
210
        finalizer = adoptPtr(new FailedFinalizer(*this));
210
        finalizer = std::make_unique<FailedFinalizer>(*this);
211
        return FailPath;
211
        return FailPath;
212
    }
212
    }
213
    
213
    
Lines 229-235 Plan::CompilationPath Plan::compileInThreadImpl(LongLivedState& longLivedState) a/Source/JavaScriptCore/dfg/DFGPlan.cpp_sec2
229
    if (mode == FTLForOSREntryMode) {
229
    if (mode == FTLForOSREntryMode) {
230
        bool result = performOSREntrypointCreation(dfg);
230
        bool result = performOSREntrypointCreation(dfg);
231
        if (!result) {
231
        if (!result) {
232
            finalizer = adoptPtr(new FailedFinalizer(*this));
232
            finalizer = std::make_unique<FailedFinalizer>(*this);
233
            return FailPath;
233
            return FailPath;
234
        }
234
        }
235
        performCPSRethreading(dfg);
235
        performCPSRethreading(dfg);
Lines 313-319 Plan::CompilationPath Plan::compileInThreadImpl(LongLivedState& longLivedState) a/Source/JavaScriptCore/dfg/DFGPlan.cpp_sec3
313
    case FTLForOSREntryMode: {
313
    case FTLForOSREntryMode: {
314
#if ENABLE(FTL_JIT)
314
#if ENABLE(FTL_JIT)
315
        if (FTL::canCompile(dfg) == FTL::CannotCompile) {
315
        if (FTL::canCompile(dfg) == FTL::CannotCompile) {
316
            finalizer = adoptPtr(new FailedFinalizer(*this));
316
            finalizer = std::make_unique<FailedFinalizer>(*this);
317
            return FailPath;
317
            return FailPath;
318
        }
318
        }
319
        
319
        
Lines 375-381 Plan::CompilationPath Plan::compileInThreadImpl(LongLivedState& longLivedState) a/Source/JavaScriptCore/dfg/DFGPlan.cpp_sec4
375
            return CancelPath;
375
            return CancelPath;
376
        
376
        
377
        if (!haveLLVM) {
377
        if (!haveLLVM) {
378
            finalizer = adoptPtr(new FailedFinalizer(*this));
378
            finalizer = std::make_unique<FailedFinalizer>(*this);
379
            return FailPath;
379
            return FailPath;
380
        }
380
        }
381
            
381
            
Lines 524-530 void Plan::cancel() a/Source/JavaScriptCore/dfg/DFGPlan.cpp_sec5
524
    profiledDFGCodeBlock = nullptr;
524
    profiledDFGCodeBlock = nullptr;
525
    mustHandleValues.clear();
525
    mustHandleValues.clear();
526
    compilation = nullptr;
526
    compilation = nullptr;
527
    finalizer.clear();
527
    finalizer = nullptr;
528
    inlineCallFrames = nullptr;
528
    inlineCallFrames = nullptr;
529
    watchpoints = DesiredWatchpoints();
529
    watchpoints = DesiredWatchpoints();
530
    identifiers = DesiredIdentifiers();
530
    identifiers = DesiredIdentifiers();
- a/Source/JavaScriptCore/dfg/DFGPlan.h -1 / +1 lines
Lines 86-92 struct Plan : public ThreadSafeRefCounted<Plan> { a/Source/JavaScriptCore/dfg/DFGPlan.h_sec1
86
86
87
    RefPtr<Profiler::Compilation> compilation;
87
    RefPtr<Profiler::Compilation> compilation;
88
88
89
    OwnPtr<Finalizer> finalizer;
89
    std::unique_ptr<Finalizer> finalizer;
90
    
90
    
91
    RefPtr<InlineCallFrameSet> inlineCallFrames;
91
    RefPtr<InlineCallFrameSet> inlineCallFrames;
92
    DesiredWatchpoints watchpoints;
92
    DesiredWatchpoints watchpoints;
- a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h -1 lines
Lines 32-38 a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h_sec1
32
#include "DFGSilentRegisterSavePlan.h"
32
#include "DFGSilentRegisterSavePlan.h"
33
#include "DFGSpeculativeJIT.h"
33
#include "DFGSpeculativeJIT.h"
34
#include <wtf/FastMalloc.h>
34
#include <wtf/FastMalloc.h>
35
#include <wtf/PassOwnPtr.h>
36
35
37
namespace JSC { namespace DFG {
36
namespace JSC { namespace DFG {
38
37
- a/Source/JavaScriptCore/dfg/DFGWorklist.h -1 lines
Lines 33-39 a/Source/JavaScriptCore/dfg/DFGWorklist.h_sec1
33
#include <wtf/Deque.h>
33
#include <wtf/Deque.h>
34
#include <wtf/HashMap.h>
34
#include <wtf/HashMap.h>
35
#include <wtf/Noncopyable.h>
35
#include <wtf/Noncopyable.h>
36
#include <wtf/PassOwnPtr.h>
37
#include <wtf/ThreadingPrimitives.h>
36
#include <wtf/ThreadingPrimitives.h>
38
37
39
namespace JSC {
38
namespace JSC {
- a/Source/JavaScriptCore/ftl/FTLFail.cpp -1 / +1 lines
Lines 38-44 using namespace DFG; a/Source/JavaScriptCore/ftl/FTLFail.cpp_sec1
38
38
39
void fail(State& state)
39
void fail(State& state)
40
{
40
{
41
    state.graph.m_plan.finalizer = adoptPtr(new FailedFinalizer(state.graph.m_plan));
41
    state.graph.m_plan.finalizer = std::make_unique<FailedFinalizer>(state.graph.m_plan);
42
    
42
    
43
    if (state.module)
43
    if (state.module)
44
        llvm->DisposeModule(state.module);
44
        llvm->DisposeModule(state.module);
- a/Source/JavaScriptCore/ftl/FTLState.cpp -3 / +3 lines
Lines 76-84 State::State(Graph& graph) a/Source/JavaScriptCore/ftl/FTLState.cpp_sec1
76
        RELEASE_ASSERT_NOT_REACHED();
76
        RELEASE_ASSERT_NOT_REACHED();
77
        break;
77
        break;
78
    }
78
    }
79
    
79
80
    finalizer = new JITFinalizer(graph.m_plan);
80
    graph.m_plan.finalizer = std::make_unique<JITFinalizer>(graph.m_plan);
81
    graph.m_plan.finalizer = adoptPtr(finalizer);
81
    finalizer = static_cast<JITFinalizer*>(graph.m_plan.finalizer.get());
82
}
82
}
83
83
84
State::~State()
84
State::~State()

Return to Bug 139169