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

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

Issue 1670093002: Do not initiate Oilpan GC if under known stack pressure. 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/StackFrameDepth.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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 628
629 // If stack room is currently at a high premium, do not initiate an
630 // Oilpan GC.
631 if (StackFrameDepth::hasInsufficientStackForGC())
632 return;
633
629 // The fact that the PageNavigation GC is scheduled means that there is 634 // 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 => 635 // 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 636 // Oilpan's GC is needed to collect the dead frame. So we force the
632 // PageNavigation GC before running the V8 GC. 637 // PageNavigation GC before running the V8 GC.
633 if (gcState() == PageNavigationGCScheduled) { 638 if (gcState() == PageNavigationGCScheduled) {
634 #if PRINT_HEAP_STATS 639 #if PRINT_HEAP_STATS
635 dataLogF("Scheduled PageNavigationGC\n"); 640 dataLogF("Scheduled PageNavigationGC\n");
636 #endif 641 #endif
637 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::PageNavigationGC); 642 Heap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::PageNavigationGC);
638 } 643 }
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 threadDump->addScalar("dead_count", "objects", totalDeadCount); 1505 threadDump->addScalar("dead_count", "objects", totalDeadCount);
1501 threadDump->addScalar("live_size", "bytes", totalLiveSize); 1506 threadDump->addScalar("live_size", "bytes", totalLiveSize);
1502 threadDump->addScalar("dead_size", "bytes", totalDeadSize); 1507 threadDump->addScalar("dead_size", "bytes", totalDeadSize);
1503 1508
1504 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1509 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1505 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1510 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName);
1506 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); 1511 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid());
1507 } 1512 }
1508 1513
1509 } // namespace blink 1514 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698