Skip to content

Commit

Permalink
Fix SmartOS compilation errors
Browse files Browse the repository at this point in the history
This commit resolves compilation errors on SmartOS that
were found while upgrading Node.js.

See: nodejs/node#32831
Change-Id: Ia2a2e028ba4f5bfd69c050cab4fb4e13af5eefd9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2191054
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67793}
  • Loading branch information
cjihrig authored and Anton Bikineev committed Jun 23, 2020
1 parent cad0eba commit fc16b4e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/base/platform/platform-posix.cc
Expand Up @@ -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() {
Expand All @@ -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); }
Expand Down
18 changes: 18 additions & 0 deletions src/base/platform/platform-solaris.cc
Expand Up @@ -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

0 comments on commit fc16b4e

Please sign in to comment.