JSON.stringify shouldn't use generic get() to access Array.length
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 May 2015 17:47:55 +0000 (17:47 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 May 2015 17:47:55 +0000 (17:47 +0000)
commit0e2f8da7aaaa6c24bc8bac1b49ee51f9dd94de5b
tree96a6c523c0ae88be2a4c29e3a852859699374393
parent1861d67345f73d92a7649f2988a8bdd603db809d
JSON.stringify shouldn't use generic get() to access Array.length
<https://webkit.org/b/144847>

Reviewed by Geoffrey Garen.

If the value being serialized is a JSArray object, we can downcast and call its
length() directly instead of doing a generic property lookup.

0.5% progression on Kraken/json-stringify-tinderbox.

* runtime/JSONObject.cpp:
(JSC::Stringifier::Holder::appendNextProperty):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSONObject.cpp