GC has trouble with pathologically large array allocations
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 May 2015 03:39:20 +0000 (03:39 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 May 2015 03:39:20 +0000 (03:39 +0000)
commit794d318737e5844020573f8fbe6443759b0d886a
tree4cc739f2cca3b6a4ace5a8577d16718c7a28bc2a
parent396a9917d04424946eed2a8615e0e05187a1c9f7
GC has trouble with pathologically large array allocations
https://bugs.webkit.org/show_bug.cgi?id=144609

Reviewed by Mark Lam.

* heap/Heap.cpp:
(JSC::Heap::updateObjectCounts): Make this code less confusing.
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::copyLater): The early return for isOversize() was the bug. We still need to report these bytes as live. Otherwise the GC doesn't know that it owns this memory.
* jsc.cpp: Add size measuring hooks to write the largeish test.
(GlobalObject::finishCreation):
(functionGCAndSweep):
(functionFullGC):
(functionEdenGC):
(functionHeapSize):
* tests/stress/new-array-storage-array-with-size.js: Fix this so that it actually allocates ArrayStorage arrays and tests the thing it was supposed to test.
* tests/stress/new-largeish-contiguous-array-with-size.js: Added. This tests what the other test accidentally started testing, but does so without running your system out of memory.
(foo):
(test):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/SlotVisitorInlines.h
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/tests/stress/new-array-storage-array-with-size.js
Source/JavaScriptCore/tests/stress/new-largeish-contiguous-array-with-size.js [new file with mode: 0644]