Changeset 108753 in webkit


Ignore:
Timestamp:
Feb 24, 2012 1:49:38 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Remove useless jump instructions for short circuit
https://bugs.webkit.org/show_bug.cgi?id=75602

Patch by Han Hojong <hojong.han@samsung.com> on 2012-02-24
Reviewed by Michael Saboff.

Jump instruction is inserted to make short circuit,
however it does nothing but moving to the next instruction.
Therefore useless jump instructions are removed,
and jump list is moved into the case not for a short circuit,
so that only necessary instructions are added to JIT code
unless it has a 16 bit pattern character and an 8 bit string.

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
(JSC::Yarr::YarrGenerator::backtrackPatternCharacterNonGreedy):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r108752 r108753  
     12012-02-24  Han Hojong  <hojong.han@samsung.com>
     2
     3        Remove useless jump instructions for short circuit
     4        https://bugs.webkit.org/show_bug.cgi?id=75602
     5
     6        Reviewed by Michael Saboff.
     7
     8        Jump instruction is inserted to make short circuit,
     9        however it does nothing but moving to the next instruction.
     10        Therefore useless jump instructions are removed,
     11        and jump list is moved into the case not for a short circuit,
     12        so that only necessary instructions are added to JIT code
     13        unless it has a 16 bit pattern character and an 8 bit string.
     14
     15        * yarr/YarrJIT.cpp:
     16        (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
     17        (JSC::Yarr::YarrGenerator::backtrackPatternCharacterNonGreedy):
     18
    1192012-02-24  Sheriff Bot  <webkit.review.bot@gmail.com>
    220
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r108484 r108753  
    817817        move(TrustedImm32(0), countRegister);
    818818
    819         if ((ch > 0xff) && (m_charSize == Char8)) {
    820             // Have a 16 bit pattern character and an 8 bit string - short circuit
    821             op.m_jumps.append(jump());
    822         } else {
     819        // Unless have a 16 bit pattern character and an 8 bit string - short circuit
     820        if (!((ch > 0xff) && (m_charSize == Char8))) {
    823821            JumpList failures;
    824822            Label loop(this);
     
    838836
    839837        storeToFrame(countRegister, term->frameLocation);
    840 
    841838    }
    842839    void backtrackPatternCharacterGreedy(size_t opIndex)
     
    876873        const RegisterID countRegister = regT1;
    877874
    878         JumpList nonGreedyFailures;
    879 
    880875        m_backtrackingState.link(this);
    881876
    882877        loadFromFrame(term->frameLocation, countRegister);
    883878
    884         if ((ch > 0xff) && (m_charSize == Char8)) {
    885             // Have a 16 bit pattern character and an 8 bit string - short circuit
    886             nonGreedyFailures.append(jump());
    887         } else {
     879        // Unless have a 16 bit pattern character and an 8 bit string - short circuit
     880        if (!((ch > 0xff) && (m_charSize == Char8))) {
     881            JumpList nonGreedyFailures;
    888882            nonGreedyFailures.append(atEndOfInput());
    889883            if (term->quantityCount != quantifyInfinite)
     
    895889
    896890            jump(op.m_reentry);
    897         }
    898         nonGreedyFailures.link(this);
     891            nonGreedyFailures.link(this);
     892        }
    899893
    900894        sub32(countRegister, index);
Note: See TracChangeset for help on using the changeset viewer.