Changeset 168261 in webkit


Ignore:
Timestamp:
May 5, 2014 12:45:46 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

Unreviewed. Revert r159826 - "Finally fix some obvious Bartlett bugs"

This reverts r159826.

Location:
releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog

    r167236 r168261  
    78807880        (JSC::SymbolTable::SymbolTable):
    78817881        * runtime/SymbolTable.h:
    7882 
    7883 2013-11-27  Filip Pizlo  <fpizlo@apple.com>
    7884 
    7885         Finally fix some obvious Bartlett bugs
    7886         https://bugs.webkit.org/show_bug.cgi?id=124951
    7887 
    7888         Reviewed by Mark Hahnenberg.
    7889        
    7890         Sanitize the stack (i.e. zero parts of it known to be dead) at three key points:
    7891        
    7892         - GC.
    7893        
    7894         - At beginning of OSR entry.
    7895        
    7896         - Just as we finish preparing OSR entry. This clears those slots on the stack that
    7897           could have been live in baseline but that are known to be dead in DFG.
    7898        
    7899         This is as much as a 2x speed-up on splay if you run it in certain modes, and run it
    7900         for a long enough interval. It appears to fix all instances of the dreaded exponential
    7901         heap growth that splay gets into when some stale pointer stays around.
    7902        
    7903         This doesn't have much of an effect on real-world programs. This bug has only ever
    7904         manifested in splay and for that reason we thus far opted against fixing it. But splay
    7905         is, for what it's worth, the premiere GC stress test in JavaScript - so making sure we
    7906         can run it without pathologies - even when you tweak its configuration - is probably
    7907         fairly important.
    7908 
    7909         * dfg/DFGJITCompiler.h:
    7910         (JSC::DFG::JITCompiler::noticeOSREntry):
    7911         * dfg/DFGOSREntry.cpp:
    7912         (JSC::DFG::prepareOSREntry):
    7913         * dfg/DFGOSREntry.h:
    7914         * heap/Heap.cpp:
    7915         (JSC::Heap::markRoots):
    7916         * interpreter/JSStack.cpp:
    7917         (JSC::JSStack::JSStack):
    7918         (JSC::JSStack::sanitizeStack):
    7919         * interpreter/JSStack.h:
    79207882
    792178832013-11-26  Filip Pizlo  <fpizlo@apple.com>
  • releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r160493 r168261  
    271271            else {
    272272                VariableAccessData* variable = node->variableAccessData();
    273                 entry->m_machineStackUsed.set(variable->machineLocal().toLocal());
    274                
    275273                switch (variable->flushFormat()) {
    276274                case FlushedDouble:
  • releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.cpp

    r159826 r168261  
    5353   
    5454    VM* vm = &exec->vm();
    55    
    56     vm->interpreter->stack().sanitizeStack();
    57    
    5855    if (codeBlock->jitType() != JITCode::DFGJIT) {
    5956        RELEASE_ASSERT(codeBlock->jitType() == JITCode::FTLJIT);
     
    185182    //    would have otherwise just kept running albeit less quickly.
    186183   
    187     unsigned frameSize = jitCode->common.requiredRegisterCountForExecutionAndExit();
    188     if (!vm->interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(frameSize).offset()])) {
     184    if (!vm->interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(jitCode->common.requiredRegisterCountForExecutionAndExit()).offset()])) {
    189185        if (Options::verboseOSR())
    190186            dataLogF("    OSR failed because stack growth failed.\n");
     
    212208        registers[entry->m_reshufflings[i].toOffset] = temporaryLocals[i];
    213209   
    214     // 5) Clear those parts of the call frame that the DFG ain't using. This helps GC on some
    215     //    programs by eliminating some stale pointer pathologies.
    216    
    217     for (unsigned i = frameSize; i--;) {
    218         if (entry->m_machineStackUsed.get(i))
    219             continue;
    220         registers[virtualRegisterForLocal(i).offset()] = JSValue::encode(JSValue());
    221     }
    222    
    223     // 6) Fix the call frame.
     210    // 5) Fix the call frame.
    224211   
    225212    exec->setCodeBlock(codeBlock);
    226213   
    227     // 7) Find and return the destination machine code address.
     214    // 6) Find and return the destination machine code address.
    228215   
    229216    void* result = codeBlock->jitCode()->executableAddressAtOffset(entry->m_machineCodeOffset);
  • releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.h

    r159826 r168261  
    6060    BitVector m_localsForcedMachineInt;
    6161    Vector<OSREntryReshuffling> m_reshufflings;
    62     BitVector m_machineStackUsed;
    6362};
    6463
  • releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/heap/Heap.cpp

    r162017 r168261  
    468468        GCPHASE(GatherStackRoots);
    469469        stack().gatherConservativeRoots(stackRoots, m_jitStubRoutines, m_codeBlocks);
    470         stack().sanitizeStack();
    471470    }
    472471
  • releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.cpp

    r160063 r168261  
    5353    updateStackLimit(highAddress());
    5454    m_commitEnd = highAddress();
    55    
    56     m_lastStackTop = getBaseOfStack();
    5755
    5856    disableErrorStackReserve();
     
    102100{
    103101    conservativeRoots.add(getBaseOfStack(), getTopOfStack(), jitStubRoutines, codeBlocks);
    104 }
    105 
    106 void JSStack::sanitizeStack()
    107 {
    108     ASSERT(getTopOfStack() <= getBaseOfStack());
    109    
    110     if (m_lastStackTop < getTopOfStack()) {
    111         char* begin = reinterpret_cast<char*>(m_lastStackTop);
    112         char* end = reinterpret_cast<char*>(getTopOfStack());
    113         memset(begin, 0, end - begin);
    114     }
    115    
    116     m_lastStackTop = getTopOfStack();
    117102}
    118103
  • releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.h

    r160186 r168261  
    8383        void gatherConservativeRoots(ConservativeRoots&);
    8484        void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&);
    85         void sanitizeStack();
    8685
    8786        Register* getBaseOfStack() const
     
    158157        PageReservation m_reservation;
    159158        CallFrame*& m_topCallFrame;
    160         Register* m_lastStackTop;
    161159
    162160        friend class LLIntOffsetsExtractor;
Note: See TracChangeset for help on using the changeset viewer.