This CL adds a small cache (capped at 256 elements, evicts entries using lru) to hold the shaping results of previous HarfBuzzRuns. This avoids calls to hb_shape, which makes up the majority of time spent in profiles of pages with complex script (such as amarchoti from tough_layout_cases).

On my z620, this is a ~35% gain for amarchoti on linux, and more than 40% on a nexus 7.


Without patch:
*RESULT times: page_load_time= [45972,43913,44008,43318,43044,43399,43074,43503,42807,42366] ms
Avg times: 43540.400000ms
Sd  times: 984.437030ms


With patch:
*RESULT times: page_load_time= [27737,25984,24754,24705,24304,24904,24236,24313,24995,24726] ms
Avg times: 25065.800000ms
Sd  times: 1063.958416ms


BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@157835 bbb929c8-8fbe-4397-9dbb-9b2b20218538