Skip to content

Commit fb9e01d

Browse files
committed
deps: fix V8 8.3 on SmartOS
1 parent e9f0b8d commit fb9e01d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

deps/v8/src/base/platform/platform-posix.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
970970
// pthread_getattr_np used below is non portable (hence the _np suffix). We
971971
// keep this version in POSIX as most Linux-compatible derivatives will
972972
// support it. MacOS and FreeBSD are different here.
973-
#if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX)
973+
#if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(V8_OS_SOLARIS)
974974

975975
// static
976976
void* Stack::GetStackStart() {
@@ -996,7 +996,7 @@ void* Stack::GetStackStart() {
996996
return nullptr;
997997
}
998998

999-
#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX)
999+
#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(V8_OS_SOLARIS)
10001000

10011001
// static
10021002
void* Stack::GetCurrentStackPosition() { return __builtin_frame_address(0); }

deps/v8/src/base/platform/platform-solaris.cc

+18
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,23 @@ void OS::SignalCodeMovingGC() {}
6565

6666
void OS::AdjustSchedulingParams() {}
6767

68+
// static
69+
void* Stack::GetStackStart() {
70+
pthread_attr_t attr;
71+
int error;
72+
pthread_attr_init(&attr);
73+
error = pthread_attr_get_np(pthread_self(), &attr);
74+
if (!error) {
75+
void* base;
76+
size_t size;
77+
error = pthread_attr_getstack(&attr, &base, &size);
78+
CHECK(!error);
79+
pthread_attr_destroy(&attr);
80+
return reinterpret_cast<uint8_t*>(base) + size;
81+
}
82+
pthread_attr_destroy(&attr);
83+
return nullptr;
84+
}
85+
6886
} // namespace base
6987
} // namespace v8

0 commit comments

Comments
 (0)