Changeset 108456 in webkit


Ignore:
Timestamp:
Feb 22, 2012 12:43:52 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Short circuit fixed for a 16 bt pattern character and an 8 bit string.
https://bugs.webkit.org/show_bug.cgi?id=75602

Patch by Hojong Han <hojong.han@samsung.com> on 2012-02-22
Reviewed by Gavin Barraclough.

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r108448 r108456  
     12012-02-22  Hojong Han  <hojong.han@samsung.com>
     2
     3        Short circuit fixed for a 16 bt pattern character and an 8 bit string.
     4        https://bugs.webkit.org/show_bug.cgi?id=75602
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * yarr/YarrJIT.cpp:
     9        (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy):
     10
    1112012-02-21  Filip Pizlo  <fpizlo@apple.com>
    212
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r107647 r108456  
    844844        YarrOp& op = m_ops[opIndex];
    845845        PatternTerm* term = op.m_term;
     846        UChar ch = term->patternCharacter;
    846847
    847848        const RegisterID countRegister = regT1;
     
    849850        m_backtrackingState.link(this);
    850851
    851         loadFromFrame(term->frameLocation, countRegister);
    852         m_backtrackingState.append(branchTest32(Zero, countRegister));
    853         sub32(TrustedImm32(1), countRegister);
    854         sub32(TrustedImm32(1), index);
    855         jump(op.m_reentry);
     852        if ((ch > 0xff) && (m_charSize == Char8)) {
     853            // Have a 16 bit pattern character and an 8 bit string - short circuit
     854            m_backtrackingState.append(op.m_jumps);
     855        } else {
     856            loadFromFrame(term->frameLocation, countRegister);
     857            m_backtrackingState.append(branchTest32(Zero, countRegister));
     858            sub32(TrustedImm32(1), countRegister);
     859            sub32(TrustedImm32(1), index);
     860            jump(op.m_reentry);
     861        }
    856862    }
    857863
Note: See TracChangeset for help on using the changeset viewer.