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

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

Issue 1652103003: Oilpan: Remove synchronous completeSweep() from V8's minor GC prologue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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/platform/heap/ThreadState.h ('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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
645 completeSweep();
sof 2016/02/02 08:19:27 Unnecessary, already done in collectGarbage().
644 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::PageNavigationGC); 646 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::PageNavigationGC);
645 } 647 }
646 } 648 }
647 649
648 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) 650 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio)
649 { 651 {
650 ASSERT(checkThread()); 652 ASSERT(checkThread());
651 Heap::reportMemoryUsageForTracing(); 653 Heap::reportMemoryUsageForTracing();
652 654
653 #if PRINT_HEAP_STATS 655 #if PRINT_HEAP_STATS
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 threadDump->addScalar("dead_count", "objects", totalDeadCount); 1509 threadDump->addScalar("dead_count", "objects", totalDeadCount);
1508 threadDump->addScalar("live_size", "bytes", totalLiveSize); 1510 threadDump->addScalar("live_size", "bytes", totalLiveSize);
1509 threadDump->addScalar("dead_size", "bytes", totalDeadSize); 1511 threadDump->addScalar("dead_size", "bytes", totalDeadSize);
1510 1512
1511 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1513 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1512 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1514 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1513 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1515 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid());
1514 } 1516 }
1515 1517
1516 } // namespace blink 1518 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698