Commit b10799f4 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

platform: Fix GetStackStart for ARM64 Win

Tbr: ulan@chromium.org
Bug: chromium:1056170
Change-Id: I118b8f1911a6d61b15d3dee25aa00ab9dea4689f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2124321Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66894}
parent 6b6c1b4f
......@@ -1396,10 +1396,18 @@ void OS::AdjustSchedulingParams() {}
// static
void* Stack::GetStackStart() {
#if defined(V8_TARGET_ARCH_32_BIT)
#if defined(V8_TARGET_ARCH_X64)
return reinterpret_cast<void*>(__readgsqword(offsetof(NT_TIB64, StackBase)));
#elif defined(V8_TARGET_ARCH_32_BIT)
return reinterpret_cast<void*>(__readfsdword(offsetof(NT_TIB, StackBase)));
#elif defined(V8_TARGET_ARCH_ARM64)
// Windows 8 and later, see
// https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadstacklimits
ULONG_PTR lowLimit, highLimit;
::GetCurrentThreadStackLimits(&lowLimit, &highLimit);
return reinterpret_cast<void*>(highLimit);
#else
return reinterpret_cast<void*>(__readgsqword(offsetof(NT_TIB64, StackBase)));
#error Unsupported GetStackStart.
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment