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

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

Issue 1409243011: Precisely determine Windows thread stack size (reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gracefully handle yellow zone at the end of the stack Created 5 years, 1 month 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
579 private: 583 private:
580 enum SnapshotType { 584 enum SnapshotType {
581 HeapSnapshot, 585 HeapSnapshot,
582 FreelistSnapshot 586 FreelistSnapshot
583 }; 587 };
584 588
585 ThreadState(); 589 ThreadState();
586 ~ThreadState(); 590 ~ThreadState();
587 591
588 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); 592 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 // We would like to manage lifetime of the ThreadState attached 680 // We would like to manage lifetime of the ThreadState attached
677 // to the main thread explicitly instead and still use normal 681 // to the main thread explicitly instead and still use normal
678 // constructor and destructor for the ThreadState class. 682 // constructor and destructor for the ThreadState class.
679 // For this we reserve static storage for the main ThreadState 683 // For this we reserve static storage for the main ThreadState
680 // and lazily construct ThreadState in it using placement new. 684 // and lazily construct ThreadState in it using placement new.
681 static uint8_t s_mainThreadStateStorage[]; 685 static uint8_t s_mainThreadStateStorage[];
682 686
683 ThreadIdentifier m_thread; 687 ThreadIdentifier m_thread;
684 OwnPtr<PersistentRegion> m_persistentRegion; 688 OwnPtr<PersistentRegion> m_persistentRegion;
685 BlinkGC::StackState m_stackState; 689 BlinkGC::StackState m_stackState;
690 #if OS(WIN) && COMPILER(MSVC)
691 size_t m_threadStackSize;
692 #endif
686 intptr_t* m_startOfStack; 693 intptr_t* m_startOfStack;
687 intptr_t* m_endOfStack; 694 intptr_t* m_endOfStack;
695
688 void* m_safePointScopeMarker; 696 void* m_safePointScopeMarker;
689 Vector<Address> m_safePointStackCopy; 697 Vector<Address> m_safePointStackCopy;
690 bool m_atSafePoint; 698 bool m_atSafePoint;
691 InterruptorVector m_interruptors; 699 InterruptorVector m_interruptors;
692 bool m_sweepForbidden; 700 bool m_sweepForbidden;
693 size_t m_noAllocationCount; 701 size_t m_noAllocationCount;
694 size_t m_gcForbiddenCount; 702 size_t m_gcForbiddenCount;
695 BaseHeap* m_heaps[BlinkGC::NumberOfHeaps]; 703 BaseHeap* m_heaps[BlinkGC::NumberOfHeaps];
696 704
697 int m_vectorBackingHeapIndex; 705 int m_vectorBackingHeapIndex;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 }; 751 };
744 752
745 template<> class ThreadStateFor<AnyThread> { 753 template<> class ThreadStateFor<AnyThread> {
746 public: 754 public:
747 static ThreadState* state() { return ThreadState::current(); } 755 static ThreadState* state() { return ThreadState::current(); }
748 }; 756 };
749 757
750 } // namespace blink 758 } // namespace blink
751 759
752 #endif // ThreadState_h 760 #endif // ThreadState_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/StackFrameDepth.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