2 * Copyright (C) 2003, 2007, 2009 Apple Inc. All rights reserved.
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.
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.
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.
21 #ifndef CommonIdentifiers_h
22 #define CommonIdentifiers_h
24 #include "Identifier.h"
25 #include <wtf/Noncopyable.h>
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(ArgumentsIterator) \
33 macro(ArrayIterator) \
34 macro(BYTES_PER_ELEMENT) \
50 macro(ReferenceError) \
60 macro(__defineGetter__) \
61 macro(__defineSetter__) \
62 macro(__lookupGetter__) \
63 macro(__lookupSetter__) \
75 macro(bytecodeIndex) \
84 macro(compilationKind) \
100 macro(executionCount) \
105 macro(fromCharCode) \
110 macro(hasOwnProperty) \
117 macro(inferredName) \
119 macro(instructionCount) \
121 macro(isPrototypeOf) \
123 macro(isWatchpoint) \
124 macro(jettisonReason) \
134 macro(numInlinedCalls) \
135 macro(numInlinedGetByIds) \
136 macro(numInlinedPutByIds) \
140 macro(osrExitSites) \
144 macro(profiledBytecodes) \
145 macro(propertyIsEnumerable) \
150 macro(showModalDialog) \
159 macro(toExponential) \
163 macro(toLocaleString) \
173 #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
221 #define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
223 macro(iteratorNext) \
227 macro(fulfillmentHandler) \
228 macro(rejectionHandler) \
232 macro(countdownHolder) \
242 class CommonIdentifiers
{
243 WTF_MAKE_NONCOPYABLE(CommonIdentifiers
); WTF_MAKE_FAST_ALLOCATED
;
245 CommonIdentifiers(VM
*);
246 ~CommonIdentifiers();
250 const BuiltinNames
& builtinNames() const { return *m_builtinNames
; }
251 const Identifier nullIdentifier
;
252 const Identifier emptyIdentifier
;
253 const Identifier underscoreProto
;
254 const Identifier thisIdentifier
;
255 const Identifier useStrictIdentifier
;
257 std::unique_ptr
<BuiltinNames
> m_builtinNames
;
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
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
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
273 const Identifier
* getPrivateName(const Identifier
&) const;
274 Identifier
getPublicName(const Identifier
&) const;
279 #endif // CommonIdentifiers_h