Commit bfc94df3743 for nodejs
commit bfc94df37434f66df13725e348e4191ae056cfaf
Author: Gundepalli Sravani <Gundepalli.Sravani1@ibm.com>
Date: Tue Aug 25 11:53:47 2026 +0530
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>
diff --git a/common.gypi b/common.gypi
index d0380616db6..eb7b70b59d4 100644
--- a/common.gypi
+++ b/common.gypi
@@ -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 #####
diff --git a/deps/v8/src/base/platform/platform-aix.cc b/deps/v8/src/base/platform/platform-aix.cc
index 70b43d11c9e..3593f36239a 100644
--- a/deps/v8/src/base/platform/platform-aix.cc
+++ b/deps/v8/src/base/platform/platform-aix.cc
@@ -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