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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 bool shouldForceConservativeGC(); | 697 bool shouldForceConservativeGC(); |
698 // V8 minor or major GC is likely to drop a lot of references to objects | 698 // V8 minor or major GC is likely to drop a lot of references to objects |
699 // on Oilpan's heap. We give a chance to schedule a GC. | 699 // on Oilpan's heap. We give a chance to schedule a GC. |
700 bool shouldScheduleV8FollowupGC(); | 700 bool shouldScheduleV8FollowupGC(); |
701 // Page navigation is likely to drop a lot of references to objects | 701 // Page navigation is likely to drop a lot of references to objects |
702 // on Oilpan's heap. We give a chance to schedule a GC. | 702 // on Oilpan's heap. We give a chance to schedule a GC. |
703 // estimatedRemovalRatio is the estimated ratio of objects that will be no | 703 // estimatedRemovalRatio is the estimated ratio of objects that will be no |
704 // longer necessary due to the navigation. | 704 // longer necessary due to the navigation. |
705 bool shouldSchedulePageNavigationGC(float estimatedRemovalRatio); | 705 bool shouldSchedulePageNavigationGC(float estimatedRemovalRatio); |
706 | 706 |
707 // Internal helper for GC policy handling code. Returns true if | 707 // Internal helpers to handle memory pressure conditions. |
708 // an urgent conservative GC is now needed due to memory pressure. | 708 |
| 709 // Returns true if memory use is in a near-OOM state |
| 710 // (aka being under "memory pressure".) |
709 bool shouldForceMemoryPressureGC(); | 711 bool shouldForceMemoryPressureGC(); |
| 712 |
| 713 // Returns true if shouldForceMemoryPressureGC() held and a |
| 714 // conservative GC was performed to handle the emergency. |
| 715 bool forceMemoryPressureGCIfNeeded(); |
| 716 |
710 size_t estimatedLiveSize(size_t currentSize, size_t sizeAtLastGC); | 717 size_t estimatedLiveSize(size_t currentSize, size_t sizeAtLastGC); |
711 size_t totalMemorySize(); | 718 size_t totalMemorySize(); |
712 double heapGrowingRate(); | 719 double heapGrowingRate(); |
713 double partitionAllocGrowingRate(); | 720 double partitionAllocGrowingRate(); |
714 bool judgeGCThreshold(size_t allocatedObjectSizeThreshold, double heapGrowin
gRateThreshold); | 721 bool judgeGCThreshold(size_t allocatedObjectSizeThreshold, double heapGrowin
gRateThreshold); |
715 | 722 |
716 void runScheduledGC(StackState); | 723 void runScheduledGC(StackState); |
717 | 724 |
718 void eagerSweep(); | 725 void eagerSweep(); |
719 | 726 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 }; | 838 }; |
832 | 839 |
833 template<> class ThreadStateFor<AnyThread> { | 840 template<> class ThreadStateFor<AnyThread> { |
834 public: | 841 public: |
835 static ThreadState* state() { return ThreadState::current(); } | 842 static ThreadState* state() { return ThreadState::current(); } |
836 }; | 843 }; |
837 | 844 |
838 } // namespace blink | 845 } // namespace blink |
839 | 846 |
840 #endif // ThreadState_h | 847 #endif // ThreadState_h |
OLD | NEW |