Ignore:
Timestamp:
Oct 5, 2015, 4:31:53 PM (10 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling back in r190450
https://bugs.webkit.org/show_bug.cgi?id=149727

The cause of the leak was VM shutdown, which happens in workers.

The fix is for CodeBlockSet to participate in lastChanceToFinalize,
since it's responsible for running CodeBlock destructors.

I ran the leaks tests locally and did not see any CodeBlock-related leaks.

Restored changesets:

"CodeBlock should be a GC object"
https://bugs.webkit.org/show_bug.cgi?id=149727
http://trac.webkit.org/changeset/190450

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r190546 r190589  
    13081308    bool didTryToEnterIntoInlinedLoops = false;
    13091309    for (InlineCallFrame* inlineCallFrame = exit->m_codeOrigin.inlineCallFrame; inlineCallFrame; inlineCallFrame = inlineCallFrame->directCaller.inlineCallFrame) {
    1310         if (inlineCallFrame->executable->didTryToEnterInLoop()) {
     1310        if (inlineCallFrame->baselineCodeBlock->ownerScriptExecutable()->didTryToEnterInLoop()) {
    13111311            didTryToEnterIntoInlinedLoops = true;
    13121312            break;
     
    13781378    // We need to compile the code.
    13791379    compile(
    1380         *vm, codeBlock->newReplacement().get(), codeBlock, FTLMode, UINT_MAX,
    1381         Operands<JSValue>(), ToFTLDeferredCompilationCallback::create(codeBlock));
     1380        *vm, codeBlock->newReplacement(), codeBlock, FTLMode, UINT_MAX,
     1381        Operands<JSValue>(), ToFTLDeferredCompilationCallback::create());
    13821382}
    13831383
     
    14641464        return 0;
    14651465   
    1466     if (CodeBlock* entryBlock = jitCode->osrEntryBlock.get()) {
     1466    if (CodeBlock* entryBlock = jitCode->osrEntryBlock()) {
    14671467        void* address = FTL::prepareOSREntry(
    14681468            exec, codeBlock, entryBlock, bytecodeIndex, streamIndex);
     
    14781478        // OSR entry failed. Oh no! This implies that we need to retry. We retry
    14791479        // without exponential backoff and we only do this for the entry code block.
    1480         jitCode->osrEntryBlock = nullptr;
     1480        jitCode->clearOSREntryBlock();
    14811481        jitCode->osrEntryRetry = 0;
    14821482        return 0;
     
    14951495    jitCode->reconstruct(
    14961496        exec, codeBlock, CodeOrigin(bytecodeIndex), streamIndex, mustHandleValues);
    1497     RefPtr<CodeBlock> replacementCodeBlock = codeBlock->newReplacement();
     1497    CodeBlock* replacementCodeBlock = codeBlock->newReplacement();
    14981498    CompilationResult forEntryResult = compile(
    1499         *vm, replacementCodeBlock.get(), codeBlock, FTLForOSREntryMode, bytecodeIndex,
    1500         mustHandleValues, ToFTLForOSREntryDeferredCompilationCallback::create(codeBlock));
    1501    
    1502     if (forEntryResult != CompilationSuccessful) {
    1503         ASSERT(forEntryResult == CompilationDeferred || replacementCodeBlock->hasOneRef());
     1499        *vm, replacementCodeBlock, codeBlock, FTLForOSREntryMode, bytecodeIndex,
     1500        mustHandleValues, ToFTLForOSREntryDeferredCompilationCallback::create());
     1501   
     1502    if (forEntryResult != CompilationSuccessful)
    15041503        return 0;
    1505     }
    15061504
    15071505    // It's possible that the for-entry compile already succeeded. In that case OSR
     
    15091507    // We signal to try again after a while if that happens.
    15101508    void* address = FTL::prepareOSREntry(
    1511         exec, codeBlock, jitCode->osrEntryBlock.get(), bytecodeIndex, streamIndex);
     1509        exec, codeBlock, jitCode->osrEntryBlock(), bytecodeIndex, streamIndex);
    15121510    return static_cast<char*>(address);
    15131511}
Note: See TracChangeset for help on using the changeset viewer.