| 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 } | 615 } |
| 616 if (gcType == BlinkGC::V8MajorGC) { | 616 if (gcType == BlinkGC::V8MajorGC) { |
| 617 #if PRINT_HEAP_STATS | 617 #if PRINT_HEAP_STATS |
| 618 dataLogF("Scheduled IdleGC\n"); | 618 dataLogF("Scheduled IdleGC\n"); |
| 619 #endif | 619 #endif |
| 620 scheduleIdleGC(); | 620 scheduleIdleGC(); |
| 621 return; | 621 return; |
| 622 } | 622 } |
| 623 } | 623 } |
| 624 | 624 |
| 625 void ThreadState::willStartV8GC() | 625 void ThreadState::willStartV8GC(BlinkGC::V8GCType gcType) |
| 626 { | 626 { |
| 627 // Finish Oilpan's complete sweeping before running a V8 GC. | 627 // Finish Oilpan's complete sweeping before running a V8 major GC. |
| 628 // This will let the GC collect more V8 objects. | 628 // This will let the GC collect more V8 objects. |
| 629 // | 629 // |
| 630 // TODO(haraken): It's a bit too late for a major GC to schedule | 630 // TODO(haraken): It's a bit too late for a major GC to schedule |
| 631 // completeSweep() here, because gcPrologue for a major GC is called | 631 // completeSweep() here, because gcPrologue for a major GC is called |
| 632 // not at the point where the major GC started but at the point where | 632 // not at the point where the major GC started but at the point where |
| 633 // the major GC requests object grouping. | 633 // the major GC requests object grouping. |
| 634 completeSweep(); | 634 if (gcType == BlinkGC::V8MajorGC) |
| 635 completeSweep(); |
| 635 | 636 |
| 636 // The fact that the PageNavigation GC is scheduled means that there is | 637 // The fact that the PageNavigation GC is scheduled means that there is |
| 637 // a dead frame. In common cases, a sequence of Oilpan's GC => V8 GC => | 638 // a dead frame. In common cases, a sequence of Oilpan's GC => V8 GC => |
| 638 // Oilpan's GC is needed to collect the dead frame. So we force the | 639 // Oilpan's GC is needed to collect the dead frame. So we force the |
| 639 // PageNavigation GC before running the V8 GC. | 640 // PageNavigation GC before running the V8 GC. |
| 640 if (gcState() == PageNavigationGCScheduled) { | 641 if (gcState() == PageNavigationGCScheduled) { |
| 641 #if PRINT_HEAP_STATS | 642 #if PRINT_HEAP_STATS |
| 642 dataLogF("Scheduled PageNavigationGC\n"); | 643 dataLogF("Scheduled PageNavigationGC\n"); |
| 643 #endif | 644 #endif |
| 644 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep,
BlinkGC::PageNavigationGC); | 645 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep,
BlinkGC::PageNavigationGC); |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1508 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1508 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1509 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1509 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1510 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1510 | 1511 |
| 1511 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1512 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1512 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1513 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1513 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1514 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1514 } | 1515 } |
| 1515 | 1516 |
| 1516 } // namespace blink | 1517 } // namespace blink |
| OLD | NEW |