Skip to content

Commit cdeade3

Browse files
cjihrigtargos
authored andcommitted
deps: fix V8 8.3 on SmartOS
Backport-PR-URL: #33376 PR-URL: #32831 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 883840b commit cdeade3

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.8',
39+
'v8_embedder_string': '-node.9',
4040

4141
##### V8 defaults for Node.js #####
4242

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)