Commit 9868b2ae authored by cjihrig's avatar cjihrig Committed by Commit Bot

Fix SmartOS compilation errors

This commit resolves compilation errors on SmartOS that
were found while upgrading Node.js.

See: https://github.com/nodejs/node/pull/32831
Change-Id: Ia2a2e028ba4f5bfd69c050cab4fb4e13af5eefd9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2191054Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67793}
parent cde84e84
......@@ -970,7 +970,8 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
// pthread_getattr_np used below is non portable (hence the _np suffix). We
// keep this version in POSIX as most Linux-compatible derivatives will
// support it. MacOS and FreeBSD are different here.
#if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(_AIX)
#if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(_AIX) && \
!defined(V8_OS_SOLARIS)
// static
void* Stack::GetStackStart() {
......@@ -996,7 +997,8 @@ void* Stack::GetStackStart() {
return nullptr;
}
#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(_AIX)
#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) &&
// !defined(_AIX) && !defined(V8_OS_SOLARIS)
// static
void* Stack::GetCurrentStackPosition() { return __builtin_frame_address(0); }
......
......@@ -65,5 +65,23 @@ void OS::SignalCodeMovingGC() {}
void OS::AdjustSchedulingParams() {}
// static
void* Stack::GetStackStart() {
pthread_attr_t attr;
int error;
pthread_attr_init(&attr);
error = pthread_attr_get_np(pthread_self(), &attr);
if (!error) {
void* base;
size_t size;
error = pthread_attr_getstack(&attr, &base, &size);
CHECK(!error);
pthread_attr_destroy(&attr);
return reinterpret_cast<uint8_t*>(base) + size;
}
pthread_attr_destroy(&attr);
return nullptr;
}
} // namespace base
} // namespace v8
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