Changeset 176572 in webkit


Ignore:
Timestamp:
Nov 28, 2014, 11:11:50 PM (11 years ago)
Author:
[email protected]
Message:

Use std::unique_ptr<>|make_unique<> in ftl, bytecode of JSC
https://bugs.webkit.org/show_bug.cgi?id=139063

Reviewed by Andreas Kling.

Clean up OwnPtr and PassOwnPtr in JSC.

  • bytecode/StructureStubClearingWatchpoint.cpp:

(JSC::StructureStubClearingWatchpoint::push):

  • bytecode/StructureStubClearingWatchpoint.h:

(JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):

  • ftl/FTLCompile.cpp:

(JSC::FTL::mmAllocateDataSection):

  • ftl/FTLJITFinalizer.h:
  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • parser/SourceProviderCacheItem.h:
Location:
trunk/Source/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r176553 r176572  
     12014-11-28  Gyuyoung Kim  <[email protected]>
     2
     3        Use std::unique_ptr<>|make_unique<> in ftl, bytecode of JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=139063
     5
     6        Reviewed by Andreas Kling.
     7
     8        Clean up OwnPtr and PassOwnPtr in JSC.
     9
     10        * bytecode/StructureStubClearingWatchpoint.cpp:
     11        (JSC::StructureStubClearingWatchpoint::push):
     12        * bytecode/StructureStubClearingWatchpoint.h:
     13        (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):
     14        * ftl/FTLCompile.cpp:
     15        (JSC::FTL::mmAllocateDataSection):
     16        * ftl/FTLJITFinalizer.h:
     17        * ftl/FTLLink.cpp:
     18        (JSC::FTL::link):
     19        * parser/SourceProviderCacheItem.h:
     20
    1212014-11-27  Gyuyoung Kim  <[email protected]>
    222
  • trunk/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp

    r172129 r176572  
    3939StructureStubClearingWatchpoint* StructureStubClearingWatchpoint::push(
    4040    WatchpointsOnStructureStubInfo& holder,
    41     OwnPtr<StructureStubClearingWatchpoint>& head)
     41    std::unique_ptr<StructureStubClearingWatchpoint>& head)
    4242{
    43     head = adoptPtr(new StructureStubClearingWatchpoint(holder, head.release()));
     43    head = std::make_unique<StructureStubClearingWatchpoint>(holder, WTF::move(head));
    4444    return head.get();
    4545}
  • trunk/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.h

    r172129 r176572  
    3333#include <wtf/FastMalloc.h>
    3434#include <wtf/Noncopyable.h>
    35 #include <wtf/OwnPtr.h>
    36 #include <wtf/PassOwnPtr.h>
    3735#include <wtf/RefCounted.h>
    3836#include <wtf/RefPtr.h>
     
    5654    StructureStubClearingWatchpoint(
    5755        WatchpointsOnStructureStubInfo& holder,
    58         PassOwnPtr<StructureStubClearingWatchpoint> next)
     56        std::unique_ptr<StructureStubClearingWatchpoint> next)
    5957        : m_holder(holder)
    60         , m_next(next)
     58        , m_next(WTF::move(next))
    6159    {
    6260    }
     
    6664    static StructureStubClearingWatchpoint* push(
    6765        WatchpointsOnStructureStubInfo& holder,
    68         OwnPtr<StructureStubClearingWatchpoint>& head);
     66        std::unique_ptr<StructureStubClearingWatchpoint>& head);
    6967
    7068protected:
     
    7371private:
    7472    WatchpointsOnStructureStubInfo& m_holder;
    75     OwnPtr<StructureStubClearingWatchpoint> m_next;
     73    std::unique_ptr<StructureStubClearingWatchpoint> m_next;
    7674};
    7775
     
    9896    CodeBlock* m_codeBlock;
    9997    StructureStubInfo* m_stubInfo;
    100     OwnPtr<StructureStubClearingWatchpoint> m_head;
     98    std::unique_ptr<StructureStubClearingWatchpoint> m_head;
    10199};
    102100
  • trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp

    r173509 r176572  
    309309        checkJIT.jumpToExceptionHandler();
    310310
    311         OwnPtr<LinkBuffer> linkBuffer = adoptPtr(new LinkBuffer(
    312             vm, checkJIT, codeBlock, JITCompilationMustSucceed));
     311        auto linkBuffer = std::make_unique<LinkBuffer>(
     312            vm, checkJIT, codeBlock, JITCompilationMustSucceed);
    313313        linkBuffer->link(callLookupExceptionHandler, FunctionPtr(lookupExceptionHandler));
    314314        linkBuffer->link(callLookupExceptionHandlerFromCallerFrame, FunctionPtr(lookupExceptionHandlerFromCallerFrame));
    315315
    316         state.finalizer->handleExceptionsLinkBuffer = linkBuffer.release();
     316        state.finalizer->handleExceptionsLinkBuffer = WTF::move(linkBuffer);
    317317    }
    318318
  • trunk/Source/JavaScriptCore/ftl/FTLJITFinalizer.h

    r171076 r176572  
    5050
    5151    OwnPtr<LinkBuffer> exitThunksLinkBuffer;
    52     OwnPtr<LinkBuffer> entrypointLinkBuffer;
     52    std::unique_ptr<LinkBuffer> entrypointLinkBuffer;
    5353    OwnPtr<LinkBuffer> sideCodeLinkBuffer;
    54     OwnPtr<LinkBuffer> handleExceptionsLinkBuffer;
     54    std::unique_ptr<LinkBuffer> handleExceptionsLinkBuffer;
    5555    Vector<SlowPathCall> slowPathCalls; // Calls inside the side code.
    5656    Vector<OSRExitCompilationInfo> osrExit;
  • trunk/Source/JavaScriptCore/ftl/FTLLink.cpp

    r173509 r176572  
    7070    CCallHelpers jit(&vm, codeBlock);
    7171   
    72     OwnPtr<LinkBuffer> linkBuffer;
     72    std::unique_ptr<LinkBuffer> linkBuffer;
    7373
    7474    CCallHelpers::Address frame = CCallHelpers::Address(
     
    178178        mainPathJumps.append(jit.jump());
    179179
    180         linkBuffer = adoptPtr(new LinkBuffer(vm, jit, codeBlock, JITCompilationMustSucceed));
     180        linkBuffer = std::make_unique<LinkBuffer>(vm, jit, codeBlock, JITCompilationMustSucceed);
    181181        linkBuffer->link(callArityCheck, codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck);
    182182        linkBuffer->link(callArityFixup, FunctionPtr((vm.getCTIStub(arityFixupGenerator)).code().executableAddress()));
     
    196196        CCallHelpers::Jump mainPathJump = jit.jump();
    197197       
    198         linkBuffer = adoptPtr(new LinkBuffer(vm, jit, codeBlock, JITCompilationMustSucceed));
     198        linkBuffer = std::make_unique<LinkBuffer>(vm, jit, codeBlock, JITCompilationMustSucceed);
    199199        linkBuffer->link(mainPathJump, CodeLocationLabel(bitwise_cast<void*>(state.generatedFunction)));
    200200
     
    208208    }
    209209   
    210     state.finalizer->entrypointLinkBuffer = linkBuffer.release();
     210    state.finalizer->entrypointLinkBuffer = WTF::move(linkBuffer);
    211211    state.finalizer->function = state.generatedFunction;
    212212    state.finalizer->jitCode = state.jitCode;
  • trunk/Source/JavaScriptCore/parser/SourceProviderCacheItem.h

    r159520 r176572  
    2828
    2929#include "ParserTokens.h"
    30 #include <wtf/PassOwnPtr.h>
    3130#include <wtf/Vector.h>
    3231#include <wtf/text/WTFString.h>
Note: See TracChangeset for help on using the changeset viewer.