Changeset 76133 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jan 19, 2011, 9:58:15 AM (14 years ago)
Author:
[email protected]
Message:

2011-01-19 Michael Saboff <[email protected]>

Reviewed by Darin Adler.

<rdar://problem/8882994> Regression: Simple nested backtrack hangs
https://bugs.webkit.org/show_bug.cgi?id=52675

The changeset (r76076) for https://bugs.webkit.org/show_bug.cgi?id=52540
broke simple backtracking in some cases. Reworked that change to
link both jumps and labels.

  • yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::BacktrackDestination::hasBacktrackToLabel): (JSC::Yarr::YarrGenerator::TermGenerationState::propagateBacktrackingFrom): (JSC::Yarr::YarrGenerator::generateParenthesesSingle):

2011-01-19 Michael Saboff <[email protected]>

Reviewed by Darin Adler.

<rdar://problem/8882994> Regression: Simple nested backtrack hangs
https://bugs.webkit.org/show_bug.cgi?id=52675

New tests to support change.

  • fast/regex/parentheses-expected.txt:
  • fast/regex/script-tests/parentheses.js:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r76129 r76133  
     12011-01-19  Michael Saboff  <[email protected]>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/8882994> Regression: Simple nested backtrack hangs
     6        https://bugs.webkit.org/show_bug.cgi?id=52675
     7
     8        The changeset (r76076) for https://bugs.webkit.org/show_bug.cgi?id=52540
     9        broke simple backtracking in some cases.  Reworked that change to
     10        link both jumps and labels.
     11
     12        * yarr/YarrJIT.cpp:
     13        (JSC::Yarr::YarrGenerator::BacktrackDestination::hasBacktrackToLabel):
     14        (JSC::Yarr::YarrGenerator::TermGenerationState::propagateBacktrackingFrom):
     15        (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
     16
    1172011-01-19  Pavel Podivilov  <[email protected]>
    218
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r76076 r76133  
    619619        }
    620620
     621        bool hasBacktrackToLabel()
     622        {
     623            return m_backtrackToLabel;
     624        }
     625
    621626        void setBacktrackJumpList(JumpList* jumpList)
    622627        {
     
    9971002            if (doJump)
    9981003                m_backtrack.jumpToBacktrack(generator, backtrack.getBacktrackJumps());
     1004
     1005            if (m_backtrack.isLabel() && backtrack.hasBacktrackToLabel())
     1006                backtrack.linkBacktrackToLabel(m_backtrack.getLabel());
     1007
    9991008            if (backtrack.hasDestination()) {
    10001009                if (m_backtrack.hasDataLabel())
     
    16551664            BacktrackDestination& stateBacktrack = state.getBacktrackDestination();
    16561665
    1657             // If we have a backtrack label, use it for the parenthesis
    1658             if (stateBacktrack.isLabel())
    1659                 parenthesesBacktrack.linkBacktrackToLabel(stateBacktrack.getLabel());
    1660             else {
    1661                 state.propagateBacktrackingFrom(this, parenthesesBacktrack);
    1662                 stateBacktrack.copyBacktrackToLabel(parenthesesBacktrack);
    1663             }
     1666            state.propagateBacktrackingFrom(this, parenthesesBacktrack);
     1667            stateBacktrack.copyBacktrackToLabel(parenthesesBacktrack);
    16641668
    16651669            m_expressionState.decrementParenNestingLevel();
Note: See TracChangeset for help on using the changeset viewer.