Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Side by Side Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 1467493002: We mustn't finalize sweeping when V8 started collecting garbage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 #if PRINT_HEAP_STATS 625 #if PRINT_HEAP_STATS
626 dataLogF("Scheduled IdleGC\n"); 626 dataLogF("Scheduled IdleGC\n");
627 #endif 627 #endif
628 scheduleIdleGC(); 628 scheduleIdleGC();
629 return; 629 return;
630 } 630 }
631 } 631 }
632 632
633 void ThreadState::willStartV8GC() 633 void ThreadState::willStartV8GC()
634 { 634 {
635 // Finish Oilpan's complete sweeping before running a V8 GC.
636 // This will let the GC collect more V8 objects.
637 //
638 // TODO(haraken): It's a bit too late for a major GC to schedule
639 // completeSweep() here, because gcPrologue for a major GC is called
640 // not at the point where the major GC started but at the point where
641 // the major GC requests object grouping.
642 completeSweep();
643
644 // The fact that the PageNavigation GC is scheduled means that there is 635 // The fact that the PageNavigation GC is scheduled means that there is
sof 2015/11/20 14:39:37 This means we cannot do page navigation GCs either
jochen (gone - plz use gerrit) 2015/11/20 14:46:18 hum, right :-/
645 // a dead frame. In common cases, a sequence of Oilpan's GC => V8 GC => 636 // a dead frame. In common cases, a sequence of Oilpan's GC => V8 GC =>
646 // Oilpan's GC is needed to collect the dead frame. So we force the 637 // Oilpan's GC is needed to collect the dead frame. So we force the
647 // PageNavigation GC before running the V8 GC. 638 // PageNavigation GC before running the V8 GC.
648 if (gcState() == PageNavigationGCScheduled) { 639 if (gcState() == PageNavigationGCScheduled) {
649 #if PRINT_HEAP_STATS 640 #if PRINT_HEAP_STATS
650 dataLogF("Scheduled PageNavigationGC\n"); 641 dataLogF("Scheduled PageNavigationGC\n");
651 #endif 642 #endif
652 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::PageNavigationGC); 643 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::PageNavigationGC);
653 } 644 }
654 } 645 }
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 threadDump->addScalar("dead_count", "objects", totalDeadCount); 1474 threadDump->addScalar("dead_count", "objects", totalDeadCount);
1484 threadDump->addScalar("live_size", "bytes", totalLiveSize); 1475 threadDump->addScalar("live_size", "bytes", totalLiveSize);
1485 threadDump->addScalar("dead_size", "bytes", totalDeadSize); 1476 threadDump->addScalar("dead_size", "bytes", totalDeadSize);
1486 1477
1487 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1478 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1488 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1479 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1489 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1480 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid());
1490 } 1481 }
1491 1482
1492 } // namespace blink 1483 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698