[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

barraclough at apple.com barraclough at apple.com
Wed Dec 22 13:34:30 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e86b789358715641fd977bd6612786bd9bd932ed
Author: barraclough at apple.com <barraclough at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 20 18:31:17 2010 +0000

    2010-09-20  Gavin Barraclough  <barraclough at apple.com>
    
            Reviewed by Oliver Hunt.
    
            Bug 46077 - ASSERT failure in YARR JIT
    
            We will currently attempt to loop if there are multiple alternatives, they are all
            BOL predicated, and the last alternative is longer then the first - however if all
            alternatives are BOL predicated the head of loop label will not have been set, and
            we'll try to link a jump to an undefined label. Stop doing so.
    
            * yarr/RegexJIT.cpp:
            (JSC::Yarr::RegexGenerator::generateDisjunction):
    2010-09-20  Gavin Barraclough  <barraclough at apple.com>
    
            Reviewed by Oliver Hunt.
    
            Bug 46077 - ASSERT failure in YARR JIT
    
            We will currently attempt to loop if there are multiple alternatives, they are all
            BOL predicated, and the last alternative is longer then the first - however if all
            alternatives are BOL predicated the head of loop label will not have been set, and
            we'll try to link a jump to an undefined label. Stop doing so.
    
            * fast/js/regexp-norepeat-expected.txt: Added.
            * fast/js/regexp-norepeat.html: Added.
            * fast/js/script-tests/regexp-norepeat.js: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67867 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 09fb37c..c1f3677 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-20  Gavin Barraclough  <barraclough at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 46077 - ASSERT failure in YARR JIT
+
+        We will currently attempt to loop if there are multiple alternatives, they are all
+        BOL predicated, and the last alternative is longer then the first - however if all
+        alternatives are BOL predicated the head of loop label will not have been set, and
+        we'll try to link a jump to an undefined label. Stop doing so.
+
+        * yarr/RegexJIT.cpp:
+        (JSC::Yarr::RegexGenerator::generateDisjunction):
+
 2010-09-20  Adam Roben  <aroben at apple.com>
 
         Export RegExpObject::info from JavaScriptCore
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index d691bfd..09e32c1 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -1335,55 +1335,59 @@ class RegexGenerator : private MacroAssembler {
 
         state.checkedTotal -= countCheckedForCurrentAlternative;
 
-        // How much more input need there be to be able to retry from the first alternative?
-        // examples:
-        //   /yarr_jit/ or /wrec|pcre/
-        //     In these examples we need check for one more input before looping.
-        //   /yarr_jit|pcre/
-        //     In this case we need check for 5 more input to loop (+4 to allow for the first alterative
-        //     being four longer than the last alternative checked, and another +1 to effectively move
-        //     the start position along by one).
-        //   /yarr|rules/ or /wrec|notsomuch/
-        //     In these examples, provided that there was sufficient input to have just been matching for
-        //     the second alternative we can loop without checking for available input (since the second
-        //     alternative is longer than the first).  In the latter example we need to decrement index
-        //     (by 4) so the start position is only progressed by 1 from the last iteration.
-        int incrementForNextIter = (countToCheckForFirstAlternative - countCheckedForCurrentAlternative) + 1;
-
-        // First, deal with the cases where there was sufficient input to try the last alternative.
-        if (incrementForNextIter > 0) // We need to check for more input anyway, fall through to the checking below.
-            state.linkAlternativeBacktracks(this);
-        else if (m_pattern.m_body->m_hasFixedSize && !incrementForNextIter) // No need to update anything, link these backtracks straight to the to pof the loop!
-            state.linkAlternativeBacktracksTo(firstAlternativeInputChecked, this);
-        else { // no need to check the input, but we do have some bookkeeping to do first.
+        if (!setRepeatAlternativeLabels) {
+            // If there are no alternatives that need repeating (all are marked 'onceThrough') then just link
+            // the match failures to this point, and fall through to the return below.
             state.linkAlternativeBacktracks(this);
+            notEnoughInputForPreviousAlternative.link(this);
+        } else {
+            // How much more input need there be to be able to retry from the first alternative?
+            // examples:
+            //   /yarr_jit/ or /wrec|pcre/
+            //     In these examples we need check for one more input before looping.
+            //   /yarr_jit|pcre/
+            //     In this case we need check for 5 more input to loop (+4 to allow for the first alterative
+            //     being four longer than the last alternative checked, and another +1 to effectively move
+            //     the start position along by one).
+            //   /yarr|rules/ or /wrec|notsomuch/
+            //     In these examples, provided that there was sufficient input to have just been matching for
+            //     the second alternative we can loop without checking for available input (since the second
+            //     alternative is longer than the first).  In the latter example we need to decrement index
+            //     (by 4) so the start position is only progressed by 1 from the last iteration.
+            int incrementForNextIter = (countToCheckForFirstAlternative - countCheckedForCurrentAlternative) + 1;
+
+            // First, deal with the cases where there was sufficient input to try the last alternative.
+            if (incrementForNextIter > 0) // We need to check for more input anyway, fall through to the checking below.
+                state.linkAlternativeBacktracks(this);
+            else if (m_pattern.m_body->m_hasFixedSize && !incrementForNextIter) // No need to update anything, link these backtracks straight to the to pof the loop!
+                state.linkAlternativeBacktracksTo(firstAlternativeInputChecked, this);
+            else { // no need to check the input, but we do have some bookkeeping to do first.
+                state.linkAlternativeBacktracks(this);
 
-            // Where necessary update our preserved start position.
-            if (!m_pattern.m_body->m_hasFixedSize) {
-                move(index, regT0);
-                sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
-                store32(regT0, Address(output));
-            }
+                // Where necessary update our preserved start position.
+                if (!m_pattern.m_body->m_hasFixedSize) {
+                    move(index, regT0);
+                    sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
+                    store32(regT0, Address(output));
+                }
 
-            // Update index if necessary, and loop (without checking).
-            if (incrementForNextIter)
-                add32(Imm32(incrementForNextIter), index);
-            jump().linkTo(firstAlternativeInputChecked, this);
-        }
+                // Update index if necessary, and loop (without checking).
+                if (incrementForNextIter)
+                    add32(Imm32(incrementForNextIter), index);
+                jump().linkTo(firstAlternativeInputChecked, this);
+            }
 
-        notEnoughInputForPreviousAlternative.link(this);
-        // Update our idea of the start position, if we're tracking this.
-        if (!m_pattern.m_body->m_hasFixedSize) {
-            if (countCheckedForCurrentAlternative - 1) {
-                move(index, regT0);
-                sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
-                store32(regT0, Address(output));
-            } else
-                store32(index, Address(output));
-        }
+            notEnoughInputForPreviousAlternative.link(this);
+            // Update our idea of the start position, if we're tracking this.
+            if (!m_pattern.m_body->m_hasFixedSize) {
+                if (countCheckedForCurrentAlternative - 1) {
+                    move(index, regT0);
+                    sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
+                    store32(regT0, Address(output));
+                } else
+                    store32(index, Address(output));
+            }
         
-        // Loop if there are repeating alternatives.
-        if (setRepeatAlternativeLabels) {
             // Check if there is sufficent input to run the first alternative again.
             jumpIfAvailableInput(incrementForNextIter).linkTo(firstAlternativeInputChecked, this);
             // No - insufficent input to run the first alteranative, are there any other alternatives we
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d050f57..9434dda 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-20  Gavin Barraclough  <barraclough at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 46077 - ASSERT failure in YARR JIT
+
+        We will currently attempt to loop if there are multiple alternatives, they are all
+        BOL predicated, and the last alternative is longer then the first - however if all
+        alternatives are BOL predicated the head of loop label will not have been set, and
+        we'll try to link a jump to an undefined label. Stop doing so.
+
+        * fast/js/regexp-norepeat-expected.txt: Added.
+        * fast/js/regexp-norepeat.html: Added.
+        * fast/js/script-tests/regexp-norepeat.js: Added.
+
 2010-09-20  Adam Roben  <aroben at apple.com>
 
         Skip some failing animation tests on Windows
diff --git a/LayoutTests/fast/js/regexp-norepeat-expected.txt b/LayoutTests/fast/js/regexp-norepeat-expected.txt
new file mode 100644
index 0000000..fc7ff75
--- /dev/null
+++ b/LayoutTests/fast/js/regexp-norepeat-expected.txt
@@ -0,0 +1,10 @@
+Test for https://bugs.webkit.org/show_bug.cgi?id=46077
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS re.test(str) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/regexp-norepeat.html b/LayoutTests/fast/js/regexp-norepeat.html
new file mode 100644
index 0000000..c84c66c
--- /dev/null
+++ b/LayoutTests/fast/js/regexp-norepeat.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/regexp-norepeat.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/script-tests/regexp-norepeat.js b/LayoutTests/fast/js/script-tests/regexp-norepeat.js
new file mode 100644
index 0000000..04f509f
--- /dev/null
+++ b/LayoutTests/fast/js/script-tests/regexp-norepeat.js
@@ -0,0 +1,9 @@
+description(
+'Test for https://bugs.webkit.org/show_bug.cgi?id=46077'
+);
+
+var re = /^b|^cd/;
+var str = "abcd";
+shouldBe('re.test(str)', 'false');
+
+var successfullyParsed = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list