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: #32831
    Change-Id: Ia2a2e028ba4f5bfd69c050cab4fb4e13af5eefd9
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2191054
    Reviewed-by: Michael Lippautz <[email protected]>
    Reviewed-by: Ulan Degenbaev <[email protected]>
    Commit-Queue: Ulan Degenbaev <[email protected]>
    Cr-Commit-Position: refs/heads/master@{#67793}

Refs: v8/v8@9868b2a

Backport-PR-URL: #34356
PR-URL: #33579
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
  • Loading branch information
targos authored and MylesBorins committed Jul 16, 2020
1 parent 335e386 commit f269dff
Show file tree
Hide file tree
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
Expand Up @@ -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 #####

Expand Down
6 changes: 4 additions & 2 deletions deps/v8/src/base/platform/platform-posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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); }
Expand Down
18 changes: 18 additions & 0 deletions deps/v8/src/base/platform/platform-solaris.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 f269dff

Please sign in to comment.