| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // from a zero length string, so this should be able to be a non-null pointe
r | 46 // from a zero length string, so this should be able to be a non-null pointe
r |
| 47 // into the zero-page. | 47 // into the zero-page. |
| 48 // Replace this with 'reinterpret_cast<UChar*>(static_cast<intptr_t>(1))' on
ce | 48 // Replace this with 'reinterpret_cast<UChar*>(static_cast<intptr_t>(1))' on
ce |
| 49 // PCRE goes away. | 49 // PCRE goes away. |
| 50 static LChar emptyLCharData = 0; | 50 static LChar emptyLCharData = 0; |
| 51 DEFINE_STATIC_LOCAL(StringImpl, emptyString, (&emptyLCharData, 0, ConstructS
taticString)); | 51 DEFINE_STATIC_LOCAL(StringImpl, emptyString, (&emptyLCharData, 0, ConstructS
taticString)); |
| 52 WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyStri
ng reference counter"); | 52 WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyStri
ng reference counter"); |
| 53 return &emptyString; | 53 return &emptyString; |
| 54 } | 54 } |
| 55 | 55 |
| 56 DEFINE_GLOBAL(AtomicString, nullAtom) | 56 WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom) |
| 57 DEFINE_GLOBAL(AtomicString, emptyAtom) | 57 WTF_EXPORT DEFINE_GLOBAL(AtomicString, emptyAtom) |
| 58 DEFINE_GLOBAL(AtomicString, textAtom) | 58 WTF_EXPORT DEFINE_GLOBAL(AtomicString, textAtom) |
| 59 DEFINE_GLOBAL(AtomicString, commentAtom) | 59 WTF_EXPORT DEFINE_GLOBAL(AtomicString, commentAtom) |
| 60 DEFINE_GLOBAL(AtomicString, starAtom) | 60 WTF_EXPORT DEFINE_GLOBAL(AtomicString, starAtom) |
| 61 DEFINE_GLOBAL(AtomicString, xmlAtom) | 61 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlAtom) |
| 62 DEFINE_GLOBAL(AtomicString, xmlnsAtom) | 62 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlnsAtom) |
| 63 DEFINE_GLOBAL(AtomicString, xlinkAtom) | 63 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xlinkAtom) |
| 64 | 64 |
| 65 NEVER_INLINE unsigned StringImpl::hashSlowCase() const | 65 NEVER_INLINE unsigned StringImpl::hashSlowCase() const |
| 66 { | 66 { |
| 67 if (is8Bit()) | 67 if (is8Bit()) |
| 68 setHash(StringHasher::computeHashAndMaskTop8Bits(m_data8, m_length)); | 68 setHash(StringHasher::computeHashAndMaskTop8Bits(m_data8, m_length)); |
| 69 else | 69 else |
| 70 setHash(StringHasher::computeHashAndMaskTop8Bits(m_data16, m_length)); | 70 setHash(StringHasher::computeHashAndMaskTop8Bits(m_data16, m_length)); |
| 71 return existingHash(); | 71 return existingHash(); |
| 72 } | 72 } |
| 73 | 73 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 96 // FIXME: These should be allocated at compile time. | 96 // FIXME: These should be allocated at compile time. |
| 97 new (NotNull, (void*)&textAtom) AtomicString("#text", AtomicString::Construc
tFromLiteral); | 97 new (NotNull, (void*)&textAtom) AtomicString("#text", AtomicString::Construc
tFromLiteral); |
| 98 new (NotNull, (void*)&commentAtom) AtomicString("#comment", AtomicString::Co
nstructFromLiteral); | 98 new (NotNull, (void*)&commentAtom) AtomicString("#comment", AtomicString::Co
nstructFromLiteral); |
| 99 new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFro
mLiteral); | 99 new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFro
mLiteral); |
| 100 new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFr
omLiteral); | 100 new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFr
omLiteral); |
| 101 new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::Constru
ctFromLiteral); | 101 new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::Constru
ctFromLiteral); |
| 102 new (NotNull, (void*)&xlinkAtom) AtomicString("xlink", AtomicString::Constru
ctFromLiteral); | 102 new (NotNull, (void*)&xlinkAtom) AtomicString("xlink", AtomicString::Constru
ctFromLiteral); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } | 105 } |
| OLD | NEW |