| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 // Add pages to the orphaned page pool to ensure any global GCs from this po
int | 258 // Add pages to the orphaned page pool to ensure any global GCs from this po
int |
| 259 // on will not trace objects on this thread's arenas. | 259 // on will not trace objects on this thread's arenas. |
| 260 cleanupPages(); | 260 cleanupPages(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void ThreadState::cleanupMainThread() | 263 void ThreadState::cleanupMainThread() |
| 264 { | 264 { |
| 265 ASSERT(isMainThread()); | 265 ASSERT(isMainThread()); |
| 266 | 266 |
| 267 #if defined(LEAK_SANITIZER) |
| 268 // See comment below, clear out most garbage before releasing static |
| 269 // persistents should some of the finalizers depend on touching |
| 270 // these persistents. |
| 271 ThreadHeap::collectAllGarbage(); |
| 272 #endif |
| 273 |
| 267 releaseStaticPersistentNodes(); | 274 releaseStaticPersistentNodes(); |
| 268 | 275 |
| 269 #if defined(LEAK_SANITIZER) | 276 #if defined(LEAK_SANITIZER) |
| 270 // If LSan is about to perform leak detection, after having released all | 277 // If LSan is about to perform leak detection, after having released all |
| 271 // the registered static Persistent<> root references to global caches | 278 // the registered static Persistent<> root references to global caches |
| 272 // that Blink keeps, follow up with a round of GCs to clear out all | 279 // that Blink keeps, follow up with a round of GCs to clear out all |
| 273 // what they referred to. | 280 // what they referred to. |
| 274 // | 281 // |
| 275 // This is not needed for caches over non-Oilpan objects, as they're | 282 // This is not needed for caches over non-Oilpan objects, as they're |
| 276 // not scanned by LSan due to being held in non-global storage | 283 // not scanned by LSan due to being held in non-global storage |
| (...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1530 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1524 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1531 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1525 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1532 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1526 | 1533 |
| 1527 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1534 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1528 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1535 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1529 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1536 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1530 } | 1537 } |
| 1531 | 1538 |
| 1532 } // namespace blink | 1539 } // namespace blink |
| OLD | NEW |