| OLD | NEW |
| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 return m_heaps[heapIndex]; | 645 return m_heaps[heapIndex]; |
| 646 } | 646 } |
| 647 BaseHeap* expandedVectorBackingHeap(size_t gcInfoIndex); | 647 BaseHeap* expandedVectorBackingHeap(size_t gcInfoIndex); |
| 648 static bool isVectorHeapIndex(int heapIndex) | 648 static bool isVectorHeapIndex(int heapIndex) |
| 649 { | 649 { |
| 650 return Vector1HeapIndex <= heapIndex && heapIndex <= Vector4HeapIndex; | 650 return Vector1HeapIndex <= heapIndex && heapIndex <= Vector4HeapIndex; |
| 651 } | 651 } |
| 652 void allocationPointAdjusted(int heapIndex); | 652 void allocationPointAdjusted(int heapIndex); |
| 653 void promptlyFreed(size_t gcInfoIndex); | 653 void promptlyFreed(size_t gcInfoIndex); |
| 654 | 654 |
| 655 #if ENABLE(ASSERT) | |
| 656 static void incrementSelfKeepAliveAllocations(); | |
| 657 static void decrementSelfKeepAliveAllocations(); | |
| 658 #endif | |
| 659 | |
| 660 private: | 655 private: |
| 661 enum SnapshotType { | 656 enum SnapshotType { |
| 662 HeapSnapshot, | 657 HeapSnapshot, |
| 663 FreelistSnapshot | 658 FreelistSnapshot |
| 664 }; | 659 }; |
| 665 | 660 |
| 666 ThreadState(); | 661 ThreadState(); |
| 667 ~ThreadState(); | 662 ~ThreadState(); |
| 668 | 663 |
| 669 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); | 664 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 const InterruptorVector& interruptors() const { return m_interruptors; } | 721 const InterruptorVector& interruptors() const { return m_interruptors; } |
| 727 | 722 |
| 728 friend class SafePointAwareMutexLocker; | 723 friend class SafePointAwareMutexLocker; |
| 729 friend class SafePointBarrier; | 724 friend class SafePointBarrier; |
| 730 friend class SafePointScope; | 725 friend class SafePointScope; |
| 731 | 726 |
| 732 static WTF::ThreadSpecific<ThreadState*>* s_threadSpecific; | 727 static WTF::ThreadSpecific<ThreadState*>* s_threadSpecific; |
| 733 static uintptr_t s_mainThreadStackStart; | 728 static uintptr_t s_mainThreadStackStart; |
| 734 static uintptr_t s_mainThreadUnderestimatedStackSize; | 729 static uintptr_t s_mainThreadUnderestimatedStackSize; |
| 735 static SafePointBarrier* s_safePointBarrier; | 730 static SafePointBarrier* s_safePointBarrier; |
| 736 #if ENABLE(ASSERT) | |
| 737 static int s_selfKeepAliveAllocationsOnMainThread; | |
| 738 #endif | |
| 739 | 731 |
| 740 // We can't create a static member of type ThreadState here | 732 // We can't create a static member of type ThreadState here |
| 741 // because it will introduce global constructor and destructor. | 733 // because it will introduce global constructor and destructor. |
| 742 // We would like to manage lifetime of the ThreadState attached | 734 // We would like to manage lifetime of the ThreadState attached |
| 743 // to the main thread explicitly instead and still use normal | 735 // to the main thread explicitly instead and still use normal |
| 744 // constructor and destructor for the ThreadState class. | 736 // constructor and destructor for the ThreadState class. |
| 745 // For this we reserve static storage for the main ThreadState | 737 // For this we reserve static storage for the main ThreadState |
| 746 // and lazily construct ThreadState in it using placement new. | 738 // and lazily construct ThreadState in it using placement new. |
| 747 static uint8_t s_mainThreadStateStorage[]; | 739 static uint8_t s_mainThreadStateStorage[]; |
| 748 | 740 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 }; | 803 }; |
| 812 | 804 |
| 813 template<> class ThreadStateFor<AnyThread> { | 805 template<> class ThreadStateFor<AnyThread> { |
| 814 public: | 806 public: |
| 815 static ThreadState* state() { return ThreadState::current(); } | 807 static ThreadState* state() { return ThreadState::current(); } |
| 816 }; | 808 }; |
| 817 | 809 |
| 818 } // namespace blink | 810 } // namespace blink |
| 819 | 811 |
| 820 #endif // ThreadState_h | 812 #endif // ThreadState_h |
| OLD | NEW |