1/*
2 * Copyright (C) 2019 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#pragma once
27
28#include "JSCBuiltins.h"
29
30namespace JSC {
31
32class CodeBlock;
33class JSGlobalObject;
34
35#define JSC_FOREACH_LINK_TIME_CONSTANTS(v) \
36 JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(v) \
37 v(throwTypeErrorFunction, nullptr) \
38 v(importModule, nullptr) \
39 v(mapBucketHead, nullptr) \
40 v(mapBucketNext, nullptr) \
41 v(mapBucketKey, nullptr) \
42 v(mapBucketValue, nullptr) \
43 v(setBucketHead, nullptr) \
44 v(setBucketNext, nullptr) \
45 v(setBucketKey, nullptr) \
46 v(propertyIsEnumerable, nullptr) \
47 v(ownKeys, nullptr) \
48 v(enqueueJob, nullptr) \
49 v(makeTypeError, nullptr) \
50 v(typedArrayLength, nullptr) \
51 v(typedArrayGetOriginalConstructor, nullptr) \
52 v(typedArraySort, nullptr) \
53 v(isTypedArrayView, nullptr) \
54 v(typedArraySubarrayCreate, nullptr) \
55 v(isBoundFunction, nullptr) \
56 v(hasInstanceBoundFunction, nullptr) \
57 v(instanceOf, nullptr) \
58 v(BuiltinLog, nullptr) \
59 v(BuiltinDescribe, nullptr) \
60 v(RegExp, nullptr) \
61 v(trunc, nullptr) \
62 v(Promise, nullptr) \
63 v(InternalPromise, nullptr) \
64 v(defaultPromiseThen, nullptr) \
65 v(repeatCharacter, nullptr) \
66 v(arraySpeciesCreate, nullptr) \
67 v(isArray, nullptr) \
68 v(isArraySlow, nullptr) \
69 v(concatMemcpy, nullptr) \
70 v(appendMemcpy, nullptr) \
71 v(hostPromiseRejectionTracker, nullptr) \
72 v(InspectorInstrumentation, nullptr) \
73 v(Set, nullptr) \
74 v(thisTimeValue, nullptr) \
75 v(isConstructor, nullptr) \
76 v(regExpProtoFlagsGetter, nullptr) \
77 v(regExpProtoGlobalGetter, nullptr) \
78 v(regExpProtoIgnoreCaseGetter, nullptr) \
79 v(regExpProtoMultilineGetter, nullptr) \
80 v(regExpProtoSourceGetter, nullptr) \
81 v(regExpProtoStickyGetter, nullptr) \
82 v(regExpProtoUnicodeGetter, nullptr) \
83 v(regExpBuiltinExec, nullptr) \
84 v(regExpCreate, nullptr) \
85 v(isRegExp, nullptr) \
86 v(regExpMatchFast, nullptr) \
87 v(regExpSearchFast, nullptr) \
88 v(regExpSplitFast, nullptr) \
89 v(regExpPrototypeSymbolReplace, nullptr) \
90 v(regExpTestFast, nullptr) \
91 v(stringIncludesInternal, nullptr) \
92 v(stringSplitFast, nullptr) \
93 v(stringSubstrInternal, nullptr) \
94 v(makeBoundFunction, nullptr) \
95 v(hasOwnLengthProperty, nullptr) \
96 v(dateTimeFormat, nullptr) \
97 v(webAssemblyCompileStreamingInternal, nullptr) \
98 v(webAssemblyInstantiateStreamingInternal, nullptr) \
99 v(Object, nullptr) \
100 v(Array, nullptr) \
101 v(applyFunction, nullptr) \
102 v(callFunction, nullptr) \
103
104
105#define DECLARE_LINK_TIME_CONSTANT(name, code) name,
106enum class LinkTimeConstant : int32_t {
107 JSC_FOREACH_LINK_TIME_CONSTANTS(DECLARE_LINK_TIME_CONSTANT)
108};
109#undef DECLARE_LINK_TIME_CONSTANT
110#define COUNT_LINK_TIME_CONSTANT(name, code) 1 +
111static constexpr unsigned numberOfLinkTimeConstants = JSC_FOREACH_LINK_TIME_CONSTANTS(COUNT_LINK_TIME_CONSTANT) 0;
112#undef COUNT_LINK_TIME_CONSTANT
113
114} // namespace JSC
115
116namespace WTF {
117
118class PrintStream;
119
120void printInternal(PrintStream&, JSC::LinkTimeConstant);
121
122} // namespace WTF
123