| 1 | /* |
| 2 | * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #ifndef UStringImpl_h |
| 27 | #define UStringImpl_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/UStringImpl.h:27:9`! |
| 28 | |
| 29 | #include <limits> |
| 30 | #include <wtf/CrossThreadRefCounted.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/CrossThreadRefCounted.h`/ |
| 31 | #include <wtf/OwnFastMallocPtr.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnFastMallocPtr.h`/ |
| 32 | #include <wtf/PossiblyNull.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/PossiblyNull.h`/ |
| 33 | #include <wtf/StringHashFunctions.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/StringHashFunctions.h`/ |
| 34 | #include <wtf/Vector.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h`/ |
| 35 | #include <wtf/unicode/Unicode.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/unicode/Unicode.h`/ |
| 36 | |
| 37 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 38 | |
| 39 | class IdentifierTablecxx . . $ QTJSC/IdentifierTable#; |
| 40 | |
| 41 | typedef CrossThreadRefCountedcxx . . $ CrossThreadRefCounted#<OwnFastMallocPtrcxx . . $ OwnFastMallocPtr#<UCharcxx . . $ UChar#> > SharedUCharcxx . . $ QTJSC/SharedUChar#; |
| 42 | |
| 43 | class UStringImplcxx . . $ QTJSC/UStringImpl# : Noncopyablecxx . . $ Noncopyable# { |
| 44 | public: |
| 45 | template<size_tcxx . . $ size_t# inlineCapacity> |
| 46 | static PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> adoptcxx . . $ QTJSC/UStringImpl#adopt(ba4cde8cfd111b2f).(Vectorcxx . . $ Vector#<UCharcxx . . $ UChar#, inlineCapacity>& vector) |
| 47 | { |
| 48 | if (unsigned length = vector.sizecxx . . $ QTWTF/Vector#size(fe4d2d262d4164a8).()) |
| 49 | return adoptRefcxx . . $ adoptRef(e761da608bb8c29c).(new UStringImplcxx . . $ QTJSC/UStringImpl#(vector.releaseBuffercxx . . $ QTWTF/Vector#releaseBuffer(155dc7f103cdb9db).(), length, BufferOwnedcxx . . $ QTJSC/UStringImpl#BufferOwned.)); |
| 50 | return &emptycxx . . $ QTJSC/UStringImpl#empty(fdf30dd1b4d8233c).(); |
| 51 | } |
| 52 | |
| 53 | static PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> createcxx . . $ QTJSC/UStringImpl#create(51c429c9a11d5e84).(const UCharcxx . . $ UChar#* buffer, int length) |
| 54 | { |
| 55 | UCharcxx . . $ UChar#* newBuffer; |
| 56 | if (PassRefPtr<UStringImpl> impl = tryCreateUninitialized(length, newBuffer)) { |
| 57 | copyCharscxx . . $ QTJSC/UStringImpl#copyChars(a032ecf025a4823a).(newBuffer, buffer, length); |
| 58 | return impl; |
| 59 | } |
| 60 | return &nullcxx . . $ QTJSC/UStringImpl#null(fdf30dd1b4d8233c).(); |
| 61 | } |
| 62 | |
| 63 | static PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> createcxx . . $ QTJSC/UStringImpl#create(f016533e3cbcac04).(PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> rep, int offset, int length) |
| 64 | { |
| 65 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(rep); |
| 66 | rep->checkConsistency(); |
| 67 | return adoptRefcxx . . $ adoptRef(e761da608bb8c29c).(new UStringImplcxx . . $ QTJSC/UStringImpl#(rep->m_data +cxx . . $ operator+(f3789794639247d3). offset, length, rep->bufferOwnerString())); |
| 68 | } |
| 69 | |
| 70 | static PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> createcxx . . $ QTJSC/UStringImpl#create(dafd426b02c8d419).(PassRefPtrcxx . . $ PassRefPtr#<SharedUCharcxx . . $ QTJSC/SharedUChar#> sharedBuffer, UCharcxx . . $ UChar#* buffer, int length) |
| 71 | { |
| 72 | return adoptRefcxx . . $ adoptRef(e761da608bb8c29c).(new UStringImplcxx . . $ QTJSC/UStringImpl#(buffer, length, sharedBuffer)); |
| 73 | } |
| 74 | |
| 75 | static PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> createUninitializedcxx . . $ QTJSC/UStringImpl#createUninitialized(63c632811f6c187c).(unsigned length, UCharcxx . . $ UChar#*& output) |
| 76 | { |
| 77 | if (!length) { |
| 78 | output = 0; |
| 79 | return &emptycxx . . $ QTJSC/UStringImpl#empty(fdf30dd1b4d8233c).(); |
| 80 | } |
| 81 | |
| 82 | if (length > ((stdcxx . . $ std/::numeric_limitscxx . . $ std/numeric_limits#<size_t>::maxcxx . . $ std/numeric_limits#max(f708dce9a8856c70).() - sizeof(UStringImplcxx . . $ QTJSC/UStringImpl#)) / sizeof(UCharcxx . . $ UChar#))) |
| 83 | CRASHcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:160:9`!(); |
| 84 | UStringImplcxx . . $ QTJSC/UStringImpl#* resultImpl = static_cast<UStringImplcxx . . $ QTJSC/UStringImpl#*>(fastMalloccxx . . $ fastMalloc(bfcfa4d6b7f7ef64).(sizeof(UCharcxx . . $ UChar#) * length + sizeof(UStringImplcxx . . $ QTJSC/UStringImpl#))); |
| 85 | output = reinterpret_cast<UCharcxx . . $ UChar#*>(resultImpl + 1); |
| 86 | return adoptRefcxx . . $ adoptRef(e761da608bb8c29c).(new(resultImpl) UStringImplcxx . . $ QTJSC/UStringImpl#UStringImpl(79332107d9e0174e).(output, length, BufferInternalcxx . . $ QTJSC/UStringImpl#BufferInternal.)); |
| 87 | } |
| 88 | |
| 89 | static PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> tryCreateUninitializedcxx . . $ QTJSC/UStringImpl#tryCreateUninitialized(63c632811f6c187c).(unsigned length, UCharcxx . . $ UChar#*& output) |
| 90 | { |
| 91 | if (!length) { |
| 92 | output = 0; |
| 93 | return &emptycxx . . $ QTJSC/UStringImpl#empty(fdf30dd1b4d8233c).(); |
| 94 | } |
| 95 | |
| 96 | if (length > ((stdcxx . . $ std/::numeric_limitscxx . . $ std/numeric_limits#<size_t>::maxcxx . . $ std/numeric_limits#max(f708dce9a8856c70).() - sizeof(UStringImplcxx . . $ QTJSC/UStringImpl#)) / sizeof(UCharcxx . . $ UChar#))) |
| 97 | return 0; |
| 98 | UStringImplcxx . . $ QTJSC/UStringImpl#* resultImpl; |
| 99 | if (!tryFastMalloccxx . . $ tryFastMalloc(a199d47e2bcba94).(sizeof(UCharcxx . . $ UChar#) * length + sizeof(UStringImplcxx . . $ QTJSC/UStringImpl#)).getValuecxx . . $ QTWTF/TryMallocReturnValue#getValue(e5bfd7b2d24a2428).(resultImpl)) |
| 100 | return 0; |
| 101 | output = reinterpret_cast<UCharcxx . . $ UChar#*>(resultImpl + 1); |
| 102 | return adoptRefcxx . . $ adoptRef(e761da608bb8c29c).(new(resultImpl) UStringImplcxx . . $ QTJSC/UStringImpl#(output, length, BufferInternalcxx . . $ QTJSC/UStringImpl#BufferInternal.)); |
| 103 | } |
| 104 | |
| 105 | SharedUCharcxx . . $ QTJSC/SharedUChar#* sharedBuffercxx . . $ QTJSC/UStringImpl#sharedBuffer(392aa7cd882f4d9f).(); |
| 106 | UCharcxx . . $ UChar#* datacxx . . $ QTJSC/UStringImpl#data(da28cdd8371e77b7).() const { return m_datacxx . . $ QTJSC/UStringImpl#m_data.; } |
| 107 | int sizecxx . . $ QTJSC/UStringImpl#size(455f465bc33b4cdf).() const { return m_lengthcxx . . $ QTJSC/UStringImpl#m_length.; } |
| 108 | size_tcxx . . $ size_t# costcxx . . $ QTJSC/UStringImpl#cost(f708dce9a8856c70).() |
| 109 | { |
| 110 | // For substrings, return the cost of the base string. |
| 111 | if (bufferOwnershipcxx . . $ QTJSC/UStringImpl#bufferOwnership(ddd8539a2fcdd4ce).() == BufferSubstringcxx . . $ QTJSC/UStringImpl#BufferSubstring.) |
| 112 | return m_bufferSubstringcxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_bufferSubstring.->costcxx . . $ QTJSC/UStringImpl#cost(f708dce9a8856c70).(); |
| 113 | |
| 114 | if (m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. & s_refCountFlagHasReportedCostcxx . . $ QTJSC/UStringImpl#s_refCountFlagHasReportedCost.) |
| 115 | return 0; |
| 116 | m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. |= s_refCountFlagHasReportedCostcxx . . $ QTJSC/UStringImpl#s_refCountFlagHasReportedCost.; |
| 117 | return m_lengthcxx . . $ QTJSC/UStringImpl#m_length.; |
| 118 | } |
| 119 | unsigned hashcxx . . $ QTJSC/UStringImpl#hash(ddd8539a2fcdd4ce).() const { if (!m_hashcxx . . $ QTJSC/UStringImpl#m_hash.) m_hashcxx . . $ QTJSC/UStringImpl#m_hash. = computeHashcxx . . $ QTJSC/UStringImpl#computeHash(73f81729e39ab85f).(datacxx . . $ QTJSC/UStringImpl#data(da28cdd8371e77b7).(), m_lengthcxx . . $ QTJSC/UStringImpl#m_length.); return m_hashcxx . . $ QTJSC/UStringImpl#m_hash.; } |
| 120 | unsigned existingHashcxx . . $ QTJSC/UStringImpl#existingHash(ddd8539a2fcdd4ce).() const { ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_hash); return m_hashcxx . . $ QTJSC/UStringImpl#m_hash.; } // fast path for Identifiers |
| 121 | void setHashcxx . . $ QTJSC/UStringImpl#setHash(cb2f890c2fdad230).(unsigned hash) { ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(hash == computeHash(data(), m_length)); m_hashcxx . . $ QTJSC/UStringImpl#m_hash. = hash; } // fast path for Identifiers |
| 122 | bool isIdentifiercxx . . $ QTJSC/UStringImpl#isIdentifier(50ce9a9e25b4a850).() const { return m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. & s_refCountFlagIsIdentifiercxx . . $ QTJSC/UStringImpl#s_refCountFlagIsIdentifier.; } |
| 123 | void setIsIdentifiercxx . . $ QTJSC/UStringImpl#setIsIdentifier(b45ddcbc8423892c).(bool isIdentifier) |
| 124 | { |
| 125 | if (isIdentifier) |
| 126 | m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. |= s_refCountFlagIsIdentifiercxx . . $ QTJSC/UStringImpl#s_refCountFlagIsIdentifier.; |
| 127 | else |
| 128 | m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. &= ~s_refCountFlagIsIdentifiercxx . . $ QTJSC/UStringImpl#s_refCountFlagIsIdentifier.; |
| 129 | } |
| 130 | |
| 131 | UStringImplcxx . . $ QTJSC/UStringImpl#* refcxx . . $ QTJSC/UStringImpl#ref(b56a90d0afa3b8ee).() { m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. += s_refCountIncrementcxx . . $ QTJSC/UStringImpl#s_refCountIncrement.; return this; } |
| 132 | ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! void derefcxx . . $ QTJSC/UStringImpl#deref(49f6e7a06ebc5aa8).() { m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. -= s_refCountIncrementcxx . . $ QTJSC/UStringImpl#s_refCountIncrement.; if (!(m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. & s_refCountMaskcxx . . $ QTJSC/UStringImpl#s_refCountMask.)) delete this; } |
| 133 | |
| 134 | static void copyCharscxx . . $ QTJSC/UStringImpl#copyChars(a032ecf025a4823a).(UCharcxx . . $ UChar#* destination, const UCharcxx . . $ UChar#* source, unsigned numCharacters) |
| 135 | { |
| 136 | if (numCharacters <= s_copyCharsInlineCutOffcxx . . $ QTJSC/UStringImpl#s_copyCharsInlineCutOff.) { |
| 137 | for (unsigned i = 0; i < numCharacters; ++i) |
| 138 | destination[i] = source[i]; |
| 139 | } else |
| 140 | memcpy(destination, source, numCharacters * sizeof(UCharcxx . . $ UChar#)); |
| 141 | } |
| 142 | |
| 143 | static unsigned computeHashcxx . . $ QTJSC/UStringImpl#computeHash(73f81729e39ab85f).(const UCharcxx . . $ UChar#* s, int length) { ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(length >= 0); return WTFcxx . . $ QTWTF/::stringHashcxx . . $ QTWTF/stringHash(d1a687133290a15f).(s, length); } |
| 144 | static unsigned computeHashcxx . . $ QTJSC/UStringImpl#computeHash(cc09747f0f147881).(const char* s, int length) { ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(length >= 0); return WTFcxx . . $ `<built-in>:467:9`!::stringHashcxx . . $ QTWTF/stringHash(2c614dbb70bd35ee).(s, length); } |
| 145 | static unsigned computeHashcxx . . $ QTJSC/UStringImpl#computeHash(c61c63047ce273de).(const char* s) { return WTFcxx . . $ QTWTF/::stringHashcxx . . $ QTWTF/stringHash(c61c63047ce273de).(s); } |
| 146 | |
| 147 | static UStringImplcxx . . $ QTJSC/UStringImpl#& nullcxx . . $ QTJSC/UStringImpl#null(fdf30dd1b4d8233c).() { return *s_nullcxx . . $ QTJSC/UStringImpl#s_null.; } |
| 148 | static UStringImplcxx . . $ QTJSC/UStringImpl#& emptycxx . . $ QTJSC/UStringImpl#empty(fdf30dd1b4d8233c).() { return *s_emptycxx . . $ QTJSC/UStringImpl#s_empty.; } |
| 149 | |
| 150 | ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! void checkConsistencycxx . . $ QTJSC/UStringImpl#checkConsistency(83f5f38750778ac8).() const |
| 151 | { |
| 152 | // There is no recursion of substrings. |
| 153 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(bufferOwnerString()->bufferOwnership() != BufferSubstring); |
| 154 | // Static strings cannot be put in identifier tables, because they are globally shared. |
| 155 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!isStatic() || !isIdentifier()); |
| 156 | } |
| 157 | |
| 158 | private: |
| 159 | enum BufferOwnershipcxx . . $ QTJSC/UStringImpl#BufferOwnership# { |
| 160 | BufferInternalcxx . . $ QTJSC/UStringImpl#BufferInternal., |
| 161 | BufferOwnedcxx . . $ QTJSC/UStringImpl#BufferOwned., |
| 162 | BufferSubstringcxx . . $ QTJSC/UStringImpl#BufferSubstring., |
| 163 | BufferSharedcxx . . $ QTJSC/UStringImpl#BufferShared., |
| 164 | }; |
| 165 | |
| 166 | // For SmallStringStorage, which allocates an array and uses an in-place new. |
| 167 | UStringImplcxx . . $ QTJSC/UStringImpl#UStringImpl(49f6e7a06ebc5aa8).() { } |
| 168 | |
| 169 | // Used to construct normal strings with an internal or external buffer. |
| 170 | UStringImplcxx . . $ QTJSC/UStringImpl#UStringImpl(79332107d9e0174e).(UCharcxx . . $ UChar#* data, int length, BufferOwnershipcxx . . $ QTJSC/UStringImpl#BufferOwnership# ownership) |
| 171 | : m_datacxx . . $ QTJSC/UStringImpl#m_data.(data) |
| 172 | , m_buffercxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_buffer.(0) |
| 173 | , m_lengthcxx . . $ QTJSC/UStringImpl#m_length.(length) |
| 174 | , m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags.(s_refCountIncrementcxx . . $ QTJSC/UStringImpl#s_refCountIncrement. | ownership) |
| 175 | , m_hashcxx . . $ QTJSC/UStringImpl#m_hash.(0) |
| 176 | { |
| 177 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!((ownership == BufferInternal) || (ownership == BufferOwned)); |
| 178 | checkConsistencycxx . . $ QTJSC/UStringImpl#checkConsistency(83f5f38750778ac8).(); |
| 179 | } |
| 180 | |
| 181 | // Used to construct static strings, which have an special refCount that can never hit zero. |
| 182 | // This means that the static string will never be destroyed, which is important because |
| 183 | // static strings will be shared across threads & ref-counted in a non-threadsafe manner. |
| 184 | enum StaticStringConstructTypecxx . . $ QTJSC/UStringImpl#StaticStringConstructType# { ConstructStaticStringcxx . . $ QTJSC/UStringImpl#ConstructStaticString. }; |
| 185 | UStringImplcxx . . $ QTJSC/UStringImpl#UStringImpl(46eeab94b2442e49).(UCharcxx . . $ UChar#* data, int length, StaticStringConstructTypecxx . . $ QTJSC/UStringImpl#StaticStringConstructType#) |
| 186 | : m_datacxx . . $ QTJSC/UStringImpl#m_data.(data) |
| 187 | , m_buffercxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_buffer.(0) |
| 188 | , m_lengthcxx . . $ QTJSC/UStringImpl#m_length.(length) |
| 189 | , m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags.(s_refCountFlagStaticcxx . . $ QTJSC/UStringImpl#s_refCountFlagStatic. | BufferOwnedcxx . . $ QTJSC/UStringImpl#BufferOwned.) |
| 190 | , m_hashcxx . . $ QTJSC/UStringImpl#m_hash.(0) |
| 191 | { |
| 192 | checkConsistencycxx . . $ QTJSC/UStringImpl#checkConsistency(83f5f38750778ac8).(); |
| 193 | } |
| 194 | |
| 195 | // Used to create new strings that are a substring of an existing string. |
| 196 | UStringImplcxx . . $ QTJSC/UStringImpl#UStringImpl(b6b6520094b793b5).(UCharcxx . . $ UChar#* data, int length, PassRefPtrcxx . . $ PassRefPtr#<UStringImplcxx . . $ QTJSC/UStringImpl#> base) |
| 197 | : m_datacxx . . $ QTJSC/UStringImpl#m_data.(data) |
| 198 | , m_bufferSubstringcxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_bufferSubstring.(base.releaseRef()) |
| 199 | , m_lengthcxx . . $ QTJSC/UStringImpl#m_length.(length) |
| 200 | , m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags.(s_refCountIncrementcxx . . $ QTJSC/UStringImpl#s_refCountIncrement. | BufferSubstringcxx . . $ QTJSC/UStringImpl#BufferSubstring.) |
| 201 | , m_hashcxx . . $ QTJSC/UStringImpl#m_hash.(0) |
| 202 | { |
| 203 | // Do use static strings as a base for substrings; UntypedPtrAndBitfield assumes |
| 204 | // that all pointers will be at least 8-byte aligned, we cannot guarantee that of |
| 205 | // UStringImpls that are not heap allocated. |
| 206 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_bufferSubstring->size()); |
| 207 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!m_bufferSubstring->isStatic()); |
| 208 | checkConsistencycxx . . $ QTJSC/UStringImpl#checkConsistency(83f5f38750778ac8).(); |
| 209 | } |
| 210 | |
| 211 | // Used to construct new strings sharing an existing shared buffer. |
| 212 | UStringImplcxx . . $ QTJSC/UStringImpl#UStringImpl(44ac57308768ae44).(UCharcxx . . $ UChar#* data, int length, PassRefPtrcxx . . $ PassRefPtr#<SharedUCharcxx . . $ QTJSC/SharedUChar#> sharedBuffer) |
| 213 | : m_datacxx . . $ QTJSC/UStringImpl#m_data.(data) |
| 214 | , m_bufferSharedcxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_bufferShared.(sharedBuffer.releaseRef()) |
| 215 | , m_lengthcxx . . $ QTJSC/UStringImpl#m_length.(length) |
| 216 | , m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags.(s_refCountIncrementcxx . . $ QTJSC/UStringImpl#s_refCountIncrement. | BufferSharedcxx . . $ QTJSC/UStringImpl#BufferShared.) |
| 217 | , m_hashcxx . . $ QTJSC/UStringImpl#m_hash.(0) |
| 218 | { |
| 219 | checkConsistencycxx . . $ QTJSC/UStringImpl#checkConsistency(83f5f38750778ac8).(); |
| 220 | } |
| 221 | |
| 222 | #if OScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:49:9`!(SOLARIS) && COMPILERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:39:9`!(SUNCC) |
| 223 | public: // Otherwise the compiler complains about operator new not being accessible. |
| 224 | #endif |
| 225 | #if COMPILERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:39:9`!(WINSCW) || COMPILERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:39:9`!(XLC) |
| 226 | void* operator new(size_t size) { return Noncopyable::operator new(size); } |
| 227 | #else |
| 228 | using Noncopyablecxx . . $ WTFNoncopyable/Noncopyable#::operatorcxx . . $ QTJSC/UStringImpl#`operator new`(bfcfa4d6b7f7ef64). new; |
| 229 | #endif |
| 230 | #if OScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:49:9`!(SOLARIS) && COMPILERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:39:9`!(SUNCC) |
| 231 | private: |
| 232 | #endif |
| 233 | void* operatorcxx . . $ QTJSC/UStringImpl#`operator new`(7cf5f2fc6057a0cc). new(size_tcxx . . $ size_t#, void* p) { return p; } |
| 234 | |
| 235 | ~cxx . . $ QTJSC/UStringImpl#`~UStringImpl`(49f6e7a06ebc5aa8).UStringImplcxx . . $ QTJSC/UStringImpl#(); |
| 236 | |
| 237 | // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings. |
| 238 | static const int s_minLengthToSharecxx . . $ QTJSC/UStringImpl#s_minLengthToShare. = 10; |
| 239 | static const unsigned s_copyCharsInlineCutOffcxx . . $ QTJSC/UStringImpl#s_copyCharsInlineCutOff. = 20; |
| 240 | // We initialize and increment/decrement the refCount for all normal (non-static) strings by the value 2. |
| 241 | // We initialize static strings with an odd number (specifically, 1), such that the refCount cannot reach zero. |
| 242 | static const unsigned s_refCountMaskcxx . . $ QTJSC/UStringImpl#s_refCountMask. = 0xFFFFFFF0; |
| 243 | static const int s_refCountIncrementcxx . . $ QTJSC/UStringImpl#s_refCountIncrement. = 0x20; |
| 244 | static const int s_refCountFlagStaticcxx . . $ QTJSC/UStringImpl#s_refCountFlagStatic. = 0x10; |
| 245 | static const unsigned s_refCountFlagHasReportedCostcxx . . $ QTJSC/UStringImpl#s_refCountFlagHasReportedCost. = 0x8; |
| 246 | static const unsigned s_refCountFlagIsIdentifiercxx . . $ QTJSC/UStringImpl#s_refCountFlagIsIdentifier. = 0x4; |
| 247 | static const unsigned s_refCountMaskBufferOwnershipcxx . . $ QTJSC/UStringImpl#s_refCountMaskBufferOwnership. = 0x3; |
| 248 | |
| 249 | UStringImplcxx . . $ QTJSC/UStringImpl#* bufferOwnerStringcxx . . $ QTJSC/UStringImpl#bufferOwnerString(b56a90d0afa3b8ee).() { return (bufferOwnershipcxx . . $ QTJSC/UStringImpl#bufferOwnership(ddd8539a2fcdd4ce).() == BufferSubstringcxx . . $ QTJSC/UStringImpl#BufferSubstring.) ? m_bufferSubstringcxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_bufferSubstring. : this; } |
| 250 | const UStringImplcxx . . $ QTJSC/UStringImpl#* bufferOwnerStringcxx . . $ QTJSC/UStringImpl#bufferOwnerString(21de3b397d5f604f).() const { return (bufferOwnershipcxx . . $ QTJSC/UStringImpl#bufferOwnership(ddd8539a2fcdd4ce).() == BufferSubstringcxx . . $ QTJSC/UStringImpl#BufferSubstring.) ? m_bufferSubstringcxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_bufferSubstring. : this; } |
| 251 | SharedUCharcxx . . $ QTJSC/SharedUChar#* baseSharedBuffercxx . . $ QTJSC/UStringImpl#baseSharedBuffer(392aa7cd882f4d9f).(); |
| 252 | unsigned bufferOwnershipcxx . . $ QTJSC/UStringImpl#bufferOwnership(ddd8539a2fcdd4ce).() const { return m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. & s_refCountMaskBufferOwnershipcxx . . $ QTJSC/UStringImpl#s_refCountMaskBufferOwnership.; } |
| 253 | bool isStaticcxx . . $ QTJSC/UStringImpl#isStatic(50ce9a9e25b4a850).() const { return m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags. & s_refCountFlagStaticcxx . . $ QTJSC/UStringImpl#s_refCountFlagStatic.; } |
| 254 | |
| 255 | // unshared data |
| 256 | UCharcxx . . $ UChar#* m_datacxx . . $ QTJSC/UStringImpl#m_data.; |
| 257 | unioncxx . . $ QTJSC/UStringImpl#$anonymous_type_0# { |
| 258 | void* m_buffercxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_buffer.; |
| 259 | UStringImplcxx . . $ QTJSC/UStringImpl#* m_bufferSubstringcxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_bufferSubstring.; |
| 260 | SharedUCharcxx . . $ QTJSC/SharedUChar#* m_bufferSharedcxx . . $ QTJSC/UStringImpl#$anonymous_type_0#m_bufferShared.; |
| 261 | }; |
| 262 | int m_lengthcxx . . $ QTJSC/UStringImpl#m_length.; |
| 263 | unsigned m_refCountAndFlagscxx . . $ QTJSC/UStringImpl#m_refCountAndFlags.; |
| 264 | mutable unsigned m_hashcxx . . $ QTJSC/UStringImpl#m_hash.; |
| 265 | |
| 266 | JS_EXPORTDATAcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/config.h:36:9`! static UStringImplcxx . . $ QTJSC/UStringImpl#* s_nullcxx . . $ QTJSC/UStringImpl#s_null.; |
| 267 | JS_EXPORTDATAcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/config.h:36:9`! static UStringImplcxx . . $ QTJSC/UStringImpl#* s_emptycxx . . $ QTJSC/UStringImpl#s_empty.; |
| 268 | |
| 269 | friend class JITcxx . . $ QTJSC/JIT#; |
| 270 | friend class SmallStringsStoragecxx . . $ QTJSC/SmallStringsStorage#; |
| 271 | friend void initializeUStringcxx . . $ QTJSC/initializeUString(49f6e7a06ebc5aa8).(); |
| 272 | }; |
| 273 | |
| 274 | bool equalcxx . . $ QTJSC/equal(ec03a94da9606b8d).(const UStringImplcxx . . $ QTJSC/UStringImpl#*, const UStringImplcxx . . $ QTJSC/UStringImpl#*); |
| 275 | |
| 276 | } |
| 277 | |
| 278 | #endif |