Title: [188351] trunk/Source/_javascript_Core
Revision
188351
Author
[email protected]
Date
2015-08-12 13:12:05 -0700 (Wed, 12 Aug 2015)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (188350 => 188351)


--- trunk/Source/_javascript_Core/ChangeLog	2015-08-12 19:31:38 UTC (rev 188350)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-08-12 20:12:05 UTC (rev 188351)
@@ -1,3 +1,25 @@
+2015-08-12  Geoffrey Garen  <[email protected]>
+
+        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):
+
 2015-08-12  Jon Honeycutt  <[email protected]>
 
         Roll out r188339, which broke the build.

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.h (188350 => 188351)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2015-08-12 19:31:38 UTC (rev 188350)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2015-08-12 20:12:05 UTC (rev 188351)
@@ -67,7 +67,6 @@
 namespace JSC {
 
 class VM;
-void releaseExecutableMemory(VM&);
 
 static const unsigned jitAllocationGranule = 32;
 

Modified: trunk/Source/_javascript_Core/jsc.cpp (188350 => 188351)


--- trunk/Source/_javascript_Core/jsc.cpp	2015-08-12 19:31:38 UTC (rev 188350)
+++ trunk/Source/_javascript_Core/jsc.cpp	2015-08-12 20:12:05 UTC (rev 188351)
@@ -463,7 +463,6 @@
 static EncodedJSValue JSC_HOST_CALL functionDeleteAllCompiledCode(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionAddressOf(ExecState*);
 #ifndef NDEBUG
-static EncodedJSValue JSC_HOST_CALL functionReleaseExecutableMemory(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState*);
 #endif
 static EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*);
@@ -612,7 +611,6 @@
         addFunction(vm, "addressOf", functionAddressOf, 1);
 #ifndef NDEBUG
         addFunction(vm, "dumpCallFrame", functionDumpCallFrame, 0);
-        addFunction(vm, "releaseExecutableMemory", functionReleaseExecutableMemory, 0);
 #endif
         addFunction(vm, "version", functionVersion, 1);
         addFunction(vm, "run", functionRun, 1);
@@ -909,16 +907,6 @@
     return returnValue;
 }
 
-
-#ifndef NDEBUG
-EncodedJSValue JSC_HOST_CALL functionReleaseExecutableMemory(ExecState* exec)
-{
-    JSLockHolder lock(exec);
-    exec->vm().releaseExecutableMemory();
-    return JSValue::encode(jsUndefined());
-}
-#endif
-
 EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*)
 {
     // We need this function for compatibility with the Mozilla JS tests but for now

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (188350 => 188351)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2015-08-12 19:31:38 UTC (rev 188350)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2015-08-12 20:12:05 UTC (rev 188351)
@@ -510,58 +510,6 @@
     sourceProviderCacheMap.clear();
 }
 
-struct StackPreservingRecompiler : public MarkedBlock::VoidFunctor {
-    HashSet<FunctionExecutable*> currentlyExecutingFunctions;
-    inline void visit(JSCell* cell)
-    {
-        if (!cell->inherits(FunctionExecutable::info()))
-            return;
-        FunctionExecutable* executable = jsCast<FunctionExecutable*>(cell);
-        if (currentlyExecutingFunctions.contains(executable))
-            return;
-        executable->clearCode();
-    }
-    IterationStatus operator()(JSCell* cell)
-    {
-        visit(cell);
-        return IterationStatus::Continue;
-    }
-};
-
-void VM::releaseExecutableMemory()
-{
-    prepareToDiscardCode();
-    
-    if (entryScope) {
-        StackPreservingRecompiler recompiler;
-        HeapIterationScope iterationScope(heap);
-        HashSet<JSCell*> roots;
-        heap.getConservativeRegisterRoots(roots);
-        HashSet<JSCell*>::iterator end = roots.end();
-        for (HashSet<JSCell*>::iterator ptr = roots.begin(); ptr != end; ++ptr) {
-            ScriptExecutable* executable = 0;
-            JSCell* cell = *ptr;
-            if (cell->inherits(ScriptExecutable::info()))
-                executable = static_cast<ScriptExecutable*>(*ptr);
-            else if (cell->inherits(JSFunction::info())) {
-                JSFunction* function = jsCast<JSFunction*>(*ptr);
-                if (function->isHostFunction())
-                    continue;
-                executable = function->jsExecutable();
-            } else
-                continue;
-            ASSERT(executable->inherits(ScriptExecutable::info()));
-            executable->unlinkCalls();
-            if (executable->inherits(FunctionExecutable::info()))
-                recompiler.currentlyExecutingFunctions.add(static_cast<FunctionExecutable*>(executable));
-                
-        }
-        heap.objectSpace().forEachLiveCell<StackPreservingRecompiler>(iterationScope, recompiler);
-    }
-    m_regExpCache->invalidateCode();
-    heap.collectAllGarbage();
-}
-
 void VM::throwException(ExecState* exec, Exception* exception)
 {
     if (Options::breakOnThrow()) {
@@ -669,11 +617,6 @@
 }
 #endif
 
-void releaseExecutableMemory(VM& vm)
-{
-    vm.releaseExecutableMemory();
-}
-
 #if ENABLE(DFG_JIT)
 void VM::gatherConservativeRoots(ConservativeRoots& conservativeRoots)
 {

Modified: trunk/Source/_javascript_Core/runtime/VM.h (188350 => 188351)


--- trunk/Source/_javascript_Core/runtime/VM.h	2015-08-12 19:31:38 UTC (rev 188350)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2015-08-12 20:12:05 UTC (rev 188351)
@@ -514,7 +514,6 @@
     JS_EXPORT_PRIVATE void dumpRegExpTrace();
 
     bool isCollectorBusy() { return heap.isBusy(); }
-    JS_EXPORT_PRIVATE void releaseExecutableMemory();
 
 #if ENABLE(GC_VALIDATION)
     bool isInitializingObject() const; 

Modified: trunk/Source/_javascript_Core/runtime/Watchdog.cpp (188350 => 188351)


--- trunk/Source/_javascript_Core/runtime/Watchdog.cpp	2015-08-12 19:31:38 UTC (rev 188350)
+++ trunk/Source/_javascript_Core/runtime/Watchdog.cpp	2015-08-12 20:12:05 UTC (rev 188351)
@@ -84,7 +84,7 @@
     if (!hadTimeLimit) {
         // And if we've previously compiled any functions, we need to revert
         // them because they don't have the needed polling checks yet.
-        vm.releaseExecutableMemory();
+        vm.discardAllCode();
     }
 
     if (m_hasEnteredVM && hasTimeLimit())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to