Skip to content

Commit 5043db3

Browse files
committed
patch for object layout on windows ~ptrcmp
1 parent 100e21c commit 5043db3

2 files changed

Lines changed: 69 additions & 1 deletion

File tree

autoroll.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const V8_VERSIONS = [
22
"14.9",
3-
"14.7",
43
];
54

65
const checkVersions = !!Deno.env.get("CHECK_V8_VERSIONS");
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 73d19698991616a34a00ca691a6e697dbb69e2ef Mon Sep 17 00:00:00 2001
2+
From: snek <the@snek.dev>
3+
Date: Thu, 7 May 2026 09:24:15 +0200
4+
Subject: [PATCH] add padding to fix ~ptrcmp builds on windows
5+
6+
---
7+
src/objects/js-atomics-synchronization.h | 10 ++++++----
8+
src/objects/js-atomics-synchronization.tq | 3 ++-
9+
2 files changed, 8 insertions(+), 5 deletions(-)
10+
11+
diff --git a/src/objects/js-atomics-synchronization.h b/src/objects/js-atomics-synchronization.h
12+
index 1a60658ac77..1fc172661a5 100644
13+
--- a/src/objects/js-atomics-synchronization.h
14+
+++ b/src/objects/js-atomics-synchronization.h
15+
@@ -116,6 +116,9 @@ V8_OBJECT class JSSynchronizationPrimitive : public AlwaysSharedSpaceJSObject {
16+
public:
17+
ExternalPointerMember<kWaiterQueueNodeTag> waiter_queue_head_;
18+
std::atomic<uint32_t> state_;
19+
+#if TAGGED_SIZE_8_BYTES
20+
+ uint32_t optional_padding_;
21+
+#endif // TAGGED_SIZE_8_BYTES
22+
} V8_OBJECT_END;
23+
24+
inline constexpr int JSSynchronizationPrimitive::kWaiterQueueHeadOffset =
25+
@@ -296,6 +299,9 @@ V8_OBJECT class JSAtomicsMutex : public JSSynchronizationPrimitive {
26+
27+
public:
28+
std::atomic<int32_t> owner_thread_id_;
29+
+#if TAGGED_SIZE_8_BYTES
30+
+ uint32_t optional_padding_2_;
31+
+#endif // TAGGED_SIZE_8_BYTES
32+
33+
// Defined out-of-line below the class so `offsetof` / `sizeof` on the
34+
// still-incomplete type can appear in an initializer.
35+
@@ -374,10 +380,6 @@ V8_OBJECT class JSAtomicsCondition : public JSSynchronizationPrimitive {
36+
const DequeueAction& dequeue_action);
37+
38+
public:
39+
-#if TAGGED_SIZE_8_BYTES
40+
- uint32_t optional_padding_;
41+
-#endif // TAGGED_SIZE_8_BYTES
42+
-
43+
static const int kHeaderSize;
44+
} V8_OBJECT_END;
45+
46+
diff --git a/src/objects/js-atomics-synchronization.tq b/src/objects/js-atomics-synchronization.tq
47+
index c867cd87b89..726f02928fe 100644
48+
--- a/src/objects/js-atomics-synchronization.tq
49+
+++ b/src/objects/js-atomics-synchronization.tq
50+
@@ -7,14 +7,15 @@
51+
extern class JSSynchronizationPrimitive extends AlwaysSharedSpaceJSObject {
52+
waiter_queue_head: ExternalPointer;
53+
state: uint32;
54+
+ @if(TAGGED_SIZE_8_BYTES) optional_padding: uint32;
55+
}
56+
57+
@cppObjectLayoutDefinition
58+
extern class JSAtomicsMutex extends JSSynchronizationPrimitive {
59+
owner_thread_id: int32;
60+
+ @if(TAGGED_SIZE_8_BYTES) optional_padding_2: uint32;
61+
}
62+
63+
@cppObjectLayoutDefinition
64+
extern class JSAtomicsCondition extends JSSynchronizationPrimitive {
65+
- @if(TAGGED_SIZE_8_BYTES) optional_padding: uint32;
66+
}
67+
--
68+
2.54.0
69+

0 commit comments

Comments
 (0)