Changeset 188351 in webkit
- Timestamp:
- Aug 12, 2015, 1:12:05 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r188344 r188351 1 2015-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 1 23 2015-08-12 Jon Honeycutt <jhoneycutt@apple.com> 2 24 -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h
r188344 r188351 68 68 69 69 class VM; 70 void releaseExecutableMemory(VM&);71 70 72 71 static const unsigned jitAllocationGranule = 32; -
trunk/Source/JavaScriptCore/jsc.cpp
r188344 r188351 464 464 static EncodedJSValue JSC_HOST_CALL functionAddressOf(ExecState*); 465 465 #ifndef NDEBUG 466 static EncodedJSValue JSC_HOST_CALL functionReleaseExecutableMemory(ExecState*);467 466 static EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState*); 468 467 #endif … … 613 612 #ifndef NDEBUG 614 613 addFunction(vm, "dumpCallFrame", functionDumpCallFrame, 0); 615 addFunction(vm, "releaseExecutableMemory", functionReleaseExecutableMemory, 0);616 614 #endif 617 615 addFunction(vm, "version", functionVersion, 1); … … 909 907 return returnValue; 910 908 } 911 912 913 #ifndef NDEBUG914 EncodedJSValue JSC_HOST_CALL functionReleaseExecutableMemory(ExecState* exec)915 {916 JSLockHolder lock(exec);917 exec->vm().releaseExecutableMemory();918 return JSValue::encode(jsUndefined());919 }920 #endif921 909 922 910 EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*) -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r188344 r188351 511 511 } 512 512 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 } else552 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 565 513 void VM::throwException(ExecState* exec, Exception* exception) 566 514 { … … 670 618 #endif 671 619 672 void releaseExecutableMemory(VM& vm)673 {674 vm.releaseExecutableMemory();675 }676 677 620 #if ENABLE(DFG_JIT) 678 621 void VM::gatherConservativeRoots(ConservativeRoots& conservativeRoots) -
trunk/Source/JavaScriptCore/runtime/VM.h
r188344 r188351 515 515 516 516 bool isCollectorBusy() { return heap.isBusy(); } 517 JS_EXPORT_PRIVATE void releaseExecutableMemory();518 517 519 518 #if ENABLE(GC_VALIDATION) -
trunk/Source/JavaScriptCore/runtime/Watchdog.cpp
r188344 r188351 85 85 // And if we've previously compiled any functions, we need to revert 86 86 // them because they don't have the needed polling checks yet. 87 vm. releaseExecutableMemory();87 vm.discardAllCode(); 88 88 } 89 89
Note:
See TracChangeset
for help on using the changeset viewer.