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

Side by Side Diff: Source/platform/heap/ThreadState.h

Issue 1190513006: Oilpan: adjust GC policy under memory pressure (only.) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove testing CPPery Created 5 years, 6 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 | « Source/bindings/core/v8/V8GCController.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 308 }
309 309
310 static ThreadState* mainThreadState() 310 static ThreadState* mainThreadState()
311 { 311 {
312 return reinterpret_cast<ThreadState*>(s_mainThreadStateStorage); 312 return reinterpret_cast<ThreadState*>(s_mainThreadStateStorage);
313 } 313 }
314 314
315 bool isMainThread() const { return this == mainThreadState(); } 315 bool isMainThread() const { return this == mainThreadState(); }
316 void checkThread() const { ASSERT(m_thread == currentThread()); } 316 void checkThread() const { ASSERT(m_thread == currentThread()); }
317 317
318 void didV8GC(); 318 void didV8MajorGC();
319 319
320 void performIdleGC(double deadlineSeconds); 320 void performIdleGC(double deadlineSeconds);
321 void performIdleLazySweep(double deadlineSeconds); 321 void performIdleLazySweep(double deadlineSeconds);
322 322
323 void scheduleIdleGC(); 323 void scheduleIdleGC();
324 void scheduleIdleLazySweep(); 324 void scheduleIdleLazySweep();
325 void schedulePreciseGC(); 325 void schedulePreciseGC();
326 void scheduleGCIfNeeded(); 326 void scheduleGCIfNeeded();
327 void setGCState(GCState); 327 void setGCState(GCState);
328 GCState gcState() const; 328 GCState gcState() const;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); 645 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope();
646 void clearSafePointScopeMarker() 646 void clearSafePointScopeMarker()
647 { 647 {
648 m_safePointStackCopy.clear(); 648 m_safePointStackCopy.clear();
649 m_safePointScopeMarker = nullptr; 649 m_safePointScopeMarker = nullptr;
650 } 650 }
651 651
652 // shouldSchedule{Precise,Idle}GC and shouldForceConservativeGC 652 // shouldSchedule{Precise,Idle}GC and shouldForceConservativeGC
653 // implement the heuristics that are used to determine when to collect garba ge. 653 // implement the heuristics that are used to determine when to collect garba ge.
654 // If shouldForceConservativeGC returns true, we force the garbage 654 // If shouldForceConservativeGC returns true, we force the garbage
655 // collection immediately. Otherwise, if shouldGC returns true, we 655 // collection immediately. Otherwise, if should*GC returns true, we
656 // record that we should garbage collect the next time we return 656 // record that we should garbage collect the next time we return
657 // to the event loop. If both return false, we don't need to 657 // to the event loop. If both return false, we don't need to
658 // collect garbage at this point. 658 // collect garbage at this point.
659 bool shouldScheduleIdleGC(); 659 bool shouldScheduleIdleGC();
660 bool shouldSchedulePreciseGC(); 660 bool shouldSchedulePreciseGC();
661 bool shouldForceConservativeGC(); 661 bool shouldForceConservativeGC();
662
663 // Internal helper for GC policy handling code. Returns true if
664 // an urgent conservative GC is now needed due to memory pressure.
665 bool shouldForceMemoryPressureGC();
666
662 void runScheduledGC(StackState); 667 void runScheduledGC(StackState);
663 668
664 void eagerSweep(); 669 void eagerSweep();
665 670
666 #if defined(ADDRESS_SANITIZER) 671 #if defined(ADDRESS_SANITIZER)
667 void poisonEagerHeap(Poisoning); 672 void poisonEagerHeap(Poisoning);
668 void poisonAllHeaps(); 673 void poisonAllHeaps();
669 #endif 674 #endif
670 675
671 // When ThreadState is detaching from non-main thread its 676 // When ThreadState is detaching from non-main thread its
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 }; 772 };
768 773
769 template<> class ThreadStateFor<AnyThread> { 774 template<> class ThreadStateFor<AnyThread> {
770 public: 775 public:
771 static ThreadState* state() { return ThreadState::current(); } 776 static ThreadState* state() { return ThreadState::current(); }
772 }; 777 };
773 778
774 } // namespace blink 779 } // namespace blink
775 780
776 #endif // ThreadState_h 781 #endif // ThreadState_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8GCController.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698