| 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 { | 618 { |
| 619 // Finish Oilpan's complete sweeping before running a V8 major GC. | 619 // Finish Oilpan's complete sweeping before running a V8 major GC. |
| 620 // This will let the GC collect more V8 objects. | 620 // This will let the GC collect more V8 objects. |
| 621 // | 621 // |
| 622 // TODO(haraken): It's a bit too late for a major GC to schedule | 622 // TODO(haraken): It's a bit too late for a major GC to schedule |
| 623 // completeSweep() here, because gcPrologue for a major GC is called | 623 // completeSweep() here, because gcPrologue for a major GC is called |
| 624 // not at the point where the major GC started but at the point where | 624 // not at the point where the major GC started but at the point where |
| 625 // the major GC requests object grouping. | 625 // the major GC requests object grouping. |
| 626 if (gcType == BlinkGC::V8MajorGC) | 626 if (gcType == BlinkGC::V8MajorGC) |
| 627 completeSweep(); | 627 completeSweep(); |
| 628 | |
| 629 // The fact that the PageNavigation GC is scheduled means that there is | |
| 630 // a dead frame. In common cases, a sequence of Oilpan's GC => V8 GC => | |
| 631 // Oilpan's GC is needed to collect the dead frame. So we force the | |
| 632 // PageNavigation GC before running the V8 GC. | |
| 633 if (gcState() == PageNavigationGCScheduled) { | |
| 634 #if PRINT_HEAP_STATS | |
| 635 dataLogF("Scheduled PageNavigationGC\n"); | |
| 636 #endif | |
| 637 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep,
BlinkGC::PageNavigationGC); | |
| 638 } | |
| 639 } | 628 } |
| 640 | 629 |
| 641 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) | 630 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) |
| 642 { | 631 { |
| 643 ASSERT(checkThread()); | 632 ASSERT(checkThread()); |
| 644 Heap::reportMemoryUsageForTracing(); | 633 Heap::reportMemoryUsageForTracing(); |
| 645 | 634 |
| 646 #if PRINT_HEAP_STATS | 635 #if PRINT_HEAP_STATS |
| 647 dataLogF("ThreadState::schedulePageNavigationGCIfNeeded (estimatedRemovalRat
io=%.2lf)\n", estimatedRemovalRatio); | 636 dataLogF("ThreadState::schedulePageNavigationGCIfNeeded (estimatedRemovalRat
io=%.2lf)\n", estimatedRemovalRatio); |
| 648 #endif | 637 #endif |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1500 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1489 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1501 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1490 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1502 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1491 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1503 | 1492 |
| 1504 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1493 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1505 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1494 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1506 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1495 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1507 } | 1496 } |
| 1508 | 1497 |
| 1509 } // namespace blink | 1498 } // namespace blink |
| OLD | NEW |