Debian Codegraph @

src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
21 #ifndef Identifier_h
22 #define Identifier_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.h:22:9`!
23
24 #include "JSGlobalData.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h`/
25 #include "ThreadSpecific.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadSpecific.h`/
26 #include "UString.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/UString.h`/
27
28 namespace JSCcxx . . $ QTJSC/ {
29
30 class ExecStatecxx . . $ QTJSC/ExecState#;
31
32 class Identifiercxx . . $ QTJSC/Identifier# {
33 friend class Structurecxx . . $ QTJSC/Structure#;
34 public:
35 Identifiercxx . . $ QTJSC/Identifier#Identifier(49f6e7a06ebc5aa8).() { }
36
37 Identifiercxx . . $ QTJSC/Identifier#Identifier(76b09fa744670831).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const char* s) : _ustring(add(exec, s)) { } // Only to be used with string literals.
38 Identifiercxx . . $ QTJSC/Identifier#Identifier(2f2075d8bf507eaf).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const UCharcxx . . $ UChar#* s, int length) : _ustring(add(exec, s, length)) { }
39 Identifiercxx . . $ QTJSC/Identifier#Identifier(a8e0b2d7f9c69786).(ExecStatecxx . . $ QTJSC/ExecState#* exec, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* rep) : _ustring(add(exec, rep)) { }
40 Identifiercxx . . $ QTJSC/Identifier#Identifier(7710b6c66c0f9b39).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const UStringcxx . . $ QTJSC/UString#& s) : _ustring(add(exec, s.rep())) { }
41
42 Identifiercxx . . $ QTJSC/Identifier#Identifier(595135cd7a0d70f).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData, const char* s) : _ustring(add(globalData, s)) { } // Only to be used with string literals.
43 Identifiercxx . . $ QTJSC/Identifier#Identifier(cfd65586b4846ed1).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData, const UCharcxx . . $ UChar#* s, int length) : _ustring(add(globalData, s, length)) { }
44 Identifiercxx . . $ QTJSC/Identifier#Identifier(a32b800d6344c8e3).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* rep) : _ustring(add(globalData, rep)) { }
45 Identifiercxx . . $ QTJSC/Identifier#Identifier(da2e3d018b4db96).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData, const UStringcxx . . $ QTJSC/UString#& s) : _ustring(add(globalData, s.rep())) { }
46
47 // Special constructor for cases where we overwrite an object in place.
48 Identifiercxx . . $ QTJSC/Identifier#Identifier(cc0015d274ebce84).(PlacementNewAdoptTypecxx . . $ QTJSC/PlacementNewAdoptType#) : _ustring(PlacementNewAdopt) { }
49
50 const UStringcxx . . $ QTJSC/UString#& ustringcxx . . $ QTJSC/Identifier#ustring(de21ee9ecbd506fd).() const { return _ustring; }
51
52 const UCharcxx . . $ UChar#* datacxx . . $ QTJSC/Identifier#data(9865edf6270d80f8).() const { return _ustring.data(); }
53 int sizecxx . . $ QTJSC/Identifier#size(455f465bc33b4cdf).() const { return _ustring.size(); }
54
55 const char* asciicxx . . $ QTJSC/Identifier#ascii(a9f41ea0e82d88cf).() const { return _ustring.ascii(); }
56
57 static Identifiercxx . . $ QTJSC/Identifier# fromcxx . . $ QTJSC/Identifier#from(d1afedae20629715).(ExecStatecxx . . $ QTJSC/ExecState#* exec, unsigned y) { return Identifiercxx . . $ QTJSC/Identifier#Identifier(7710b6c66c0f9b39).(exec, UStringcxx . . $ QTJSC/UString#::fromcxx . . $ QTJSC/UString#from(54d53174fb977824).(y)); }
58 static Identifiercxx . . $ QTJSC/Identifier# fromcxx . . $ QTJSC/Identifier#from(eb8ac624dc8b3006).(ExecStatecxx . . $ QTJSC/ExecState#* exec, int y) { return Identifiercxx . . $ QTJSC/Identifier#Identifier(7710b6c66c0f9b39).(exec, UStringcxx . . $ QTJSC/UString#::fromcxx . . $ QTJSC/UString#from(1ed97944dfe079ad).(y)); }
59 static Identifiercxx . . $ QTJSC/Identifier# fromcxx . . $ QTJSC/Identifier#from(59de27b43d2deae8).(ExecStatecxx . . $ QTJSC/ExecState#* exec, double y) { return Identifiercxx . . $ QTJSC/Identifier#Identifier(7710b6c66c0f9b39).(exec, UStringcxx . . $ QTJSC/UString#::fromcxx . . $ QTJSC/UString#from(f1fb2f715195f7ba).(y)); }
60
61 bool isNullcxx . . $ QTJSC/Identifier#isNull(50ce9a9e25b4a850).() const { return _ustring.isNull(); }
62 bool isEmptycxx . . $ QTJSC/Identifier#isEmpty(50ce9a9e25b4a850).() const { return _ustring.isEmpty(); }
63
64 uint32_tcxx . . $ uint32_t# toUInt32cxx . . $ QTJSC/Identifier#toUInt32(870b63f89c7fb98).(bool* ok) const { return _ustring.toUInt32(ok); }
65 uint32_tcxx . . $ uint32_t# toUInt32cxx . . $ QTJSC/Identifier#toUInt32(7e25dc0896afbd5b).(bool* ok, bool tolerateEmptyString) const { return _ustring.toUInt32(ok, tolerateEmptyString); };
66 uint32_tcxx . . $ uint32_t# toStrictUInt32cxx . . $ QTJSC/Identifier#toStrictUInt32(870b63f89c7fb98).(bool* ok) const { return _ustring.toStrictUInt32(ok); }
67 unsigned toArrayIndexcxx . . $ QTJSC/Identifier#toArrayIndex(870b63f89c7fb98).(bool* ok) const { return _ustring.toArrayIndex(ok); }
68 double toDoublecxx . . $ QTJSC/Identifier#toDouble(21b6c25e127938e2).() const { return _ustring.toDouble(); }
69
70 friend bool operatorcxx . . $ QTJSC/`operator==`(f22803490e6cf0c3).==(const Identifiercxx . . $ QTJSC/Identifier#&, const Identifiercxx . . $ QTJSC/Identifier#&);
71 friend bool operatorcxx . . $ QTJSC/`operator!=`(f22803490e6cf0c3).!=(const Identifiercxx . . $ QTJSC/Identifier#&, const Identifiercxx . . $ QTJSC/Identifier#&);
72
73 friend bool operatorcxx . . $ QTJSC/`operator==`(232c046ed08b72b8).==(const Identifiercxx . . $ QTJSC/Identifier#&, const char*);
74 friend bool operatorcxx . . $ QTJSC/`operator!=`(232c046ed08b72b8).!=(const Identifiercxx . . $ QTJSC/Identifier#&, const char*);
75
76 static void removecxx . . $ QTJSC/Identifier#remove(f38096febece923b).(UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#*);
77
78 static bool equalcxx . . $ QTJSC/Identifier#equal(a0fb99199941000e).(const UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#*, const char*);
79 static bool equalcxx . . $ QTJSC/Identifier#equal(47268a0913697c1).(const UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#*, const UCharcxx . . $ UChar#*, int length);
80 static bool equalcxx . . $ QTJSC/Identifier#equal(ec03a94da9606b8d).(const UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* a, const UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* b) { return JSCcxx . . $ QTJSC/::equalcxx . . $ QTJSC/equal(ec03a94da9606b8d).(a, b); }
81
82 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addcxx . . $ QTJSC/Identifier#add(b2bc4d53e7e7851c).(ExecStatecxx . . $ QTJSC/ExecState#*, const char*); // Only to be used with string literals.
83 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addcxx . . $ QTJSC/Identifier#add(569ed62d0938c2fa).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*, const char*); // Only to be used with string literals.
84
85 private:
86 UStringcxx . . $ QTJSC/UString# _ustringcxx . . $ QTJSC/Identifier#_ustring.;
87
88 static bool equalcxx . . $ QTJSC/Identifier#equal(f22803490e6cf0c3).(const Identifiercxx . . $ QTJSC/Identifier#& a, const Identifiercxx . . $ QTJSC/Identifier#& b) { return a._ustring.rep() ==cxx . . $ QTJSC/`operator==`(2a94f8346549a239). b._ustring.rep(); }
89 static bool equalcxx . . $ QTJSC/Identifier#equal(232c046ed08b72b8).(const Identifiercxx . . $ QTJSC/Identifier#& a, const char* b) { return equalcxx . . $ QTJSC/Identifier#equal(f22803490e6cf0c3).(a._ustring.rep(), b); }
90
91 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addcxx . . $ QTJSC/Identifier#add(46b6130ee8ef472f).(ExecStatecxx . . $ QTJSC/ExecState#*, const UCharcxx . . $ UChar#*, int length);
92 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addcxx . . $ QTJSC/Identifier#add(4da60fb78fcb64be).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*, const UCharcxx . . $ UChar#*, int length);
93
94 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addcxx . . $ QTJSC/Identifier#add(cb5ebea9f6e2dec7).(ExecStatecxx . . $ QTJSC/ExecState#* exec, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* r)
95 {
96 if (r->isIdentifiercxx . . $ QTJSC/UStringImpl#isIdentifier(50ce9a9e25b4a850).()) {
97 #ifndef NDEBUGcxx . . $ `<built-in>:472:9`!
98 checkSameIdentifierTable(exec, r);
99 #endif
100 return r;
101 }
102 return addSlowCasecxx . . $ QTJSC/Identifier#addSlowCase(cb5ebea9f6e2dec7).(exec, r);
103 }
104 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addcxx . . $ QTJSC/Identifier#add(af61cc6867b6ecd1).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* r)
105 {
106 if (r->isIdentifiercxx . . $ QTJSC/UStringImpl#isIdentifier(50ce9a9e25b4a850).()) {
107 #ifndef NDEBUGcxx . . $ `<built-in>:472:9`!
108 checkSameIdentifierTable(globalData, r);
109 #endif
110 return r;
111 }
112 return addSlowCasecxx . . $ QTJSC/Identifier#addSlowCase(cb5ebea9f6e2dec7).(globalData, r);
113 }
114
115 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addSlowCasecxx . . $ QTJSC/Identifier#addSlowCase(cb5ebea9f6e2dec7).(ExecStatecxx . . $ QTJSC/ExecState#*, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* r);
116 static PassRefPtrcxx . . $ PassRefPtr#<UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#> addSlowCasecxx . . $ QTJSC/Identifier#addSlowCase(af61cc6867b6ecd1).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* r);
117
118 static void checkSameIdentifierTablecxx . . $ QTJSC/Identifier#checkSameIdentifierTable(a8e0b2d7f9c69786).(ExecStatecxx . . $ QTJSC/ExecState#*, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#*);
119 static void checkSameIdentifierTablecxx . . $ QTJSC/Identifier#checkSameIdentifierTable(a32b800d6344c8e3).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*, UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#*);
120 };
121
122 inline bool operatorcxx . . $ QTJSC/`operator==`(f22803490e6cf0c3).==(const Identifiercxx . . $ QTJSC/Identifier#& a, const Identifiercxx . . $ QTJSC/Identifier#& b)
123 {
124 return Identifiercxx . . $ QTJSC/Identifier#::equalcxx . . $ QTJSC/Identifier#equal(f22803490e6cf0c3).(a, b);
125 }
126
127 inline bool operatorcxx . . $ QTJSC/`operator!=`(f22803490e6cf0c3).!=(const Identifiercxx . . $ QTJSC/Identifier#& a, const Identifiercxx . . $ QTJSC/Identifier#& b)
128 {
129 return !Identifiercxx . . $ QTJSC/Identifier#::equalcxx . . $ QTJSC/Identifier#equal(f22803490e6cf0c3).(a, b);
130 }
131
132 inline bool operatorcxx . . $ QTJSC/`operator==`(232c046ed08b72b8).==(const Identifiercxx . . $ QTJSC/Identifier#& a, const char* b)
133 {
134 return Identifiercxx . . $ QTJSC/Identifier#::equalcxx . . $ QTJSC/Identifier#equal(232c046ed08b72b8).(a, b);
135 }
136
137 inline bool operatorcxx . . $ QTJSC/`operator!=`(232c046ed08b72b8).!=(const Identifiercxx . . $ QTJSC/Identifier#& a, const char* b)
138 {
139 return !Identifiercxx . . $ QTJSC/Identifier#::equalcxx . . $ QTJSC/Identifier#equal(232c046ed08b72b8).(a, b);
140 }
141
142 IdentifierTablecxx . . $ QTJSC/IdentifierTable#* createIdentifierTablecxx . . $ QTJSC/createIdentifierTable(a321ca86ef1b282a).();
143 void deleteIdentifierTablecxx . . $ QTJSC/deleteIdentifierTable(1628e5553183b104).(IdentifierTablecxx . . $ QTJSC/IdentifierTable#*);
144
145 struct ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData# {
146 ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData#ThreadIdentifierTableData(49f6e7a06ebc5aa8).()
147 : defaultIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#defaultIdentifierTable.(0)
148 , currentIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#currentIdentifierTable.(0)
149 {
150 }
151
152 IdentifierTablecxx . . $ QTJSC/IdentifierTable#* defaultIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#defaultIdentifierTable.;
153 IdentifierTablecxx . . $ QTJSC/IdentifierTable#* currentIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#currentIdentifierTable.;
154 };
155
156 extern WTFcxx . . $ `<built-in>:467:9`!::ThreadSpecificcxx . . $ QTWTF/ThreadSpecific#<ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData#>* g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.;
157 void createIdentifierTableSpecificcxx . . $ QTJSC/createIdentifierTableSpecific(49f6e7a06ebc5aa8).();
158
159 inline IdentifierTablecxx . . $ QTJSC/IdentifierTable#* defaultIdentifierTablecxx . . $ QTJSC/defaultIdentifierTable(a321ca86ef1b282a).()
160 {
161 if (!g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.)
162 createIdentifierTableSpecificcxx . . $ QTJSC/createIdentifierTableSpecific(49f6e7a06ebc5aa8).();
163 ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData#& data = **g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.;
164
165 return data.defaultIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#defaultIdentifierTable.;
166 }
167
168 inline void setDefaultIdentifierTablecxx . . $ QTJSC/setDefaultIdentifierTable(1628e5553183b104).(IdentifierTablecxx . . $ QTJSC/IdentifierTable#* identifierTable)
169 {
170 if (!g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.)
171 createIdentifierTableSpecificcxx . . $ QTJSC/createIdentifierTableSpecific(49f6e7a06ebc5aa8).();
172 ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData#& data = **g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.;
173
174 data.defaultIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#defaultIdentifierTable. = identifierTable;
175 }
176
177 inline IdentifierTablecxx . . $ QTJSC/IdentifierTable#* currentIdentifierTablecxx . . $ QTJSC/currentIdentifierTable(a321ca86ef1b282a).()
178 {
179 if (!g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.)
180 createIdentifierTableSpecificcxx . . $ QTJSC/createIdentifierTableSpecific(49f6e7a06ebc5aa8).();
181 ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData#& data = **g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.;
182
183 return data.currentIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#currentIdentifierTable.;
184 }
185
186 inline IdentifierTablecxx . . $ QTJSC/IdentifierTable#* setCurrentIdentifierTablecxx . . $ QTJSC/setCurrentIdentifierTable(ea78c35e65f5567b).(IdentifierTablecxx . . $ QTJSC/IdentifierTable#* identifierTable)
187 {
188 if (!g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.)
189 createIdentifierTableSpecificcxx . . $ QTJSC/createIdentifierTableSpecific(49f6e7a06ebc5aa8).();
190 ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData#& data = **g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.;
191
192 IdentifierTablecxx . . $ QTJSC/IdentifierTable#* oldIdentifierTable = data.currentIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#currentIdentifierTable.;
193 data.currentIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#currentIdentifierTable. = identifierTable;
194 return oldIdentifierTable;
195 }
196
197 inline void resetCurrentIdentifierTablecxx . . $ QTJSC/resetCurrentIdentifierTable(49f6e7a06ebc5aa8).()
198 {
199 if (!g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.)
200 createIdentifierTableSpecificcxx . . $ QTJSC/createIdentifierTableSpecific(49f6e7a06ebc5aa8).();
201 ThreadIdentifierTableDatacxx . . $ QTJSC/ThreadIdentifierTableData#& data = **g_identifierTableSpecificcxx . . $ QTJSC/g_identifierTableSpecific.;
202
203 data.currentIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#currentIdentifierTable. = data.defaultIdentifierTablecxx . . $ QTJSC/ThreadIdentifierTableData#defaultIdentifierTable.;
204 }
205
206 } // namespace JSC
207
208 #endif // Identifier_h