1/*
2 *  Copyright (C) 2003, 2007, 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 CommonIdentifiers_h
22#define CommonIdentifiers_h
23
24#include "Identifier.h"
25#include <wtf/Noncopyable.h>
26
27// MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various
28// ways without repeating the list.
29#define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
30    macro(Array) \
31    macro(Boolean) \
32    macro(Date) \
33    macro(Error) \
34    macro(EvalError) \
35    macro(Function) \
36    macro(Infinity) \
37    macro(JSON) \
38    macro(Math) \
39    macro(NaN) \
40    macro(Number) \
41    macro(Object) \
42    macro(RangeError) \
43    macro(ReferenceError) \
44    macro(RegExp) \
45    macro(String) \
46    macro(SyntaxError) \
47    macro(TypeError) \
48    macro(URIError) \
49    macro(UTC) \
50    macro(__defineGetter__) \
51    macro(__defineSetter__) \
52    macro(__lookupGetter__) \
53    macro(__lookupSetter__) \
54    macro(anonymous) \
55    macro(apply) \
56    macro(arguments) \
57    macro(bind) \
58    macro(bytecode) \
59    macro(bytecodeIndex) \
60    macro(bytecodes) \
61    macro(bytecodesID) \
62    macro(call) \
63    macro(callee) \
64    macro(caller) \
65    macro(compilationKind) \
66    macro(compilations) \
67    macro(compile) \
68    macro(configurable) \
69    macro(constructor) \
70    macro(count) \
71    macro(counters) \
72    macro(description) \
73    macro(descriptions) \
74    macro(displayName) \
75    macro(document) \
76    macro(enumerable) \
77    macro(eval) \
78    macro(exec) \
79    macro(executionCount) \
80    macro(exitKind) \
81    macro(fromCharCode) \
82    macro(get) \
83    macro(global) \
84    macro(hasOwnProperty) \
85    macro(hash) \
86    macro(header) \
87    macro(id) \
88    macro(ignoreCase) \
89    macro(index) \
90    macro(inferredName) \
91    macro(input) \
92    macro(instructionCount) \
93    macro(isArray) \
94    macro(isPrototypeOf) \
95    macro(isWatchpoint) \
96    macro(join) \
97    macro(lastIndex) \
98    macro(length) \
99    macro(message) \
100    macro(multiline) \
101    macro(name) \
102    macro(now) \
103    macro(numInlinedCalls) \
104    macro(numInlinedGetByIds) \
105    macro(numInlinedPutByIds) \
106    macro(opcode) \
107    macro(origin) \
108    macro(osrExitSites) \
109    macro(osrExits) \
110    macro(parse) \
111    macro(profiledBytecodes) \
112    macro(propertyIsEnumerable) \
113    macro(prototype) \
114    macro(set) \
115    macro(source) \
116    macro(sourceCode) \
117    macro(stack) \
118    macro(test) \
119    macro(toExponential) \
120    macro(toFixed) \
121    macro(toISOString) \
122    macro(toJSON) \
123    macro(toLocaleString) \
124    macro(toPrecision) \
125    macro(toString) \
126    macro(value) \
127    macro(valueOf) \
128    macro(window) \
129    macro(writable)
130
131#define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
132    macro(null) \
133    macro(undefined) \
134    macro(true) \
135    macro(false) \
136    macro(break) \
137    macro(case) \
138    macro(catch) \
139    macro(const) \
140    macro(default) \
141    macro(finally) \
142    macro(for) \
143    macro(instanceof) \
144    macro(new) \
145    macro(var) \
146    macro(continue) \
147    macro(function) \
148    macro(return) \
149    macro(void) \
150    macro(delete) \
151    macro(if) \
152    macro(this) \
153    macro(do) \
154    macro(while) \
155    macro(else) \
156    macro(in) \
157    macro(switch) \
158    macro(throw) \
159    macro(try) \
160    macro(typeof) \
161    macro(with) \
162    macro(debugger) \
163    macro(class) \
164    macro(enum) \
165    macro(export) \
166    macro(extends) \
167    macro(import) \
168    macro(super) \
169    macro(implements) \
170    macro(interface) \
171    macro(let) \
172    macro(package) \
173    macro(private) \
174    macro(protected) \
175    macro(public) \
176    macro(static) \
177    macro(yield)
178
179namespace JSC {
180
181    class CommonIdentifiers {
182        WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
183    private:
184        CommonIdentifiers(VM*);
185        friend class VM;
186
187    public:
188        const Identifier nullIdentifier;
189        const Identifier emptyIdentifier;
190        const Identifier underscoreProto;
191        const Identifier thisIdentifier;
192        const Identifier useStrictIdentifier;
193
194
195#define JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL(name) const Identifier name##Keyword;
196        JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL)
197#undef JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL
198
199#define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name;
200        JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL)
201#undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
202    };
203
204} // namespace JSC
205
206#endif // CommonIdentifiers_h
207