Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Simplify / optimize JSC's LiteralParser
https://bugs.webkit.org/show_bug.cgi?id=255928 Reviewed by Justin Michaud. Simplify / optimize JSC's LiteralParser: - Avoid storing the start/end pointers inside LiteralParserToken, as they are not actually needed. We already have a `stringStart + length` for strings/identifiers, which is all that's needed. - Stop using LiteralParserToken::stringIs8Bit for identifiers. Unlike strings, identifiers always use the same character type as the LiteralParser. This also avoids some unnecessary branching. This may be a small progression on Speedometer on M1. * Source/JavaScriptCore/runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::tryJSONPParse): (JSC::LiteralParser<CharType>::makeIdentifier): (JSC::LiteralParser<CharType>::makeJSString): (JSC::LiteralParser<CharType>::Lexer::lex): (JSC::LiteralParser<LChar>::Lexer::lexIdentifier): (JSC::LiteralParser<UChar>::Lexer::lexIdentifier): (JSC::setParserTokenString<LChar>): (JSC::setParserTokenString<UChar>): (JSC::LiteralParser<CharType>::Lexer::lexString): (JSC::LiteralParser<CharType>::Lexer::lexStringSlow): (JSC::LiteralParser<CharType>::Lexer::lexNumber): (JSC::LiteralParser<CharType>::parsePrimitiveValue): * Source/JavaScriptCore/runtime/LiteralParser.h: Canonical link: https://commits.webkit.org/263416@main
- Loading branch information
Showing
2 changed files
with
50 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters