Ignore:
Timestamp:
Feb 7, 2020, 2:06:18 AM (5 years ago)
Author:
[email protected]
Message:

[JSC] CodeBlock::shrinkToFit should shrink m_constantRegisters and m_constantsSourceCodeRepresentation in 64bit architectures
https://bugs.webkit.org/show_bug.cgi?id=207356

Reviewed by Mark Lam.

Only 32bit architectures are using m_constantRegisters's address. 64bit architectures are not relying on m_constantRegisters's address.
This patches fixes the thing so that CodeBlock::shrinkToFit will shrink m_constantRegisters and m_constantsSourceCodeRepresentation
regardless of whether this is EarlyShrink or not. We also move DFG/FTL's LateShrink call to the place after calling DFGCommon reallyAdd
since they can add more constant registers.

Relanding it by fixing dead-lock.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::shrinkToFit):

  • bytecode/CodeBlock.h:
  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):

  • dfg/DFGJITFinalizer.cpp:

(JSC::DFG::JITFinalizer::finalizeCommon):

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::compileInThreadImpl):
(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):

  • jit/JIT.cpp:

(JSC::JIT::link):

  • jit/JIT.h:
  • jit/JITInlines.h:

(JSC::JIT::emitLoadDouble):
(JSC::JIT::emitLoadInt32ToDouble): Deleted.

File:
1 edited

Legend:

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

    r255994 r256015  
    8484    CodeBlock* codeBlock = m_plan.codeBlock();
    8585
    86     // Some JIT finalizers may have added more constants. Shrink-to-fit those things now.
    87     {
    88         ConcurrentJSLocker locker(codeBlock->m_lock);
    89         codeBlock->constants().shrinkToFit();
    90         codeBlock->constantsSourceCodeRepresentation().shrinkToFit();
    91     }
    92 
    9386#if ENABLE(FTL_JIT)
    9487    m_jitCode->optimizeAfterWarmUp(codeBlock);
Note: See TracChangeset for help on using the changeset viewer.