From cdeade308ee5e3c5573f036146f9822743c71681 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 17 Apr 2020 11:24:15 -0400 Subject: [PATCH] deps: fix V8 8.3 on SmartOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport-PR-URL: https://github.com/nodejs/node/pull/33376 PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng Reviewed-By: Colin Ihrig --- common.gypi | 2 +- deps/v8/src/base/platform/platform-posix.cc | 4 ++-- deps/v8/src/base/platform/platform-solaris.cc | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index faf92f1f71e1c2..7f5102d31d8a6b 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.8', + 'v8_embedder_string': '-node.9', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc index 1e600c7891b99a..54f72e04e68372 100644 --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc @@ -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() { @@ -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); } diff --git a/deps/v8/src/base/platform/platform-solaris.cc b/deps/v8/src/base/platform/platform-solaris.cc index b5b16dac568789..b4ac98ce73bdbb 100644 --- a/deps/v8/src/base/platform/platform-solaris.cc +++ b/deps/v8/src/base/platform/platform-solaris.cc @@ -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(base) + size; + } + pthread_attr_destroy(&attr); + return nullptr; +} + } // namespace base } // namespace v8