Unreviewed, rolling out r221327.
[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  * Copyright (c) 2016 Apple Inc. All rights reserved.
5  * 
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 
15  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
19  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25  * THE POSSIBILITY OF SUCH DAMAGE.
26  * 
27  */
28
29 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
30 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
31
32 #pragma once
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 class ArbitraryConditionalGuardBuiltinsWrapper : private JSC::WeakHandleOwner {
70 public:
71     explicit ArbitraryConditionalGuardBuiltinsWrapper(JSC::VM* vm)
72         : m_vm(*vm)
73         WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
74 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))
75         WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
76 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
77     {
78     }
79
80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
81     JSC::UnlinkedFunctionExecutable* name##Executable(); \
82     const JSC::SourceCode& name##Source() const { return m_##name##Source; }
83     WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
84 #undef EXPOSE_BUILTIN_EXECUTABLES
85
86     WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
87
88     void exportNames();
89
90 private:
91     JSC::VM& m_vm;
92
93     WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
94
95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
96     JSC::SourceCode m_##name##Source;\
97     JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
98     WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
99 #undef DECLARE_BUILTIN_SOURCE_MEMBERS
100
101 };
102
103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
104 inline JSC::UnlinkedFunctionExecutable* ArbitraryConditionalGuardBuiltinsWrapper::name##Executable() \
105 {\
106     if (!m_##name##Executable)\
107         m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
108     return m_##name##Executable.get();\
109 }
110 WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
111 #undef DEFINE_BUILTIN_EXECUTABLES
112
113 inline void ArbitraryConditionalGuardBuiltinsWrapper::exportNames()
114 {
115 #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
116     WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
117 #undef EXPORT_FUNCTION_NAME
118 }
119
120 } // namespace WebCore
121
122 #endif // ENABLE(STREAMS_API) || USE(CF)
123 ### End File: ArbitraryConditionalGuardBuiltins.h
124
125 ### Begin File: ArbitraryConditionalGuardBuiltins.cpp
126 /*
127  * Copyright (c) 2015 Canon Inc. All rights reserved.
128  * Copyright (c) 2016 Apple Inc. All rights reserved.
129  * 
130  * Redistribution and use in source and binary forms, with or without
131  * modification, are permitted provided that the following conditions
132  * are met:
133  * 1. Redistributions of source code must retain the above copyright
134  *    notice, this list of conditions and the following disclaimer.
135  * 2. Redistributions in binary form must reproduce the above copyright
136  *    notice, this list of conditions and the following disclaimer in the
137  *    documentation and/or other materials provided with the distribution.
138  * 
139  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
140  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
141  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
142  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
143  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
144  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
145  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
146  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
147  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
148  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
149  * THE POSSIBILITY OF SUCH DAMAGE.
150  * 
151  */
152
153 // DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
154 // builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
155
156 #include "config.h"
157 #include "ArbitraryConditionalGuardBuiltins.h"
158
159 #if ENABLE(STREAMS_API) || USE(CF)
160
161 #include "WebCoreJSClientData.h"
162 #include <heap/HeapInlines.h>
163 #include <runtime/Intrinsic.h>
164 #include <runtime/JSCJSValueInlines.h>
165 #include <runtime/JSCellInlines.h>
166 #include <runtime/StructureInlines.h>
167 #include <runtime/VM.h>
168
169 namespace WebCore {
170
171 const JSC::ConstructAbility s_arbitraryConditionalGuardIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
172 const int s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength = 70;
173 static const JSC::Intrinsic s_arbitraryConditionalGuardIsReadableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
174 const char* s_arbitraryConditionalGuardIsReadableStreamLockedCode =
175     "(function (stream)\n" \
176     "{\n" \
177     "   \"use strict\";\n" \
178     "    return !!stream.@reader;\n" \
179     "})\n" \
180 ;
181
182
183 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
184 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
185 {\
186     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
187     return clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
188 }
189 WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
190 #undef DEFINE_BUILTIN_GENERATOR
191
192
193 } // namespace WebCore
194
195 #endif // ENABLE(STREAMS_API) || USE(CF)
196
197 ### End File: ArbitraryConditionalGuardBuiltins.cpp