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 "BytecodeIntrinsicRegistry.h"
25 #include "Identifier.h"
26 #include <wtf/Noncopyable.h>
28 // MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various
29 // ways without repeating the list.
30 #define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
33 macro(ArrayIterator) \
34 macro(BYTES_PER_ELEMENT) \
51 macro(ReferenceError) \
63 macro(__defineGetter__) \
64 macro(__defineSetter__) \
65 macro(__lookupGetter__) \
66 macro(__lookupSetter__) \
68 macro(additionalJettisonReason) \
79 macro(bytecodeIndex) \
88 macro(compilationKind) \
95 macro(defineProperty) \
105 macro(executionCount) \
111 macro(fromCharCode) \
116 macro(hasOwnProperty) \
124 macro(inferredName) \
126 macro(instructionCount) \
128 macro(isPrototypeOf) \
130 macro(isWatchpoint) \
131 macro(jettisonReason) \
142 macro(numInlinedCalls) \
143 macro(numInlinedGetByIds) \
144 macro(numInlinedPutByIds) \
148 macro(osrExitSites) \
153 macro(profiledBytecodes) \
154 macro(propertyIsEnumerable) \
161 macro(showModalDialog) \
171 macro(toExponential) \
175 macro(toLocaleString) \
182 macro(webkitIndexedDB) \
186 #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
234 #define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL_NOT_IMPLEMENTED_YET(macro)\
236 macro(isConcatSpreadable) \
245 #define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(macro) \
249 #define JSC_COMMON_BYTECODE_INTRINSICS_EACH_NAME(macro) \
250 macro(putByValDirect) \
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) \
263 macro(iteratedString) \
264 macro(stringIteratorNextIndex) \
266 macro(fulfillmentHandler) \
267 macro(rejectionHandler) \
271 macro(countdownHolder) \
274 macro(objectGetOwnPropertyDescriptor) \
275 macro(objectGetOwnPropertySymbols) \
283 macro(getPrototypeOf) \
284 macro(getOwnPropertyNames) \
289 macro(getTemplateObject) \
292 macro(promiseState) \
293 macro(promisePending) \
294 macro(promiseFulfilled) \
295 macro(promiseRejected) \
296 macro(promiseFulfillReactions) \
297 macro(promiseRejectReactions) \
298 macro(promiseResult) \
299 macro(capabilities) \
306 class CommonIdentifiers
{
307 WTF_MAKE_NONCOPYABLE(CommonIdentifiers
); WTF_MAKE_FAST_ALLOCATED
;
309 CommonIdentifiers(VM
*);
310 ~CommonIdentifiers();
314 const BuiltinNames
& builtinNames() const { return *m_builtinNames
; }
315 const Identifier nullIdentifier
;
316 const Identifier emptyIdentifier
;
317 const Identifier underscoreProto
;
318 const Identifier thisIdentifier
;
319 const Identifier useStrictIdentifier
;
321 std::unique_ptr
<BuiltinNames
> m_builtinNames
;
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
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
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
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
341 bool isPrivateName(SymbolImpl
& uid
) const;
342 bool isPrivateName(UniquedStringImpl
& uid
) const;
343 bool isPrivateName(const Identifier
&) const;
345 const Identifier
* getPrivateName(const Identifier
&) const;
346 Identifier
getPublicName(const Identifier
&) const;
348 const BytecodeIntrinsicRegistry
& bytecodeIntrinsicRegistry() const { return m_bytecodeIntrinsicRegistry
; }
351 BytecodeIntrinsicRegistry m_bytecodeIntrinsicRegistry
;
356 #endif // CommonIdentifiers_h