• vogelheim's avatar
    Rework scanner-character-streams. · 642d6d31
    vogelheim authored
    - Smaller, more consistent streams API (Advance, Back, pos, Seek)
    - Remove implementations from the header, in favor of creation functions.
    
    Observe:
    - Performance:
      - All Utf16CharacterStream methods have an inlinable V8_LIKELY w/ a
        body of only a few instructions. I expect most calls to end up there.
      - There used to be performance problems w/ bookmarking, particularly
        with copying too much data on SetBookmark w/ UTF-8 streaming streams.
        All those copies are gone.
      - The old streaming streams implementation used to copy data even for
        2-byte input. It no longer does.
      - The only remaining 'slow' method is the Seek(.) slow case for utf-8
        streaming streams. I don't expect this to be called a lot; and even if,
        I expect it to be offset by the gains in the (vastly more frequent)
        calls to the other methods or the 'fast path'.
      - If it still bothers us, there are several ways to speed it up.
    - API & code cleanliness:
      - I want to remove the 'old' API in a follow-up CL, which should mostly
        delete code, or replace it 1:1.
      - In a 2nd follow-up I want to delete much of the UTF-8 handling in Blink
        for streaming streams.
      - The "bookmark" is now always implemented (and mostly very fast), so we
        should be able to use it for more things.
    - Testing & correctness:
      - The unit tests now cover all stream implementations,
        and are pretty good and triggering all the edge cases.
      - Vastly more DCHECKs of the invariants.
    
    BUG=v8:4947
    
    Review-Url: https://codereview.chromium.org/2314663002
    Cr-Commit-Position: refs/heads/master@{#39464}
    642d6d31
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...