Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 prepareForThreadStateTermination(); | 234 prepareForThreadStateTermination(); |
| 235 | 235 |
| 236 ProcessHeap::crossThreadPersistentRegion().prepareForThreadStateTermination( this); | 236 ProcessHeap::crossThreadPersistentRegion().prepareForThreadStateTermination( this); |
| 237 | 237 |
| 238 // Do thread local GC's as long as the count of thread local Persistents | 238 // Do thread local GC's as long as the count of thread local Persistents |
| 239 // changes and is above zero. | 239 // changes and is above zero. |
| 240 int oldCount = -1; | 240 int oldCount = -1; |
| 241 int currentCount = getPersistentRegion()->numberOfPersistents(); | 241 int currentCount = getPersistentRegion()->numberOfPersistents(); |
| 242 ASSERT(currentCount >= 0); | 242 ASSERT(currentCount >= 0); |
| 243 while (currentCount != oldCount) { | 243 while (currentCount != oldCount) { |
| 244 releaseStaticPersistentNodes(); | |
|
pfeldman
2016/05/06 21:20:40
What is this about? Could you send it to the heap
xidachen
2016/05/06 21:41:54
sof@: Thank you for your CL that clears static per
sof
2016/05/07 05:17:45
It is still needed, a destructor might still creat
| |
| 244 ThreadHeap::collectGarbageForTerminatingThread(this); | 245 ThreadHeap::collectGarbageForTerminatingThread(this); |
| 245 oldCount = currentCount; | 246 oldCount = currentCount; |
| 246 currentCount = getPersistentRegion()->numberOfPersistents(); | 247 currentCount = getPersistentRegion()->numberOfPersistents(); |
| 247 } | 248 } |
| 248 // We should not have any persistents left when getting to this point, | 249 // We should not have any persistents left when getting to this point, |
| 249 // if we have it is probably a bug so adding a debug ASSERT to catch this. | 250 // if we have it is probably a bug so adding a debug ASSERT to catch this. |
| 250 ASSERT(!currentCount); | 251 ASSERT(!currentCount); |
| 251 // All of pre-finalizers should be consumed. | 252 // All of pre-finalizers should be consumed. |
| 252 ASSERT(m_orderedPreFinalizers.isEmpty()); | 253 ASSERT(m_orderedPreFinalizers.isEmpty()); |
| 253 RELEASE_ASSERT(gcState() == NoGCScheduled); | 254 RELEASE_ASSERT(gcState() == NoGCScheduled); |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1520 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1521 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1521 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1522 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1522 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1523 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1523 | 1524 |
| 1524 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1525 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1525 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1526 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1526 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); | 1527 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1527 } | 1528 } |
| 1528 | 1529 |
| 1529 } // namespace blink | 1530 } // namespace blink |
| OLD | NEW |