Large array shouldn't be slow
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 May 2015 02:40:28 +0000 (02:40 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 May 2015 02:40:28 +0000 (02:40 +0000)
commit4ec02a939fe821270ccf3810e0ba13ee5693229b
treeb5b60bedd9dc211cfa7d1884097556cd5c251c59
parented9b9b2c483b3fd6227f097fcd864f34274822d3
Large array shouldn't be slow
https://bugs.webkit.org/show_bug.cgi?id=144617

Reviewed by Geoffrey Garen.

PerformanceTests:

Add the hash-map benchmark to LongSpider. LongSpider was already not a perfect match of
SunSpider. It's not an official benchmark. It contains benchmarks that are relatively
long-running. So, hash-map sort of belongs here.

* LongSpider/hash-map.js: Added.
(HashMap):
(HashMap.):
(.get var):

Source/JavaScriptCore:

Decouple MIN_SPARSE_ARRAY_INDEX, which is the threshold for storing to the sparse map when
you're already using ArrayStorage mode, from the minimul array length required to use
ArrayStorage in a new Array(length) allocation.

Lift the array allocation length threshold to something very high. If this works, we'll
probably remove that threshold entirely.

This is a 27% speed-up on JetStream/hash-map. Because run-jsc-benchmarks still can't run
JetStream as a discrete suite, this adds hash-map to LongSpider so that we run it somewhere
for now.

* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNewArrayWithSize):
* runtime/ArrayConventions.h:
* runtime/JSArray.h:
(JSC::JSArray::create):
* runtime/JSGlobalObject.h:
(JSC::constructEmptyArray):
* tests/stress/new-array-storage-array-with-size.js: Skip this test until we fix https://bugs.webkit.org/show_bug.cgi?id=144609.

Tools:

Add the hash-map benchmark to LongSpider. LongSpider was already not a perfect match of
SunSpider. It's not an official benchmark. It contains benchmarks that are relatively
long-running. So, hash-map sort of belongs here.

* Scripts/run-jsc-benchmarks:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
PerformanceTests/ChangeLog
PerformanceTests/LongSpider/hash-map.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
Source/JavaScriptCore/runtime/ArrayConventions.h
Source/JavaScriptCore/runtime/JSArray.h
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/tests/stress/new-array-storage-array-with-size.js
Tools/ChangeLog
Tools/Scripts/run-jsc-benchmarks