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

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

Issue 2686533003: Move postGC out of CrossThreadPersistentRegion::LockScope (Closed)
Patch Set: fix Created 3 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
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 bool isSweepingInProgress() const { 219 bool isSweepingInProgress() const {
220 return gcState() == Sweeping || 220 return gcState() == Sweeping ||
221 gcState() == SweepingAndPreciseGCScheduled || 221 gcState() == SweepingAndPreciseGCScheduled ||
222 gcState() == SweepingAndIdleGCScheduled; 222 gcState() == SweepingAndIdleGCScheduled;
223 } 223 }
224 224
225 // A GC runs in the following sequence. 225 // A GC runs in the following sequence.
226 // 226 //
227 // 1) preGC() is called. 227 // 1) preGC() is called.
228 // 2) ThreadHeap::collectGarbage() is called. This marks live objects. 228 // 2) ThreadHeap::collectGarbage() is called. This marks live objects.
229 // 3) postGC() is called. This does thread-local weak processing, 229 // 3) postGC() is called. This does thread-local weak processing.
230 // pre-finalization, eager sweeping and heap compaction. 230 // 4) preSweep() is called. This does pre-finalization, eager sweeping and
231 // heap compaction.
231 // 4) Lazy sweeping sweeps heaps incrementally. completeSweep() may be called 232 // 4) Lazy sweeping sweeps heaps incrementally. completeSweep() may be called
232 // to complete the sweeping. 233 // to complete the sweeping.
233 // 5) postSweep() is called. 234 // 5) postSweep() is called.
234 // 235 //
235 // Notes: 236 // Notes:
236 // - The world is stopped between 1) and 3). 237 // - The world is stopped between 1) and 3).
237 // - isInGC() returns true between 1) and 3). 238 // - isInGC() returns true between 1) and 3).
238 // - isSweepingInProgress() returns true while any sweeping operation is 239 // - isSweepingInProgress() returns true while any sweeping operation is
239 // running. 240 // running.
240 void makeConsistentForGC(); 241 void makeConsistentForGC();
241 void preGC(); 242 void preGC();
242 void postGC(BlinkGC::GCType); 243 void postGC(BlinkGC::GCType);
243 void completeSweep(); 244 void completeSweep();
245 void preSweep(BlinkGC::GCType);
244 void postSweep(); 246 void postSweep();
245 // makeConsistentForMutator() drops marks from marked objects and rebuild 247 // makeConsistentForMutator() drops marks from marked objects and rebuild
246 // free lists. This is called after taking a snapshot and before resuming 248 // free lists. This is called after taking a snapshot and before resuming
247 // the executions of mutators. 249 // the executions of mutators.
248 void makeConsistentForMutator(); 250 void makeConsistentForMutator();
249 251
250 void compact(); 252 void compact();
251 253
252 // Support for disallowing allocation. Mainly used for sanity 254 // Support for disallowing allocation. Mainly used for sanity
253 // checks asserts. 255 // checks asserts.
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 class ThreadStateFor<AnyThread> { 730 class ThreadStateFor<AnyThread> {
729 STATIC_ONLY(ThreadStateFor); 731 STATIC_ONLY(ThreadStateFor);
730 732
731 public: 733 public:
732 static ThreadState* state() { return ThreadState::current(); } 734 static ThreadState* state() { return ThreadState::current(); }
733 }; 735 };
734 736
735 } // namespace blink 737 } // namespace blink
736 738
737 #endif // ThreadState_h 739 #endif // ThreadState_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698