<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[243950] tags/Safari-608.1.15/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/243950">243950</a></dd>
<dt>Author</dt> <dd>alancoon@apple.com</dd>
<dt>Date</dt> <dd>2019-04-05 15:08:26 -0700 (Fri, 05 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Revert <a href="http://trac.webkit.org/projects/webkit/changeset/243642">r243642</a>. rdar://problem/49654398</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#tagsSafari608115SourceJavaScriptCoreChangeLog">tags/Safari-608.1.15/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreruntimeRegExpcpp">tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExp.cpp</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreruntimeRegExpInlinesh">tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExpInlines.h</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreyarrYarrInterpretercpp">tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrInterpreter.cpp</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreyarrYarrJITcpp">tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrJIT.cpp</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreyarrYarrPatterncpp">tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.cpp</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreyarrYarrPatternh">tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.h</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreyarrcreate_regex_tables">tags/Safari-608.1.15/Source/JavaScriptCore/yarr/create_regex_tables</a></li>
<li><a href="#tagsSafari608115SourceJavaScriptCoreyarrgenerateYarrUnicodePropertyTablespy">tags/Safari-608.1.15/Source/JavaScriptCore/yarr/generateYarrUnicodePropertyTables.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="tagsSafari608115SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/ChangeLog (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/ChangeLog     2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/ChangeLog        2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -1,5 +1,9 @@
</span><span class="cx"> 2019-04-05  Kocsen Chung  <kocsen_chung@apple.com>
</span><span class="cx"> 
</span><ins>+        Revert r243642. rdar://problem/49654398
+
+2019-04-05  Kocsen Chung  <kocsen_chung@apple.com>
+
</ins><span class="cx">         Revert r243839. rdar://problem/49654398
</span><span class="cx"> 
</span><span class="cx"> 2019-04-03  Yusuke Suzuki  <ysuzuki@apple.com>
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreruntimeRegExpcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExp.cpp (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExp.cpp    2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExp.cpp       2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -385,7 +385,7 @@
</span><span class="cx">     for (unsigned j = 0, i = 0; i < m_numSubpatterns + 1; j += 2, i++)
</span><span class="cx">         interpreterOffsetVector[j] = -1;
</span><span class="cx"> 
</span><del>-    interpreterResult = Yarr::interpret(m_regExpBytecode.get(), s, startOffset, reinterpret_cast<unsigned*>(interpreterOffsetVector));
</del><ins>+    interpreterResult = Yarr::interpret(m_regExpBytecode.get(), s, startOffset, interpreterOffsetVector);
</ins><span class="cx"> 
</span><span class="cx">     if (jitResult != interpreterResult)
</span><span class="cx">         differences++;
</span><span class="lines">@@ -402,7 +402,7 @@
</span><span class="cx">         dataLogF((segmentLen < 150) ? "\"%s\"\n" : "\"%148s...\"\n", s.utf8().data() + startOffset);
</span><span class="cx"> 
</span><span class="cx">         if (jitResult != interpreterResult) {
</span><del>-            dataLogF("    JIT result = %d, interpreted result = %d\n", jitResult, interpreterResult);
</del><ins>+            dataLogF("    JIT result = %d, blah interpreted result = %d\n", jitResult, interpreterResult);
</ins><span class="cx">             differences--;
</span><span class="cx">         } else {
</span><span class="cx">             dataLogF("    Correct result = %d\n", jitResult);
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreruntimeRegExpInlinesh"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExpInlines.h (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExpInlines.h       2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/runtime/RegExpInlines.h  2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -181,10 +181,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(YARR_JIT_DEBUG)
</span><del>-        if (m_state == JITCode) {
-            byteCodeCompileIfNecessary(&vm);
-            matchCompareWithInterpreter(s, startOffset, offsetVector, result);
-        }
</del><ins>+        matchCompareWithInterpreter(s, startOffset, offsetVector, result);
</ins><span class="cx"> #endif
</span><span class="cx">     } else
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreyarrYarrInterpretercpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrInterpreter.cpp (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrInterpreter.cpp      2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrInterpreter.cpp 2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -428,12 +428,6 @@
</span><span class="cx">         bool match = testCharacterClass(characterClass, input.readChecked(negativeInputOffset));
</span><span class="cx">         return invert ? !match : match;
</span><span class="cx">     }
</span><del>-    
-    bool checkCharacterClassDontAdvanceInputForNonBMP(CharacterClass* characterClass, unsigned negativeInputOffset)
-    {
-        int readCharacter = characterClass->hasOnlyNonBMPCharacters() ? input.readSurrogatePairChecked(negativeInputOffset) :  input.readChecked(negativeInputOffset);
-        return testCharacterClass(characterClass, readCharacter);
-    }
</del><span class="cx"> 
</span><span class="cx">     bool tryConsumeBackReference(int matchBegin, int matchEnd, unsigned negativeInputOffset)
</span><span class="cx">     {
</span><span class="lines">@@ -564,21 +558,12 @@
</span><span class="cx">         switch (term.atom.quantityType) {
</span><span class="cx">         case QuantifierFixedCount: {
</span><span class="cx">             if (unicode) {
</span><del>-                CharacterClass* charClass = term.atom.characterClass;
</del><span class="cx">                 backTrack->begin = input.getPos();
</span><span class="cx">                 unsigned matchAmount = 0;
</span><span class="cx">                 for (matchAmount = 0; matchAmount < term.atom.quantityMaxCount; ++matchAmount) {
</span><del>-                    if (term.invert()) {
-                        if (!checkCharacterClass(charClass, term.invert(), term.inputPosition - matchAmount)) {
-                            input.setPos(backTrack->begin);
-                            return false;
-                        }
-                    } else {
-                        unsigned matchOffset = matchAmount * (charClass->hasOnlyNonBMPCharacters() ? 2 : 1);
-                        if (!checkCharacterClassDontAdvanceInputForNonBMP(charClass, term.inputPosition - matchOffset)) {
-                            input.setPos(backTrack->begin);
-                            return false;
-                        }
</del><ins>+                    if (!checkCharacterClass(term.atom.characterClass, term.invert(), term.inputPosition - matchAmount)) {
+                        input.setPos(backTrack->begin);
+                        return false;
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreyarrYarrJITcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrJIT.cpp (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrJIT.cpp      2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrJIT.cpp 2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -72,14 +72,13 @@
</span><span class="cx">     static const RegisterID regUnicodeInputAndTrail = ARM64Registers::x10;
</span><span class="cx">     static const RegisterID initialStart = ARM64Registers::x11;
</span><span class="cx">     static const RegisterID supplementaryPlanesBase = ARM64Registers::x12;
</span><del>-    static const RegisterID leadingSurrogateTag = ARM64Registers::x13;
-    static const RegisterID trailingSurrogateTag = ARM64Registers::x14;
-    static const RegisterID endOfStringAddress = ARM64Registers::x15;
</del><ins>+    static const RegisterID surrogateTagMask = ARM64Registers::x13;
+    static const RegisterID leadingSurrogateTag = ARM64Registers::x14;
+    static const RegisterID trailingSurrogateTag = ARM64Registers::x15;
</ins><span class="cx"> 
</span><span class="cx">     static const RegisterID returnRegister = ARM64Registers::x0;
</span><span class="cx">     static const RegisterID returnRegister2 = ARM64Registers::x1;
</span><span class="cx"> 
</span><del>-    const TrustedImm32 surrogateTagMask = TrustedImm32(0xfffffc00);
</del><span class="cx"> #define HAVE_INITIAL_START_REG
</span><span class="cx"> #define JIT_UNICODE_EXPRESSIONS
</span><span class="cx"> #elif CPU(MIPS)
</span><span class="lines">@@ -144,13 +143,12 @@
</span><span class="cx"> #endif
</span><span class="cx">     static const RegisterID regUnicodeInputAndTrail = X86Registers::r13;
</span><span class="cx">     static const RegisterID leadingSurrogateTag = X86Registers::r14;
</span><del>-    static const RegisterID endOfStringAddress = X86Registers::r15;
</del><ins>+    static const RegisterID trailingSurrogateTag = X86Registers::r15;
</ins><span class="cx"> 
</span><span class="cx">     static const RegisterID returnRegister = X86Registers::eax;
</span><span class="cx">     static const RegisterID returnRegister2 = X86Registers::edx;
</span><span class="cx"> 
</span><span class="cx">     const TrustedImm32 supplementaryPlanesBase = TrustedImm32(0x10000);
</span><del>-    const TrustedImm32 trailingSurrogateTag = TrustedImm32(0xdc00);
</del><span class="cx">     const TrustedImm32 surrogateTagMask = TrustedImm32(0xfffffc00);
</span><span class="cx"> #define HAVE_INITIAL_START_REG
</span><span class="cx"> #define JIT_UNICODE_EXPRESSIONS
</span><span class="lines">@@ -321,7 +319,7 @@
</span><span class="cx">             // We can move BMP only character classes after fixed character terms.
</span><span class="cx">             if ((term.type == PatternTerm::TypeCharacterClass)
</span><span class="cx">                 && (term.quantityType == QuantifierFixedCount)
</span><del>-                && (!m_decodeSurrogatePairs || (term.characterClass->hasOneCharacterSize() && !term.m_invert))
</del><ins>+                && (!m_decodeSurrogatePairs || (!term.characterClass->m_hasNonBMPCharacters && !term.m_invert))
</ins><span class="cx">                 && (nextTerm.type == PatternTerm::TypePatternCharacter)
</span><span class="cx">                 && (nextTerm.quantityType == QuantifierFixedCount)) {
</span><span class="cx">                 PatternTerm termCopy = term;
</span><span class="lines">@@ -385,7 +383,6 @@
</span><span class="cx">             matchDest.append(branchTest8(charClass->m_tableInverted ? Zero : NonZero, tableEntry));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-
</del><span class="cx">         JumpList unicodeFail;
</span><span class="cx">         if (charClass->m_matchesUnicode.size() || charClass->m_rangesUnicode.size()) {
</span><span class="cx">             JumpList isAscii;
</span><span class="lines">@@ -451,23 +448,6 @@
</span><span class="cx">             unicodeFail.link(this);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#ifdef JIT_UNICODE_EXPRESSIONS
-    void advanceIndexAfterCharacterClassTermMatch(const PatternTerm* term, JumpList& failures, const RegisterID character)
-    {
-        ASSERT(term->type == PatternTerm::TypeCharacterClass);
-
-        if (term->characterClass->hasOneCharacterSize() && !term->invert())
-            add32(TrustedImm32(term->characterClass->hasNonBMPCharacters() ? 2 : 1), index);
-        else {
-            add32(TrustedImm32(1), index);
-            failures.append(atEndOfInput());
-            Jump isBMPChar = branch32(LessThan, character, supplementaryPlanesBase);
-            add32(TrustedImm32(1), index);
-            isBMPChar.link(this);
-        }
-    }
-#endif
-
</del><span class="cx">     // Jumps if input not available; will have (incorrectly) incremented already!
</span><span class="cx">     Jump jumpIfNoAvailableInput(unsigned countToCheck = 0)
</span><span class="cx">     {
</span><span class="lines">@@ -540,12 +520,12 @@
</span><span class="cx">         ASSERT(m_charSize == Char16);
</span><span class="cx"> 
</span><span class="cx">         JumpList notUnicode;
</span><del>-
</del><span class="cx">         load16Unaligned(regUnicodeInputAndTrail, resultReg);
</span><span class="cx">         and32(surrogateTagMask, resultReg, regT2);
</span><span class="cx">         notUnicode.append(branch32(NotEqual, regT2, leadingSurrogateTag));
</span><span class="cx">         addPtr(TrustedImm32(2), regUnicodeInputAndTrail);
</span><del>-        notUnicode.append(branchPtr(AboveOrEqual, regUnicodeInputAndTrail, endOfStringAddress));
</del><ins>+        getEffectiveAddress(BaseIndex(input, length, TimesTwo), regT2);
+        notUnicode.append(branch32(AboveOrEqual, regUnicodeInputAndTrail, regT2));
</ins><span class="cx">         load16Unaligned(Address(regUnicodeInputAndTrail), regUnicodeInputAndTrail);
</span><span class="cx">         and32(surrogateTagMask, regUnicodeInputAndTrail, regT2);
</span><span class="cx">         notUnicode.append(branch32(NotEqual, regT2, trailingSurrogateTag));
</span><span class="lines">@@ -1754,7 +1734,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> #ifdef JIT_UNICODE_EXPRESSIONS
</span><del>-        if (m_decodeSurrogatePairs && (!term->characterClass->hasOneCharacterSize() || term->invert())) {
</del><ins>+        if (m_decodeSurrogatePairs) {
</ins><span class="cx">             Jump isBMPChar = branch32(LessThan, character, supplementaryPlanesBase);
</span><span class="cx">             add32(TrustedImm32(1), index);
</span><span class="cx">             isBMPChar.link(this);
</span><span class="lines">@@ -1788,18 +1768,11 @@
</span><span class="cx">             op.m_jumps.append(jumpIfNoAvailableInput());
</span><span class="cx"> 
</span><span class="cx">         move(index, countRegister);
</span><ins>+        sub32(Imm32(term->quantityMaxCount.unsafeGet()), countRegister);
</ins><span class="cx"> 
</span><del>-        Checked<unsigned> scaledMaxCount = term->quantityMaxCount;
-
-#ifdef JIT_UNICODE_EXPRESSIONS
-        if (m_decodeSurrogatePairs && term->characterClass->hasOnlyNonBMPCharacters() && !term->invert())
-            scaledMaxCount *= 2;
-#endif
-        sub32(Imm32(scaledMaxCount.unsafeGet()), countRegister);
-
</del><span class="cx">         Label loop(this);
</span><span class="cx">         JumpList matchDest;
</span><del>-        readCharacter(m_checkedOffset - term->inputPosition - scaledMaxCount, character, countRegister);
</del><ins>+        readCharacter(m_checkedOffset - term->inputPosition - term->quantityMaxCount, character, countRegister);
</ins><span class="cx">         // If we are matching the "any character" builtin class we only need to read the
</span><span class="cx">         // character and don't need to match as it will always succeed.
</span><span class="cx">         if (term->invert() || !term->characterClass->m_anyCharacter) {
</span><span class="lines">@@ -1813,21 +1786,16 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        add32(TrustedImm32(1), countRegister);
</ins><span class="cx"> #ifdef JIT_UNICODE_EXPRESSIONS
</span><span class="cx">         if (m_decodeSurrogatePairs) {
</span><del>-            if (term->characterClass->hasOneCharacterSize() && !term->invert())
-                add32(TrustedImm32(term->characterClass->hasNonBMPCharacters() ? 2 : 1), countRegister);
-            else {
-                add32(TrustedImm32(1), countRegister);
-                Jump isBMPChar = branch32(LessThan, character, supplementaryPlanesBase);
-                op.m_jumps.append(atEndOfInput());
-                add32(TrustedImm32(1), countRegister);
-                add32(TrustedImm32(1), index);
-                isBMPChar.link(this);
-            }
-        } else
</del><ins>+            Jump isBMPChar = branch32(LessThan, character, supplementaryPlanesBase);
+            op.m_jumps.append(atEndOfInput());
+            add32(TrustedImm32(1), countRegister);
+            add32(TrustedImm32(1), index);
+            isBMPChar.link(this);
+        }
</ins><span class="cx"> #endif
</span><del>-            add32(TrustedImm32(1), countRegister);
</del><span class="cx">         branch32(NotEqual, countRegister, index).linkTo(loop, this);
</span><span class="cx">     }
</span><span class="cx">     void backtrackCharacterClassFixed(size_t opIndex)
</span><span class="lines">@@ -1843,7 +1811,7 @@
</span><span class="cx">         const RegisterID character = regT0;
</span><span class="cx">         const RegisterID countRegister = regT1;
</span><span class="cx"> 
</span><del>-        if (m_decodeSurrogatePairs && (!term->characterClass->hasOneCharacterSize() || term->invert()))
</del><ins>+        if (m_decodeSurrogatePairs)
</ins><span class="cx">             storeToFrame(index, term->frameLocation + BackTrackInfoCharacterClass::beginIndex());
</span><span class="cx">         move(TrustedImm32(0), countRegister);
</span><span class="cx"> 
</span><span class="lines">@@ -1857,8 +1825,8 @@
</span><span class="cx">         } else {
</span><span class="cx">             JumpList matchDest;
</span><span class="cx">             readCharacter(m_checkedOffset - term->inputPosition, character);
</span><del>-            // If we are matching the "any character" builtin class for non-unicode patterns,
-            // we only need to read the character and don't need to match as it will always succeed.
</del><ins>+            // If we are matching the "any character" builtin class we only need to read the
+            // character and don't need to match as it will always succeed.
</ins><span class="cx">             if (!term->characterClass->m_anyCharacter) {
</span><span class="cx">                 matchCharacterClass(character, matchDest, term->characterClass);
</span><span class="cx">                 failures.append(jump());
</span><span class="lines">@@ -1866,12 +1834,15 @@
</span><span class="cx">             matchDest.link(this);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        add32(TrustedImm32(1), index);
</ins><span class="cx"> #ifdef JIT_UNICODE_EXPRESSIONS
</span><del>-        if (m_decodeSurrogatePairs)
-            advanceIndexAfterCharacterClassTermMatch(term, failures, character);
-        else
</del><ins>+        if (m_decodeSurrogatePairs) {
+            failures.append(atEndOfInput());
+            Jump isBMPChar = branch32(LessThan, character, supplementaryPlanesBase);
+            add32(TrustedImm32(1), index);
+            isBMPChar.link(this);
+        }
</ins><span class="cx"> #endif
</span><del>-            add32(TrustedImm32(1), index);
</del><span class="cx">         add32(TrustedImm32(1), countRegister);
</span><span class="cx"> 
</span><span class="cx">         if (term->quantityMaxCount != quantifyInfinite) {
</span><span class="lines">@@ -1897,17 +1868,14 @@
</span><span class="cx">         loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex(), countRegister);
</span><span class="cx">         m_backtrackingState.append(branchTest32(Zero, countRegister));
</span><span class="cx">         sub32(TrustedImm32(1), countRegister);
</span><del>-        storeToFrame(countRegister, term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex());
-
</del><span class="cx">         if (!m_decodeSurrogatePairs)
</span><span class="cx">             sub32(TrustedImm32(1), index);
</span><del>-        else if (term->characterClass->hasOneCharacterSize() && !term->invert())
-            sub32(TrustedImm32(term->characterClass->hasNonBMPCharacters() ? 2 : 1), index);
</del><span class="cx">         else {
</span><del>-            // Rematch one less
</del><span class="cx">             const RegisterID character = regT0;
</span><span class="cx"> 
</span><span class="cx">             loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::beginIndex(), index);
</span><ins>+            // Rematch one less
+            storeToFrame(countRegister, term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex());
</ins><span class="cx"> 
</span><span class="cx">             Label rematchLoop(this);
</span><span class="cx">             readCharacter(m_checkedOffset - term->inputPosition, character);
</span><span class="lines">@@ -1937,11 +1905,9 @@
</span><span class="cx"> 
</span><span class="cx">         move(TrustedImm32(0), countRegister);
</span><span class="cx">         op.m_reentry = label();
</span><del>-        if (m_decodeSurrogatePairs) {
-            if (!term->characterClass->hasOneCharacterSize() || term->invert())
-                storeToFrame(index, term->frameLocation + BackTrackInfoCharacterClass::beginIndex());
-            storeToFrame(countRegister, term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex());
-        }
</del><ins>+        if (m_decodeSurrogatePairs)
+            storeToFrame(index, term->frameLocation + BackTrackInfoCharacterClass::beginIndex());
+        storeToFrame(countRegister, term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void backtrackCharacterClassNonGreedy(size_t opIndex)
</span><span class="lines">@@ -1956,11 +1922,9 @@
</span><span class="cx"> 
</span><span class="cx">         m_backtrackingState.link(this);
</span><span class="cx"> 
</span><del>-        if (m_decodeSurrogatePairs) {
-            if (!term->characterClass->hasOneCharacterSize() || term->invert())
-                loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::beginIndex(), index);
-            loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex(), countRegister);
-        }
</del><ins>+        if (m_decodeSurrogatePairs)
+            loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::beginIndex(), index);
+        loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex(), countRegister);
</ins><span class="cx"> 
</span><span class="cx">         nonGreedyFailures.append(atEndOfInput());
</span><span class="cx">         nonGreedyFailures.append(branch32(Equal, countRegister, Imm32(term->quantityMaxCount.unsafeGet())));
</span><span class="lines">@@ -1967,8 +1931,8 @@
</span><span class="cx"> 
</span><span class="cx">         JumpList matchDest;
</span><span class="cx">         readCharacter(m_checkedOffset - term->inputPosition, character);
</span><del>-        // If we are matching the "any character" builtin class for non-unicode patterns,
-        // we only need to read the character and don't need to match as it will always succeed.
</del><ins>+        // If we are matching the "any character" builtin class we only need to read the
+        // character and don't need to match as it will always succeed.
</ins><span class="cx">         if (term->invert() || !term->characterClass->m_anyCharacter) {
</span><span class="cx">             matchCharacterClass(character, matchDest, term->characterClass);
</span><span class="cx"> 
</span><span class="lines">@@ -1980,12 +1944,15 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        add32(TrustedImm32(1), index);
</ins><span class="cx"> #ifdef JIT_UNICODE_EXPRESSIONS
</span><del>-        if (m_decodeSurrogatePairs)
-            advanceIndexAfterCharacterClassTermMatch(term, nonGreedyFailures, character);
-        else
</del><ins>+        if (m_decodeSurrogatePairs) {
+            nonGreedyFailures.append(atEndOfInput());
+            Jump isBMPChar = branch32(LessThan, character, supplementaryPlanesBase);
+            add32(TrustedImm32(1), index);
+            isBMPChar.link(this);
+        }
</ins><span class="cx"> #endif
</span><del>-            add32(TrustedImm32(1), index);
</del><span class="cx">         add32(TrustedImm32(1), countRegister);
</span><span class="cx"> 
</span><span class="cx">         jump(op.m_reentry);
</span><span class="lines">@@ -3733,6 +3700,7 @@
</span><span class="cx">             push(X86Registers::r15);
</span><span class="cx"> 
</span><span class="cx">             move(TrustedImm32(0xd800), leadingSurrogateTag);
</span><ins>+            move(TrustedImm32(0xdc00), trailingSurrogateTag);
</ins><span class="cx">         }
</span><span class="cx">         // The ABI doesn't guarantee the upper bits are zero on unsigned arguments, so clear them ourselves.
</span><span class="cx">         zeroExtend32ToPtr(index, index);
</span><span class="lines">@@ -3766,6 +3734,7 @@
</span><span class="cx">         if (m_decodeSurrogatePairs) {
</span><span class="cx">             pushPair(framePointerRegister, linkRegister);
</span><span class="cx">             move(TrustedImm32(0x10000), supplementaryPlanesBase);
</span><ins>+            move(TrustedImm32(0xfffffc00), surrogateTagMask);
</ins><span class="cx">             move(TrustedImm32(0xd800), leadingSurrogateTag);
</span><span class="cx">             move(TrustedImm32(0xdc00), trailingSurrogateTag);
</span><span class="cx">         }
</span><span class="lines">@@ -3846,7 +3815,6 @@
</span><span class="cx">         , m_charSize(charSize)
</span><span class="cx">         , m_decodeSurrogatePairs(m_charSize == Char16 && m_pattern.unicode())
</span><span class="cx">         , m_unicodeIgnoreCase(m_pattern.unicode() && m_pattern.ignoreCase())
</span><del>-        , m_fixedSizedAlternative(false)
</del><span class="cx">         , m_canonicalMode(m_pattern.unicode() ? CanonicalMode::Unicode : CanonicalMode::UCS2)
</span><span class="cx"> #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
</span><span class="cx">         , m_containsNestedSubpatterns(false)
</span><span class="lines">@@ -3901,11 +3869,6 @@
</span><span class="cx">         generateFailReturn();
</span><span class="cx">         hasInput.link(this);
</span><span class="cx"> 
</span><del>-#ifdef JIT_UNICODE_EXPRESSIONS
-        if (m_decodeSurrogatePairs)
-            getEffectiveAddress(BaseIndex(input, length, TimesTwo), endOfStringAddress);
-#endif
-
</del><span class="cx"> #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
</span><span class="cx">         if (m_containsNestedSubpatterns)
</span><span class="cx">             move(TrustedImm32(matchLimit), remainingMatchCount);
</span><span class="lines">@@ -4200,7 +4163,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_decodeSurrogatePairs;
</span><span class="cx">     bool m_unicodeIgnoreCase;
</span><del>-    bool m_fixedSizedAlternative;
</del><span class="cx">     CanonicalMode m_canonicalMode;
</span><span class="cx"> #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
</span><span class="cx">     bool m_containsNestedSubpatterns;
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreyarrYarrPatterncpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.cpp (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.cpp  2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.cpp     2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -45,8 +45,8 @@
</span><span class="cx"> public:
</span><span class="cx">     CharacterClassConstructor(bool isCaseInsensitive, CanonicalMode canonicalMode)
</span><span class="cx">         : m_isCaseInsensitive(isCaseInsensitive)
</span><ins>+        , m_hasNonBMPCharacters(false)
</ins><span class="cx">         , m_anyCharacter(false)
</span><del>-        , m_characterWidths(CharacterClassWidths::Unknown)
</del><span class="cx">         , m_canonicalMode(canonicalMode)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">         m_ranges.clear();
</span><span class="cx">         m_matchesUnicode.clear();
</span><span class="cx">         m_rangesUnicode.clear();
</span><ins>+        m_hasNonBMPCharacters = false;
</ins><span class="cx">         m_anyCharacter = false;
</span><del>-        m_characterWidths = CharacterClassWidths::Unknown;
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void append(const CharacterClass* other)
</span><span class="lines">@@ -246,11 +246,11 @@
</span><span class="cx">         characterClass->m_ranges.swap(m_ranges);
</span><span class="cx">         characterClass->m_matchesUnicode.swap(m_matchesUnicode);
</span><span class="cx">         characterClass->m_rangesUnicode.swap(m_rangesUnicode);
</span><ins>+        characterClass->m_hasNonBMPCharacters = hasNonBMPCharacters();
</ins><span class="cx">         characterClass->m_anyCharacter = anyCharacter();
</span><del>-        characterClass->m_characterWidths = characterWidths();
</del><span class="cx"> 
</span><ins>+        m_hasNonBMPCharacters = false;
</ins><span class="cx">         m_anyCharacter = false;
</span><del>-        m_characterWidths = CharacterClassWidths::Unknown;
</del><span class="cx"> 
</span><span class="cx">         return characterClass;
</span><span class="cx">     }
</span><span class="lines">@@ -266,7 +266,8 @@
</span><span class="cx">         unsigned pos = 0;
</span><span class="cx">         unsigned range = matches.size();
</span><span class="cx"> 
</span><del>-        m_characterWidths |= (U_IS_BMP(ch) ? CharacterClassWidths::HasBMPChars : CharacterClassWidths::HasNonBMPChars);
</del><ins>+        if (!U_IS_BMP(ch))
+            m_hasNonBMPCharacters = true;
</ins><span class="cx"> 
</span><span class="cx">         // binary chop, find position to insert char.
</span><span class="cx">         while (range) {
</span><span class="lines">@@ -315,10 +316,8 @@
</span><span class="cx">     {
</span><span class="cx">         size_t end = ranges.size();
</span><span class="cx"> 
</span><del>-        if (U_IS_BMP(lo))
-            m_characterWidths |= CharacterClassWidths::HasBMPChars;
</del><span class="cx">         if (!U_IS_BMP(hi))
</span><del>-            m_characterWidths |= CharacterClassWidths::HasNonBMPChars;
</del><ins>+            m_hasNonBMPCharacters = true;
</ins><span class="cx"> 
</span><span class="cx">         // Simple linear scan - I doubt there are that many ranges anyway...
</span><span class="cx">         // feel free to fix this with something faster (eg binary chop).
</span><span class="lines">@@ -409,14 +408,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool hasNonBMPCharacters()
</span><span class="cx">     {
</span><del>-        return m_characterWidths & CharacterClassWidths::HasNonBMPChars;
</del><ins>+        return m_hasNonBMPCharacters;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CharacterClassWidths characterWidths()
-    {
-        return m_characterWidths;
-    }
-
</del><span class="cx">     bool anyCharacter()
</span><span class="cx">     {
</span><span class="cx">         return m_anyCharacter;
</span><span class="lines">@@ -423,9 +417,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool m_isCaseInsensitive : 1;
</span><ins>+    bool m_hasNonBMPCharacters : 1;
</ins><span class="cx">     bool m_anyCharacter : 1;
</span><del>-    CharacterClassWidths m_characterWidths;
-    
</del><span class="cx">     CanonicalMode m_canonicalMode;
</span><span class="cx"> 
</span><span class="cx">     Vector<UChar32> m_matches;
</span><span class="lines">@@ -843,16 +836,8 @@
</span><span class="cx">                 } else if (m_pattern.unicode()) {
</span><span class="cx">                     term.frameLocation = currentCallFrameSize;
</span><span class="cx">                     currentCallFrameSize += YarrStackSpaceForBackTrackInfoCharacterClass;
</span><del>-                    if (term.characterClass->hasOneCharacterSize() && !term.invert()) {
-                        Checked<unsigned, RecordOverflow> tempCount = term.quantityMaxCount;
-                        tempCount *= term.characterClass->hasNonBMPCharacters() ? 2 : 1;
-                        if (tempCount.hasOverflowed())
-                            return ErrorCode::OffsetTooLarge;
-                        currentInputPosition += tempCount;
-                    } else {
-                        currentInputPosition += term.quantityMaxCount;
-                        alternative->m_hasFixedSize = false;
-                    }
</del><ins>+                    currentInputPosition += term.quantityMaxCount;
+                    alternative->m_hasFixedSize = false;
</ins><span class="cx">                 } else
</span><span class="cx">                     currentInputPosition += term.quantityMaxCount;
</span><span class="cx">                 break;
</span><span class="lines">@@ -1333,7 +1318,6 @@
</span><span class="cx">         break;
</span><span class="cx">     case TypeCharacterClass:
</span><span class="cx">         out.print("character class ");
</span><del>-        out.printf("inputPosition %u ", inputPosition);
</del><span class="cx">         dumpCharacterClass(out, thisPattern, characterClass);
</span><span class="cx">         dumpQuantifier(out);
</span><span class="cx">         if (quantityType != QuantifierFixedCount || thisPattern->unicode())
</span><span class="lines">@@ -1477,7 +1461,7 @@
</span><span class="cx">     auto characterClass = std::make_unique<CharacterClass>();
</span><span class="cx">     characterClass->m_ranges.append(CharacterRange(0x00, 0x7f));
</span><span class="cx">     characterClass->m_rangesUnicode.append(CharacterRange(0x0080, 0x10ffff));
</span><del>-    characterClass->m_characterWidths = CharacterClassWidths::HasBothBMPAndNonBMP;
</del><ins>+    characterClass->m_hasNonBMPCharacters = true;
</ins><span class="cx">     characterClass->m_anyCharacter = true;
</span><span class="cx">     return characterClass;
</span><span class="cx"> }
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreyarrYarrPatternh"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.h (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.h    2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/yarr/YarrPattern.h       2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -52,29 +52,6 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum struct CharacterClassWidths : unsigned char {
-    Unknown = 0x0,
-    HasBMPChars = 0x1,
-    HasNonBMPChars = 0x2,
-    HasBothBMPAndNonBMP = HasBMPChars | HasNonBMPChars
-};
-
-inline CharacterClassWidths operator|(CharacterClassWidths lhs, CharacterClassWidths rhs)
-{
-    return static_cast<CharacterClassWidths>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs));
-}
-
-inline bool operator&(CharacterClassWidths lhs, CharacterClassWidths rhs)
-{
-    return static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs);
-}
-
-inline CharacterClassWidths& operator|=(CharacterClassWidths& lhs, CharacterClassWidths rhs)
-{
-    lhs = lhs | rhs;
-    return lhs;
-}
-
</del><span class="cx"> struct CharacterClass {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -83,34 +60,29 @@
</span><span class="cx">     // specified matches and ranges)
</span><span class="cx">     CharacterClass()
</span><span class="cx">         : m_table(0)
</span><del>-        , m_characterWidths(CharacterClassWidths::Unknown)
</del><ins>+        , m_hasNonBMPCharacters(false)
</ins><span class="cx">         , m_anyCharacter(false)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     CharacterClass(const char* table, bool inverted)
</span><span class="cx">         : m_table(table)
</span><del>-        , m_characterWidths(CharacterClassWidths::Unknown)
</del><span class="cx">         , m_tableInverted(inverted)
</span><ins>+        , m_hasNonBMPCharacters(false)
</ins><span class="cx">         , m_anyCharacter(false)
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    CharacterClass(std::initializer_list<UChar32> matches, std::initializer_list<CharacterRange> ranges, std::initializer_list<UChar32> matchesUnicode, std::initializer_list<CharacterRange> rangesUnicode, CharacterClassWidths widths)
</del><ins>+    CharacterClass(std::initializer_list<UChar32> matches, std::initializer_list<CharacterRange> ranges, std::initializer_list<UChar32> matchesUnicode, std::initializer_list<CharacterRange> rangesUnicode)
</ins><span class="cx">         : m_matches(matches)
</span><span class="cx">         , m_ranges(ranges)
</span><span class="cx">         , m_matchesUnicode(matchesUnicode)
</span><span class="cx">         , m_rangesUnicode(rangesUnicode)
</span><span class="cx">         , m_table(0)
</span><del>-        , m_characterWidths(widths)
</del><span class="cx">         , m_tableInverted(false)
</span><ins>+        , m_hasNonBMPCharacters(false)
</ins><span class="cx">         , m_anyCharacter(false)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool hasNonBMPCharacters() { return m_characterWidths & CharacterClassWidths::HasNonBMPChars; }
-
-    bool hasOneCharacterSize() { return m_characterWidths == CharacterClassWidths::HasBMPChars || m_characterWidths == CharacterClassWidths::HasNonBMPChars; }
-    bool hasOnlyNonBMPCharacters() { return m_characterWidths == CharacterClassWidths::HasNonBMPChars; }
-    
</del><span class="cx">     Vector<UChar32> m_matches;
</span><span class="cx">     Vector<CharacterRange> m_ranges;
</span><span class="cx">     Vector<UChar32> m_matchesUnicode;
</span><span class="lines">@@ -117,8 +89,8 @@
</span><span class="cx">     Vector<CharacterRange> m_rangesUnicode;
</span><span class="cx"> 
</span><span class="cx">     const char* m_table;
</span><del>-    CharacterClassWidths m_characterWidths;
</del><span class="cx">     bool m_tableInverted : 1;
</span><ins>+    bool m_hasNonBMPCharacters : 1;
</ins><span class="cx">     bool m_anyCharacter : 1;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -248,7 +220,7 @@
</span><span class="cx">         return PatternTerm(TypeAssertionWordBoundary, invert);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    bool invert() const
</del><ins>+    bool invert()
</ins><span class="cx">     {
</span><span class="cx">         return m_invert;
</span><span class="cx">     }
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreyarrcreate_regex_tables"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/yarr/create_regex_tables (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/yarr/create_regex_tables      2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/yarr/create_regex_tables 2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -100,13 +100,8 @@
</span><span class="cx">             function += ("    auto characterClass = std::make_unique<CharacterClass>(_%sData, false);\n" % (name))
</span><span class="cx">     else:
</span><span class="cx">         function += ("    auto characterClass = std::make_unique<CharacterClass>();\n")
</span><del>-    hasBMPCharacters = False
</del><span class="cx">     hasNonBMPCharacters = False
</span><span class="cx">     for (min, max) in ranges:
</span><del>-        if min < 0x10000:
-            hasBMPCharacters = True
-        if max >= 0x10000:
-            hasNonBMPCharacters = True
</del><span class="cx">         if (min == max):
</span><span class="cx">             if (min > 127):
</span><span class="cx">                 function += ("    characterClass->m_matchesUnicode.append(0x%04x);\n" % min)
</span><span class="lines">@@ -117,7 +112,9 @@
</span><span class="cx">             function += ("    characterClass->m_rangesUnicode.append(CharacterRange(0x%04x, 0x%04x));\n" % (min, max))
</span><span class="cx">         else:
</span><span class="cx">             function += ("    characterClass->m_ranges.append(CharacterRange(0x%02x, 0x%02x));\n" % (min, max))
</span><del>-    function += ("    characterClass->m_characterWidths = CharacterClassWidths::%s;\n" % (("Unknown", "HasBMPChars", "HasNonBMPChars", "HasBothBMPAndNonBMP")[int(hasNonBMPCharacters) * 2 + int(hasBMPCharacters)]))
</del><ins>+        if max >= 0x10000:
+            hasNonBMPCharacters = True
+    function += ("    characterClass->m_hasNonBMPCharacters = %s;\n" % ("true" if hasNonBMPCharacters else "false"))
</ins><span class="cx">     function += ("    return characterClass;\n")
</span><span class="cx">     function += ("}\n\n")
</span><span class="cx">     functions += function
</span></span></pre></div>
<a id="tagsSafari608115SourceJavaScriptCoreyarrgenerateYarrUnicodePropertyTablespy"></a>
<div class="modfile"><h4>Modified: tags/Safari-608.1.15/Source/JavaScriptCore/yarr/generateYarrUnicodePropertyTables.py (243949 => 243950)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-608.1.15/Source/JavaScriptCore/yarr/generateYarrUnicodePropertyTables.py     2019-04-05 22:08:22 UTC (rev 243949)
+++ tags/Safari-608.1.15/Source/JavaScriptCore/yarr/generateYarrUnicodePropertyTables.py        2019-04-05 22:08:26 UTC (rev 243950)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> from hasher import stringHash
</span><span class="cx"> 
</span><span class="cx"> header = """/*
</span><del>-* Copyright (C) 2017-2019 Apple Inc. All rights reserved.
</del><ins>+* Copyright (C) 2017-2018 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -225,7 +225,6 @@
</span><span class="cx">         self.name = name
</span><span class="cx">         self.aliases = []
</span><span class="cx">         self.index = len(PropertyData.allPropertyData)
</span><del>-        self.hasBMPCharacters = False
</del><span class="cx">         self.hasNonBMPCharacters = False
</span><span class="cx">         self.matches = []
</span><span class="cx">         self.ranges = []
</span><span class="lines">@@ -250,9 +249,7 @@
</span><span class="cx">         return "createCharacterClass{}".format(self.index)
</span><span class="cx"> 
</span><span class="cx">     def addMatch(self, codePoint):
</span><del>-        if codePoint <= MaxBMP:
-            self.hasBMPCharacters = True
-        else:
</del><ins>+        if codePoint > MaxBMP:
</ins><span class="cx">             self.hasNonBMPCharacters = True
</span><span class="cx">         if codePoint <= lastASCIICodePoint:
</span><span class="cx">             if (len(self.matches) and self.matches[-1] > codePoint) or (len(self.ranges) and self.ranges[-1][1] > codePoint):
</span><span class="lines">@@ -284,8 +281,6 @@
</span><span class="cx">                 self.unicodeMatches.append(codePoint)
</span><span class="cx"> 
</span><span class="cx">     def addRange(self, lowCodePoint, highCodePoint):
</span><del>-        if lowCodePoint <= MaxBMP:
-            self.hasBMPCharacters = True
</del><span class="cx">         if highCodePoint > MaxBMP:
</span><span class="cx">             self.hasNonBMPCharacters = True
</span><span class="cx">         if highCodePoint <= lastASCIICodePoint:
</span><span class="lines">@@ -541,9 +536,9 @@
</span><span class="cx">         file.write("),\n")
</span><span class="cx">         file.write("        std::initializer_list<CharacterRange>(")
</span><span class="cx">         self.dumpMatchData(file, 4, self.unicodeRanges, lambda file, range: (file.write("{{{0:0=#6x}, {1:0=#6x}}}".format(range[0], range[1]))))
</span><del>-        file.write("),\n")
</del><ins>+        file.write("));\n")
</ins><span class="cx"> 
</span><del>-        file.write("        CharacterClassWidths::{});\n".format(("Unknown", "HasBMPChars", "HasNonBMPChars", "HasBothBMPAndNonBMP")[int(self.hasNonBMPCharacters) * 2 + int(self.hasBMPCharacters)]))
</del><ins>+        file.write("    characterClass->m_hasNonBMPCharacters = {};\n".format(("false", "true")[self.hasNonBMPCharacters]))
</ins><span class="cx">         file.write("    return characterClass;\n}\n\n")
</span><span class="cx"> 
</span><span class="cx">     @classmethod
</span></span></pre>
</div>
</div>

</body>
</html>