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

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

Issue 980653002: Oilpan: disable conservative GCs during initial GC mixin construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch to a static const for mixinLevels Created 5 years, 9 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 void shouldFlushHeapDoesNotContainCache() { m_shouldFlushHeapDoesNotContainC ache = true; } 575 void shouldFlushHeapDoesNotContainCache() { m_shouldFlushHeapDoesNotContainC ache = true; }
576 576
577 void registerTraceDOMWrappers(v8::Isolate* isolate, void (*traceDOMWrappers) (v8::Isolate*, Visitor*)) 577 void registerTraceDOMWrappers(v8::Isolate* isolate, void (*traceDOMWrappers) (v8::Isolate*, Visitor*))
578 { 578 {
579 m_isolate = isolate; 579 m_isolate = isolate;
580 m_traceDOMWrappers = traceDOMWrappers; 580 m_traceDOMWrappers = traceDOMWrappers;
581 } 581 }
582 582
583 double collectionRate() const { return m_collectionRate; } 583 double collectionRate() const { return m_collectionRate; }
584 584
585 // By entering a gc-forbidden scope, conservative GCs will not
586 // be allowed while handling an out-of-line allocation request.
587 // Intended used when constructing subclasses of GC mixins, where
588 // the object being constructed cannot be safely traced & marked
589 // fully should a GC be allowed while its subclasses are being
590 // constructed.
591 void enterGCForbiddenScope(unsigned delta)
592 {
593 m_gcForbiddenCount += delta;
594 }
595
585 private: 596 private:
586 ThreadState(); 597 ThreadState();
587 ~ThreadState(); 598 ~ThreadState();
588 599
589 friend class SafePointBarrier; 600 friend class SafePointBarrier;
590 friend class SafePointAwareMutexLocker; 601 friend class SafePointAwareMutexLocker;
591 602
592 void enterSafePoint(StackState, void*); 603 void enterSafePoint(StackState, void*);
593 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); 604 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope();
594 void clearSafePointScopeMarker() 605 void clearSafePointScopeMarker()
(...skipping 24 matching lines...) Expand all
619 void cleanup(); 630 void cleanup();
620 void cleanupPages(); 631 void cleanupPages();
621 632
622 void unregisterPreFinalizerInternal(void*); 633 void unregisterPreFinalizerInternal(void*);
623 void invokePreFinalizers(Visitor&); 634 void invokePreFinalizers(Visitor&);
624 635
625 #if ENABLE(GC_PROFILING) 636 #if ENABLE(GC_PROFILING)
626 void snapshotFreeList(); 637 void snapshotFreeList();
627 #endif 638 #endif
628 639
629 // By entering a gc-forbidden scope, conservative GCs will not 640 template<typename U> friend class GarbageCollectedMixinConstructorMarker;
630 // be allowed while handling an out-of-line allocation request.
631 // Intended used when constructing subclasses of GC mixins, where
632 // the object being constructed cannot be safely traced & marked
633 // fully should a GC be allowed while its subclasses are being
634 // constructed.
635 template<typename U, typename V> friend class AllocateObjectTrait;
636 void enterGCForbiddenScope() { m_gcForbiddenCount++; }
637 void leaveGCForbiddenScope() 641 void leaveGCForbiddenScope()
638 { 642 {
639 ASSERT(m_gcForbiddenCount > 0); 643 ASSERT(m_gcForbiddenCount > 0);
640 m_gcForbiddenCount--; 644 m_gcForbiddenCount--;
641 } 645 }
642 646
643 static WTF::ThreadSpecific<ThreadState*>* s_threadSpecific; 647 static WTF::ThreadSpecific<ThreadState*>* s_threadSpecific;
644 static uintptr_t s_mainThreadStackStart; 648 static uintptr_t s_mainThreadStackStart;
645 static uintptr_t s_mainThreadUnderestimatedStackSize; 649 static uintptr_t s_mainThreadUnderestimatedStackSize;
646 static SafePointBarrier* s_safePointBarrier; 650 static SafePointBarrier* s_safePointBarrier;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 m_locked = false; 766 m_locked = false;
763 } 767 }
764 768
765 MutexBase& m_mutex; 769 MutexBase& m_mutex;
766 bool m_locked; 770 bool m_locked;
767 }; 771 };
768 772
769 } // namespace blink 773 } // namespace blink
770 774
771 #endif // ThreadState_h 775 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698