Speed up the Stringifier::toJSON() fast case
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jul 2015 02:15:41 +0000 (02:15 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jul 2015 02:15:41 +0000 (02:15 +0000)
commitb259e6a750f3e896a7454412ec0828fa8e86c18c
tree4f05d4f532d2942c9034907bad480f8291360a58
parent3e930fbb327cbb1c1c6d11edbd2db8b496395a12
Speed up the Stringifier::toJSON() fast case
https://bugs.webkit.org/show_bug.cgi?id=147383

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-07-28
Reviewed by Andreas Kling.

Source/JavaScriptCore:

* runtime/JSONObject.cpp:
(JSC::Stringifier::toJSON):
(JSC::Stringifier::toJSONImpl):

LayoutTests:

Make the fast case of Stringifier::toJSON() inline and the uncommon
case out-of-line.

* js/dom/JSON-stringify-string-object-with-tojson-expected.txt: Added.
* js/dom/JSON-stringify-string-object-with-tojson.html: Added.
* js/resources/JSON-stringify-string-object-with-tojson.js: Added.
(stringObject.toJSON):
(String.prototype.toJSON):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/dom/JSON-stringify-string-object-with-tojson-expected.txt [new file with mode: 0644]
LayoutTests/js/dom/JSON-stringify-string-object-with-tojson.html [new file with mode: 0644]
LayoutTests/js/resources/JSON-stringify-string-object-with-tojson.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSONObject.cpp