| Index: third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
|
| diff --git a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
|
| index 345e71b1970e485f3dfb6fe7570097dc823e98ca..c118c814b2bdb23a966cb4aa70139e398bf593ea 100644
|
| --- a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
|
| +++ b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
|
| @@ -98,7 +98,14 @@
|
| // size for the main thread on Mavericks(10.9).
|
| return 0;
|
| #elif OS(WIN) && COMPILER(MSVC)
|
| - return ThreadState::current()->threadStackSize();
|
| + // On Windows stack limits for the current thread are available in
|
| + // the thread information block (TIB). Its fields can be accessed through
|
| + // FS segment register on x86 and GS segment register on x86_64.
|
| +#ifdef _WIN64
|
| + return __readgsqword(offsetof(NT_TIB64, StackBase)) - __readgsqword(offsetof(NT_TIB64, StackLimit));
|
| +#else
|
| + return __readfsdword(offsetof(NT_TIB, StackBase)) - __readfsdword(offsetof(NT_TIB, StackLimit));
|
| +#endif
|
| #else
|
| #error "Stack frame size estimation not supported on this platform."
|
| return 0;
|
|
|