CommonIdentifiers.h 4.71 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) \
ap@webkit.org's avatar
ap@webkit.org committed
30
    macro(apply) \
mjs's avatar
mjs committed
31
    macro(arguments) \
32
    macro(Array) \
33
    macro(bind) \
34 35 36 37
    macro(bytecode) \
    macro(bytecodeIndex) \
    macro(bytecodes) \
    macro(bytecodesID) \
ap@webkit.org's avatar
ap@webkit.org committed
38
    macro(call) \
mjs's avatar
mjs committed
39 40
    macro(callee) \
    macro(caller) \
41 42
    macro(compilationKind) \
    macro(compilations) \
ap@webkit.org's avatar
ap@webkit.org committed
43
    macro(compile) \
44
    macro(configurable) \
mjs's avatar
mjs committed
45
    macro(constructor) \
46
    macro(count) \
47 48 49
    macro(counters) \
    macro(description) \
    macro(descriptions) \
50
    macro(enumerable) \
ap@webkit.org's avatar
ap@webkit.org committed
51 52
    macro(eval) \
    macro(exec) \
53
    macro(executionCount) \
54
    macro(exitKind) \
mjs's avatar
mjs committed
55
    macro(fromCharCode) \
oliver's avatar
oliver committed
56
    macro(global) \
57
    macro(get) \
ap@webkit.org's avatar
ap@webkit.org committed
58
    macro(hasOwnProperty) \
59
    macro(hash) \
60
    macro(header) \
61
    macro(id) \
oliver's avatar
oliver committed
62 63
    macro(ignoreCase) \
    macro(index) \
64
    macro(inferredName) \
oliver's avatar
oliver committed
65
    macro(input) \
66
    macro(instructionCount) \
67
    macro(isArray) \
ap@webkit.org's avatar
ap@webkit.org committed
68
    macro(isPrototypeOf) \
69
    macro(isWatchpoint) \
70
    macro(lastIndex) \
mjs's avatar
mjs committed
71 72
    macro(length) \
    macro(message) \
oliver's avatar
oliver committed
73
    macro(multiline) \
mjs's avatar
mjs committed
74
    macro(name) \
75
    macro(now) \
76
    macro(Object) \
77
    macro(opcode) \
78
    macro(origin) \
79 80
    macro(osrExitSites) \
    macro(osrExits) \
ap@webkit.org's avatar
ap@webkit.org committed
81
    macro(parse) \
82
    macro(profiledBytecodes) \
ap@webkit.org's avatar
ap@webkit.org committed
83
    macro(propertyIsEnumerable) \
mjs's avatar
mjs committed
84
    macro(prototype) \
85
    macro(set) \
oliver's avatar
oliver committed
86
    macro(source) \
87
    macro(sourceCode) \
oliver@apple.com's avatar
oliver@apple.com committed
88
    macro(stack) \
ap@webkit.org's avatar
ap@webkit.org committed
89
    macro(test) \
mjs's avatar
mjs committed
90
    macro(toExponential) \
oliver's avatar
oliver committed
91
    macro(toFixed) \
92
    macro(toISOString) \
93
    macro(toJSON) \
oliver's avatar
oliver committed
94
    macro(toLocaleString) \
mjs's avatar
mjs committed
95
    macro(toPrecision) \
oliver's avatar
oliver committed
96
    macro(toString) \
ap@webkit.org's avatar
ap@webkit.org committed
97
    macro(UTC) \
98
    macro(value) \
99
    macro(valueOf) \
100
    macro(writable) \
101
    macro(displayName) \
102 103 104 105 106
    macro(join) \
    macro(__defineGetter__) \
    macro(__defineSetter__) \
    macro(__lookupGetter__) \
    macro(__lookupSetter__)
mjs's avatar
mjs committed
107

108 109
#define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
    macro(null) \
110
    macro(undefined) \
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
    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) \
145 146 147 148 149 150 151 152 153 154
    macro(super) \
    macro(implements) \
    macro(interface) \
    macro(let) \
    macro(package) \
    macro(private) \
    macro(protected) \
    macro(public) \
    macro(static) \
    macro(yield)
155

156
namespace JSC {
mjs's avatar
mjs committed
157

158 159
    class CommonIdentifiers {
        WTF_MAKE_NONCOPYABLE(CommonIdentifiers); WTF_MAKE_FAST_ALLOCATED;
mjs's avatar
mjs committed
160
    private:
ap@webkit.org's avatar
ap@webkit.org committed
161
        CommonIdentifiers(JSGlobalData*);
eric@webkit.org's avatar
eric@webkit.org committed
162
        friend class JSGlobalData;
mjs's avatar
mjs committed
163 164

    public:
165
        const Identifier nullIdentifier;
darin@apple.com's avatar
darin@apple.com committed
166
        const Identifier emptyIdentifier;
mjs's avatar
mjs committed
167
        const Identifier underscoreProto;
168
        const Identifier thisIdentifier;
169
        const Identifier useStrictIdentifier;
mjs's avatar
mjs committed
170

171 172 173 174 175
        
#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
        
176 177 178
#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
179 180
    };

181
} // namespace JSC
mjs's avatar
mjs committed
182

183
#endif // CommonIdentifiers_h