CommonIdentifiers.h 5.57 KB
Newer Older
mjs's avatar
mjs committed
1
/*
darin@apple.com's avatar
darin@apple.com committed
2
 *  Copyright (C) 2003, 2007, 2009 Apple Inc. All rights reserved.
mjs's avatar
mjs committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this library; see the file COPYING.LIB.  If not, write to
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 *
 */

21 22
#ifndef CommonIdentifiers_h
#define CommonIdentifiers_h
mjs's avatar
mjs committed
23

24
#include "Identifier.h"
mjs's avatar
mjs committed
25 26
#include <wtf/Noncopyable.h>

27
// MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various
mjs's avatar
mjs committed
28
// ways without repeating the list.
29
#define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
30
    macro(Array) \
31 32
    macro(ArrayBuffer) \
    macro(BYTES_PER_ELEMENT) \
33 34 35 36 37 38 39 40 41 42 43
    macro(Boolean) \
    macro(Date) \
    macro(Error) \
    macro(EvalError) \
    macro(Function) \
    macro(Infinity) \
    macro(JSON) \
    macro(Math) \
    macro(NaN) \
    macro(Number) \
    macro(Object) \
weinig@apple.com's avatar
weinig@apple.com committed
44 45
    macro(Promise) \
    macro(PromiseResolver) \
46 47 48 49 50 51 52 53 54 55 56 57 58
    macro(RangeError) \
    macro(ReferenceError) \
    macro(RegExp) \
    macro(String) \
    macro(SyntaxError) \
    macro(TypeError) \
    macro(URIError) \
    macro(UTC) \
    macro(__defineGetter__) \
    macro(__defineSetter__) \
    macro(__lookupGetter__) \
    macro(__lookupSetter__) \
    macro(anonymous) \
ap@webkit.org's avatar
ap@webkit.org committed
59
    macro(apply) \
mjs's avatar
mjs committed
60
    macro(arguments) \
61
    macro(bind) \
62 63 64
    macro(buffer) \
    macro(byteLength) \
    macro(byteOffset) \
65 66 67 68
    macro(bytecode) \
    macro(bytecodeIndex) \
    macro(bytecodes) \
    macro(bytecodesID) \
ap@webkit.org's avatar
ap@webkit.org committed
69
    macro(call) \
mjs's avatar
mjs committed
70 71
    macro(callee) \
    macro(caller) \
72 73
    macro(compilationKind) \
    macro(compilations) \
ap@webkit.org's avatar
ap@webkit.org committed
74
    macro(compile) \
75
    macro(configurable) \
mjs's avatar
mjs committed
76
    macro(constructor) \
77
    macro(count) \
78 79 80
    macro(counters) \
    macro(description) \
    macro(descriptions) \
81 82
    macro(displayName) \
    macro(document) \
83
    macro(enumerable) \
ap@webkit.org's avatar
ap@webkit.org committed
84 85
    macro(eval) \
    macro(exec) \
86
    macro(executionCount) \
87
    macro(exitKind) \
mjs's avatar
mjs committed
88
    macro(fromCharCode) \
89
    macro(get) \
90
    macro(global) \
ap@webkit.org's avatar
ap@webkit.org committed
91
    macro(hasOwnProperty) \
92
    macro(hash) \
93
    macro(header) \
94
    macro(id) \
oliver's avatar
oliver committed
95 96
    macro(ignoreCase) \
    macro(index) \
97
    macro(inferredName) \
oliver's avatar
oliver committed
98
    macro(input) \
99
    macro(instructionCount) \
100
    macro(isArray) \
ap@webkit.org's avatar
ap@webkit.org committed
101
    macro(isPrototypeOf) \
102
    macro(isWatchpoint) \
103
    macro(join) \
104
    macro(lastIndex) \
mjs's avatar
mjs committed
105 106
    macro(length) \
    macro(message) \
oliver's avatar
oliver committed
107
    macro(multiline) \
mjs's avatar
mjs committed
108
    macro(name) \
109
    macro(now) \
110
    macro(numInlinedCalls) \
