]>
Commit | Line | Data |
---|---|---|
b37bf2e1 | 1 | /* |
ba379fdc | 2 | * Copyright (C) 2003, 2007, 2009 Apple Inc. All rights reserved. |
b37bf2e1 A |
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 | ||
9dae56ea A |
21 | #ifndef CommonIdentifiers_h |
22 | #define CommonIdentifiers_h | |
b37bf2e1 | 23 | |
9dae56ea | 24 | #include "Identifier.h" |
b37bf2e1 A |
25 | #include <wtf/Noncopyable.h> |
26 | ||
ba379fdc | 27 | // MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various |
b37bf2e1 | 28 | // ways without repeating the list. |
9dae56ea | 29 | #define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \ |
81345200 | 30 | macro(ArgumentsIterator) \ |
93a37866 | 31 | macro(Array) \ |
81345200 A |
32 | macro(ArrayBuffer) \ |
33 | macro(ArrayIterator) \ | |
34 | macro(BYTES_PER_ELEMENT) \ | |
93a37866 A |
35 | macro(Boolean) \ |
36 | macro(Date) \ | |
37 | macro(Error) \ | |
38 | macro(EvalError) \ | |
39 | macro(Function) \ | |
40 | macro(Infinity) \ | |
41 | macro(JSON) \ | |
81345200 A |
42 | macro(Map)\ |
43 | macro(MapIterator)\ | |
93a37866 A |
44 | macro(Math) \ |
45 | macro(NaN) \ | |
46 | macro(Number) \ | |
47 | macro(Object) \ | |
81345200 | 48 | macro(Promise) \ |
93a37866 A |
49 | macro(RangeError) \ |
50 | macro(ReferenceError) \ | |
51 | macro(RegExp) \ | |
81345200 A |
52 | macro(Set)\ |
53 | macro(SetIterator)\ | |
93a37866 A |
54 | macro(String) \ |
55 | macro(SyntaxError) \ | |
56 | macro(TypeError) \ | |
57 | macro(URIError) \ | |
58 | macro(UTC) \ | |
81345200 | 59 | macro(WeakMap)\ |
93a37866 A |
60 | macro(__defineGetter__) \ |
61 | macro(__defineSetter__) \ | |
62 | macro(__lookupGetter__) \ | |
63 | macro(__lookupSetter__) \ | |
81345200 | 64 | macro(add) \ |
93a37866 | 65 | macro(anonymous) \ |
b37bf2e1 | 66 | macro(arguments) \ |
81345200 A |
67 | macro(assign) \ |
68 | macro(back) \ | |
6fe7ccc8 | 69 | macro(bind) \ |
81345200 A |
70 | macro(blur) \ |
71 | macro(buffer) \ | |
72 | macro(byteLength) \ | |
73 | macro(byteOffset) \ | |
93a37866 A |
74 | macro(bytecode) \ |
75 | macro(bytecodeIndex) \ | |
76 | macro(bytecodes) \ | |
77 | macro(bytecodesID) \ | |
b37bf2e1 A |
78 | macro(callee) \ |
79 | macro(caller) \ | |
81345200 A |
80 | macro(cast) \ |
81 | macro(clear) \ | |
82 | macro(close) \ | |
83 | macro(closed) \ | |
93a37866 A |
84 | macro(compilationKind) \ |
85 | macro(compilations) \ | |
9dae56ea | 86 | macro(compile) \ |
f9bf01c6 | 87 | macro(configurable) \ |
b37bf2e1 | 88 | macro(constructor) \ |
93a37866 A |
89 | macro(count) \ |
90 | macro(counters) \ | |
91 | macro(description) \ | |
92 | macro(descriptions) \ | |
93 | macro(displayName) \ | |
94 | macro(document) \ | |
81345200 A |
95 | macro(done) \ |
96 | macro(entries) \ | |
f9bf01c6 | 97 | macro(enumerable) \ |
9dae56ea A |
98 | macro(eval) \ |
99 | macro(exec) \ | |
93a37866 A |
100 | macro(executionCount) \ |
101 | macro(exitKind) \ | |
81345200 A |
102 | macro(focus) \ |
103 | macro(forEach) \ | |
104 | macro(forward) \ | |
b37bf2e1 | 105 | macro(fromCharCode) \ |
f9bf01c6 | 106 | macro(get) \ |
93a37866 | 107 | macro(global) \ |
81345200 A |
108 | macro(go) \ |
109 | macro(has) \ | |
9dae56ea | 110 | macro(hasOwnProperty) \ |
93a37866 A |
111 | macro(hash) \ |
112 | macro(header) \ | |
81345200 | 113 | macro(href) \ |
93a37866 | 114 | macro(id) \ |
b37bf2e1 A |
115 | macro(ignoreCase) \ |
116 | macro(index) \ | |
93a37866 | 117 | macro(inferredName) \ |
b37bf2e1 | 118 | macro(input) \ |
93a37866 | 119 | macro(instructionCount) \ |
f9bf01c6 | 120 | macro(isArray) \ |
9dae56ea | 121 | macro(isPrototypeOf) \ |
81345200 | 122 | macro(isView) \ |
93a37866 | 123 | macro(isWatchpoint) \ |
81345200 | 124 | macro(jettisonReason) \ |
93a37866 | 125 | macro(join) \ |
81345200 | 126 | macro(keys) \ |
6fe7ccc8 | 127 | macro(lastIndex) \ |
b37bf2e1 A |
128 | macro(length) \ |
129 | macro(message) \ | |
130 | macro(multiline) \ | |
131 | macro(name) \ | |
81345200 | 132 | macro(next) \ |
9dae56ea | 133 | macro(now) \ |
93a37866 A |
134 | macro(numInlinedCalls) \ |
135 | macro(numInlinedGetByIds) \ | |
136 | macro(numInlinedPutByIds) \ | |
81345200 | 137 | macro(of) \ |
93a37866 A |
138 | macro(opcode) \ |
139 | macro(origin) \ | |
140 | macro(osrExitSites) \ | |
141 | macro(osrExits) \ | |
9dae56ea | 142 | macro(parse) \ |
81345200 | 143 | macro(postMessage) \ |
93a37866 | 144 | macro(profiledBytecodes) \ |
9dae56ea | 145 | macro(propertyIsEnumerable) \ |
b37bf2e1 | 146 | macro(prototype) \ |
81345200 A |
147 | macro(reload) \ |
148 | macro(replace) \ | |
f9bf01c6 | 149 | macro(set) \ |
81345200 A |
150 | macro(showModalDialog) \ |
151 | macro(size) \ | |
152 | macro(slice) \ | |
b37bf2e1 | 153 | macro(source) \ |
93a37866 | 154 | macro(sourceCode) \ |
6fe7ccc8 | 155 | macro(stack) \ |
81345200 | 156 | macro(subarray) \ |
9dae56ea | 157 | macro(test) \ |
81345200 | 158 | macro(then) \ |
b37bf2e1 A |
159 | macro(toExponential) \ |
160 | macro(toFixed) \ | |
ba379fdc A |
161 | macro(toISOString) \ |
162 | macro(toJSON) \ | |
b37bf2e1 A |
163 | macro(toLocaleString) \ |
164 | macro(toPrecision) \ | |
165 | macro(toString) \ | |
f9bf01c6 | 166 | macro(value) \ |
ba379fdc | 167 | macro(valueOf) \ |
81345200 A |
168 | macro(values) \ |
169 | macro(webkit) \ | |
93a37866 A |
170 | macro(window) \ |
171 | macro(writable) | |
b37bf2e1 | 172 | |
14957cd0 | 173 | #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \ |
14957cd0 A |
174 | macro(break) \ |
175 | macro(case) \ | |
176 | macro(catch) \ | |
81345200 | 177 | macro(class) \ |
14957cd0 | 178 | macro(const) \ |
14957cd0 | 179 | macro(continue) \ |
81345200 A |
180 | macro(debugger) \ |
181 | macro(default) \ | |
14957cd0 | 182 | macro(delete) \ |
14957cd0 | 183 | macro(do) \ |
14957cd0 | 184 | macro(else) \ |
14957cd0 A |
185 | macro(enum) \ |
186 | macro(export) \ | |
187 | macro(extends) \ | |
81345200 A |
188 | macro(false) \ |
189 | macro(finally) \ | |
190 | macro(for) \ | |
191 | macro(function) \ | |
192 | macro(if) \ | |
6fe7ccc8 | 193 | macro(implements) \ |
81345200 A |
194 | macro(import) \ |
195 | macro(in) \ | |
196 | macro(instanceof) \ | |
6fe7ccc8 A |
197 | macro(interface) \ |
198 | macro(let) \ | |
81345200 A |
199 | macro(new) \ |
200 | macro(null) \ | |
6fe7ccc8 A |
201 | macro(package) \ |
202 | macro(private) \ | |
203 | macro(protected) \ | |
204 | macro(public) \ | |
81345200 | 205 | macro(return) \ |
6fe7ccc8 | 206 | macro(static) \ |
81345200 A |
207 | macro(super) \ |
208 | macro(switch) \ | |
209 | macro(this) \ | |
210 | macro(throw) \ | |
211 | macro(true) \ | |
212 | macro(try) \ | |
213 | macro(typeof) \ | |
214 | macro(undefined) \ | |
215 | macro(var) \ | |
216 | macro(void) \ | |
217 | macro(while) \ | |
218 | macro(with) \ | |
6fe7ccc8 | 219 | macro(yield) |
14957cd0 | 220 | |
81345200 A |
221 | #define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \ |
222 | macro(iterator) \ | |
223 | macro(iteratorNext) \ | |
224 | macro(resolve) \ | |
225 | macro(reject) \ | |
226 | macro(promise) \ | |
227 | macro(fulfillmentHandler) \ | |
228 | macro(rejectionHandler) \ | |
229 | macro(index) \ | |
230 | macro(values) \ | |
231 | macro(deferred) \ | |
232 | macro(countdownHolder) \ | |
233 | macro(Object) \ | |
234 | macro(TypeError) \ | |
235 | macro(undefined) \ | |
236 | macro(BuiltinLog) | |
b37bf2e1 | 237 | |
81345200 A |
238 | namespace JSC { |
239 | ||
240 | class BuiltinNames; | |
241 | ||
14957cd0 A |
242 | class CommonIdentifiers { |
243 | WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED; | |
b37bf2e1 | 244 | private: |
93a37866 | 245 | CommonIdentifiers(VM*); |
81345200 | 246 | ~CommonIdentifiers(); |
93a37866 | 247 | friend class VM; |
81345200 | 248 | |
b37bf2e1 | 249 | public: |
81345200 | 250 | const BuiltinNames& builtinNames() const { return *m_builtinNames; } |
b37bf2e1 | 251 | const Identifier nullIdentifier; |
ba379fdc | 252 | const Identifier emptyIdentifier; |
b37bf2e1 | 253 | const Identifier underscoreProto; |
9dae56ea | 254 | const Identifier thisIdentifier; |
14957cd0 | 255 | const Identifier useStrictIdentifier; |
81345200 A |
256 | private: |
257 | std::unique_ptr<BuiltinNames> m_builtinNames; | |
b37bf2e1 | 258 | |
81345200 | 259 | public: |
14957cd0 A |
260 | |
261 | #define JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL(name) const Identifier name##Keyword; | |
262 | JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL) | |
263 | #undef JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL | |
264 | ||
9dae56ea A |
265 | #define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name; |
266 | JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL) | |
267 | #undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL | |
81345200 A |
268 | |
269 | #define JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL(name) const Identifier name##PrivateName; | |
270 | JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL) | |
271 | #undef JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL | |
272 | ||
273 | const Identifier* getPrivateName(const Identifier&) const; | |
274 | Identifier getPublicName(const Identifier&) const; | |
b37bf2e1 | 275 | }; |
b37bf2e1 | 276 | |
9dae56ea | 277 | } // namespace JSC |
b37bf2e1 | 278 | |
9dae56ea | 279 | #endif // CommonIdentifiers_h |