Changeset 188351 in webkit


Ignore:
Timestamp:
Aug 12, 2015, 1:12:05 PM (10 years ago)
Author:
ggaren@apple.com
Message:

Re-land r188339, since Alex fixed it in r188341 by landing the WebCore half.

  • jit/ExecutableAllocator.h:
  • jsc.cpp:

(GlobalObject::finishCreation):
(functionAddressOf):
(functionVersion):
(functionReleaseExecutableMemory): Deleted.

  • runtime/VM.cpp:

(JSC::StackPreservingRecompiler::operator()):
(JSC::VM::throwException):
(JSC::VM::updateFTLLargestStackSize):
(JSC::VM::gatherConservativeRoots):
(JSC::VM::releaseExecutableMemory): Deleted.
(JSC::releaseExecutableMemory): Deleted.

  • runtime/VM.h:

(JSC::VM::isCollectorBusy):

  • runtime/Watchdog.cpp:

(JSC::Watchdog::setTimeLimit):

Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r188344 r188351  
     12015-08-12  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Re-land r188339, since Alex fixed it in r188341 by landing the WebCore half.
     4
     5        * jit/ExecutableAllocator.h:
     6        * jsc.cpp:
     7        (GlobalObject::finishCreation):
     8        (functionAddressOf):
     9        (functionVersion):
     10        (functionReleaseExecutableMemory): Deleted.
     11        * runtime/VM.cpp:
     12        (JSC::StackPreservingRecompiler::operator()):
     13        (JSC::VM::throwException):
     14        (JSC::VM::updateFTLLargestStackSize):
     15        (JSC::VM::gatherConservativeRoots):
     16        (JSC::VM::releaseExecutableMemory): Deleted.
     17        (JSC::releaseExecutableMemory): Deleted.
     18        * runtime/VM.h:
     19        (JSC::VM::isCollectorBusy):
     20        * runtime/Watchdog.cpp:
     21        (JSC::Watchdog::setTimeLimit):
     22
    1232015-08-12  Jon Honeycutt  <jhoneycutt@apple.com>
    224
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h

    r188344 r188351  
    6868
    6969class VM;
    70 void releaseExecutableMemory(VM&);
    7170
    7271static const unsigned jitAllocationGranule = 32;
  • trunk/Source/JavaScriptCore/jsc.cpp

    r188344 r188351  
    464464static EncodedJSValue JSC_HOST_CALL functionAddressOf(ExecState*);
    465465#ifndef NDEBUG
    466 static EncodedJSValue JSC_HOST_CALL functionReleaseExecutableMemory(ExecState*);
    467466static EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState*);
    468467#endif
     
    613612#ifndef NDEBUG
    614613        addFunction(vm, "dumpCallFrame", functionDumpCallFrame, 0);
    615         addFunction(vm, "releaseExecutableMemory", functionReleaseExecutableMemory, 0);
    616614#endif
    617615        addFunction(vm, "version", functionVersion, 1);
     
    909907    return returnValue;
    910908}
    911 
    912 
    913 #ifndef NDEBUG
    914 EncodedJSValue JSC_HOST_CALL functionReleaseExecutableMemory(ExecState* exec)
    915 {
    916     JSLockHolder lock(exec);
    917     exec->vm().releaseExecutableMemory();
    918     return JSValue::encode(jsUndefined());
    919 }
    920 #endif
    921909
    922910EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*)
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r188344 r188351  
    511511}
    512512
    513 struct StackPreservingRecompiler : public MarkedBlock::VoidFunctor {
    514     HashSet<FunctionExecutable*> currentlyExecutingFunctions;
    515     inline void visit(JSCell* cell)
    516     {
    517         if (!cell->inherits(FunctionExecutable::info()))
    518             return;
    519         FunctionExecutable* executable = jsCast<FunctionExecutable*>(cell);
    520         if (currentlyExecutingFunctions.contains(executable))
    521             return;
    522         executable->clearCode();
    523     }
    524     IterationStatus operator()(JSCell* cell)
    525     {
    526         visit(cell);
    527         return IterationStatus::Continue;
    528     }
    529 };
    530 
    531 void VM::releaseExecutableMemory()
    532 {
    533     prepareToDiscardCode();
    534    
    535     if (entryScope) {
    536         StackPreservingRecompiler recompiler;
    537         HeapIterationScope iterationScope(heap);
    538         HashSet<JSCell*> roots;
    539         heap.getConservativeRegisterRoots(roots);
    540         HashSet<JSCell*>::iterator end = roots.end();
    541         for (HashSet<JSCell*>::iterator ptr = roots.begin(); ptr != end; ++ptr) {
    542             ScriptExecutable* executable = 0;
    543             JSCell* cell = *ptr;
    544             if (cell->inherits(ScriptExecutable::info()))
    545                 executable = static_cast<ScriptExecutable*>(*ptr);
    546             else if (cell->inherits(JSFunction::info())) {
    547                 JSFunction* function = jsCast<JSFunction*>(*ptr);
    548                 if (function->isHostFunction())
    549                     continue;
    550                 executable = function->jsExecutable();
    551             } else
    552                 continue;
    553             ASSERT(executable->inherits(ScriptExecutable::info()));
    554             executable->unlinkCalls();
    555             if (executable->inherits(FunctionExecutable::info()))
    556                 recompiler.currentlyExecutingFunctions.add(static_cast<FunctionExecutable*>(executable));
    557                
    558         }
    559         heap.objectSpace().forEachLiveCell<StackPreservingRecompiler>(iterationScope, recompiler);
    560     }
    561     m_regExpCache->invalidateCode();
    562     heap.collectAllGarbage();
    563 }
    564 
    565513void VM::throwException(ExecState* exec, Exception* exception)
    566514{
     
    670618#endif
    671619
    672 void releaseExecutableMemory(VM& vm)
    673 {
    674     vm.releaseExecutableMemory();
    675 }
    676 
    677620#if ENABLE(DFG_JIT)
    678621void VM::gatherConservativeRoots(ConservativeRoots& conservativeRoots)
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r188344 r188351  
    515515
    516516    bool isCollectorBusy() { return heap.isBusy(); }
    517     JS_EXPORT_PRIVATE void releaseExecutableMemory();
    518517
    519518#if ENABLE(GC_VALIDATION)
  • trunk/Source/JavaScriptCore/runtime/Watchdog.cpp

    r188344 r188351  
    8585        // And if we've previously compiled any functions, we need to revert
    8686        // them because they don't have the needed polling checks yet.
    87         vm.releaseExecutableMemory();
     87        vm.discardAllCode();
    8888    }
    8989
Note: See TracChangeset for help on using the changeset viewer.