Mobile Gmail should use 1.3 MB less memory
Mobile Gmail should use 1.3 MB less memory

The vast majority of the remaining 16 bit strings in Mobile Gmail are coming
from our v8::String to WTF::String conversion. Before this CL, we were relying
upon V8 to detect 8 bit strings. This CL makes it so we check whether the
resulting WTF::String fits in 8 bits when we create it from the v8::String.
(Note that we also externalize the v8::String when we convert it to a
WTF::String, so we shrink the V8 representation of the string at the same
time.)

The STRING_STATS for this change are below. My test environment isn't 100%
reproducable, so the data isn't completely consistent. For example, there are
283,552 more toal characters in the "before" measurement than in the "after"
measurement, which biases the results slightly.  However, even if those missing
strings were all 16 bits wide, this CL would still be a >1 MB memory win.

= Mobile Gmail =

== Before ==

String stats for process id 23182:
    5311 (98.99%) 8 bit             1877856 chars       1877856 bytes  avg length  353.6
      54 ( 1.01%) 16 bit            1839813 chars       3679626 bytes  avg length 34070.6
       8 ( 0.15%) upconverted          1138 chars          2276 bytes  avg length  142.2
    5365 Total                      3717669 chars       5559758 bytes  avg length  692.9
         Total savings      1876718 bytes (25.24%)

== After ==

String stats for process id 23382:
    5307 (99.31%) 8 bit             2687571 chars       2687571 bytes  avg length  506.4
      38 ( 0.71%) 16 bit             746572 chars       1493144 bytes  avg length 19646.6
       6 ( 0.11%) upconverted          1112 chars          2224 bytes  avg length  185.3
    5344 Total                      3434143 chars       4182939 bytes  avg length  642.6
         Total savings      2686459 bytes (39.11%)

NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/16158008

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@151994 bbb929c8-8fbe-4397-9dbb-9b2b20218538

primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs