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