Ignore:
Timestamp:
Feb 6, 2020, 3:25:01 PM (6 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.

  • 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/bytecode/CodeBlock.cpp

    r255887 r255987  
    19541954}
    19551955
    1956 void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
     1956void CodeBlock::shrinkToFit(const ConcurrentJSLocker&, ShrinkMode shrinkMode)
    19571957{
    19581958    ConcurrentJSLocker locker(m_lock);
    19591959
    1960     if (shrinkMode == EarlyShrink) {
     1960#if USE(JSVALUE32_64)
     1961    // Only 32bit Baseline JIT is touching m_constantRegisters address directly.
     1962    if (shrinkMode == ShrinkMode::EarlyShrink)
    19611963        m_constantRegisters.shrinkToFit();
    1962         m_constantsSourceCodeRepresentation.shrinkToFit();
    1963        
     1964#else
     1965    m_constantRegisters.shrinkToFit();
     1966#endif
     1967    m_constantsSourceCodeRepresentation.shrinkToFit();
     1968
     1969    if (shrinkMode == ShrinkMode::EarlyShrink) {
    19641970        if (m_rareData) {
    19651971            m_rareData->m_switchJumpTables.shrinkToFit();
Note: See TracChangeset for help on using the changeset viewer.