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

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

Issue 220203005: Oilpan: introduce sticky forcedForTesting flag to ensure that a precise (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // collect garbage at this point. 271 // collect garbage at this point.
272 bool shouldGC(); 272 bool shouldGC();
273 bool shouldForceConservativeGC(); 273 bool shouldForceConservativeGC();
274 274
275 // If gcRequested returns true when a thread returns to its event 275 // If gcRequested returns true when a thread returns to its event
276 // loop the thread will initiate a garbage collection. 276 // loop the thread will initiate a garbage collection.
277 bool gcRequested(); 277 bool gcRequested();
278 void setGCRequested(); 278 void setGCRequested();
279 void clearGCRequested(); 279 void clearGCRequested();
280 280
281 void performPendingGC(StackState);
wibling-chromium 2014/04/01 13:26:09 NIT: Could be made private.
Mads Ager (chromium) 2014/04/01 13:45:38 Done.
282
283 // Was the last GC forced for testing? This is set when garbage collection
284 // is forced for testing and there are pointers on the stack. It remains
285 // set until a garbage collection is triggered with no pointers on the stack .
286 // This is used for layout tests that trigger GCs and check if objects are
287 // dead at a given point in time. That only reliably works when we get
288 // precise GCs with no conservative stack scanning.
289 void setForcedForTesting(bool);
290 bool forcedForTesting();
wibling-chromium 2014/04/01 13:26:09 NIT: Could be made private.
Mads Ager (chromium) 2014/04/01 13:45:38 This one is called from Heap. We could make heap a
291
281 bool sweepRequested(); 292 bool sweepRequested();
282 void setSweepRequested(); 293 void setSweepRequested();
283 void clearSweepRequested(); 294 void clearSweepRequested();
284 void performPendingSweep(); 295 void performPendingSweep();
285 296
286 // Support for disallowing allocation. Mainly used for sanity 297 // Support for disallowing allocation. Mainly used for sanity
287 // checks asserts. 298 // checks asserts.
288 bool isAllocationAllowed() const { return !isAtSafePoint() && !m_noAllocatio nCount; } 299 bool isAllocationAllowed() const { return !isAtSafePoint() && !m_noAllocatio nCount; }
289 void enterNoAllocationScope() { m_noAllocationCount++; } 300 void enterNoAllocationScope() { m_noAllocationCount++; }
290 void leaveNoAllocationScope() { m_noAllocationCount--; } 301 void leaveNoAllocationScope() { m_noAllocationCount--; }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 ThreadIdentifier m_thread; 544 ThreadIdentifier m_thread;
534 OwnPtr<PersistentNode> m_persistents; 545 OwnPtr<PersistentNode> m_persistents;
535 StackState m_stackState; 546 StackState m_stackState;
536 intptr_t* m_startOfStack; 547 intptr_t* m_startOfStack;
537 intptr_t* m_endOfStack; 548 intptr_t* m_endOfStack;
538 void* m_safePointScopeMarker; 549 void* m_safePointScopeMarker;
539 Vector<Address> m_safePointStackCopy; 550 Vector<Address> m_safePointStackCopy;
540 bool m_atSafePoint; 551 bool m_atSafePoint;
541 Vector<Interruptor*> m_interruptors; 552 Vector<Interruptor*> m_interruptors;
542 bool m_gcRequested; 553 bool m_gcRequested;
554 bool m_forcedForTesting;
543 volatile int m_sweepRequested; 555 volatile int m_sweepRequested;
544 bool m_sweepInProgress; 556 bool m_sweepInProgress;
545 size_t m_noAllocationCount; 557 size_t m_noAllocationCount;
546 bool m_inGC; 558 bool m_inGC;
547 BaseHeap* m_heaps[NumberOfHeaps]; 559 BaseHeap* m_heaps[NumberOfHeaps];
548 OwnPtr<HeapContainsCache> m_heapContainsCache; 560 OwnPtr<HeapContainsCache> m_heapContainsCache;
549 HeapStats m_stats; 561 HeapStats m_stats;
550 HeapStats m_statsAfterLastGC; 562 HeapStats m_statsAfterLastGC;
551 563
552 Vector<OwnPtr<CleanupTask> > m_cleanupTasks; 564 Vector<OwnPtr<CleanupTask> > m_cleanupTasks;
(...skipping 15 matching lines...) Expand all
568 }; 580 };
569 581
570 template<> class ThreadStateFor<AnyThread> { 582 template<> class ThreadStateFor<AnyThread> {
571 public: 583 public:
572 static ThreadState* state() { return ThreadState::current(); } 584 static ThreadState* state() { return ThreadState::current(); }
573 }; 585 };
574 586
575 } 587 }
576 588
577 #endif // ThreadState_h 589 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698