Remove m_subclassData from JSArray, move the attribute to subclass as needed
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 18:36:59 +0000 (18:36 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 18:36:59 +0000 (18:36 +0000)
commit647884f134bfdfa22986c7e86c61a913f79c4774
tree4073b211690bda3137b1e5f7fb9e5e625875711e
parentf712ed330cdb578f4895d3408e81c983ed01a0ad
Remove m_subclassData from JSArray, move the attribute to subclass as needed
https://bugs.webkit.org/show_bug.cgi?id=84249

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-04-18
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

JSArray's m_subclassData is only used by WebCore's RuntimeArray. This patch moves
the attribute to RuntimeArray to avoid allocating memory for the pointer in the common
case.

This gives ~1% improvement in JSArray creation microbenchmark thanks to fewer allocations
of CopiedSpace.

* jit/JITInlineMethods.h:
(JSC::JIT::emitAllocateJSArray):
* runtime/JSArray.cpp:
(JSC::JSArray::JSArray):
* runtime/JSArray.h:

Source/WebCore:

* bridge/runtime_array.cpp:
(JSC::RuntimeArray::RuntimeArray):
(JSC::RuntimeArray::finishCreation):
* bridge/runtime_array.h:
(JSC::RuntimeArray::getLength):
(JSC::RuntimeArray::getConcreteArray):
(RuntimeArray):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114539 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jit/JITInlineMethods.h
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/runtime/JSArray.h
Source/WebCore/ChangeLog
Source/WebCore/bridge/runtime_array.cpp
Source/WebCore/bridge/runtime_array.h