Title: [220470] branches/safari-604.1.38.1-branch/Source/_javascript_Core
Revision
220470
Author
jmarc...@apple.com
Date
2017-08-09 11:24:25 -0700 (Wed, 09 Aug 2017)

Log Message

Cherry-pick r220346. rdar://problem/33805219

Modified Paths

Diff

Modified: branches/safari-604.1.38.1-branch/Source/_javascript_Core/ChangeLog (220469 => 220470)


--- branches/safari-604.1.38.1-branch/Source/_javascript_Core/ChangeLog	2017-08-09 18:14:57 UTC (rev 220469)
+++ branches/safari-604.1.38.1-branch/Source/_javascript_Core/ChangeLog	2017-08-09 18:24:25 UTC (rev 220470)
@@ -1,3 +1,23 @@
+2017-08-09  Jason Marcell  <jmarc...@apple.com>
+
+        Cherry-pick r220346. rdar://problem/33805219
+
+    2017-08-07  Commit Queue  <commit-qu...@webkit.org>
+
+            Unreviewed, rolling out r220144.
+            https://bugs.webkit.org/show_bug.cgi?id=175276
+
+            "It did not actually speed things up in the way I expected"
+            (Requested by saamyjoon on #webkit).
+
+            Reverted changeset:
+
+            "On memory-constrained iOS devices, reduce the rate at which
+            the JS heap grows before a GC to try to keep more memory
+            available for the system"
+            https://bugs.webkit.org/show_bug.cgi?id=175041
+            http://trac.webkit.org/changeset/220144
+
 2017-08-02  Jason Marcell  <jmarc...@apple.com>
 
         Cherry-pick r220144. rdar://problem/33687404

Modified: branches/safari-604.1.38.1-branch/Source/_javascript_Core/heap/Heap.cpp (220469 => 220470)


--- branches/safari-604.1.38.1-branch/Source/_javascript_Core/heap/Heap.cpp	2017-08-09 18:14:57 UTC (rev 220469)
+++ branches/safari-604.1.38.1-branch/Source/_javascript_Core/heap/Heap.cpp	2017-08-09 18:24:25 UTC (rev 220470)
@@ -71,7 +71,6 @@
 #include <algorithm>
 #if PLATFORM(IOS)
 #include <bmalloc/bmalloc.h>
-#include <sys/sysctl.h>
 #endif
 #include <wtf/CurrentTime.h>
 #include <wtf/ListDump.h>
@@ -116,39 +115,9 @@
     return Options::smallHeapSize();
 }
 
-#if PLATFORM(IOS)
-static bool useAggressiveGCTrigger()
-{
-    static bool useAggressiveGCTrigger;
-    static std::once_flag once;
-    std::call_once(once, [] {
-        useAggressiveGCTrigger = false;
-
-        if (Options::forceAggressiveGCTrigger()) {
-            useAggressiveGCTrigger = true;
-            return;
-        }
-
-        uint64_t memSizeInBytes;
-        size_t sizeofMemSize = sizeof(memSizeInBytes);
-        if (sysctlbyname("hw.memsize", &memSizeInBytes, &sizeofMemSize, nullptr, 0))
-            return;
-        useAggressiveGCTrigger = memSizeInBytes <= 1 * GB;
-    });
-
-    return useAggressiveGCTrigger;
-}
-#endif
-
 size_t proportionalHeapSize(size_t heapSize, size_t ramSize)
 {
 #if PLATFORM(IOS)
-    if (useAggressiveGCTrigger()) {
-        double memoryUsed = bmalloc::api::percentAvailableMemoryInUse();
-        double result = ((1 - memoryUsed) / Options::aggressiveGCTriggerScalingValue()) + 1;
-        return heapSize * std::max(std::min(result, Options::aggressiveGCTriggerMaxMultiplier()), Options::aggressiveGCTriggerMinMultiplier());
-    }
-
     size_t memoryFootprint = bmalloc::api::memoryFootprint();
     if (memoryFootprint < ramSize * Options::smallHeapRAMFraction())
         return Options::smallHeapGrowthFactor() * heapSize;

Modified: branches/safari-604.1.38.1-branch/Source/_javascript_Core/runtime/Options.h (220469 => 220470)


--- branches/safari-604.1.38.1-branch/Source/_javascript_Core/runtime/Options.h	2017-08-09 18:14:57 UTC (rev 220469)
+++ branches/safari-604.1.38.1-branch/Source/_javascript_Core/runtime/Options.h	2017-08-09 18:24:25 UTC (rev 220470)
@@ -210,10 +210,6 @@
     v(double, mediumHeapRAMFraction, 0.5, Normal, nullptr) \
     v(double, mediumHeapGrowthFactor, 1.5, Normal, nullptr) \
     v(double, largeHeapGrowthFactor, 1.24, Normal, nullptr) \
-    v(bool, forceAggressiveGCTrigger, false, Normal, "If true, on iOS, we will use a different formula for proportionalHeapSize().") \
-    v(double, aggressiveGCTriggerMinMultiplier, 1.07, Normal, "This is the minimum we must grow by for proportionalHeapSize() when doing aggressive triggering.") \
-    v(double, aggressiveGCTriggerMaxMultiplier, 2.0, Normal,  "This is the maximum we can grow by for proportionalHeapSize() when doing aggressive triggering.") \
-    v(double, aggressiveGCTriggerScalingValue, 3.5, Normal, "This scales the above formula. A larger number is more aggressive in limiting heap growth. A smaller number is more permissive in allowing heap growth.") \
     v(double, criticalGCMemoryThreshold, 0.80, Normal, "percent memory in use the GC considers critical.  The collector is much more aggressive above this threshold") \
     v(double, minimumMutatorUtilization, 0, Normal, nullptr) \
     v(double, maximumMutatorUtilization, 0.7, Normal, nullptr) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to