111 112
    macro(numInlinedGetByIds) \
    macro(numInlinedPutByIds) \
113
    macro(opcode) \
114
    macro(origin) \
115 116
    macro(osrExitSites) \
    macro(osrExits) \
ap@webkit.org's avatar
ap@webkit.org committed
117
    macro(parse) \
118
    macro(profiledBytecodes) \
ap@webkit.org's avatar
ap@webkit.org committed
119
    macro(propertyIsEnumerable) \
mjs's avatar
mjs committed
120
    macro(prototype) \
121
    macro(set) \
122
    macro(slice) \
oliver's avatar
oliver committed
123
    macro(source) \
124
    macro(sourceCode) \
oliver@apple.com's avatar
oliver@apple.com committed
125
    macro(stack) \
126
    macro(subarray) \
ap@webkit.org's avatar
ap@webkit.org committed
127
    macro(test) \
weinig@apple.com's avatar
weinig@apple.com committed
128
    macro(then) \
mjs's avatar
mjs committed
129
    macro(toExponential) \
oliver's avatar
oliver committed
130
    macro(toFixed) \
131
    macro(toISOString) \
132
    macro(toJSON) \
oliver's avatar
oliver committed
133
    macro(toLocaleString) \
mjs's avatar
mjs committed
134
    macro(toPrecision) \
oliver's avatar
oliver committed
135
    macro(toString) \
136
    macro(value) \
137
    macro(valueOf) \
138
    macro(window) \
oliver@apple.com's avatar
oliver@apple.com committed
139 140 141 142 143
    macro(writable) \
    macro(has) \
    macro(forEach) \
    macro(clear) \
    macro(size) \
oliver@apple.com's avatar
oliver@apple.com committed
144 145
    macro(Map)\
    macro(Set)\
oliver@apple.com's avatar
oliver@apple.com committed
146
    macro(WeakMap)\
oliver@apple.com's avatar
oliver@apple.com committed
147
    macro(add)
mjs's avatar
mjs committed
148

149 150
#define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
    macro(null) \
151
    macro(undefined) \
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
    macro(true) \
    macro(false) \
    macro(break) \
    macro(case) \
    macro(catch) \
    macro(const) \
    macro(default) \
    macro(finally) \
    macro(for) \
    macro(instanceof) \
    macro(new) \
    macro(var) \
    macro(continue) \
    macro(function) \
    macro(return) \
    macro(void) \
    macro(delete) \
    macro(if) \
    macro(this) \
    macro(do) \
    macro(while) \
    macro(else) \
    macro(in) \
    macro(switch) \
    macro(throw) \
    macro(try) \
    macro(typeof) \
    macro(with) \
    macro(debugger) \
    macro(class) \
    macro(enum) \
    macro(export) \
    macro(extends) \
    macro(import) \
186 187 188 189 190 191 192 193 194 195
    macro(super) \
    macro(implements) \
    macro(interface) \
    macro(let) \
    macro(package) \
    macro(private) \
    macro(protected) \
    macro(public) \
    macro(static) \
    macro(yield)
196

197
namespace JSC {
mjs's avatar
mjs committed
198

199 200
    class CommonIdentifiers {
        WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
mjs's avatar
mjs committed
201
    private:
ggaren@apple.com's avatar
ggaren@apple.com committed
202 203
        CommonIdentifiers(VM*);
        friend class VM;
mjs's avatar
mjs committed
204 205

    public:
206
        const Identifier nullIdentifier;
darin@apple.com's avatar
darin@apple.com committed
207
        const Identifier emptyIdentifier;
mjs's avatar
mjs committed
208
        const Identifier underscoreProto;
209
        const Identifier thisIdentifier;
210
        const Identifier useStrictIdentifier;
mjs's avatar
mjs committed
211

212 213 214 215 216
        
#define JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL(name) const Identifier name##Keyword;
        JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL)
#undef JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL
        
217 218 219
#define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name;
        JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL)
#undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
mjs's avatar
mjs committed
220 221
    };

222
} // namespace JSC
mjs's avatar
mjs committed
223

224
#endif // CommonIdentifiers_h