Skip to content

Commit

Permalink
deps: V8: cherry-pick 9868b2aefa1a
Browse files Browse the repository at this point in the history
Original commit message:

    Fix SmartOS compilation errors

    This commit resolves compilation errors on SmartOS that
    were found while upgrading Node.js.

    See: nodejs#32831
    Change-Id: Ia2a2e028ba4f5bfd69c050cab4fb4e13af5eefd9
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2191054
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
    Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#67793}

Refs: v8/v8@9868b2a
  • Loading branch information
targos authored and cjihrig committed Jul 4, 2020
1 parent 9ccc44f commit 1958335
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
@@ -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.7',
'v8_embedder_string': '-node.8',

##### V8 defaults for Node.js #####

6 changes: 4 additions & 2 deletions deps/v8/src/base/platform/platform-posix.cc
Original file line number Diff line number Diff line change
@@ -970,7 +970,8 @@ 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(_AIX)
#if !defined(V8_OS_FREEBSD) && !defined(V8_OS_MACOSX) && !defined(_AIX) && \
!defined(V8_OS_SOLARIS)

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

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

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

Please sign in to comment.