[JSC] JSString::getIndex() should avoid reifying substrings.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jun 2015 18:03:40 +0000 (18:03 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jun 2015 18:03:40 +0000 (18:03 +0000)
commitaa21312c57d809589f73699f388939bdea9c8d1f
tree76b6c6981af5de83308ccf4616e25e9d55b6bd64
parent3c683709c54b397d207e49e84d1c16f04bdbadac
[JSC] JSString::getIndex() should avoid reifying substrings.
<https://webkit.org/b/145803>

Reviewed by Darin Adler.

Implement getIndex() using JSString::view(), which cuts it down to a one-liner
and also avoids reifying substrings.

I saw 178 kB of reified substrings below operationGetByVal -> getIndex()
on cnet.com, so this should help.

* runtime/JSString.cpp:
(JSC::JSRopeString::getIndexSlowCase): Deleted.
* runtime/JSString.h:
(JSC::JSString::getIndex):

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