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

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

Issue 1252683003: Oilpan: Schedule a precise GC when a page navigates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // thread. 178 // thread.
179 ThreadTerminationGC, 179 ThreadTerminationGC,
180 }; 180 };
181 181
182 // See setGCState() for possible state transitions. 182 // See setGCState() for possible state transitions.
183 enum GCState { 183 enum GCState {
184 NoGCScheduled, 184 NoGCScheduled,
185 IdleGCScheduled, 185 IdleGCScheduled,
186 PreciseGCScheduled, 186 PreciseGCScheduled,
187 FullGCScheduled, 187 FullGCScheduled,
188 PageNavigationGCScheduled,
haraken 2015/08/11 07:43:08 You need to add PageNavigationGCScheduled to Threa
keishi 2015/08/11 08:12:58 Please check the change to ThreadState::setGCState
188 GCRunning, 189 GCRunning,
189 EagerSweepScheduled, 190 EagerSweepScheduled,
190 LazySweepScheduled, 191 LazySweepScheduled,
191 Sweeping, 192 Sweeping,
192 SweepingAndIdleGCScheduled, 193 SweepingAndIdleGCScheduled,
193 SweepingAndPreciseGCScheduled, 194 SweepingAndPreciseGCScheduled,
194 }; 195 };
195 196
196 enum HeapIndices { 197 enum HeapIndices {
197 EagerSweepHeapIndex = 0, 198 EagerSweepHeapIndex = 0,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 #endif 323 #endif
323 324
324 void didV8MajorGC(); 325 void didV8MajorGC();
325 326
326 void performIdleGC(double deadlineSeconds); 327 void performIdleGC(double deadlineSeconds);
327 void performIdleLazySweep(double deadlineSeconds); 328 void performIdleLazySweep(double deadlineSeconds);
328 329
329 void scheduleIdleGC(); 330 void scheduleIdleGC();
330 void scheduleIdleLazySweep(); 331 void scheduleIdleLazySweep();
331 void schedulePreciseGC(); 332 void schedulePreciseGC();
333 // estimatedRemovalRatio is the estimated ratio of objects that will be no
334 // longer necessary due to the navigation.
335 bool shouldSchedulePageNavigationGC(float estimatedRemovalRatio);
haraken 2015/08/11 07:43:08 Move this declaration to the other shouldScheduleX
keishi 2015/08/11 08:12:58 Done.
336 void schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio);
337 void schedulePageNavigationGC();
332 void scheduleGCIfNeeded(); 338 void scheduleGCIfNeeded();
333 void setGCState(GCState); 339 void setGCState(GCState);
334 GCState gcState() const; 340 GCState gcState() const;
335 bool isInGC() const { return gcState() == GCRunning; } 341 bool isInGC() const { return gcState() == GCRunning; }
336 bool isSweepingInProgress() const 342 bool isSweepingInProgress() const
337 { 343 {
338 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul ed || gcState() == SweepingAndIdleGCScheduled; 344 return gcState() == Sweeping || gcState() == SweepingAndPreciseGCSchedul ed || gcState() == SweepingAndIdleGCScheduled;
339 } 345 }
340 346
341 // A GC runs in the following sequence. 347 // A GC runs in the following sequence.
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 }; 809 };
804 810
805 template<> class ThreadStateFor<AnyThread> { 811 template<> class ThreadStateFor<AnyThread> {
806 public: 812 public:
807 static ThreadState* state() { return ThreadState::current(); } 813 static ThreadState* state() { return ThreadState::current(); }
808 }; 814 };
809 815
810 } // namespace blink 816 } // namespace blink
811 817
812 #endif // ThreadState_h 818 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698