Skip to content

Commit

Permalink
deps: fix V8 8.3 on SmartOS
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Apr 17, 2020
1 parent e9f0b8d commit fb9e01d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deps/v8/src/base/platform/platform-posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ 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)
#if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(V8_OS_SOLARIS)

// static
void* Stack::GetStackStart() {
Expand All @@ -996,7 +996,7 @@ void* Stack::GetStackStart() {
return nullptr;
}

#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX)
#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(V8_OS_SOLARIS)

// static
void* Stack::GetCurrentStackPosition() { return __builtin_frame_address(0); }
Expand Down
18 changes: 18 additions & 0 deletions deps/v8/src/base/platform/platform-solaris.cc
Original file line number Diff line number Diff line change
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 fb9e01d

Please sign in to comment.