diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-12 11:09:28 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-12 11:09:28 +0100 |
commit | 519775b8d9d823b8cee786bc668e050110a8aa67 (patch) | |
tree | 42296be483ab2f1f3042f5aca8ce91c2aa669ec3 /js/src/irregexp/RegExpEngine.cpp | |
parent | 2fbd1794780f92d1e511f6314cc9af7b446a6338 (diff) | |
download | UXP-519775b8d9d823b8cee786bc668e050110a8aa67.tar UXP-519775b8d9d823b8cee786bc668e050110a8aa67.tar.gz UXP-519775b8d9d823b8cee786bc668e050110a8aa67.tar.lz UXP-519775b8d9d823b8cee786bc668e050110a8aa67.tar.xz UXP-519775b8d9d823b8cee786bc668e050110a8aa67.zip |
Revert "JS - RegExp - match updated spec for `/\b/iu` and `/\B/iu`"
This reverts commit 93f8e06bb8d8656e868679d584c7c8771ff8e42f.
Diffstat (limited to 'js/src/irregexp/RegExpEngine.cpp')
-rw-r--r-- | js/src/irregexp/RegExpEngine.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/js/src/irregexp/RegExpEngine.cpp b/js/src/irregexp/RegExpEngine.cpp index 7116ff1e5..2e19065fd 100644 --- a/js/src/irregexp/RegExpEngine.cpp +++ b/js/src/irregexp/RegExpEngine.cpp @@ -2358,10 +2358,7 @@ void BoyerMoorePositionInfo::SetInterval(const Interval& interval) { s_ = AddRange(s_, kSpaceRanges, kSpaceRangeCount, interval); - if (unicode_ignore_case_) - w_ = AddRange(w_, kIgnoreCaseWordRanges, kIgnoreCaseWordRangeCount, interval); - else - w_ = AddRange(w_, kWordRanges, kWordRangeCount, interval); + w_ = AddRange(w_, kWordRanges, kWordRangeCount, interval); d_ = AddRange(d_, kDigitRanges, kDigitRangeCount, interval); surrogate_ = AddRange(surrogate_, kSurrogateRanges, kSurrogateRangeCount, interval); @@ -2398,12 +2395,11 @@ BoyerMoorePositionInfo::SetAll() BoyerMooreLookahead::BoyerMooreLookahead(LifoAlloc* alloc, size_t length, RegExpCompiler* compiler) : length_(length), compiler_(compiler), bitmaps_(*alloc) { - bool unicode_ignore_case = compiler->unicode() && compiler->ignore_case(); max_char_ = MaximumCharacter(compiler->ascii()); bitmaps_.reserve(length); for (size_t i = 0; i < length; i++) - bitmaps_.append(alloc->newInfallible<BoyerMoorePositionInfo>(alloc, unicode_ignore_case)); + bitmaps_.append(alloc->newInfallible<BoyerMoorePositionInfo>(alloc)); } // Find the longest range of lookahead that has the fewest number of different @@ -3069,22 +3065,15 @@ EmitNotInSurrogatePair(RegExpCompiler* compiler, RegExpNode* on_success, Trace* // Check for [0-9A-Z_a-z]. static void EmitWordCheck(RegExpMacroAssembler* assembler, - jit::Label* word, jit::Label* non_word, bool fall_through_on_word, - bool unicode_ignore_case) + jit::Label* word, jit::Label* non_word, bool fall_through_on_word) { - if (!unicode_ignore_case && - assembler->CheckSpecialCharacterClass(fall_through_on_word ? 'w' : 'W', + if (assembler->CheckSpecialCharacterClass(fall_through_on_word ? 'w' : 'W', fall_through_on_word ? non_word : word)) { // Optimized implementation available. return; } - if (unicode_ignore_case) { - assembler->CheckCharacter(0x017F, word); - assembler->CheckCharacter(0x212A, word); - } - assembler->CheckCharacterGT('z', non_word); assembler->CheckCharacterLT('0', non_word); assembler->CheckCharacterGT('a' - 1, word); @@ -3133,8 +3122,7 @@ AssertionNode::EmitBoundaryCheck(RegExpCompiler* compiler, Trace* trace) assembler->LoadCurrentCharacter(trace->cp_offset(), &before_non_word); } // Fall through on non-word. - EmitWordCheck(assembler, &before_word, &before_non_word, false, - compiler->unicode() && compiler->ignore_case()); + EmitWordCheck(assembler, &before_word, &before_non_word, false); // Next character is not a word character. assembler->Bind(&before_non_word); jit::Label ok; @@ -3174,8 +3162,7 @@ AssertionNode::BacktrackIfPrevious(RegExpCompiler* compiler, // We already checked that we are not at the start of input so it must be // OK to load the previous character. assembler->LoadCurrentCharacter(new_trace.cp_offset() - 1, &dummy, false); - EmitWordCheck(assembler, word, non_word, backtrack_if_previous == kIsNonWord, - compiler->unicode() && compiler->ignore_case()); + EmitWordCheck(assembler, word, non_word, backtrack_if_previous == kIsNonWord); assembler->Bind(&fall_through); on_success()->Emit(compiler, &new_trace); |