Changeset 181486 in webkit
- Timestamp:
- Mar 13, 2015, 1:14:39 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
heap/Heap.cpp (modified) (2 diffs)
-
heap/IncrementalSweeper.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r181485 r181486 1 2015-03-12 Geoffrey Garen <ggaren@apple.com> 2 3 Prohibit GC while sweeping 4 https://bugs.webkit.org/show_bug.cgi?id=142638 5 6 Reviewed by Andreas Kling. 7 8 I noticed in https://bugs.webkit.org/show_bug.cgi?id=142636 that a GC 9 could trigger a sweep which could trigger another GC. Yo Dawg. 10 11 I tried to figure out whether this could cause problems or not and it 12 made me cross-eyed. 13 14 (Some clients like to report extra memory cost during deallocation as a 15 way to indicate that the GC now owns something exclusively. It's 16 arguably a bug to communicate with the GC in this way, but we shouldn't 17 do crazy when this happens.) 18 19 This patch makes explicit the fact that we don't allow GC while sweeping. 20 21 Usually, sweeping implicitly defers GC by virtue of happening during 22 allocation. But not always. 23 24 * heap/Heap.cpp: 25 (JSC::Heap::collectAllGarbage): Defer GC while sweeping due to an 26 explicit GC request. 27 28 (JSC::Heap::didFinishCollection): Make sure that zombifying sweep 29 defers GC by not returning to the non-GC state until we're all done. 30 31 * heap/IncrementalSweeper.cpp: 32 (JSC::IncrementalSweeper::sweepNextBlock): Defer GC while sweeping due 33 to a timer. 34 1 35 2015-03-13 Mark Lam <mark.lam@apple.com> 2 36 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r181407 r181486 989 989 990 990 SamplingRegion samplingRegion("Garbage Collection: Sweeping"); 991 992 DeferGCForAWhile deferGC(*this); 991 993 m_objectSpace.sweep(); 992 994 m_objectSpace.shrink(); … … 1294 1296 if (Options::recordGCPauseTimes()) 1295 1297 HeapStatistics::recordGCPauseTime(gcStartTime, gcEndTime); 1298 1299 if (Options::useZombieMode()) 1300 zombifyDeadObjects(); 1301 1302 if (Options::objectsAreImmortal()) 1303 markDeadObjects(); 1304 1305 if (Options::showObjectStatistics()) 1306 HeapStatistics::showObjectStatistics(this); 1307 1308 if (Options::logGC() == GCLogging::Verbose) 1309 GCLogging::dumpObjectGraph(this); 1310 1296 1311 RELEASE_ASSERT(m_operationInProgress == EdenCollection || m_operationInProgress == FullCollection); 1297 1298 1312 m_operationInProgress = NoOperation; 1299 1313 JAVASCRIPTCORE_GC_END(); 1300 1301 if (Options::useZombieMode())1302 zombifyDeadObjects();1303 1304 if (Options::objectsAreImmortal())1305 markDeadObjects();1306 1307 if (Options::showObjectStatistics())1308 HeapStatistics::showObjectStatistics(this);1309 1310 if (Options::logGC() == GCLogging::Verbose)1311 GCLogging::dumpObjectGraph(this);1312 1314 } 1313 1315 -
trunk/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
r181350 r181486 96 96 continue; 97 97 98 DeferGCForAWhile deferGC(m_vm->heap); 98 99 block->sweep(); 99 100 m_vm->heap.objectSpace().freeOrShrinkBlock(block);
Note:
See TracChangeset
for help on using the changeset viewer.