Unreviewed, rolling out r221327.
[WebKit-https.git] / Source / JavaScriptCore / Scripts / tests / builtins / expected / WebCore-AnotherGuardedInternalBuiltin-Separate.js-result
1 ### Begin File: AnotherGuardedInternalBuiltinBuiltins.h
2 /*
3  * Copyright (c) 2016 Apple Inc. All rights reserved.
4  * 
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24  * THE POSSIBILITY OF SUCH DAMAGE.
25  * 
26  */
27
28 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
29 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
30
31 #pragma once
32
33 #if ENABLE(FETCH_API)
34
35 #include <builtins/BuiltinUtils.h>
36 #include <bytecode/UnlinkedFunctionExecutable.h>
37 #include <runtime/Identifier.h>
38 #include <runtime/JSFunction.h>
39
40 namespace JSC {
41 class FunctionExecutable;
42 }
43
44 namespace WebCore {
45
46 /* AnotherGuardedInternalBuiltin */
47 extern const char* s_anotherGuardedInternalBuiltinLetsFetchCode;
48 extern const int s_anotherGuardedInternalBuiltinLetsFetchCodeLength;
49 extern const JSC::ConstructAbility s_anotherGuardedInternalBuiltinLetsFetchCodeConstructAbility;
50
51 #define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_DATA(macro) \
52     macro(letsFetch, anotherGuardedInternalBuiltinLetsFetch, 0) \
53
54 #define WEBCORE_BUILTIN_ANOTHERGUARDEDINTERNALBUILTIN_LETSFETCH 1
55
56 #define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \
57     macro(anotherGuardedInternalBuiltinLetsFetchCode, letsFetch, s_anotherGuardedInternalBuiltinLetsFetchCodeLength) \
58
59 #define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
60     macro(letsFetch) \
61
62 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
63     JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
64
65 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
66 #undef DECLARE_BUILTIN_GENERATOR
67
68 class AnotherGuardedInternalBuiltinBuiltinsWrapper : private JSC::WeakHandleOwner {
69 public:
70     explicit AnotherGuardedInternalBuiltinBuiltinsWrapper(JSC::VM* vm)
71         : m_vm(*vm)
72         WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
73 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))
74         WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
75 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
76     {
77     }
78
79 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
80     JSC::UnlinkedFunctionExecutable* name##Executable(); \
81     const JSC::SourceCode& name##Source() const { return m_##name##Source; }
82     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
83 #undef EXPOSE_BUILTIN_EXECUTABLES
84
85     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
86
87     void exportNames();
88
89 private:
90     JSC::VM& m_vm;
91
92     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
93
94 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
95     JSC::SourceCode m_##name##Source;\
96     JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
97     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
98 #undef DECLARE_BUILTIN_SOURCE_MEMBERS
99
100 };
101
102 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
103 inline JSC::UnlinkedFunctionExecutable* AnotherGuardedInternalBuiltinBuiltinsWrapper::name##Executable() \
104 {\
105     if (!m_##name##Executable)\
106         m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
107     return m_##name##Executable.get();\
108 }
109 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
110 #undef DEFINE_BUILTIN_EXECUTABLES
111
112 inline void AnotherGuardedInternalBuiltinBuiltinsWrapper::exportNames()
113 {
114 #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
115     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
116 #undef EXPORT_FUNCTION_NAME
117 }
118
119 class AnotherGuardedInternalBuiltinBuiltinFunctions {
120 public:
121     explicit AnotherGuardedInternalBuiltinBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
122
123     void init(JSC::JSGlobalObject&);
124     void visit(JSC::SlotVisitor&);
125
126 public:
127     JSC::VM& m_vm;
128
129 #define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
130     JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
131     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
132 #undef DECLARE_BUILTIN_SOURCE_MEMBERS
133 };
134
135 inline void AnotherGuardedInternalBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
136 {
137 #define EXPORT_FUNCTION(codeName, functionName, length)\
138     m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
139     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION)
140 #undef EXPORT_FUNCTION
141 }
142
143 inline void AnotherGuardedInternalBuiltinBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
144 {
145 #define VISIT_FUNCTION(name) visitor.append(m_##name##Function);
146     WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
147 #undef VISIT_FUNCTION
148 }
149
150
151 } // namespace WebCore
152
153 #endif // ENABLE(FETCH_API)
154 ### End File: AnotherGuardedInternalBuiltinBuiltins.h
155
156 ### Begin File: AnotherGuardedInternalBuiltinBuiltins.cpp
157 /*
158  * Copyright (c) 2016 Apple Inc. All rights reserved.
159  * 
160  * Redistribution and use in source and binary forms, with or without
161  * modification, are permitted provided that the following conditions
162  * are met:
163  * 1. Redistributions of source code must retain the above copyright
164  *    notice, this list of conditions and the following disclaimer.
165  * 2. Redistributions in binary form must reproduce the above copyright
166  *    notice, this list of conditions and the following disclaimer in the
167  *    documentation and/or other materials provided with the distribution.
168  * 
169  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
170  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
171  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
172  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
173  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
174  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
175  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
176  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
177  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
178  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
179  * THE POSSIBILITY OF SUCH DAMAGE.
180  * 
181  */
182
183 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
184 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
185
186 #include "config.h"
187 #include "AnotherGuardedInternalBuiltinBuiltins.h"
188
189 #if ENABLE(FETCH_API)
190
191 #include "WebCoreJSClientData.h"
192 #include <heap/HeapInlines.h>
193 #include <runtime/Intrinsic.h>
194 #include <runtime/JSCJSValueInlines.h>
195 #include <runtime/JSCellInlines.h>
196 #include <runtime/StructureInlines.h>
197 #include <runtime/VM.h>
198
199 namespace WebCore {
200
201 const JSC::ConstructAbility s_anotherGuardedInternalBuiltinLetsFetchCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
202 const int s_anotherGuardedInternalBuiltinLetsFetchCodeLength = 82;
203 static const JSC::Intrinsic s_anotherGuardedInternalBuiltinLetsFetchCodeIntrinsic = JSC::NoIntrinsic;
204 const char* s_anotherGuardedInternalBuiltinLetsFetchCode =
205     "(function ()\n" \
206     "{\n" \
207     "   \"use strict\";\n" \
208     "    return @fetchRequest(new @Request(\"yes\"));\n" \
209     "})\n" \
210 ;
211
212
213 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
214 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
215 {\
216     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
217     return clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
218 }
219 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
220 #undef DEFINE_BUILTIN_GENERATOR
221
222
223 } // namespace WebCore
224
225 #endif // ENABLE(FETCH_API)
226
227 ### End File: AnotherGuardedInternalBuiltinBuiltins.cpp