Cleanup blink::SegmentedString.

This CL cleans up and simplifies SegmentedString, leading
to an improvement in parsing performance.

This CL also adds a cache for the current_char_ in SegmentedSubstring,
so it can avoid a branch when calling GetCurrentChar().

Profiling shows a 1.5% improvement in the jQuery benchmark in
Speedometer 2.0 and around 1% across the various VanillaJS benchmarks
in Speedometer 2.0.

Change-Id: Idc1ae1e277aaec1c9f581075eab563fcd2a72688
Commit-Queue: Lucas Gadani <>
Reviewed-by: Jeremy Roman <>
Reviewed-by: Kouhei Ueno <>
Cr-Commit-Position: refs/heads/master@{#515989}
3 files changed