]> git.saurik.com Git - apple/javascriptcore.git/blame - runtime/CommonIdentifiers.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / CommonIdentifiers.h
CommitLineData
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
ed1e77d3 24#include "BytecodeIntrinsicRegistry.h"
9dae56ea 25#include "Identifier.h"
b37bf2e1
A
26#include <wtf/Noncopyable.h>
27
ba379fdc 28// MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various
b37bf2e1 29// ways without repeating the list.
9dae56ea 30#define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
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) \
ed1e77d3 41 macro(Intl) \
93a37866 42 macro(JSON) \
81345200
A
43 macro(Map)\
44 macro(MapIterator)\
93a37866
A
45 macro(Math) \
46 macro(NaN) \
47 macro(Number) \
48 macro(Object) \
81345200 49 macro(Promise) \
93a37866
A
50 macro(RangeError) \
51 macro(ReferenceError) \
52 macro(RegExp) \
81345200
A
53 macro(Set)\
54 macro(SetIterator)\
93a37866 55 macro(String) \
ed1e77d3 56 macro(Symbol) \
93a37866
A
57 macro(SyntaxError) \
58 macro(TypeError) \
59 macro(URIError) \
60 macro(UTC) \
81345200 61 macro(WeakMap)\
ed1e77d3 62 macro(WeakSet)\
93a37866
A
63 macro(__defineGetter__) \
64 macro(__defineSetter__) \
65 macro(__lookupGetter__) \
66 macro(__lookupSetter__) \
81345200 67 macro(add) \
ed1e77d3 68 macro(additionalJettisonReason) \
93a37866 69 macro(anonymous) \
b37bf2e1 70 macro(arguments) \
81345200
A
71 macro(assign) \
72 macro(back) \
6fe7ccc8 73 macro(bind) \
81345200
A
74 macro(blur) \
75 macro(buffer) \
76 macro(byteLength) \
77 macro(byteOffset) \
93a37866
A
78 macro(bytecode) \
79 macro(bytecodeIndex) \
80 macro(bytecodes) \
81 macro(bytecodesID) \
b37bf2e1
A
82 macro(callee) \
83 macro(caller) \
81345200
A
84 macro(clear) \
85 macro(close) \
86 macro(closed) \
ed1e77d3 87 macro(column) \
93a37866
A
88 macro(compilationKind) \
89 macro(compilations) \
9dae56ea 90 macro(compile) \
f9bf01c6 91 macro(configurable) \
b37bf2e1 92 macro(constructor) \
93a37866
A
93 macro(count) \
94 macro(counters) \
ed1e77d3 95 macro(defineProperty) \
93a37866
A
96 macro(description) \
97 macro(descriptions) \
98 macro(displayName) \
99 macro(document) \
81345200
A
100 macro(done) \
101 macro(entries) \
f9bf01c6 102 macro(enumerable) \
9dae56ea
A
103 macro(eval) \
104 macro(exec) \
93a37866
A
105 macro(executionCount) \
106 macro(exitKind) \
ed1e77d3 107 macro(flags) \
81345200
A
108 macro(focus) \
109 macro(forEach) \
110 macro(forward) \
b37bf2e1 111 macro(fromCharCode) \
f9bf01c6 112 macro(get) \
93a37866 113 macro(global) \
81345200
A
114 macro(go) \
115 macro(has) \
9dae56ea 116 macro(hasOwnProperty) \
93a37866
A
117 macro(hash) \
118 macro(header) \
81345200 119 macro(href) \
93a37866 120 macro(id) \
b37bf2e1
A
121 macro(ignoreCase) \
122 macro(index) \
ed1e77d3 123 macro(indexedDB) \
93a37866 124 macro(inferredName) \
b37bf2e1 125 macro(input) \
93a37866 126 macro(instructionCount) \
f9bf01c6 127 macro(isArray) \
9dae56ea 128 macro(isPrototypeOf) \
81345200 129 macro(isView) \
93a37866 130 macro(isWatchpoint) \
81345200 131 macro(jettisonReason) \
93a37866 132 macro(join) \
81345200 133 macro(keys) \
6fe7ccc8 134 macro(lastIndex) \
b37bf2e1 135 macro(length) \
ed1e77d3 136 macro(line) \
b37bf2e1
A
137 macro(message) \
138 macro(multiline) \
139 macro(name) \
81345200 140 macro(next) \
9dae56ea 141 macro(now) \
93a37866
A
142 macro(numInlinedCalls) \
143 macro(numInlinedGetByIds) \
144 macro(numInlinedPutByIds) \
81345200 145 macro(of) \
93a37866
A
146 macro(opcode) \
147 macro(origin) \
148 macro(osrExitSites) \
149 macro(osrExits) \
9dae56ea 150 macro(parse) \
ed1e77d3 151 macro(parseInt) \
81345200 152 macro(postMessage) \
93a37866 153 macro(profiledBytecodes) \
9dae56ea 154 macro(propertyIsEnumerable) \
b37bf2e1 155 macro(prototype) \
ed1e77d3 156 macro(raw) \
81345200
A
157 macro(reload) \
158 macro(replace) \
ed1e77d3 159 macro(resolve) \
f9bf01c6 160 macro(set) \
81345200
A
161 macro(showModalDialog) \
162 macro(size) \
163 macro(slice) \
b37bf2e1 164 macro(source) \
ed1e77d3 165 macro(sourceURL) \
93a37866 166 macro(sourceCode) \
6fe7ccc8 167 macro(stack) \
81345200 168 macro(subarray) \
9dae56ea 169 macro(test) \
81345200 170 macro(then) \
b37bf2e1
A
171 macro(toExponential) \
172 macro(toFixed) \
ba379fdc
A
173 macro(toISOString) \
174 macro(toJSON) \
b37bf2e1
A
175 macro(toLocaleString) \
176 macro(toPrecision) \
177 macro(toString) \
f9bf01c6 178 macro(value) \
ba379fdc 179 macro(valueOf) \
81345200
A
180 macro(values) \
181 macro(webkit) \
ed1e77d3 182 macro(webkitIndexedDB) \
93a37866
A
183 macro(window) \
184 macro(writable)
b37bf2e1 185
14957cd0 186#define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
14957cd0
A
187 macro(break) \
188 macro(case) \
189 macro(catch) \
81345200 190 macro(class) \
14957cd0 191 macro(const) \
14957cd0 192 macro(continue) \
81345200
A
193 macro(debugger) \
194 macro(default) \
14957cd0 195 macro(delete) \
14957cd0 196 macro(do) \
14957cd0 197 macro(else) \
14957cd0
A
198 macro(enum) \
199 macro(export) \
200 macro(extends) \
81345200
A
201 macro(false) \
202 macro(finally) \
203 macro(for) \
204 macro(function) \
205 macro(if) \
6fe7ccc8 206 macro(implements) \
81345200
A
207 macro(import) \
208 macro(in) \
209 macro(instanceof) \
6fe7ccc8
A
210 macro(interface) \
211 macro(let) \
81345200
A
212 macro(new) \
213 macro(null) \
6fe7ccc8
A
214 macro(package) \
215 macro(private) \
216 macro(protected) \
217 macro(public) \
81345200 218 macro(return) \
6fe7ccc8 219 macro(static) \
81345200
A
220 macro(super) \
221 macro(switch) \
222 macro(this) \
223 macro(throw) \
224 macro(true) \
225 macro(try) \
226 macro(typeof) \
227 macro(undefined) \
228 macro(var) \
229 macro(void) \
230 macro(while) \
231 macro(with) \
6fe7ccc8 232 macro(yield)
14957cd0 233
ed1e77d3
A
234#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL_NOT_IMPLEMENTED_YET(macro)\
235 macro(hasInstance) \
236 macro(isConcatSpreadable) \
237 macro(match) \
238 macro(replace) \
239 macro(search) \
240 macro(species) \
241 macro(split) \
242 macro(toPrimitive) \
243 macro(toStringTag)
244
245#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(macro) \
81345200 246 macro(iterator) \
ed1e77d3
A
247 macro(unscopables)
248
249#define JSC_COMMON_BYTECODE_INTRINSICS_EACH_NAME(macro) \
250 macro(putByValDirect) \
251 macro(toString)
252
253#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
254 JSC_COMMON_BYTECODE_INTRINSICS_EACH_NAME(macro) \
255 macro(symbolIterator) \
256 macro(iteratedObject) \
257 macro(arrayIteratorNextIndex) \
258 macro(arrayIterationKind) \
259 macro(arrayIterationKindKey) \
260 macro(arrayIterationKindValue) \
261 macro(arrayIterationKindKeyValue) \
262 macro(charCodeAt) \
263 macro(iteratedString) \
264 macro(stringIteratorNextIndex) \
81345200
A
265 macro(promise) \
266 macro(fulfillmentHandler) \
267 macro(rejectionHandler) \
268 macro(index) \
269 macro(values) \
270 macro(deferred) \
271 macro(countdownHolder) \
272 macro(Object) \
ed1e77d3
A
273 macro(objectKeys) \
274 macro(objectGetOwnPropertyDescriptor) \
275 macro(objectGetOwnPropertySymbols) \
276 macro(Number) \
277 macro(Array) \
278 macro(String) \
279 macro(Promise) \
280 macro(abs) \
281 macro(floor) \
282 macro(isFinite) \
283 macro(getPrototypeOf) \
284 macro(getOwnPropertyNames) \
81345200
A
285 macro(TypeError) \
286 macro(undefined) \
ed1e77d3
A
287 macro(BuiltinLog) \
288 macro(homeObject) \
289 macro(getTemplateObject) \
290 macro(enqueueJob) \
291 macro(handler) \
292 macro(promiseState) \
293 macro(promisePending) \
294 macro(promiseFulfilled) \
295 macro(promiseRejected) \
296 macro(promiseFulfillReactions) \
297 macro(promiseRejectReactions) \
298 macro(promiseResult) \
299 macro(capabilities) \
300
b37bf2e1 301
81345200
A
302namespace JSC {
303
304 class BuiltinNames;
305
14957cd0
A
306 class CommonIdentifiers {
307 WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
b37bf2e1 308 private:
93a37866 309 CommonIdentifiers(VM*);
81345200 310 ~CommonIdentifiers();
93a37866 311 friend class VM;
81345200 312
b37bf2e1 313 public:
81345200 314 const BuiltinNames& builtinNames() const { return *m_builtinNames; }
b37bf2e1 315 const Identifier nullIdentifier;
ba379fdc 316 const Identifier emptyIdentifier;
b37bf2e1 317 const Identifier underscoreProto;
9dae56ea 318 const Identifier thisIdentifier;
14957cd0 319 const Identifier useStrictIdentifier;
81345200
A
320 private:
321 std::unique_ptr<BuiltinNames> m_builtinNames;
b37bf2e1 322
81345200 323 public:
14957cd0
A
324
325#define JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL(name) const Identifier name##Keyword;
326 JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL)
327#undef JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL
328
9dae56ea
A
329#define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name;
330 JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL)
331#undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
81345200
A
332
333#define JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL(name) const Identifier name##PrivateName;
334 JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL)
335#undef JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL
ed1e77d3
A
336
337#define JSC_IDENTIFIER_DECLARE_PRIVATE_WELL_KNOWN_SYMBOL_GLOBAL(name) const Identifier name##Symbol;
338 JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(JSC_IDENTIFIER_DECLARE_PRIVATE_WELL_KNOWN_SYMBOL_GLOBAL)
339#undef JSC_IDENTIFIER_DECLARE_PRIVATE_WELL_KNOWN_SYMBOL_GLOBAL
340
341 bool isPrivateName(SymbolImpl& uid) const;
342 bool isPrivateName(UniquedStringImpl& uid) const;
343 bool isPrivateName(const Identifier&) const;
344
81345200
A
345 const Identifier* getPrivateName(const Identifier&) const;
346 Identifier getPublicName(const Identifier&) const;
ed1e77d3
A
347
348 const BytecodeIntrinsicRegistry& bytecodeIntrinsicRegistry() const { return m_bytecodeIntrinsicRegistry; }
349
350 private:
351 BytecodeIntrinsicRegistry m_bytecodeIntrinsicRegistry;
b37bf2e1 352 };
b37bf2e1 353
9dae56ea 354} // namespace JSC
b37bf2e1 355
9dae56ea 356#endif // CommonIdentifiers_h