Changeset 110138 in webkit


Ignore:
Timestamp:
Mar 7, 2012 8:04:40 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r110127.
http://trac.webkit.org/changeset/110127
https://bugs.webkit.org/show_bug.cgi?id=80562

compile failed on AppleWin (Requested by ukai on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-03-07

  • heap/Heap.cpp:

(JSC::Heap::collectAllGarbage):

  • heap/Heap.h:

(JSC):
(Heap):

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::FunctionExecutable):
(JSC::FunctionExecutable::finalize):

  • runtime/Executable.h:

(FunctionExecutable):
(JSC::FunctionExecutable::create):

  • runtime/JSGlobalData.cpp:

(WTF):
(Recompiler):
(WTF::Recompiler::operator()):
(JSC::JSGlobalData::recompileAllJSFunctions):
(JSC):

  • runtime/JSGlobalData.h:

(JSGlobalData):

  • runtime/JSGlobalObject.cpp:

(JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):

Location:
trunk/Source/JavaScriptCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r110134 r110138  
     12012-03-07  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r110127.
     4        http://trac.webkit.org/changeset/110127
     5        https://bugs.webkit.org/show_bug.cgi?id=80562
     6
     7        compile failed on AppleWin (Requested by ukai on #webkit).
     8
     9        * heap/Heap.cpp:
     10        (JSC::Heap::collectAllGarbage):
     11        * heap/Heap.h:
     12        (JSC):
     13        (Heap):
     14        * runtime/Executable.cpp:
     15        (JSC::FunctionExecutable::FunctionExecutable):
     16        (JSC::FunctionExecutable::finalize):
     17        * runtime/Executable.h:
     18        (FunctionExecutable):
     19        (JSC::FunctionExecutable::create):
     20        * runtime/JSGlobalData.cpp:
     21        (WTF):
     22        (Recompiler):
     23        (WTF::Recompiler::operator()):
     24        (JSC::JSGlobalData::recompileAllJSFunctions):
     25        (JSC):
     26        * runtime/JSGlobalData.h:
     27        (JSGlobalData):
     28        * runtime/JSGlobalObject.cpp:
     29        (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
     30
    1312012-03-07  Hojong Han  <hojong.han@samsung.com>
    232
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r110127 r110138  
    765765}
    766766
    767 void Heap::discardAllCompiledCode()
    768 {
    769     // If JavaScript is running, it's not safe to recompile, since we'll end
    770     // up throwing away code that is live on the stack.
    771     ASSERT(!m_globalData->dynamicGlobalObject);
    772    
    773     for (FunctionExecutable* current = m_functions.head(); current; current = current->next())
    774         current->discardCode();
    775 }
    776 
    777767void Heap::collectAllGarbage()
    778768{
     
    780770        return;
    781771    if (!m_globalData->dynamicGlobalObject)
    782         discardAllCompiledCode();
     772        m_globalData->recompileAllJSFunctions();
    783773
    784774    collect(DoSweep);
     
    935925}
    936926
    937 void Heap::addFunctionExecutable(FunctionExecutable* executable)
    938 {
    939     m_functions.append(executable);
    940 }
    941 
    942 void Heap::removeFunctionExecutable(FunctionExecutable* executable)
    943 {
    944     m_functions.remove(executable);
    945 }
    946 
    947927} // namespace JSC
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r110127 r110138  
    4343    class CopiedSpace;
    4444    class CodeBlock;
    45     class FunctionExecutable;
    4645    class GCActivityCallback;
    4746    class GlobalCodeBlock;
     
    107106        typedef void (*Finalizer)(JSCell*);
    108107        JS_EXPORT_PRIVATE void addFinalizer(JSCell*, Finalizer);
    109         void addFunctionExecutable(FunctionExecutable*);
    110         void removeFunctionExecutable(FunctionExecutable*);
    111108
    112109        void notifyIsSafeToCollect() { m_isSafeToCollect = true; }
     
    143140
    144141        double lastGCLength() { return m_lastGCLength; }
    145 
    146         void discardAllCompiledCode();
    147142
    148143    private:
     
    245240        JSGlobalData* m_globalData;
    246241        double m_lastGCLength;
    247 
    248         DoublyLinkedList<FunctionExecutable> m_functions;
    249242    };
    250243
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r110127 r110138  
    147147    , m_inferredName(inferredName.isNull() ? globalData.propertyNames->emptyIdentifier : inferredName)
    148148    , m_symbolTable(0)
    149     , m_next(0)
    150     , m_prev(0)
    151149{
    152150}
     
    160158    , m_inferredName(inferredName.isNull() ? exec->globalData().propertyNames->emptyIdentifier : inferredName)
    161159    , m_symbolTable(0)
    162     , m_next(0)
    163     , m_prev(0)
    164160{
    165161}
     
    659655void FunctionExecutable::finalize(JSCell* cell)
    660656{
    661     FunctionExecutable* executable = jsCast<FunctionExecutable*>(cell);
    662     Heap::heap(executable)->removeFunctionExecutable(executable);
    663     executable->clearCode();
     657    jsCast<FunctionExecutable*>(cell)->clearCode();
    664658}
    665659
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r110127 r110138  
    464464    };
    465465
    466     class FunctionExecutable : public ScriptExecutable, public DoublyLinkedListNode<FunctionExecutable> {
     466    class FunctionExecutable : public ScriptExecutable {
    467467        friend class JIT;
    468468        friend class LLIntOffsetsExtractor;
    469         friend class DoublyLinkedListNode<FunctionExecutable>;
    470469    public:
    471470        typedef ScriptExecutable Base;
     
    475474            FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, inferredName, source, forceUsesArguments, parameters, isInStrictContext);
    476475            executable->finishCreation(exec->globalData(), name, firstLine, lastLine);
    477             exec->globalData().heap.addFunctionExecutable(executable);
    478476            exec->globalData().heap.addFinalizer(executable, &finalize);
    479477            return executable;
     
    484482            FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, inferredName, source, forceUsesArguments, parameters, isInStrictContext);
    485483            executable->finishCreation(globalData, name, firstLine, lastLine);
    486             globalData.heap.addFunctionExecutable(executable);
    487484            globalData.heap.addFinalizer(executable, &finalize);
    488485            return executable;
     
    692689        WriteBarrier<JSString> m_nameValue;
    693690        SharedSymbolTable* m_symbolTable;
    694         FunctionExecutable* m_next;
    695         FunctionExecutable* m_prev;
    696691    };
    697692
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r110127 r110138  
    6969using namespace WTF;
    7070
     71namespace {
     72
     73using namespace JSC;
     74
     75class Recompiler : public MarkedBlock::VoidFunctor {
     76public:
     77    void operator()(JSCell*);
     78};
     79
     80inline void Recompiler::operator()(JSCell* cell)
     81{
     82    if (!cell->inherits(&JSFunction::s_info))
     83        return;
     84    JSFunction* function = asFunction(cell);
     85    if (!function->executable() || function->executable()->isHostFunction())
     86        return;
     87    function->jsExecutable()->discardCode();
     88}
     89
     90} // namespace
     91
    7192namespace JSC {
    7293
     
    423444}
    424445
     446void JSGlobalData::recompileAllJSFunctions()
     447{
     448    // If JavaScript is running, it's not safe to recompile, since we'll end
     449    // up throwing away code that is live on the stack.
     450    ASSERT(!dynamicGlobalObject);
     451   
     452    heap.objectSpace().forEachCell<Recompiler>();
     453}
     454
    425455struct StackPreservingRecompiler : public MarkedBlock::VoidFunctor {
    426456    HashSet<FunctionExecutable*> currentlyExecutingFunctions;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r110127 r110138  
    325325        JS_EXPORT_PRIVATE void stopSampling();
    326326        JS_EXPORT_PRIVATE void dumpSampleData(ExecState* exec);
    327         void discardAllCompiledCode();
     327        void recompileAllJSFunctions();
    328328        RegExpCache* regExpCache() { return m_regExpCache; }
    329329#if ENABLE(REGEXP_TRACING)
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r110127 r110138  
    461461#if ENABLE(ASSEMBLER)
    462462        if (ExecutableAllocator::underMemoryPressure())
    463             globalData.heap.discardAllCompiledCode();
     463            globalData.recompileAllJSFunctions();
    464464#endif
    465465
Note: See TracChangeset for help on using the changeset viewer.