| Summary: | Quantifiers after lookahead assertions should be syntax errors in Unicode patterns only | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Alexey Shvayka <ashvayka> | ||||||||||
| Component: | JavaScriptCore | Assignee: | Alexey Shvayka <ashvayka> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Trivial | CC: | commit-queue, darin, ews-watchlist, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Alexey Shvayka
2020-01-30 01:27:35 PST
Created attachment 389236 [details]
Patch
Created attachment 389312 [details]
Patch
Rename bug in ChangeLog.
Comment on attachment 389312 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=389312&action=review > Source/JavaScriptCore/yarr/YarrParser.h:709 > + auto parensType = m_parenthesesStack.takeLast(); > + return parensType == ParenthesesType::Subpattern || !m_isUnicode; In WebKit coding style we normally don’t abbreviate a word like parentheses even in a local variable name. I think calling this just "type" is fine. > Source/JavaScriptCore/yarr/YarrParser.h:1124 > + enum ParenthesesType { Subpattern, Assertion }; Might get a slightly more efficient code if this was an enum class based on bool or uint8_t. > Source/JavaScriptCore/yarr/YarrParser.h:1133 > + Vector<ParenthesesType, 16> m_parenthesesStack; Thisis likely going to be a bit inefficient; we could possibly get a more efficient implementation of a bit vector. I didn’t set the commit queue flag yet because I think the change to enum class might be worth doing before landing. If not, add a comment some committer can add commit-queue+. Created attachment 389448 [details]
Patch
Set reviewer, rename vars, and use std::vector with typed enum class.
(In reply to Darin Adler from comment #3) > > Thisis likely going to be a bit inefficient; we could possibly get a more > efficient implementation of a bit vector. I did some isolated profiling of std::vector<bool>: it allocates 8x less memory, but it performs ~30% slower on push_back() + pop_back() and is not compatible with `enum class`. Comment on attachment 389448 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=389448&action=review > Source/JavaScriptCore/yarr/YarrParser.h:1141 > + std::vector<ParenthesesType> m_parenthesesStack; Regardless of the enum class type, we should still use a WTF::Vector. Created attachment 389671 [details]
Patch
Replace std::vector with WTF::Vector.
Comment on attachment 389671 [details] Patch Clearing flags on attachment: 389671 Committed r255689: <https://trac.webkit.org/changeset/255689> All reviewed patches have been landed. Closing bug. |