| 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 return m_heaps[heapIndex]; | 569 return m_heaps[heapIndex]; |
| 570 } | 570 } |
| 571 BaseHeap* expandedVectorBackingHeap(size_t gcInfoIndex); | 571 BaseHeap* expandedVectorBackingHeap(size_t gcInfoIndex); |
| 572 static bool isVectorHeapIndex(int heapIndex) | 572 static bool isVectorHeapIndex(int heapIndex) |
| 573 { | 573 { |
| 574 return BlinkGC::Vector1HeapIndex <= heapIndex && heapIndex <= BlinkGC::V
ector4HeapIndex; | 574 return BlinkGC::Vector1HeapIndex <= heapIndex && heapIndex <= BlinkGC::V
ector4HeapIndex; |
| 575 } | 575 } |
| 576 void allocationPointAdjusted(int heapIndex); | 576 void allocationPointAdjusted(int heapIndex); |
| 577 void promptlyFreed(size_t gcInfoIndex); | 577 void promptlyFreed(size_t gcInfoIndex); |
| 578 | 578 |
| 579 #if OS(WIN) && COMPILER(MSVC) | |
| 580 size_t threadStackSize(); | |
| 581 #endif | |
| 582 | |
| 583 private: | 579 private: |
| 584 enum SnapshotType { | 580 enum SnapshotType { |
| 585 HeapSnapshot, | 581 HeapSnapshot, |
| 586 FreelistSnapshot | 582 FreelistSnapshot |
| 587 }; | 583 }; |
| 588 | 584 |
| 589 ThreadState(); | 585 ThreadState(); |
| 590 ~ThreadState(); | 586 ~ThreadState(); |
| 591 | 587 |
| 592 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); | 588 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 // We would like to manage lifetime of the ThreadState attached | 676 // We would like to manage lifetime of the ThreadState attached |
| 681 // to the main thread explicitly instead and still use normal | 677 // to the main thread explicitly instead and still use normal |
| 682 // constructor and destructor for the ThreadState class. | 678 // constructor and destructor for the ThreadState class. |
| 683 // For this we reserve static storage for the main ThreadState | 679 // For this we reserve static storage for the main ThreadState |
| 684 // and lazily construct ThreadState in it using placement new. | 680 // and lazily construct ThreadState in it using placement new. |
| 685 static uint8_t s_mainThreadStateStorage[]; | 681 static uint8_t s_mainThreadStateStorage[]; |
| 686 | 682 |
| 687 ThreadIdentifier m_thread; | 683 ThreadIdentifier m_thread; |
| 688 OwnPtr<PersistentRegion> m_persistentRegion; | 684 OwnPtr<PersistentRegion> m_persistentRegion; |
| 689 BlinkGC::StackState m_stackState; | 685 BlinkGC::StackState m_stackState; |
| 690 #if OS(WIN) && COMPILER(MSVC) | |
| 691 size_t m_threadStackSize; | |
| 692 #endif | |
| 693 intptr_t* m_startOfStack; | 686 intptr_t* m_startOfStack; |
| 694 intptr_t* m_endOfStack; | 687 intptr_t* m_endOfStack; |
| 695 | |
| 696 void* m_safePointScopeMarker; | 688 void* m_safePointScopeMarker; |
| 697 Vector<Address> m_safePointStackCopy; | 689 Vector<Address> m_safePointStackCopy; |
| 698 bool m_atSafePoint; | 690 bool m_atSafePoint; |
| 699 InterruptorVector m_interruptors; | 691 InterruptorVector m_interruptors; |
| 700 bool m_sweepForbidden; | 692 bool m_sweepForbidden; |
| 701 size_t m_noAllocationCount; | 693 size_t m_noAllocationCount; |
| 702 size_t m_gcForbiddenCount; | 694 size_t m_gcForbiddenCount; |
| 703 BaseHeap* m_heaps[BlinkGC::NumberOfHeaps]; | 695 BaseHeap* m_heaps[BlinkGC::NumberOfHeaps]; |
| 704 | 696 |
| 705 int m_vectorBackingHeapIndex; | 697 int m_vectorBackingHeapIndex; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 }; | 743 }; |
| 752 | 744 |
| 753 template<> class ThreadStateFor<AnyThread> { | 745 template<> class ThreadStateFor<AnyThread> { |
| 754 public: | 746 public: |
| 755 static ThreadState* state() { return ThreadState::current(); } | 747 static ThreadState* state() { return ThreadState::current(); } |
| 756 }; | 748 }; |
| 757 | 749 |
| 758 } // namespace blink | 750 } // namespace blink |
| 759 | 751 |
| 760 #endif // ThreadState_h | 752 #endif // ThreadState_h |
| OLD | NEW |