diff options
author | Michaël Zasso <targos@protonmail.com> | 2019-08-16 11:32:46 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-08-19 09:25:23 +0200 |
commit | e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4 (patch) | |
tree | 6c6bed9804be9df6162b2483f0a56f371f66464d /deps/v8/src/parsing/scanner-character-streams.cc | |
parent | ec16fdae540adaf710b1a86c620170b2880088f0 (diff) | |
download | android-node-v8-e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4.tar.gz android-node-v8-e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4.tar.bz2 android-node-v8-e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4.zip |
deps: update V8 to 7.7.299.4
PR-URL: https://github.com/nodejs/node/pull/28918
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/v8/src/parsing/scanner-character-streams.cc')
-rw-r--r-- | deps/v8/src/parsing/scanner-character-streams.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/deps/v8/src/parsing/scanner-character-streams.cc b/deps/v8/src/parsing/scanner-character-streams.cc index 7758b2bb73..01ea0a0d02 100644 --- a/deps/v8/src/parsing/scanner-character-streams.cc +++ b/deps/v8/src/parsing/scanner-character-streams.cc @@ -590,7 +590,8 @@ void Utf8ExternalStreamingStream::FillBufferFromCurrentChunk() { } } - while (cursor < end && output_cursor + 1 < buffer_start_ + kBufferSize) { + const uint16_t* max_buffer_end = buffer_start_ + kBufferSize; + while (cursor < end && output_cursor + 1 < max_buffer_end) { unibrow::uchar t = unibrow::Utf8::ValueOfIncremental(&cursor, &state, &incomplete_char); if (V8_LIKELY(t <= unibrow::Utf16::kMaxNonSurrogateCharCode)) { @@ -601,6 +602,15 @@ void Utf8ExternalStreamingStream::FillBufferFromCurrentChunk() { *(output_cursor++) = unibrow::Utf16::LeadSurrogate(t); *(output_cursor++) = unibrow::Utf16::TrailSurrogate(t); } + // Fast path for ascii sequences. + size_t remaining = end - cursor; + size_t max_buffer = max_buffer_end - output_cursor; + int max_length = static_cast<int>(Min(remaining, max_buffer)); + DCHECK_EQ(state, unibrow::Utf8::State::kAccept); + int ascii_length = NonAsciiStart(cursor, max_length); + CopyChars(output_cursor, cursor, ascii_length); + cursor += ascii_length; + output_cursor += ascii_length; } current_.pos.bytes = chunk.start.bytes + (cursor - chunk.data); |