mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
deps: V8: cherry-pick f4221e09e812
Original commit message:
AIX: implement Stack::ObtainCurrentThreadStackReservedLimit
Port 5a54f45b671bdf47e083ffbad547713d8bacb28f
AIX lacks `pthread_getattr_np()` so we implement the function using
pthread_getthrds_np() with PTHRDSINFO_QUERY_ALL, consistent with
ObtainCurrentThreadStackStart(). The `__pi_stackaddr` field maps to the
lowest stack address, equivalent to the base returned by
pthread_attr_getstack() on other POSIX platforms.
IT: 145
Change-Id: Ia1a34912630e3128f61fa0fca502429b837d611f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8236132
Reviewed-by: Milad Farazmand <mfarazma@ibm.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
Cr-Commit-Position: refs/heads/main@{#109640}
Refs: https://github.com/v8/v8/commit/f4221e09e812c33900520c445267b8979fcf8fe8
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65161
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
1 parent
f2967441e5
commit
bfc94df374
2 files changed
+22
-2
No files matched your search
+1
-1
@@ -44,7 +44,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.12',
|
||||
'v8_embedder_string': '-node.13',
|
||||
|
||||
##### V8 defaults for Node.js #####
|
||||
|
||||
|
||||
+21
-1
@@ -147,7 +147,7 @@ Stack::StackSlot Stack::ObtainCurrentThreadStackStart() {
|
||||
// |
|
||||
// V
|
||||
//
|
||||
// lower address ----- __pi_stackaddr, current sp
|
||||
// lower address ----- __pi_stackaddr, reserved stack limit
|
||||
|
||||
pthread_t tid = pthread_self();
|
||||
struct __pthrdsinfo buf;
|
||||
@@ -164,6 +164,26 @@ Stack::StackSlot Stack::ObtainCurrentThreadStackStart() {
|
||||
return reinterpret_cast<void*>(buf.__pi_stackend);
|
||||
}
|
||||
|
||||
// static
|
||||
Stack::StackSlot Stack::ObtainCurrentThreadStackReservedLimit() {
|
||||
pthread_t tid = pthread_self();
|
||||
struct __pthrdsinfo 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);
|
||||
if (rc != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (buf.__pi_stackaddr == NULL) {
|
||||
return nullptr;
|
||||
}
|
||||
return reinterpret_cast<void*>(buf.__pi_stackaddr);
|
||||
}
|
||||
|
||||
// static
|
||||
bool OS::DecommitPages(void* address, size_t size) {
|
||||
// The difference between this implementation and the alternative under
|
||||
|
||||
Reference in new issue
Block a user