diff options
author | Michaël Zasso <targos@protonmail.com> | 2020-07-13 10:39:42 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2020-07-13 14:41:41 +0200 |
commit | 12478684aab233942e0d5dc24f195930c8a5e59d (patch) | |
tree | 97dbee955ab91d4df480bcb82274d710a2195e64 /deps/v8/src/base/platform | |
parent | 913d36d97da187a3804f6cfa96b4d24a8b7be78a (diff) | |
download | node-new-12478684aab233942e0d5dc24f195930c8a5e59d.tar.gz |
deps: update V8 to 8.4.371.19
PR-URL: https://github.com/nodejs/node/pull/33579
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Diffstat (limited to 'deps/v8/src/base/platform')
-rw-r--r-- | deps/v8/src/base/platform/mutex.h | 3 | ||||
-rw-r--r-- | deps/v8/src/base/platform/platform-aix.cc | 29 | ||||
-rw-r--r-- | deps/v8/src/base/platform/platform-posix.cc | 4 | ||||
-rw-r--r-- | deps/v8/src/base/platform/platform-solaris.cc | 18 | ||||
-rw-r--r-- | deps/v8/src/base/platform/time.cc | 17 |
5 files changed, 35 insertions, 36 deletions
diff --git a/deps/v8/src/base/platform/mutex.h b/deps/v8/src/base/platform/mutex.h index 5b3b31ec1e..c3144f7ceb 100644 --- a/deps/v8/src/base/platform/mutex.h +++ b/deps/v8/src/base/platform/mutex.h @@ -67,7 +67,8 @@ class V8_BASE_EXPORT Mutex final { return native_handle_; } - V8_INLINE void AssertHeld() { DCHECK_EQ(1, level_); } + V8_INLINE void AssertHeld() const { DCHECK_EQ(1, level_); } + V8_INLINE void AssertUnheld() const { DCHECK_EQ(0, level_); } private: NativeHandle native_handle_; diff --git a/deps/v8/src/base/platform/platform-aix.cc b/deps/v8/src/base/platform/platform-aix.cc index e3d7c426b4..e1ccda2ab0 100644 --- a/deps/v8/src/base/platform/platform-aix.cc +++ b/deps/v8/src/base/platform/platform-aix.cc @@ -129,5 +129,34 @@ void OS::SignalCodeMovingGC() {} void OS::AdjustSchedulingParams() {} +// static +void* Stack::GetStackStart() { + // pthread_getthrds_np creates 3 values: + // __pi_stackaddr, __pi_stacksize, __pi_stackend + + // higher address ----- __pi_stackend, stack base + // + // | + // | __pi_stacksize, stack grows downwards + // | + // V + // + // lower address ----- __pi_stackaddr, current sp + + pthread_t tid = pthread_self(); + struct __pthrdsinfo buf; + // clear buf + memset(&buf, 0, sizeof(buf)); + char regbuf[1]; + int regbufsize = sizeof(regbuf); + const int rc = pthread_getthrds_np(&tid, PTHRDSINFO_QUERY_ALL, &buf, + sizeof(buf), regbuf, ®bufsize); + CHECK(!rc); + if (buf.__pi_stackend == NULL || buf.__pi_stackaddr == NULL) { + return nullptr; + } + return reinterpret_cast<void*>(buf.__pi_stackend); +} + } // namespace base } // namespace v8 diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc index 54f72e04e6..c3f0b08ddd 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) && !defined(V8_OS_SOLARIS) +#if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(_AIX) // static void* Stack::GetStackStart() { @@ -996,7 +996,7 @@ void* Stack::GetStackStart() { return nullptr; } -#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(V8_OS_SOLARIS) +#endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(_AIX) // 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 b4ac98ce73..b5b16dac56 100644 --- a/deps/v8/src/base/platform/platform-solaris.cc +++ b/deps/v8/src/base/platform/platform-solaris.cc @@ -65,23 +65,5 @@ 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 diff --git a/deps/v8/src/base/platform/time.cc b/deps/v8/src/base/platform/time.cc index f07fd8e595..a12a5b0d0a 100644 --- a/deps/v8/src/base/platform/time.cc +++ b/deps/v8/src/base/platform/time.cc @@ -125,12 +125,6 @@ V8_INLINE bool IsHighResolutionTimer(clockid_t clk_id) { } #elif V8_OS_WIN -V8_INLINE bool IsQPCReliable() { - v8::base::CPU cpu; - // On Athlon X2 CPUs (e.g. model 15) QueryPerformanceCounter is unreliable. - return strcmp(cpu.vendor(), "AuthenticAMD") == 0 && cpu.family() == 15; -} - // Returns the current value of the performance counter. V8_INLINE uint64_t QPCNowRaw() { LARGE_INTEGER perf_counter_now = {}; @@ -645,11 +639,6 @@ TimeDelta QPCValueToTimeDelta(LONGLONG qpc_value) { TimeTicks QPCNow() { return TimeTicks() + QPCValueToTimeDelta(QPCNowRaw()); } -bool IsBuggyAthlon(const CPU& cpu) { - // On Athlon X2 CPUs (e.g. model 15) QueryPerformanceCounter is unreliable. - return strcmp(cpu.vendor(), "AuthenticAMD") == 0 && cpu.family() == 15; -} - void InitializeTimeTicksNowFunctionPointer() { LARGE_INTEGER ticks_per_sec = {}; if (!QueryPerformanceFrequency(&ticks_per_sec)) ticks_per_sec.QuadPart = 0; @@ -667,8 +656,7 @@ void InitializeTimeTicksNowFunctionPointer() { // ~72% of users fall within this category. TimeTicksNowFunction now_function; CPU cpu; - if (ticks_per_sec.QuadPart <= 0 || !cpu.has_non_stop_time_stamp_counter() || - IsBuggyAthlon(cpu)) { + if (ticks_per_sec.QuadPart <= 0 || !cpu.has_non_stop_time_stamp_counter()) { now_function = &RolloverProtectedNow; } else { now_function = &QPCNow; @@ -800,8 +788,7 @@ ThreadTicks ThreadTicks::GetForThread(const HANDLE& thread_handle) { // static bool ThreadTicks::IsSupportedWin() { - static bool is_supported = base::CPU().has_non_stop_time_stamp_counter() && - !IsQPCReliable(); + static bool is_supported = base::CPU().has_non_stop_time_stamp_counter(); return is_supported; } |