• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/WTF-7600.1.24/wtf/text/

Lines Matching refs:length

74     inline void add8BitString(unsigned length, bool isSubString = false)
79 m_total8BitData += length;
82 inline void add16BitString(unsigned length, bool isSubString = false)
87 m_total16BitData += length;
90 inline void addUpconvertedString(unsigned length)
93 m_totalUpconvertedData += length;
111 #define STRING_STATS_ADD_8BIT_STRING(length) StringImpl::stringStats().add8BitString(length)
112 #define STRING_STATS_ADD_8BIT_STRING2(length, isSubString) StringImpl::stringStats().add8BitString(length, isSubString)
113 #define STRING_STATS_ADD_16BIT_STRING(length) StringImpl::stringStats().add16BitString(length)
114 #define STRING_STATS_ADD_16BIT_STRING2(length, isSubString) StringImpl::stringStats().add16BitString(length, isSubString)
115 #define STRING_STATS_ADD_UPCONVERTED_STRING(length) StringImpl::stringStats().addUpconvertedString(length)
118 #define STRING_STATS_ADD_8BIT_STRING(length) ((void)0)
119 #define STRING_STATS_ADD_8BIT_STRING2(length, isSubString) ((void)0)
120 #define STRING_STATS_ADD_16BIT_STRING(length) ((void)0)
121 #define STRING_STATS_ADD_16BIT_STRING2(length, isSubString) ((void)0)
122 #define STRING_STATS_ADD_UPCONVERTED_STRING(length) ((void)0)
168 StringImpl(unsigned length, Force8Bit)
170 , m_length(length)
181 StringImpl(unsigned length)
183 , m_length(length)
194 StringImpl(MallocPtr<LChar> characters, unsigned length)
196 , m_length(length)
207 StringImpl(const UChar* characters, unsigned length, ConstructWithoutCopyingTag)
209 , m_length(length)
219 StringImpl(const LChar* characters, unsigned length, ConstructWithoutCopyingTag)
221 , m_length(length)
232 StringImpl(MallocPtr<UChar> characters, unsigned length)
234 , m_length(length)
245 StringImpl(const LChar* characters, unsigned length, PassRefPtr<StringImpl> base)
247 , m_length(length)
262 StringImpl(const UChar* characters, unsigned length, PassRefPtr<StringImpl> base)
264 , m_length(length)
297 WTF_EXPORT_STRING_API static PassRef<StringImpl> create(const UChar*, unsigned length);
298 WTF_EXPORT_STRING_API static PassRef<StringImpl> create(const LChar*, unsigned length);
299 WTF_EXPORT_STRING_API static PassRef<StringImpl> create8BitIfPossible(const UChar*, unsigned length);
307 ALWAYS_INLINE static PassRef<StringImpl> create(const char* s, unsigned length) { return create(reinterpret_cast<const LChar*>(s), length); }
311 static ALWAYS_INLINE PassRef<StringImpl> createSubstringSharingImpl8(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
314 ASSERT(length <= rep->length());
316 if (!length)
324 return adoptRef(*new (NotNull, stringImpl) StringImpl(rep->m_data8 + offset, length, ownerRep));
327 static ALWAYS_INLINE PassRef<StringImpl> createSubstringSharingImpl(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
330 ASSERT(length <= rep->length());
332 if (!length)
340 return adoptRef(*new (NotNull, stringImpl) StringImpl(rep->m_data8 + offset, length, ownerRep));
341 return adoptRef(*new (NotNull, stringImpl) StringImpl(rep->m_data16 + offset, length, ownerRep));
354 WTF_EXPORT_STRING_API static PassRef<StringImpl> createFromLiteral(const char* characters, unsigned length);
357 WTF_EXPORT_STRING_API static PassRef<StringImpl> createWithoutCopying(const UChar* characters, unsigned length);
358 WTF_EXPORT_STRING_API static PassRef<StringImpl> createWithoutCopying(const LChar* characters, unsigned length);
360 WTF_EXPORT_STRING_API static PassRef<StringImpl> createUninitialized(unsigned length, LChar*& data);
361 WTF_EXPORT_STRING_API static PassRef<StringImpl> createUninitialized(unsigned length, UChar*& data);
362 template <typename T> static ALWAYS_INLINE PassRefPtr<StringImpl> tryCreateUninitialized(unsigned length, T*& output)
364 if (!length) {
369 if (length > ((std::numeric_limits<unsigned>::max() - sizeof(StringImpl)) / sizeof(T))) {
374 if (!tryFastMalloc(allocationSize<T>(length)).getValue(resultImpl)) {
380 return constructInternal<T>(resultImpl, length);
391 static PassRef<StringImpl> reallocate(PassRefPtr<StringImpl> originalString, unsigned length, LChar*& data);
392 static PassRef<StringImpl> reallocate(PassRefPtr<StringImpl> originalString, unsigned length, UChar*& data);
414 unsigned length() const { return m_length; }
457 return !length() && !isStatic();
475 static WTF_EXPORT_STRING_API CString utf8ForCharacters(const UChar* characters, unsigned length, ConversionMode = LenientConversion);
476 WTF_EXPORT_STRING_API CString utf8ForRange(unsigned offset, unsigned length, ConversionMode = LenientConversion) const;
480 static WTF_EXPORT_STRING_API bool utf8Impl(const UChar* characters, unsigned length, char*& buffer, size_t bufferSize, ConversionMode);
809 ASSERT(existingHash() == StringHasher::computeHashAndMaskTop8Bits(characters8(), length()));
839 ALWAYS_INLINE PassRef<StringImpl> StringImpl::constructInternal<LChar>(StringImpl* impl, unsigned length) { return adoptRef(*new (NotNull, impl) StringImpl(length, Force8BitConstructor)); }
841 ALWAYS_INLINE PassRef<StringImpl> StringImpl::constructInternal<UChar>(StringImpl* impl, unsigned length) { return adoptRef(*new (NotNull, impl) StringImpl(length)); }
854 inline bool equal(const StringImpl* a, const char* b, unsigned length) { return equal(a, reinterpret_cast<const LChar*>(b), length); }
874 ALWAYS_INLINE bool equal(const LChar* aLChar, const LChar* bLChar, unsigned length)
876 unsigned dwordLength = length >> 3;
891 if (length & 4) {
899 if (length & 2) {
907 if (length & 1 && (*reinterpret_cast<const LChar*>(a) != *reinterpret_cast<const LChar*>(b)))
913 ALWAYS_INLINE bool equal(const UChar* aUChar, const UChar* bUChar, unsigned length)
915 unsigned dwordLength = length >> 2;
930 if (length & 2) {
938 if (length & 1 && (*reinterpret_cast<const UChar*>(a) != *reinterpret_cast<const UChar*>(b)))
944 ALWAYS_INLINE bool equal(const LChar* aLChar, const LChar* bLChar, unsigned length)
949 unsigned wordLength = length >> 2;
957 length &= 3;
959 if (length) {
963 for (unsigned i = 0; i < length; ++i) {
972 ALWAYS_INLINE bool equal(const UChar* aUChar, const UChar* bUChar, unsigned length)
977 unsigned wordLength = length >> 1;
985 if (length & 1 && *reinterpret_cast<const UChar*>(a) != *reinterpret_cast<const UChar*>(b))
991 ALWAYS_INLINE bool equal(const LChar* a, const LChar* b, unsigned length)
996 asm("subs %[length], #4\n"
1004 "subs %[length], #4\n"
1007 // At this point, length can be:
1012 // -4: 11111111111111111111111111111100 (length was 0)
1015 "tst %[length], #2\n"
1023 "tst %[length], #1\n"
1033 : [length]"+r"(length), [isEqual]"+r"(isEqual), [a]"+r"(a), [b]"+r"(b), [aValue]"+r"(aValue), [bValue]"+r"(bValue)
1040 ALWAYS_INLINE bool equal(const UChar* a, const UChar* b, unsigned length)
1045 asm("subs %[length], #2\n"
1053 "subs %[length], #2\n"
1056 // At this point, length can be:
1059 // -2: 11111111111111111111111111111110 (length was zero)
1062 "tst %[length], #1\n"
1072 : [length]"+r"(length), [isEqual]"+r"(isEqual), [a]"+r"(a), [b]"+r"(b), [aValue]"+r"(aValue), [bValue]"+r"(bValue)
1079 ALWAYS_INLINE bool equal(const LChar* a, const LChar* b, unsigned length) { return !memcmp(a, b, length); }
1080 ALWAYS_INLINE bool equal(const UChar* a, const UChar* b, unsigned length) { return !memcmp(a, b, length * sizeof(UChar)); }
1083 ALWAYS_INLINE bool equal(const LChar* a, const UChar* b, unsigned length)
1085 for (unsigned i = 0; i < length; ++i) {
1092 ALWAYS_INLINE bool equal(const UChar* a, const LChar* b, unsigned length) { return equal(b, a, length); }
1099 inline bool equalIgnoringCase(const UChar* a, const char* b, unsigned length) { return equalIgnoringCase(a, reinterpret_cast<const LChar*>(b), length); }
1100 inline bool equalIgnoringCase(const LChar* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, a, length); }
1101 inline bool equalIgnoringCase(const char* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, reinterpret_cast<const LChar*>(a), length); }
1102 inline bool equalIgnoringCase(const char* a, const LChar* b, unsigned length) { return equalIgnoringCase(b, reinterpret_cast<const LChar*>(a), length); }
1103 inline bool equalIgnoringCase(const UChar* a, const UChar* b, int length)
1105 ASSERT(length >= 0);
1106 return !u_memcasecmp(a, b, length, U_FOLD_CASE_DEFAULT);
1111 WTF_EXPORT_STRING_API bool equalIgnoringNullity(const UChar*, size_t length, StringImpl*);
1114 inline size_t find(const CharacterType* characters, unsigned length, CharacterType matchCharacter, unsigned index = 0)
1116 while (index < length) {
1124 ALWAYS_INLINE size_t find(const UChar* characters, unsigned length, LChar matchCharacter, unsigned index = 0)
1126 return find(characters, length, static_cast<UChar>(matchCharacter), index);
1129 inline size_t find(const LChar* characters, unsigned length, UChar matchCharacter, unsigned index = 0)
1133 return find(characters, length, static_cast<LChar>(matchCharacter), index);
1136 inline size_t find(const LChar* characters, unsigned length, CharacterMatchFunctionPtr matchFunction, unsigned index = 0)
1138 while (index < length) {
1146 inline size_t find(const UChar* characters, unsigned length, CharacterMatchFunctionPtr matchFunction, unsigned index = 0)
1148 while (index < length) {
1157 inline size_t findNextLineStart(const CharacterType* characters, unsigned length, unsigned index = 0)
1159 while (index < length) {
1166 if (index < length) {
1180 if (++index < length)
1188 inline size_t reverseFindLineTerminator(const CharacterType* characters, unsigned length, unsigned index = UINT_MAX)
1190 if (!length)
1192 if (index >= length)
1193 index = length - 1;
1204 inline size_t reverseFind(const CharacterType* characters, unsigned length, CharacterType matchCharacter, unsigned index = UINT_MAX)
1206 if (!length)
1208 if (index >= length)
1209 index = length - 1;
1217 ALWAYS_INLINE size_t reverseFind(const UChar* characters, unsigned length, LChar matchCharacter, unsigned index = UINT_MAX)
1219 return reverseFind(characters, length, static_cast<UChar>(matchCharacter), index);
1222 inline size_t reverseFind(const LChar* characters, unsigned length, UChar matchCharacter, unsigned index = UINT_MAX)
1226 return reverseFind(characters, length, static_cast<LChar>(matchCharacter), index);
1275 return codePointCompare(string1->length(), string2->length(), string1->characters8(), string2->characters8());
1280 return codePointCompare(string1->length(), string2->length(), string1->characters16(), string2->characters16());
1285 return codePointCompare(string1->length(), string2->length(), string1->characters8(), string2->characters16());
1291 return (string2 && string2->length()) ? -1 : 0;
1294 return string1->length() ? 1 : 0;
1319 size_t length = 0;
1320 while (string[length])
1321 ++length;
1323 RELEASE_ASSERT(length < std::numeric_limits<unsigned>::max());
1324 return static_cast<unsigned>(length);