Changeset 285653 in webkit
- Timestamp:
- Nov 11, 2021, 1:24:11 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r285651 r285653 1 2021-11-11 Mark Lam <mark.lam@apple.com> 2 3 Rename Heap::isCurrentThreadBusy() to Heap::currentThreadIsDoingGCWork(). 4 https://bugs.webkit.org/show_bug.cgi?id=233005 5 rdar://85307204 6 7 Reviewed by Saam Barati. 8 9 This rename clarifies what the "busy" part is about. Also remove some unused code: 10 Heap::isValidAllocation(), isValidThreadState(), and isValidSharedInstanceThreadState(). 11 12 * bytecode/CodeBlock.cpp: 13 (JSC::CodeBlock::jettison): 14 * heap/Heap.cpp: 15 (JSC::Heap::currentThreadIsDoingGCWork): 16 (JSC::Heap::isValidAllocation): Deleted. 17 (JSC::Heap::isCurrentThreadBusy): Deleted. 18 * heap/Heap.h: 19 * jsc.cpp: 20 (jscmain): 21 * runtime/VM.h: 22 (JSC::VM::isCollectorBusyOnCurrentThread): 23 1 24 2021-11-11 Michael Saboff <msaboff@apple.com> 2 25 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r285636 r285653 2295 2295 if (!jitCode()->dfgCommon()->invalidate()) { 2296 2296 // We've already been invalidated. 2297 RELEASE_ASSERT(this != replacement() || (vm.heap. isCurrentThreadBusy() && !vm.heap.isMarked(ownerExecutable())));2297 RELEASE_ASSERT(this != replacement() || (vm.heap.currentThreadIsDoingGCWork() && !vm.heap.isMarked(ownerExecutable()))); 2298 2298 return; 2299 2299 } … … 2327 2327 // Jettison can happen during GC. We don't want to install code to a dead executable 2328 2328 // because that would add a dead object to the remembered set. 2329 if (vm.heap. isCurrentThreadBusy() && !vm.heap.isMarked(ownerExecutable()))2329 if (vm.heap.currentThreadIsDoingGCWork() && !vm.heap.isMarked(ownerExecutable())) 2330 2330 return; 2331 2331 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r285636 r285653 139 139 } 140 140 141 bool isValidSharedInstanceThreadState(VM& vm)142 {143 return vm.currentThreadIsHoldingAPILock();144 }145 146 bool isValidThreadState(VM& vm)147 {148 if (vm.atomStringTable() != Thread::current().atomStringTable())149 return false;150 151 if (vm.isSharedInstance() && !isValidSharedInstanceThreadState(vm))152 return false;153 154 return true;155 }156 157 141 void recordType(VM& vm, TypeCountSet& set, JSCell* cell) 158 142 { … … 2380 2364 } 2381 2365 2382 bool Heap::isValidAllocation(size_t)2383 {2384 if (!isValidThreadState(vm()))2385 return false;2386 2387 if (isCurrentThreadBusy())2388 return false;2389 2390 return true;2391 }2392 2393 2366 void Heap::addFinalizer(JSCell* cell, CFinalizer finalizer) 2394 2367 { … … 2537 2510 } 2538 2511 2539 bool Heap:: isCurrentThreadBusy()2512 bool Heap::currentThreadIsDoingGCWork() 2540 2513 { 2541 2514 return Thread::mayBeGCThread() || mutatorState() != MutatorState::Running; -
trunk/Source/JavaScriptCore/heap/Heap.h
r285636 r285653 165 165 // We're always busy on the collection threads. On the main thread, this returns true if we're 166 166 // helping heap. 167 JS_EXPORT_PRIVATE bool isCurrentThreadBusy();167 JS_EXPORT_PRIVATE bool currentThreadIsDoingGCWork(); 168 168 169 169 typedef void (*CFinalizer)(JSCell*); … … 427 427 }; 428 428 429 JS_EXPORT_PRIVATE bool isValidAllocation(size_t);430 429 JS_EXPORT_PRIVATE void reportExtraMemoryAllocatedSlowCase(size_t); 431 430 JS_EXPORT_PRIVATE void deprecatedReportExtraMemorySlowCase(size_t); -
trunk/Source/JavaScriptCore/jsc.cpp
r285636 r285653 3766 3766 vm.deleteAllCode(DeleteAllCodeIfNotCollecting); 3767 3767 3768 if (!vm.heap. isCurrentThreadBusy()) {3768 if (!vm.heap.currentThreadIsDoingGCWork()) { 3769 3769 if (isSynchronous) { 3770 3770 vm.heap.collectNow(Sync, CollectionScope::Full); -
trunk/Source/JavaScriptCore/runtime/VM.h
r285636 r285653 1087 1087 JS_EXPORT_PRIVATE void dumpRegExpTrace(); 1088 1088 1089 bool isCollectorBusyOnCurrentThread() { return heap. isCurrentThreadBusy(); }1089 bool isCollectorBusyOnCurrentThread() { return heap.currentThreadIsDoingGCWork(); } 1090 1090 1091 1091 #if ENABLE(GC_VALIDATION) -
trunk/Source/WebCore/ChangeLog
r285652 r285653 1 2021-11-11 Mark Lam <mark.lam@apple.com> 2 3 Rename Heap::isCurrentThreadBusy() to Heap::currentThreadIsDoingGCWork(). 4 https://bugs.webkit.org/show_bug.cgi?id=233005 5 rdar://85307204 6 7 Reviewed by Saam Barati. 8 9 * bindings/js/GCController.cpp: 10 (WebCore::GCController::garbageCollectNow): 11 (WebCore::GCController::garbageCollectNowIfNotDoneRecently): 12 * workers/WorkerGlobalScope.cpp: 13 (WebCore::WorkerGlobalScope::deleteJSCodeAndGC): 14 1 15 2021-11-11 Michael Catanzaro <mcatanzaro@gnome.org> 2 16 -
trunk/Source/WebCore/bindings/js/GCController.cpp
r285636 r285653 93 93 { 94 94 JSLockHolder lock(commonVM()); 95 if (!commonVM().heap. isCurrentThreadBusy()) {95 if (!commonVM().heap.currentThreadIsDoingGCWork()) { 96 96 commonVM().heap.collectNow(Sync, CollectionScope::Full); 97 97 WTF::releaseFastMallocFreeMemory(); … … 103 103 #if USE(CF) || USE(GLIB) 104 104 JSLockHolder lock(commonVM()); 105 if (!commonVM().heap. isCurrentThreadBusy())105 if (!commonVM().heap.currentThreadIsDoingGCWork()) 106 106 commonVM().heap.collectNowFullIfNotDoneRecently(Async); 107 107 #else -
trunk/Source/WebCore/workers/WorkerGlobalScope.cpp
r285566 r285653 576 576 577 577 if (synchronous == Synchronous::Yes) { 578 if (!vm().heap. isCurrentThreadBusy()) {578 if (!vm().heap.currentThreadIsDoingGCWork()) { 579 579 vm().heap.collectNow(JSC::Sync, JSC::CollectionScope::Full); 580 580 WTF::releaseFastMallocFreeMemory(); … … 583 583 } 584 584 #if PLATFORM(IOS_FAMILY) 585 if (!vm().heap. isCurrentThreadBusy()) {585 if (!vm().heap.currentThreadIsDoingGCWork()) { 586 586 vm().heap.collectNowFullIfNotDoneRecently(JSC::Async); 587 587 return;
Note:
See TracChangeset
for help on using the changeset viewer.