Commit 6abfd167 authored by Joshua Litt's avatar Joshua Litt Committed by Commit Bot

[scanner] Try and recover some perf from launching nullish

Launching nullish behind a flag resulted in a small performance
regression in the adwords parsing benchmark. From local tests, doing a
little manual PGO seemed to improve performance slightly.

Parse.duration on this benchmark dropped from 1,639.188 ms to 1,535.312 ms

Bug: chromium:997652
Change-Id: I537985793cdf310a0dda5a69ded9f0ea2c0a7fb0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1773098
Commit-Queue: Joshua Litt <joshualitt@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63417}
parent 0366533c
......@@ -365,11 +365,11 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() {
case Token::CONDITIONAL:
// ? ?. ??
Advance();
if (allow_harmony_optional_chaining() && c0_ == '.') {
if (V8_UNLIKELY(allow_harmony_optional_chaining() && c0_ == '.')) {
Advance();
if (!IsDecimalDigit(c0_)) return Token::QUESTION_PERIOD;
PushBack('.');
} else if (allow_harmony_nullish() && c0_ == '?') {
} else if (V8_UNLIKELY(allow_harmony_nullish() && c0_ == '?')) {
return Select(Token::NULLISH);
}
return Token::CONDITIONAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment