summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsigbjornf <sigbjornf@opera.com>2016-02-27 00:57:08 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-27 08:58:30 +0000
commitac2a059d4486172d24bdcf5b82be6f5300d5102d (patch)
treef384d89f6c548d9c032616f09442de7cefa68ca5
parentc6eb8ad71579f9945976e5b4b4915f084388e5ae (diff)
downloadchromium_src-ac2a059d4486172d24bdcf5b82be6f5300d5102d.zip
chromium_src-ac2a059d4486172d24bdcf5b82be6f5300d5102d.tar.gz
chromium_src-ac2a059d4486172d24bdcf5b82be6f5300d5102d.tar.bz2
Reduce ephemeron stack size reservation.
The ephemeron stack is used by the Oilpan GC to handle key-value pairs over weak references as wanted (i.e., the value is strongly referenced until the key becomes unreachable). The marking process will push hash tables containing such onto a stack processing for later processing. Blink only has a handful of hash tables requiring ephemeron processing, hence tune down the initial size of the stack accordingly. As a data point, browsing around on various popular sites resulted in ephemeron stacks no deeper than in the mid-20s. R=haraken BUG= Review URL: https://codereview.chromium.org/1741833002 Cr-Commit-Position: refs/heads/master@{#378131}
-rw-r--r--third_party/WebKit/Source/platform/heap/BlinkGC.h1
-rw-r--r--third_party/WebKit/Source/platform/heap/CallbackStack.cpp2
-rw-r--r--third_party/WebKit/Source/platform/heap/CallbackStack.h4
-rw-r--r--third_party/WebKit/Source/platform/heap/Heap.cpp3
4 files changed, 8 insertions, 2 deletions
diff --git a/third_party/WebKit/Source/platform/heap/BlinkGC.h b/third_party/WebKit/Source/platform/heap/BlinkGC.h
index 4f1447a..688525a 100644
--- a/third_party/WebKit/Source/platform/heap/BlinkGC.h
+++ b/third_party/WebKit/Source/platform/heap/BlinkGC.h
@@ -7,6 +7,7 @@
// BlinkGC.h is a file that defines common things used by Blink GC.
+#include "platform/PlatformExport.h"
#include "wtf/Allocator.h"
namespace blink {
diff --git a/third_party/WebKit/Source/platform/heap/CallbackStack.cpp b/third_party/WebKit/Source/platform/heap/CallbackStack.cpp
index 4cea26a..17e46a1 100644
--- a/third_party/WebKit/Source/platform/heap/CallbackStack.cpp
+++ b/third_party/WebKit/Source/platform/heap/CallbackStack.cpp
@@ -7,6 +7,8 @@
namespace blink {
+size_t const CallbackStack::kMinimalBlockSize = WTF::kPageAllocationGranularity / sizeof(CallbackStack::Item);
+
CallbackStack::Block::Block(Block* next, size_t blockSize)
: m_blockSize(blockSize)
{
diff --git a/third_party/WebKit/Source/platform/heap/CallbackStack.h b/third_party/WebKit/Source/platform/heap/CallbackStack.h
index 753941c..3bc2800 100644
--- a/third_party/WebKit/Source/platform/heap/CallbackStack.h
+++ b/third_party/WebKit/Source/platform/heap/CallbackStack.h
@@ -5,7 +5,7 @@
#ifndef CallbackStack_h
#define CallbackStack_h
-#include "platform/heap/ThreadState.h"
+#include "platform/heap/BlinkGC.h"
#include "wtf/Allocator.h"
#include "wtf/Assertions.h"
@@ -54,6 +54,8 @@ public:
bool hasCallbackForObject(const void*);
#endif
+ static const size_t kMinimalBlockSize;
+
private:
static const size_t defaultBlockSize = (1 << 13);
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index 11ba827..62e4f91 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -110,7 +110,8 @@ void Heap::init()
s_markingStack = new CallbackStack();
s_postMarkingCallbackStack = new CallbackStack();
s_globalWeakCallbackStack = new CallbackStack();
- s_ephemeronStack = new CallbackStack();
+ // Use smallest supported block size for ephemerons.
+ s_ephemeronStack = new CallbackStack(CallbackStack::kMinimalBlockSize);
s_heapDoesNotContainCache = new HeapDoesNotContainCache();
s_freePagePool = new FreePagePool();
s_orphanedPagePool = new OrphanedPagePool();