Skip to content

Commit 4e963b9

Browse files
committed
[wpewebkit] adding reduction patches
1 parent 56b8696 commit 4e963b9

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 6a7c1e2fbba1a28734b8a49b5c039d06aa7cb5a5 Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Sat, 27 May 2017 22:30:08 -0700
4+
Subject: [PATCH] Reduce stack limits
5+
6+
JavaScriptCore needs to lower the thread stack limits for musl
7+
which allocates 80Kb for thread stack by default
8+
9+
Signed-off-by: Khem Raj <[email protected]>
10+
---
11+
Source/JavaScriptCore/runtime/Options.h | 6 +++---
12+
1 file changed, 3 insertions(+), 3 deletions(-)
13+
14+
diff --git a/Source/JavaScriptCore/runtime/Options.h b/Source/JavaScriptCore/runtime/Options.h
15+
index 3d428c9b589..81e5c3c47a9 100644
16+
--- a/Source/JavaScriptCore/runtime/Options.h
17+
+++ b/Source/JavaScriptCore/runtime/Options.h
18+
@@ -120,9 +120,9 @@ typedef const char* optionString;
19+
\
20+
v(bool, reportMustSucceedExecutableAllocations, false, Normal, nullptr) \
21+
\
22+
- v(unsigned, maxPerThreadStackUsage, 4 * MB, Normal, "Max allowed stack usage by the VM") \
23+
- v(unsigned, softReservedZoneSize, 128 * KB, Normal, "A buffer greater than reservedZoneSize that reserves space for stringifying exceptions.") \
24+
- v(unsigned, reservedZoneSize, 64 * KB, Normal, "The amount of stack space we guarantee to our clients (and to interal VM code that does not call out to clients).") \
25+
+ v(unsigned, maxPerThreadStackUsage, 80 * KB, Normal, "Max allowed stack usage by the VM") \
26+
+ v(unsigned, softReservedZoneSize, 32 * KB, Normal, "A buffer greater than reservedZoneSize that reserves space for stringifying exceptions.") \
27+
+ v(unsigned, reservedZoneSize, 16 * KB, Normal, "The amount of stack space we guarantee to our clients (and to interal VM code that does not call out to clients).") \
28+
\
29+
v(bool, crashIfCantAllocateJITMemory, false, Normal, nullptr) \
30+
v(unsigned, jitMemoryReservationSize, 0, Normal, "Set this number to change the executable allocation size in ExecutableAllocatorFixedVMPool. (In bytes.)") \
31+
--
32+
2.13.0
33+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From cc2a4708f1c3ee48e70abfea56ba28ae74ef239a Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Sat, 27 May 2017 13:02:20 -0700
4+
Subject: [PATCH] Reduce the default thread stack size to 32KB
5+
6+
Fixes RangeError: Maximum call stack size exceeded.
7+
when using musl C library
8+
9+
Signed-off-by: Khem Raj <[email protected]>
10+
---
11+
Source/WTF/wtf/StackBounds.h | 2 +-
12+
1 file changed, 1 insertion(+), 1 deletion(-)
13+
14+
diff --git a/Source/WTF/wtf/StackBounds.h b/Source/WTF/wtf/StackBounds.h
15+
index ce9ea96dd85..5e86ea3b001 100644
16+
--- a/Source/WTF/wtf/StackBounds.h
17+
+++ b/Source/WTF/wtf/StackBounds.h
18+
@@ -38,7 +38,7 @@ class StackBounds {
19+
// functions was seen to be as high as 27k. Hence, 64k is chosen as a
20+
// conservative availability value that is not too large but comfortably
21+
// exceeds 27k with some buffer for error.
22+
- const static size_t s_defaultAvailabilityDelta = 64 * 1024;
23+
+ const static size_t s_defaultAvailabilityDelta = 32 * 1024;
24+
25+
public:
26+
static StackBounds currentThreadStackBounds()
27+
--
28+
2.13.0
29+

0 commit comments

Comments
 (0)