Ignore:
Timestamp:
Sep 18, 2013, 8:55:55 AM (12 years ago)
Author:
[email protected]
Message:

YARR: Put UCS2 canonicalization tables in read-only memory.
<https://webkit.org/b/121547>

Reviewed by Sam Weinig.

These tables never mutate so mark them const.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp

    r148259 r156043  
    8585
    8686        // Add multiple matches, if necessary.
    87         UCS2CanonicalizationRange* info = rangeInfoFor(ch);
     87        const UCS2CanonicalizationRange* info = rangeInfoFor(ch);
    8888        if (info->type == CanonicalizeUnique)
    8989            addSorted(m_matchesUnicode, ch);
     
    9292    }
    9393
    94     void putUnicodeIgnoreCase(UChar ch, UCS2CanonicalizationRange* info)
     94    void putUnicodeIgnoreCase(UChar ch, const UCS2CanonicalizationRange* info)
    9595    {
    9696        ASSERT(m_isCaseInsensitive);
     
    9999        ASSERT(info->type != CanonicalizeUnique);
    100100        if (info->type == CanonicalizeSet) {
    101             for (uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
     101            for (const uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
    102102                addSorted(m_matchesUnicode, ch);
    103103        } else {
     
    130130            return;
    131131
    132         UCS2CanonicalizationRange* info = rangeInfoFor(lo);
     132        const UCS2CanonicalizationRange* info = rangeInfoFor(lo);
    133133        while (true) {
    134134            // Handle the range [lo .. end]
     
    141141            case CanonicalizeSet: {
    142142                UChar ch;
    143                 for (uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
     143                for (const uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
    144144                    addSorted(m_matchesUnicode, ch);
    145145                break;
     
    323323        }
    324324
    325         UCS2CanonicalizationRange* info = rangeInfoFor(ch);
     325        const UCS2CanonicalizationRange* info = rangeInfoFor(ch);
    326326        if (info->type == CanonicalizeUnique) {
    327327            m_alternative->m_terms.append(PatternTerm(ch));
Note: See TracChangeset for help on using the changeset viewer.