File: | var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/js/RootingAPI.h |
Warning: | line 1223, column 5 Dereference of null pointer (loaded from field 'stack') |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* THIS FILE IS AUTOGENERATED FROM TestExampleGen.webidl BY Codegen.py - DO NOT EDIT */ | |||
2 | ||||
3 | #include <type_traits> | |||
4 | #include "CustomEventBinding.h" | |||
5 | #include "EventBinding.h" | |||
6 | #include "EventHandlerBinding.h" | |||
7 | #include "MainThreadUtils.h" | |||
8 | #include "TestBindingHeader.h" | |||
9 | #include "TestCodeGenBinding.h" | |||
10 | #include "TestDictionaryBinding.h" | |||
11 | #include "TestExampleGenBinding.h" | |||
12 | #include "TestExampleInterface-example.h" | |||
13 | #include "TestExampleProxyInterface-example.h" | |||
14 | #include "TestExampleThrowingConstructorInterface-example.h" | |||
15 | #include "TestExampleWorkerInterface-example.h" | |||
16 | #include "WrapperFactory.h" | |||
17 | #include "XrayWrapper.h" | |||
18 | #include "js/Array.h" | |||
19 | #include "js/CallAndConstruct.h" | |||
20 | #include "js/Exception.h" | |||
21 | #include "js/ForOfIterator.h" | |||
22 | #include "js/MapAndSet.h" | |||
23 | #include "js/Object.h" | |||
24 | #include "js/PropertyAndElement.h" | |||
25 | #include "js/PropertyDescriptor.h" | |||
26 | #include "js/experimental/JitInfo.h" | |||
27 | #include "js/shadow/Object.h" | |||
28 | #include "jsfriendapi.h" | |||
29 | #include "mozilla/Atomics.h" | |||
30 | #include "mozilla/BasePrincipal.h" | |||
31 | #include "mozilla/FloatingPoint.h" | |||
32 | #include "mozilla/OriginTrials.h" | |||
33 | #include "mozilla/OwningNonNull.h" | |||
34 | #include "mozilla/ProfilerLabels.h" | |||
35 | #include "mozilla/dom/BindingCallContext.h" | |||
36 | #include "mozilla/dom/BindingUtils.h" | |||
37 | #include "mozilla/dom/CanvasGradient.h" | |||
38 | #include "mozilla/dom/CanvasPattern.h" | |||
39 | #include "mozilla/dom/CustomElementRegistry.h" | |||
40 | #include "mozilla/dom/DOMJSClass.h" | |||
41 | #include "mozilla/dom/DOMJSProxyHandler.h" | |||
42 | #include "mozilla/dom/DocGroup.h" | |||
43 | #include "mozilla/dom/Document.h" | |||
44 | #include "mozilla/dom/Element.h" | |||
45 | #include "mozilla/dom/ImageData.h" | |||
46 | #include "mozilla/dom/NonRefcountedDOMObject.h" | |||
47 | #include "mozilla/dom/Nullable.h" | |||
48 | #include "mozilla/dom/ObservableArrayProxyHandler.h" | |||
49 | #include "mozilla/dom/PrimitiveConversions.h" | |||
50 | #include "mozilla/dom/Promise.h" | |||
51 | #include "mozilla/dom/ProxyHandlerUtils.h" | |||
52 | #include "mozilla/dom/Record.h" | |||
53 | #include "mozilla/dom/RootedDictionary.h" | |||
54 | #include "mozilla/dom/ToJSValue.h" | |||
55 | #include "mozilla/dom/TypedArray.h" | |||
56 | #include "mozilla/dom/UnionTypes.h" | |||
57 | #include "mozilla/dom/WebIDLPrefs.h" | |||
58 | #include "mozilla/dom/XrayExpandoClass.h" | |||
59 | #include "nsContentUtils.h" | |||
60 | #include "nsIContent.h" | |||
61 | #include "nsJSPrincipals.h" | |||
62 | #include "nsJSUtils.h" | |||
63 | ||||
64 | namespace mozilla::dom { | |||
65 | ||||
66 | namespace binding_detail {}; // Just to make sure it's known as a namespace | |||
67 | using namespace mozilla::dom::binding_detail; | |||
68 | ||||
69 | ||||
70 | namespace TestExampleInterface_Binding { | |||
71 | ||||
72 | static bool | |||
73 | _Example(JSContext* cx_, unsigned argc, JS::Value* vp) | |||
74 | { | |||
75 | BindingCallContext cx(cx_, "Example constructor"); | |||
76 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject78( cx, "Example", "constructor" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
77 | "Example", "constructor", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject78( cx, "Example", "constructor" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
78 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject78( cx, "Example", "constructor" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
79 | ||||
80 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); | |||
81 | JS::Rooted<JSObject*> obj(cx, &args.callee()); | |||
82 | if (!args.isConstructing()) { | |||
83 | return ThrowConstructorWithoutNew(cx, "Example"); | |||
84 | } | |||
85 | ||||
86 | JS::Rooted<JSObject*> desiredProto(cx); | |||
87 | if (!GetDesiredProto(cx, args, | |||
88 | prototypes::id::TestExampleInterface, | |||
89 | CreateInterfaceObjects, | |||
90 | &desiredProto)) { | |||
91 | return false; | |||
92 | } | |||
93 | ||||
94 | unsigned argcount = std::min(args.length(), 1u); | |||
95 | switch (argcount) { | |||
96 | case 0: { | |||
97 | GlobalObject global(cx, obj); | |||
98 | if (global.Failed()) { | |||
99 | return false; | |||
100 | } | |||
101 | ||||
102 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | |||
103 | Maybe<JSAutoRealm> ar; | |||
104 | if (objIsXray) { | |||
105 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | |||
106 | // we know Xrays have no dynamic unwrap behavior. | |||
107 | obj = js::CheckedUnwrapStatic(obj); | |||
108 | if (!obj) { | |||
109 | return false; | |||
110 | } | |||
111 | ar.emplace(cx, obj); | |||
112 | if (!JS_WrapObject(cx, &desiredProto)) { | |||
113 | return false; | |||
114 | } | |||
115 | } | |||
116 | FastErrorResult rv; | |||
117 | auto result(StrongOrRawPtr<mozilla::dom::TestExampleInterface>(mozilla::dom::TestExampleInterface::Example(global, rv))); | |||
118 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Example constructor"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "Example constructor" )), 0))) { | |||
119 | return false; | |||
120 | } | |||
121 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 121); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 121; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
122 | static_assert(!std::is_pointer_v<decltype(result)>, | |||
123 | "NewObject implies that we need to keep the object alive with a strong reference."); | |||
124 | if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) { | |||
125 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 125); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 125; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
126 | return false; | |||
127 | } | |||
128 | return true; | |||
129 | break; | |||
130 | } | |||
131 | case 1: { | |||
132 | GlobalObject global(cx, obj); | |||
133 | if (global.Failed()) { | |||
134 | return false; | |||
135 | } | |||
136 | ||||
137 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | |||
138 | binding_detail::FakeString<char16_t> arg0; | |||
139 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | |||
140 | return false; | |||
141 | } | |||
142 | Maybe<JSAutoRealm> ar; | |||
143 | if (objIsXray) { | |||
144 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | |||
145 | // we know Xrays have no dynamic unwrap behavior. | |||
146 | obj = js::CheckedUnwrapStatic(obj); | |||
147 | if (!obj) { | |||
148 | return false; | |||
149 | } | |||
150 | ar.emplace(cx, obj); | |||
151 | if (!JS_WrapObject(cx, &desiredProto)) { | |||
152 | return false; | |||
153 | } | |||
154 | } | |||
155 | FastErrorResult rv; | |||
156 | auto result(StrongOrRawPtr<mozilla::dom::TestExampleInterface>(mozilla::dom::TestExampleInterface::Example(global, NonNullHelper(Constify(arg0)), rv))); | |||
157 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Example constructor"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "Example constructor" )), 0))) { | |||
158 | return false; | |||
159 | } | |||
160 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 160); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 160; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
161 | static_assert(!std::is_pointer_v<decltype(result)>, | |||
162 | "NewObject implies that we need to keep the object alive with a strong reference."); | |||
163 | if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) { | |||
164 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 164); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 164; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
165 | return false; | |||
166 | } | |||
167 | return true; | |||
168 | break; | |||
169 | } | |||
170 | default: { | |||
171 | // Using nsPrintfCString here would require including that | |||
172 | // header. Let's not worry about it. | |||
173 | nsAutoCString argCountStr; | |||
174 | argCountStr.AppendPrintf("%u", args.length()); | |||
175 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | |||
176 | } | |||
177 | } | |||
178 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestExampleGenBinding.cpp", 178); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 178; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | |||
179 | return false; | |||
180 | } | |||
181 | ||||
182 | static bool | |||
183 | _Example2(JSContext* cx_, unsigned argc, JS::Value* vp) | |||
184 | { | |||
185 | BindingCallContext cx(cx_, "Example2 constructor"); | |||
186 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject188( cx, "Example2", "constructor" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
187 | "Example2", "constructor", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject188( cx, "Example2", "constructor" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
188 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject188( cx, "Example2", "constructor" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
189 | ||||
190 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); | |||
191 | JS::Rooted<JSObject*> obj(cx, &args.callee()); | |||
192 | if (!args.isConstructing()) { | |||
193 | return ThrowConstructorWithoutNew(cx, "Example2"); | |||
194 | } | |||
195 | ||||
196 | JS::Rooted<JSObject*> desiredProto(cx); | |||
197 | if (!GetDesiredProto(cx, args, | |||
198 | prototypes::id::TestExampleInterface, | |||
199 | CreateInterfaceObjects, | |||
200 | &desiredProto)) { | |||
201 | return false; | |||
202 | } | |||
203 | ||||
204 | unsigned argcount = std::min(args.length(), 8u); | |||
205 | switch (argcount) { | |||
206 | case 1: { | |||
207 | GlobalObject global(cx, obj); | |||
208 | if (global.Failed()) { | |||
209 | return false; | |||
210 | } | |||
211 | ||||
212 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | |||
213 | LongOrStringAnyRecord arg0; | |||
214 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
215 | return false; | |||
216 | } | |||
217 | Maybe<JSAutoRealm> ar; | |||
218 | if (objIsXray) { | |||
219 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | |||
220 | // we know Xrays have no dynamic unwrap behavior. | |||
221 | obj = js::CheckedUnwrapStatic(obj); | |||
222 | if (!obj) { | |||
223 | return false; | |||
224 | } | |||
225 | ar.emplace(cx, obj); | |||
226 | if (!JS_WrapObject(cx, &desiredProto)) { | |||
227 | return false; | |||
228 | } | |||
229 | if (arg0.IsStringAnyRecord()) { | |||
230 | for (auto& mapEntry0 : arg0.GetAsStringAnyRecord().Entries()) { | |||
231 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&mapEntry0.mValue))) { | |||
232 | return false; | |||
233 | } | |||
234 | } | |||
235 | } | |||
236 | } | |||
237 | FastErrorResult rv; | |||
238 | auto result(StrongOrRawPtr<mozilla::dom::TestExampleInterface>(mozilla::dom::TestExampleInterface::Example2(global, Constify(arg0), rv))); | |||
239 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Example2 constructor"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "Example2 constructor" )), 0))) { | |||
240 | return false; | |||
241 | } | |||
242 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 242); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 242; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
243 | static_assert(!std::is_pointer_v<decltype(result)>, | |||
244 | "NewObject implies that we need to keep the object alive with a strong reference."); | |||
245 | if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) { | |||
246 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 246); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 246; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
247 | return false; | |||
248 | } | |||
249 | return true; | |||
250 | break; | |||
251 | } | |||
252 | case 5: { | |||
253 | [[fallthrough]]; | |||
254 | } | |||
255 | case 6: { | |||
256 | [[fallthrough]]; | |||
257 | } | |||
258 | case 7: { | |||
259 | [[fallthrough]]; | |||
260 | } | |||
261 | case 8: { | |||
262 | GlobalObject global(cx, obj); | |||
263 | if (global.Failed()) { | |||
264 | return false; | |||
265 | } | |||
266 | ||||
267 | bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj); | |||
268 | RootedDictionary<binding_detail::FastDictForConstructor> arg0(cx); | |||
269 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
270 | return false; | |||
271 | } | |||
272 | JS::Rooted<JS::Value> arg1(cx); | |||
273 | arg1 = args[1]; | |||
274 | JS::Rooted<JSObject*> arg2(cx); | |||
275 | if (args[2].isObject()) { | |||
276 | arg2 = &args[2].toObject(); | |||
277 | } else { | |||
278 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 3"); | |||
279 | return false; | |||
280 | } | |||
281 | JS::Rooted<JSObject*> arg3(cx); | |||
282 | if (args[3].isObject()) { | |||
283 | arg3 = &args[3].toObject(); | |||
284 | } else if (args[3].isNullOrUndefined()) { | |||
285 | arg3 = nullptr; | |||
286 | } else { | |||
287 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 4"); | |||
288 | return false; | |||
289 | } | |||
290 | binding_detail::AutoSequence<Dict> arg4; | |||
291 | SequenceRooter<Dict> arg4_holder(cx, &arg4); | |||
292 | if (args[4].isObject()) { | |||
293 | JS::ForOfIterator iter(cx); | |||
294 | if (!iter.init(args[4], JS::ForOfIterator::AllowNonIterable)) { | |||
295 | return false; | |||
296 | } | |||
297 | if (!iter.valueIsIterable()) { | |||
298 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 5", "sequence"); | |||
299 | return false; | |||
300 | } | |||
301 | binding_detail::AutoSequence<Dict> &arr = arg4; | |||
302 | JS::Rooted<JS::Value> temp(cx); | |||
303 | while (true) { | |||
304 | bool done; | |||
305 | if (!iter.next(&temp, &done)) { | |||
306 | return false; | |||
307 | } | |||
308 | if (done) { | |||
309 | break; | |||
310 | } | |||
311 | Dict* slotPtr = arr.AppendElement(mozilla::fallible); | |||
312 | if (!slotPtr) { | |||
313 | JS_ReportOutOfMemory(cx); | |||
314 | return false; | |||
315 | } | |||
316 | Dict& slot = *slotPtr; | |||
317 | if (!slot.Init(cx, temp, "Element of argument 5", false)) { | |||
318 | return false; | |||
319 | } | |||
320 | } | |||
321 | } else { | |||
322 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 5", "sequence"); | |||
323 | return false; | |||
324 | } | |||
325 | JS::Rooted<JS::Value> arg5(cx); | |||
326 | if (args.hasDefined(5)) { | |||
327 | arg5 = args[5]; | |||
328 | } else { | |||
329 | arg5 = JS::UndefinedValue(); | |||
330 | } | |||
331 | Optional<JS::Handle<JSObject*>> arg6; | |||
332 | if (args.hasDefined(6)) { | |||
333 | arg6.Construct(cx); | |||
334 | if (args[6].isObject()) { | |||
335 | arg6.Value() = &args[6].toObject(); | |||
336 | } else { | |||
337 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 7"); | |||
338 | return false; | |||
339 | } | |||
340 | } | |||
341 | Optional<JS::Handle<JSObject*>> arg7; | |||
342 | if (args.hasDefined(7)) { | |||
343 | arg7.Construct(cx); | |||
344 | if (args[7].isObject()) { | |||
345 | arg7.Value() = &args[7].toObject(); | |||
346 | } else if (args[7].isNullOrUndefined()) { | |||
347 | arg7.Value() = nullptr; | |||
348 | } else { | |||
349 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 8"); | |||
350 | return false; | |||
351 | } | |||
352 | } | |||
353 | Maybe<JSAutoRealm> ar; | |||
354 | if (objIsXray) { | |||
355 | // Since our object is an Xray, we can just CheckedUnwrapStatic: | |||
356 | // we know Xrays have no dynamic unwrap behavior. | |||
357 | obj = js::CheckedUnwrapStatic(obj); | |||
358 | if (!obj) { | |||
359 | return false; | |||
360 | } | |||
361 | ar.emplace(cx, obj); | |||
362 | if (!JS_WrapObject(cx, &desiredProto)) { | |||
363 | return false; | |||
364 | } | |||
365 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mAny1))) { | |||
366 | return false; | |||
367 | } | |||
368 | if (arg0.mDict.WasPassed()) { | |||
369 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mAnotherAny))) { | |||
370 | return false; | |||
371 | } | |||
372 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mAnotherObj))) { | |||
373 | return false; | |||
374 | } | |||
375 | if (arg0.mDict.Value().mArrayBuffer.WasPassed()) { | |||
376 | if (!arg0.mDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | |||
377 | return false; | |||
378 | } | |||
379 | } | |||
380 | if (arg0.mDict.Value().mCustomEventInit.WasPassed()) { | |||
381 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mCustomEventInit.Value().mDetail))) { | |||
382 | return false; | |||
383 | } | |||
384 | } | |||
385 | if (arg0.mDict.Value().mDictionaryTypedef.WasPassed()) { | |||
386 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mDictionaryTypedef.Value().mDetail))) { | |||
387 | return false; | |||
388 | } | |||
389 | } | |||
390 | if (arg0.mDict.Value().mEventInitOrLong2.WasPassed()) { | |||
391 | if (arg0.mDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) { | |||
392 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | |||
393 | return false; | |||
394 | } | |||
395 | } | |||
396 | } | |||
397 | if (arg0.mDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | |||
398 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | |||
399 | return false; | |||
400 | } | |||
401 | } | |||
402 | if (arg0.mDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | |||
403 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | |||
404 | return false; | |||
405 | } | |||
406 | } | |||
407 | if (!arg0.mDict.Value().mFloat64Array.IsNull()) { | |||
408 | if (!arg0.mDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | |||
409 | return false; | |||
410 | } | |||
411 | } | |||
412 | if (arg0.mDict.Value().mNullableArrayBuffer.WasPassed()) { | |||
413 | if (!arg0.mDict.Value().mNullableArrayBuffer.Value().IsNull()) { | |||
414 | if (!arg0.mDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | |||
415 | return false; | |||
416 | } | |||
417 | } | |||
418 | } | |||
419 | if (arg0.mDict.Value().mNullableEventInitOrLong2.WasPassed()) { | |||
420 | if (!arg0.mDict.Value().mNullableEventInitOrLong2.Value().IsNull()) { | |||
421 | if (arg0.mDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | |||
422 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | |||
423 | return false; | |||
424 | } | |||
425 | } | |||
426 | } | |||
427 | } | |||
428 | if (!arg0.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | |||
429 | if (arg0.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | |||
430 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | |||
431 | return false; | |||
432 | } | |||
433 | } | |||
434 | } | |||
435 | if (!arg0.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | |||
436 | if (arg0.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | |||
437 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | |||
438 | return false; | |||
439 | } | |||
440 | } | |||
441 | } | |||
442 | if (arg0.mDict.Value().mNullableObjectSequenceOrLong.WasPassed()) { | |||
443 | if (!arg0.mDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) { | |||
444 | if (arg0.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | |||
445 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
446 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) { | |||
447 | return false; | |||
448 | } | |||
449 | } | |||
450 | } | |||
451 | } | |||
452 | } | |||
453 | if (!arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | |||
454 | if (arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | |||
455 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
456 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) { | |||
457 | return false; | |||
458 | } | |||
459 | } | |||
460 | } | |||
461 | } | |||
462 | if (!arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | |||
463 | if (arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | |||
464 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
465 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) { | |||
466 | return false; | |||
467 | } | |||
468 | } | |||
469 | } | |||
470 | } | |||
471 | if (arg0.mDict.Value().mObjectOrLong.WasPassed()) { | |||
472 | if (arg0.mDict.Value().mObjectOrLong.Value().IsObject()) { | |||
473 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mObjectOrLong.Value().GetAsObject()))) { | |||
474 | return false; | |||
475 | } | |||
476 | } | |||
477 | } | |||
478 | if (arg0.mDict.Value().mObjectSequenceOrLong.WasPassed()) { | |||
479 | if (arg0.mDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) { | |||
480 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
481 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) { | |||
482 | return false; | |||
483 | } | |||
484 | } | |||
485 | } | |||
486 | } | |||
487 | if (arg0.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | |||
488 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) { | |||
489 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) { | |||
490 | return false; | |||
491 | } | |||
492 | } | |||
493 | } | |||
494 | if (arg0.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | |||
495 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) { | |||
496 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) { | |||
497 | return false; | |||
498 | } | |||
499 | } | |||
500 | } | |||
501 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mRequiredObject))) { | |||
502 | return false; | |||
503 | } | |||
504 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mSomeAny))) { | |||
505 | return false; | |||
506 | } | |||
507 | if (arg0.mDict.Value().mSomeObj.WasPassed()) { | |||
508 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict.Value().mSomeObj.Value()))) { | |||
509 | return false; | |||
510 | } | |||
511 | } | |||
512 | if (arg0.mDict.Value().mUint8Array.WasPassed()) { | |||
513 | if (!arg0.mDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) { | |||
514 | return false; | |||
515 | } | |||
516 | } | |||
517 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict.Value().mParentAny))) { | |||
518 | return false; | |||
519 | } | |||
520 | } | |||
521 | if (arg0.mDict2.WasPassed()) { | |||
522 | if (arg0.mDict2.Value().mMemberDict.WasPassed()) { | |||
523 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mAnotherAny))) { | |||
524 | return false; | |||
525 | } | |||
526 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mAnotherObj))) { | |||
527 | return false; | |||
528 | } | |||
529 | if (arg0.mDict2.Value().mMemberDict.Value().mArrayBuffer.WasPassed()) { | |||
530 | if (!arg0.mDict2.Value().mMemberDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | |||
531 | return false; | |||
532 | } | |||
533 | } | |||
534 | if (arg0.mDict2.Value().mMemberDict.Value().mCustomEventInit.WasPassed()) { | |||
535 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mCustomEventInit.Value().mDetail))) { | |||
536 | return false; | |||
537 | } | |||
538 | } | |||
539 | if (arg0.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.WasPassed()) { | |||
540 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.Value().mDetail))) { | |||
541 | return false; | |||
542 | } | |||
543 | } | |||
544 | if (arg0.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.WasPassed()) { | |||
545 | if (arg0.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) { | |||
546 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | |||
547 | return false; | |||
548 | } | |||
549 | } | |||
550 | } | |||
551 | if (arg0.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | |||
552 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | |||
553 | return false; | |||
554 | } | |||
555 | } | |||
556 | if (arg0.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | |||
557 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | |||
558 | return false; | |||
559 | } | |||
560 | } | |||
561 | if (!arg0.mDict2.Value().mMemberDict.Value().mFloat64Array.IsNull()) { | |||
562 | if (!arg0.mDict2.Value().mMemberDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | |||
563 | return false; | |||
564 | } | |||
565 | } | |||
566 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.WasPassed()) { | |||
567 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().IsNull()) { | |||
568 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | |||
569 | return false; | |||
570 | } | |||
571 | } | |||
572 | } | |||
573 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.WasPassed()) { | |||
574 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().IsNull()) { | |||
575 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | |||
576 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | |||
577 | return false; | |||
578 | } | |||
579 | } | |||
580 | } | |||
581 | } | |||
582 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | |||
583 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | |||
584 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | |||
585 | return false; | |||
586 | } | |||
587 | } | |||
588 | } | |||
589 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | |||
590 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | |||
591 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | |||
592 | return false; | |||
593 | } | |||
594 | } | |||
595 | } | |||
596 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.WasPassed()) { | |||
597 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) { | |||
598 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | |||
599 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
600 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) { | |||
601 | return false; | |||
602 | } | |||
603 | } | |||
604 | } | |||
605 | } | |||
606 | } | |||
607 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | |||
608 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | |||
609 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
610 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) { | |||
611 | return false; | |||
612 | } | |||
613 | } | |||
614 | } | |||
615 | } | |||
616 | if (!arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | |||
617 | if (arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | |||
618 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
619 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) { | |||
620 | return false; | |||
621 | } | |||
622 | } | |||
623 | } | |||
624 | } | |||
625 | if (arg0.mDict2.Value().mMemberDict.Value().mObjectOrLong.WasPassed()) { | |||
626 | if (arg0.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().IsObject()) { | |||
627 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().GetAsObject()))) { | |||
628 | return false; | |||
629 | } | |||
630 | } | |||
631 | } | |||
632 | if (arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.WasPassed()) { | |||
633 | if (arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) { | |||
634 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) { | |||
635 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) { | |||
636 | return false; | |||
637 | } | |||
638 | } | |||
639 | } | |||
640 | } | |||
641 | if (arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | |||
642 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) { | |||
643 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) { | |||
644 | return false; | |||
645 | } | |||
646 | } | |||
647 | } | |||
648 | if (arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | |||
649 | for (uint32_t indexName0 = 0; indexName0 < arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) { | |||
650 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) { | |||
651 | return false; | |||
652 | } | |||
653 | } | |||
654 | } | |||
655 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mRequiredObject))) { | |||
656 | return false; | |||
657 | } | |||
658 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mSomeAny))) { | |||
659 | return false; | |||
660 | } | |||
661 | if (arg0.mDict2.Value().mMemberDict.Value().mSomeObj.WasPassed()) { | |||
662 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mSomeObj.Value()))) { | |||
663 | return false; | |||
664 | } | |||
665 | } | |||
666 | if (arg0.mDict2.Value().mMemberDict.Value().mUint8Array.WasPassed()) { | |||
667 | if (!arg0.mDict2.Value().mMemberDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) { | |||
668 | return false; | |||
669 | } | |||
670 | } | |||
671 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mDict2.Value().mMemberDict.Value().mParentAny))) { | |||
672 | return false; | |||
673 | } | |||
674 | } | |||
675 | } | |||
676 | if (arg0.mObj1.WasPassed()) { | |||
677 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mObj1.Value()))) { | |||
678 | return false; | |||
679 | } | |||
680 | } | |||
681 | if (arg0.mObj2.WasPassed()) { | |||
682 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mObj2.Value()))) { | |||
683 | return false; | |||
684 | } | |||
685 | } | |||
686 | if (arg0.mSeq1.WasPassed()) { | |||
687 | for (uint32_t indexName0 = 0; indexName0 < arg0.mSeq1.Value().Length(); ++indexName0) { | |||
688 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mAnotherAny))) { | |||
689 | return false; | |||
690 | } | |||
691 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mAnotherObj))) { | |||
692 | return false; | |||
693 | } | |||
694 | if (arg0.mSeq1.Value()[indexName0].mArrayBuffer.WasPassed()) { | |||
695 | if (!arg0.mSeq1.Value()[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | |||
696 | return false; | |||
697 | } | |||
698 | } | |||
699 | if (arg0.mSeq1.Value()[indexName0].mCustomEventInit.WasPassed()) { | |||
700 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mCustomEventInit.Value().mDetail))) { | |||
701 | return false; | |||
702 | } | |||
703 | } | |||
704 | if (arg0.mSeq1.Value()[indexName0].mDictionaryTypedef.WasPassed()) { | |||
705 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mDictionaryTypedef.Value().mDetail))) { | |||
706 | return false; | |||
707 | } | |||
708 | } | |||
709 | if (arg0.mSeq1.Value()[indexName0].mEventInitOrLong2.WasPassed()) { | |||
710 | if (arg0.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) { | |||
711 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | |||
712 | return false; | |||
713 | } | |||
714 | } | |||
715 | } | |||
716 | if (arg0.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | |||
717 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | |||
718 | return false; | |||
719 | } | |||
720 | } | |||
721 | if (arg0.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | |||
722 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | |||
723 | return false; | |||
724 | } | |||
725 | } | |||
726 | if (!arg0.mSeq1.Value()[indexName0].mFloat64Array.IsNull()) { | |||
727 | if (!arg0.mSeq1.Value()[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | |||
728 | return false; | |||
729 | } | |||
730 | } | |||
731 | if (arg0.mSeq1.Value()[indexName0].mNullableArrayBuffer.WasPassed()) { | |||
732 | if (!arg0.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().IsNull()) { | |||
733 | if (!arg0.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | |||
734 | return false; | |||
735 | } | |||
736 | } | |||
737 | } | |||
738 | if (arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.WasPassed()) { | |||
739 | if (!arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().IsNull()) { | |||
740 | if (arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | |||
741 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | |||
742 | return false; | |||
743 | } | |||
744 | } | |||
745 | } | |||
746 | } | |||
747 | if (!arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | |||
748 | if (arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | |||
749 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | |||
750 | return false; | |||
751 | } | |||
752 | } | |||
753 | } | |||
754 | if (!arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | |||
755 | if (arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | |||
756 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | |||
757 | return false; | |||
758 | } | |||
759 | } | |||
760 | } | |||
761 | if (arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.WasPassed()) { | |||
762 | if (!arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) { | |||
763 | if (arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | |||
764 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
765 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) { | |||
766 | return false; | |||
767 | } | |||
768 | } | |||
769 | } | |||
770 | } | |||
771 | } | |||
772 | if (!arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | |||
773 | if (arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | |||
774 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
775 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) { | |||
776 | return false; | |||
777 | } | |||
778 | } | |||
779 | } | |||
780 | } | |||
781 | if (!arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | |||
782 | if (arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | |||
783 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
784 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) { | |||
785 | return false; | |||
786 | } | |||
787 | } | |||
788 | } | |||
789 | } | |||
790 | if (arg0.mSeq1.Value()[indexName0].mObjectOrLong.WasPassed()) { | |||
791 | if (arg0.mSeq1.Value()[indexName0].mObjectOrLong.Value().IsObject()) { | |||
792 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mObjectOrLong.Value().GetAsObject()))) { | |||
793 | return false; | |||
794 | } | |||
795 | } | |||
796 | } | |||
797 | if (arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLong.WasPassed()) { | |||
798 | if (arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) { | |||
799 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
800 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) { | |||
801 | return false; | |||
802 | } | |||
803 | } | |||
804 | } | |||
805 | } | |||
806 | if (arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | |||
807 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) { | |||
808 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) { | |||
809 | return false; | |||
810 | } | |||
811 | } | |||
812 | } | |||
813 | if (arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | |||
814 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) { | |||
815 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) { | |||
816 | return false; | |||
817 | } | |||
818 | } | |||
819 | } | |||
820 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mRequiredObject))) { | |||
821 | return false; | |||
822 | } | |||
823 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mSomeAny))) { | |||
824 | return false; | |||
825 | } | |||
826 | if (arg0.mSeq1.Value()[indexName0].mSomeObj.WasPassed()) { | |||
827 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mSomeObj.Value()))) { | |||
828 | return false; | |||
829 | } | |||
830 | } | |||
831 | if (arg0.mSeq1.Value()[indexName0].mUint8Array.WasPassed()) { | |||
832 | if (!arg0.mSeq1.Value()[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | |||
833 | return false; | |||
834 | } | |||
835 | } | |||
836 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq1.Value()[indexName0].mParentAny))) { | |||
837 | return false; | |||
838 | } | |||
839 | } | |||
840 | } | |||
841 | if (arg0.mSeq2.WasPassed()) { | |||
842 | if (!arg0.mSeq2.Value().IsNull()) { | |||
843 | for (uint32_t indexName0 = 0; indexName0 < arg0.mSeq2.Value().Value().Length(); ++indexName0) { | |||
844 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq2.Value().Value()[indexName0].Length(); ++indexName1) { | |||
845 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mAnotherAny))) { | |||
846 | return false; | |||
847 | } | |||
848 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mAnotherObj))) { | |||
849 | return false; | |||
850 | } | |||
851 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.WasPassed()) { | |||
852 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | |||
853 | return false; | |||
854 | } | |||
855 | } | |||
856 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.WasPassed()) { | |||
857 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.Value().mDetail))) { | |||
858 | return false; | |||
859 | } | |||
860 | } | |||
861 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.WasPassed()) { | |||
862 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.Value().mDetail))) { | |||
863 | return false; | |||
864 | } | |||
865 | } | |||
866 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.WasPassed()) { | |||
867 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) { | |||
868 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | |||
869 | return false; | |||
870 | } | |||
871 | } | |||
872 | } | |||
873 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | |||
874 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | |||
875 | return false; | |||
876 | } | |||
877 | } | |||
878 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | |||
879 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | |||
880 | return false; | |||
881 | } | |||
882 | } | |||
883 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.IsNull()) { | |||
884 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | |||
885 | return false; | |||
886 | } | |||
887 | } | |||
888 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.WasPassed()) { | |||
889 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().IsNull()) { | |||
890 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | |||
891 | return false; | |||
892 | } | |||
893 | } | |||
894 | } | |||
895 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.WasPassed()) { | |||
896 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().IsNull()) { | |||
897 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | |||
898 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | |||
899 | return false; | |||
900 | } | |||
901 | } | |||
902 | } | |||
903 | } | |||
904 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | |||
905 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | |||
906 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | |||
907 | return false; | |||
908 | } | |||
909 | } | |||
910 | } | |||
911 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | |||
912 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | |||
913 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | |||
914 | return false; | |||
915 | } | |||
916 | } | |||
917 | } | |||
918 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.WasPassed()) { | |||
919 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) { | |||
920 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | |||
921 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
922 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) { | |||
923 | return false; | |||
924 | } | |||
925 | } | |||
926 | } | |||
927 | } | |||
928 | } | |||
929 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | |||
930 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | |||
931 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
932 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) { | |||
933 | return false; | |||
934 | } | |||
935 | } | |||
936 | } | |||
937 | } | |||
938 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | |||
939 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | |||
940 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
941 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) { | |||
942 | return false; | |||
943 | } | |||
944 | } | |||
945 | } | |||
946 | } | |||
947 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.WasPassed()) { | |||
948 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().IsObject()) { | |||
949 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().GetAsObject()))) { | |||
950 | return false; | |||
951 | } | |||
952 | } | |||
953 | } | |||
954 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.WasPassed()) { | |||
955 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) { | |||
956 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
957 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) { | |||
958 | return false; | |||
959 | } | |||
960 | } | |||
961 | } | |||
962 | } | |||
963 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | |||
964 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) { | |||
965 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) { | |||
966 | return false; | |||
967 | } | |||
968 | } | |||
969 | } | |||
970 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | |||
971 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) { | |||
972 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) { | |||
973 | return false; | |||
974 | } | |||
975 | } | |||
976 | } | |||
977 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mRequiredObject))) { | |||
978 | return false; | |||
979 | } | |||
980 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mSomeAny))) { | |||
981 | return false; | |||
982 | } | |||
983 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.WasPassed()) { | |||
984 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.Value()))) { | |||
985 | return false; | |||
986 | } | |||
987 | } | |||
988 | if (arg0.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.WasPassed()) { | |||
989 | if (!arg0.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | |||
990 | return false; | |||
991 | } | |||
992 | } | |||
993 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq2.Value().Value()[indexName0][indexName1].mParentAny))) { | |||
994 | return false; | |||
995 | } | |||
996 | } | |||
997 | } | |||
998 | } | |||
999 | } | |||
1000 | if (arg0.mSeq3.WasPassed()) { | |||
1001 | for (uint32_t indexName0 = 0; indexName0 < arg0.mSeq3.Value().Length(); ++indexName0) { | |||
1002 | if (!arg0.mSeq3.Value()[indexName0].IsNull()) { | |||
1003 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq3.Value()[indexName0].Value().Length(); ++indexName1) { | |||
1004 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherAny))) { | |||
1005 | return false; | |||
1006 | } | |||
1007 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherObj))) { | |||
1008 | return false; | |||
1009 | } | |||
1010 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.WasPassed()) { | |||
1011 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | |||
1012 | return false; | |||
1013 | } | |||
1014 | } | |||
1015 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.WasPassed()) { | |||
1016 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.Value().mDetail))) { | |||
1017 | return false; | |||
1018 | } | |||
1019 | } | |||
1020 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.WasPassed()) { | |||
1021 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.Value().mDetail))) { | |||
1022 | return false; | |||
1023 | } | |||
1024 | } | |||
1025 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.WasPassed()) { | |||
1026 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) { | |||
1027 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | |||
1028 | return false; | |||
1029 | } | |||
1030 | } | |||
1031 | } | |||
1032 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | |||
1033 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | |||
1034 | return false; | |||
1035 | } | |||
1036 | } | |||
1037 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | |||
1038 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | |||
1039 | return false; | |||
1040 | } | |||
1041 | } | |||
1042 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.IsNull()) { | |||
1043 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | |||
1044 | return false; | |||
1045 | } | |||
1046 | } | |||
1047 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.WasPassed()) { | |||
1048 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().IsNull()) { | |||
1049 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | |||
1050 | return false; | |||
1051 | } | |||
1052 | } | |||
1053 | } | |||
1054 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.WasPassed()) { | |||
1055 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().IsNull()) { | |||
1056 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | |||
1057 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | |||
1058 | return false; | |||
1059 | } | |||
1060 | } | |||
1061 | } | |||
1062 | } | |||
1063 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | |||
1064 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | |||
1065 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | |||
1066 | return false; | |||
1067 | } | |||
1068 | } | |||
1069 | } | |||
1070 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | |||
1071 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | |||
1072 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | |||
1073 | return false; | |||
1074 | } | |||
1075 | } | |||
1076 | } | |||
1077 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.WasPassed()) { | |||
1078 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) { | |||
1079 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | |||
1080 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
1081 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) { | |||
1082 | return false; | |||
1083 | } | |||
1084 | } | |||
1085 | } | |||
1086 | } | |||
1087 | } | |||
1088 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | |||
1089 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | |||
1090 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
1091 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) { | |||
1092 | return false; | |||
1093 | } | |||
1094 | } | |||
1095 | } | |||
1096 | } | |||
1097 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | |||
1098 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | |||
1099 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
1100 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) { | |||
1101 | return false; | |||
1102 | } | |||
1103 | } | |||
1104 | } | |||
1105 | } | |||
1106 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.WasPassed()) { | |||
1107 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().IsObject()) { | |||
1108 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().GetAsObject()))) { | |||
1109 | return false; | |||
1110 | } | |||
1111 | } | |||
1112 | } | |||
1113 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.WasPassed()) { | |||
1114 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) { | |||
1115 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) { | |||
1116 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) { | |||
1117 | return false; | |||
1118 | } | |||
1119 | } | |||
1120 | } | |||
1121 | } | |||
1122 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | |||
1123 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) { | |||
1124 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) { | |||
1125 | return false; | |||
1126 | } | |||
1127 | } | |||
1128 | } | |||
1129 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | |||
1130 | for (uint32_t indexName2 = 0; indexName2 < arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) { | |||
1131 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) { | |||
1132 | return false; | |||
1133 | } | |||
1134 | } | |||
1135 | } | |||
1136 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mRequiredObject))) { | |||
1137 | return false; | |||
1138 | } | |||
1139 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mSomeAny))) { | |||
1140 | return false; | |||
1141 | } | |||
1142 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.WasPassed()) { | |||
1143 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.Value()))) { | |||
1144 | return false; | |||
1145 | } | |||
1146 | } | |||
1147 | if (arg0.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.WasPassed()) { | |||
1148 | if (!arg0.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | |||
1149 | return false; | |||
1150 | } | |||
1151 | } | |||
1152 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq3.Value()[indexName0].Value()[indexName1].mParentAny))) { | |||
1153 | return false; | |||
1154 | } | |||
1155 | } | |||
1156 | } | |||
1157 | } | |||
1158 | } | |||
1159 | if (arg0.mSeq4.WasPassed()) { | |||
1160 | for (uint32_t indexName0 = 0; indexName0 < arg0.mSeq4.Value().Length(); ++indexName0) { | |||
1161 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq4.Value()[indexName0]))) { | |||
1162 | return false; | |||
1163 | } | |||
1164 | } | |||
1165 | } | |||
1166 | if (arg0.mSeq5.WasPassed()) { | |||
1167 | for (uint32_t indexName0 = 0; indexName0 < arg0.mSeq5.Value().Length(); ++indexName0) { | |||
1168 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq5.Value()[indexName0]))) { | |||
1169 | return false; | |||
1170 | } | |||
1171 | } | |||
1172 | } | |||
1173 | if (arg0.mSeq6.WasPassed()) { | |||
1174 | for (uint32_t indexName0 = 0; indexName0 < arg0.mSeq6.Value().Length(); ++indexName0) { | |||
1175 | if (arg0.mSeq6.Value()[indexName0].mOurSequence3.WasPassed()) { | |||
1176 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq6.Value()[indexName0].mOurSequence3.Value().Length(); ++indexName1) { | |||
1177 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg0.mSeq6.Value()[indexName0].mOurSequence3.Value()[indexName1]))) { | |||
1178 | return false; | |||
1179 | } | |||
1180 | } | |||
1181 | } | |||
1182 | if (arg0.mSeq6.Value()[indexName0].mOurSequence4.WasPassed()) { | |||
1183 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq6.Value()[indexName0].mOurSequence4.Value().Length(); ++indexName1) { | |||
1184 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq6.Value()[indexName0].mOurSequence4.Value()[indexName1]))) { | |||
1185 | return false; | |||
1186 | } | |||
1187 | } | |||
1188 | } | |||
1189 | if (arg0.mSeq6.Value()[indexName0].mOurSequence5.WasPassed()) { | |||
1190 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq6.Value()[indexName0].mOurSequence5.Value().Length(); ++indexName1) { | |||
1191 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq6.Value()[indexName0].mOurSequence5.Value()[indexName1]))) { | |||
1192 | return false; | |||
1193 | } | |||
1194 | } | |||
1195 | } | |||
1196 | if (arg0.mSeq6.Value()[indexName0].mOurSequence6.WasPassed()) { | |||
1197 | if (!arg0.mSeq6.Value()[indexName0].mOurSequence6.Value().IsNull()) { | |||
1198 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq6.Value()[indexName0].mOurSequence6.Value().Value().Length(); ++indexName1) { | |||
1199 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq6.Value()[indexName0].mOurSequence6.Value().Value()[indexName1]))) { | |||
1200 | return false; | |||
1201 | } | |||
1202 | } | |||
1203 | } | |||
1204 | } | |||
1205 | if (arg0.mSeq6.Value()[indexName0].mOurSequence7.WasPassed()) { | |||
1206 | if (!arg0.mSeq6.Value()[indexName0].mOurSequence7.Value().IsNull()) { | |||
1207 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq6.Value()[indexName0].mOurSequence7.Value().Value().Length(); ++indexName1) { | |||
1208 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq6.Value()[indexName0].mOurSequence7.Value().Value()[indexName1]))) { | |||
1209 | return false; | |||
1210 | } | |||
1211 | } | |||
1212 | } | |||
1213 | } | |||
1214 | if (!arg0.mSeq6.Value()[indexName0].mOurSequence8.IsNull()) { | |||
1215 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq6.Value()[indexName0].mOurSequence8.Value().Length(); ++indexName1) { | |||
1216 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq6.Value()[indexName0].mOurSequence8.Value()[indexName1]))) { | |||
1217 | return false; | |||
1218 | } | |||
1219 | } | |||
1220 | } | |||
1221 | if (!arg0.mSeq6.Value()[indexName0].mOurSequence9.IsNull()) { | |||
1222 | for (uint32_t indexName1 = 0; indexName1 < arg0.mSeq6.Value()[indexName0].mOurSequence9.Value().Length(); ++indexName1) { | |||
1223 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg0.mSeq6.Value()[indexName0].mOurSequence9.Value()[indexName1]))) { | |||
1224 | return false; | |||
1225 | } | |||
1226 | } | |||
1227 | } | |||
1228 | } | |||
1229 | } | |||
1230 | if (!JS_WrapValue(cx, &arg1)) { | |||
1231 | return false; | |||
1232 | } | |||
1233 | if (!JS_WrapObject(cx, &arg2)) { | |||
1234 | return false; | |||
1235 | } | |||
1236 | if (!JS_WrapObject(cx, &arg3)) { | |||
1237 | return false; | |||
1238 | } | |||
1239 | for (uint32_t indexName0 = 0; indexName0 < arg4.Length(); ++indexName0) { | |||
1240 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mAnotherAny))) { | |||
1241 | return false; | |||
1242 | } | |||
1243 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mAnotherObj))) { | |||
1244 | return false; | |||
1245 | } | |||
1246 | if (arg4[indexName0].mArrayBuffer.WasPassed()) { | |||
1247 | if (!arg4[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) { | |||
1248 | return false; | |||
1249 | } | |||
1250 | } | |||
1251 | if (arg4[indexName0].mCustomEventInit.WasPassed()) { | |||
1252 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mCustomEventInit.Value().mDetail))) { | |||
1253 | return false; | |||
1254 | } | |||
1255 | } | |||
1256 | if (arg4[indexName0].mDictionaryTypedef.WasPassed()) { | |||
1257 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mDictionaryTypedef.Value().mDetail))) { | |||
1258 | return false; | |||
1259 | } | |||
1260 | } | |||
1261 | if (arg4[indexName0].mEventInitOrLong2.WasPassed()) { | |||
1262 | if (arg4[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) { | |||
1263 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) { | |||
1264 | return false; | |||
1265 | } | |||
1266 | } | |||
1267 | } | |||
1268 | if (arg4[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) { | |||
1269 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) { | |||
1270 | return false; | |||
1271 | } | |||
1272 | } | |||
1273 | if (arg4[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) { | |||
1274 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) { | |||
1275 | return false; | |||
1276 | } | |||
1277 | } | |||
1278 | if (!arg4[indexName0].mFloat64Array.IsNull()) { | |||
1279 | if (!arg4[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) { | |||
1280 | return false; | |||
1281 | } | |||
1282 | } | |||
1283 | if (arg4[indexName0].mNullableArrayBuffer.WasPassed()) { | |||
1284 | if (!arg4[indexName0].mNullableArrayBuffer.Value().IsNull()) { | |||
1285 | if (!arg4[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) { | |||
1286 | return false; | |||
1287 | } | |||
1288 | } | |||
1289 | } | |||
1290 | if (arg4[indexName0].mNullableEventInitOrLong2.WasPassed()) { | |||
1291 | if (!arg4[indexName0].mNullableEventInitOrLong2.Value().IsNull()) { | |||
1292 | if (arg4[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) { | |||
1293 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) { | |||
1294 | return false; | |||
1295 | } | |||
1296 | } | |||
1297 | } | |||
1298 | } | |||
1299 | if (!arg4[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) { | |||
1300 | if (arg4[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) { | |||
1301 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) { | |||
1302 | return false; | |||
1303 | } | |||
1304 | } | |||
1305 | } | |||
1306 | if (!arg4[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) { | |||
1307 | if (arg4[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) { | |||
1308 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) { | |||
1309 | return false; | |||
1310 | } | |||
1311 | } | |||
1312 | } | |||
1313 | if (arg4[indexName0].mNullableObjectSequenceOrLong.WasPassed()) { | |||
1314 | if (!arg4[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) { | |||
1315 | if (arg4[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) { | |||
1316 | for (uint32_t indexName1 = 0; indexName1 < arg4[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
1317 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) { | |||
1318 | return false; | |||
1319 | } | |||
1320 | } | |||
1321 | } | |||
1322 | } | |||
1323 | } | |||
1324 | if (!arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) { | |||
1325 | if (arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) { | |||
1326 | for (uint32_t indexName1 = 0; indexName1 < arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
1327 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) { | |||
1328 | return false; | |||
1329 | } | |||
1330 | } | |||
1331 | } | |||
1332 | } | |||
1333 | if (!arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) { | |||
1334 | if (arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) { | |||
1335 | for (uint32_t indexName1 = 0; indexName1 < arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
1336 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) { | |||
1337 | return false; | |||
1338 | } | |||
1339 | } | |||
1340 | } | |||
1341 | } | |||
1342 | if (arg4[indexName0].mObjectOrLong.WasPassed()) { | |||
1343 | if (arg4[indexName0].mObjectOrLong.Value().IsObject()) { | |||
1344 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mObjectOrLong.Value().GetAsObject()))) { | |||
1345 | return false; | |||
1346 | } | |||
1347 | } | |||
1348 | } | |||
1349 | if (arg4[indexName0].mObjectSequenceOrLong.WasPassed()) { | |||
1350 | if (arg4[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) { | |||
1351 | for (uint32_t indexName1 = 0; indexName1 < arg4[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) { | |||
1352 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) { | |||
1353 | return false; | |||
1354 | } | |||
1355 | } | |||
1356 | } | |||
1357 | } | |||
1358 | if (arg4[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) { | |||
1359 | for (uint32_t indexName1 = 0; indexName1 < arg4[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) { | |||
1360 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) { | |||
1361 | return false; | |||
1362 | } | |||
1363 | } | |||
1364 | } | |||
1365 | if (arg4[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) { | |||
1366 | for (uint32_t indexName1 = 0; indexName1 < arg4[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) { | |||
1367 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) { | |||
1368 | return false; | |||
1369 | } | |||
1370 | } | |||
1371 | } | |||
1372 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mRequiredObject))) { | |||
1373 | return false; | |||
1374 | } | |||
1375 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mSomeAny))) { | |||
1376 | return false; | |||
1377 | } | |||
1378 | if (arg4[indexName0].mSomeObj.WasPassed()) { | |||
1379 | if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg4[indexName0].mSomeObj.Value()))) { | |||
1380 | return false; | |||
1381 | } | |||
1382 | } | |||
1383 | if (arg4[indexName0].mUint8Array.WasPassed()) { | |||
1384 | if (!arg4[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) { | |||
1385 | return false; | |||
1386 | } | |||
1387 | } | |||
1388 | if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg4[indexName0].mParentAny))) { | |||
1389 | return false; | |||
1390 | } | |||
1391 | } | |||
1392 | if (!JS_WrapValue(cx, &arg5)) { | |||
1393 | return false; | |||
1394 | } | |||
1395 | if (arg6.WasPassed()) { | |||
1396 | if (!JS_WrapObject(cx, &arg6.Value())) { | |||
1397 | return false; | |||
1398 | } | |||
1399 | } | |||
1400 | if (arg7.WasPassed()) { | |||
1401 | if (!JS_WrapObject(cx, &arg7.Value())) { | |||
1402 | return false; | |||
1403 | } | |||
1404 | } | |||
1405 | } | |||
1406 | FastErrorResult rv; | |||
1407 | auto result(StrongOrRawPtr<mozilla::dom::TestExampleInterface>(mozilla::dom::TestExampleInterface::Example2(global, Constify(arg0), arg1, arg2, arg3, Constify(arg4), arg5, Constify(arg6), Constify(arg7), rv))); | |||
1408 | if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "Example2 constructor"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "Example2 constructor" )), 0))) { | |||
1409 | return false; | |||
1410 | } | |||
1411 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1411); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1411; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1412 | static_assert(!std::is_pointer_v<decltype(result)>, | |||
1413 | "NewObject implies that we need to keep the object alive with a strong reference."); | |||
1414 | if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) { | |||
1415 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1415); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 1415; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1416 | return false; | |||
1417 | } | |||
1418 | return true; | |||
1419 | break; | |||
1420 | } | |||
1421 | default: { | |||
1422 | // Using nsPrintfCString here would require including that | |||
1423 | // header. Let's not worry about it. | |||
1424 | nsAutoCString argCountStr; | |||
1425 | argCountStr.AppendPrintf("%u", args.length()); | |||
1426 | return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get()); | |||
1427 | } | |||
1428 | } | |||
1429 | MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case" , "../TestExampleGenBinding.cpp", 1429); AnnotateMozCrashReason ("MOZ_CRASH(" "We have an always-returning default case" ")") ; do { *((volatile int*)__null) = 1429; __attribute__((nomerge )) ::abort(); } while (false); } while (false); | |||
1430 | return false; | |||
1431 | } | |||
1432 | ||||
1433 | MOZ_CAN_RUN_SCRIPT static bool | |||
1434 | get_readonlyByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
1435 | { | |||
1436 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1439( cx, "TestExampleInterface" , "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1437 | "TestExampleInterface", "readonlyByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1439( cx, "TestExampleInterface" , "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1438 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1439( cx, "TestExampleInterface" , "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1439 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1439( cx, "TestExampleInterface" , "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1440 | ||||
1441 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1442 | int8_t result(MOZ_KnownLive(self)(self)->ReadonlyByte()); | |||
1443 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1443); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1443; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1444 | args.rval().setInt32(int32_t(result)); | |||
1445 | return true; | |||
1446 | } | |||
1447 | ||||
1448 | static const JSJitInfo readonlyByte_getterinfo = { | |||
1449 | { get_readonlyByte }, | |||
1450 | { prototypes::id::TestExampleInterface }, | |||
1451 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1452 | JSJitInfo::Getter, | |||
1453 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1454 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
1455 | true, /* isInfallible. False in setters. */ | |||
1456 | false, /* isMovable. Not relevant for setters. */ | |||
1457 | false, /* isEliminatable. Not relevant for setters. */ | |||
1458 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1459 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1460 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1461 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1462 | }; | |||
1463 | ||||
1464 | MOZ_CAN_RUN_SCRIPT static bool | |||
1465 | get_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
1466 | { | |||
1467 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1470( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1468 | "TestExampleInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1470( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1469 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1470( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1470 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1470( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1471 | ||||
1472 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1473 | int8_t result(MOZ_KnownLive(self)(self)->WritableByte()); | |||
1474 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1474); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1474; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1475 | args.rval().setInt32(int32_t(result)); | |||
1476 | return true; | |||
1477 | } | |||
1478 | ||||
1479 | MOZ_CAN_RUN_SCRIPT static bool | |||
1480 | set_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
1481 | { | |||
1482 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1485( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1483 | "TestExampleInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1485( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1484 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1485( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1485 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1485( cx, "TestExampleInterface" , "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1486 | ||||
1487 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1488 | int8_t arg0; | |||
1489 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
1490 | return false; | |||
1491 | } | |||
1492 | // NOTE: This assert does NOT call the function. | |||
1493 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableByte(arg0))>, "Should be returning void here"); | |||
1494 | MOZ_KnownLive(self)(self)->SetWritableByte(arg0); | |||
1495 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1495); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1495; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1496 | ||||
1497 | return true; | |||
1498 | } | |||
1499 | ||||
1500 | static const JSJitInfo writableByte_getterinfo = { | |||
1501 | { get_writableByte }, | |||
1502 | { prototypes::id::TestExampleInterface }, | |||
1503 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1504 | JSJitInfo::Getter, | |||
1505 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1506 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
1507 | true, /* isInfallible. False in setters. */ | |||
1508 | false, /* isMovable. Not relevant for setters. */ | |||
1509 | false, /* isEliminatable. Not relevant for setters. */ | |||
1510 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1511 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1512 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1513 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1514 | }; | |||
1515 | static const JSJitInfo writableByte_setterinfo = { | |||
1516 | { (JSJitGetterOp)set_writableByte }, | |||
1517 | { prototypes::id::TestExampleInterface }, | |||
1518 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1519 | JSJitInfo::Setter, | |||
1520 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1521 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1522 | false, /* isInfallible. False in setters. */ | |||
1523 | false, /* isMovable. Not relevant for setters. */ | |||
1524 | false, /* isEliminatable. Not relevant for setters. */ | |||
1525 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1526 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1527 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1528 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1529 | }; | |||
1530 | ||||
1531 | MOZ_CAN_RUN_SCRIPT static bool | |||
1532 | passByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1533 | { | |||
1534 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1537( cx, "TestExampleInterface" , "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
1535 | "TestExampleInterface", "passByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1537( cx, "TestExampleInterface" , "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
1536 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1537( cx, "TestExampleInterface" , "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
1537 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1537( cx, "TestExampleInterface" , "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
1538 | ||||
1539 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1540 | if (!args.requireAtLeast(cx, "TestExampleInterface.passByte", 1)) { | |||
1541 | return false; | |||
1542 | } | |||
1543 | int8_t arg0; | |||
1544 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
1545 | return false; | |||
1546 | } | |||
1547 | // NOTE: This assert does NOT call the function. | |||
1548 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByte(arg0))>, "Should be returning void here"); | |||
1549 | MOZ_KnownLive(self)(self)->PassByte(arg0); | |||
1550 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1550); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1550; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1551 | args.rval().setUndefined(); | |||
1552 | return true; | |||
1553 | } | |||
1554 | ||||
1555 | static const JSJitInfo passByte_methodinfo = { | |||
1556 | { (JSJitGetterOp)passByte }, | |||
1557 | { prototypes::id::TestExampleInterface }, | |||
1558 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1559 | JSJitInfo::Method, | |||
1560 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1561 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1562 | false, /* isInfallible. False in setters. */ | |||
1563 | false, /* isMovable. Not relevant for setters. */ | |||
1564 | false, /* isEliminatable. Not relevant for setters. */ | |||
1565 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1566 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1567 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1568 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1569 | }; | |||
1570 | ||||
1571 | MOZ_CAN_RUN_SCRIPT static bool | |||
1572 | receiveByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1573 | { | |||
1574 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1577( cx, "TestExampleInterface" , "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1575 | "TestExampleInterface", "receiveByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1577( cx, "TestExampleInterface" , "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1576 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1577( cx, "TestExampleInterface" , "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1577 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1577( cx, "TestExampleInterface" , "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1578 | ||||
1579 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1580 | int8_t result(MOZ_KnownLive(self)(self)->ReceiveByte()); | |||
1581 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1581); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1581; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1582 | args.rval().setInt32(int32_t(result)); | |||
1583 | return true; | |||
1584 | } | |||
1585 | ||||
1586 | static const JSJitInfo receiveByte_methodinfo = { | |||
1587 | { (JSJitGetterOp)receiveByte }, | |||
1588 | { prototypes::id::TestExampleInterface }, | |||
1589 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1590 | JSJitInfo::Method, | |||
1591 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1592 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
1593 | true, /* isInfallible. False in setters. */ | |||
1594 | false, /* isMovable. Not relevant for setters. */ | |||
1595 | false, /* isEliminatable. Not relevant for setters. */ | |||
1596 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1597 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1598 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1599 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1600 | }; | |||
1601 | ||||
1602 | MOZ_CAN_RUN_SCRIPT static bool | |||
1603 | passOptionalByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1604 | { | |||
1605 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1608( cx, "TestExampleInterface" , "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1606 | "TestExampleInterface", "passOptionalByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1608( cx, "TestExampleInterface" , "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1607 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1608( cx, "TestExampleInterface" , "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1608 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1608( cx, "TestExampleInterface" , "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1609 | ||||
1610 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1611 | Optional<int8_t> arg0; | |||
1612 | if (args.hasDefined(0)) { | |||
1613 | arg0.Construct(); | |||
1614 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
1615 | return false; | |||
1616 | } | |||
1617 | } | |||
1618 | // NOTE: This assert does NOT call the function. | |||
1619 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByte(Constify(arg0)))>, "Should be returning void here"); | |||
1620 | MOZ_KnownLive(self)(self)->PassOptionalByte(Constify(arg0)); | |||
1621 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1621); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1621; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1622 | args.rval().setUndefined(); | |||
1623 | return true; | |||
1624 | } | |||
1625 | ||||
1626 | static const JSJitInfo passOptionalByte_methodinfo = { | |||
1627 | { (JSJitGetterOp)passOptionalByte }, | |||
1628 | { prototypes::id::TestExampleInterface }, | |||
1629 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1630 | JSJitInfo::Method, | |||
1631 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1632 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1633 | false, /* isInfallible. False in setters. */ | |||
1634 | false, /* isMovable. Not relevant for setters. */ | |||
1635 | false, /* isEliminatable. Not relevant for setters. */ | |||
1636 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1637 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1638 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1639 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1640 | }; | |||
1641 | ||||
1642 | MOZ_CAN_RUN_SCRIPT static bool | |||
1643 | passOptionalByteBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1644 | { | |||
1645 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1648( cx, "TestExampleInterface" , "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1646 | "TestExampleInterface", "passOptionalByteBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1648( cx, "TestExampleInterface" , "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1647 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1648( cx, "TestExampleInterface" , "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1648 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1648( cx, "TestExampleInterface" , "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
1649 | ||||
1650 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1651 | if (!args.requireAtLeast(cx, "TestExampleInterface.passOptionalByteBeforeRequired", 2)) { | |||
1652 | return false; | |||
1653 | } | |||
1654 | Optional<int8_t> arg0; | |||
1655 | if (args.hasDefined(0)) { | |||
1656 | arg0.Construct(); | |||
1657 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
1658 | return false; | |||
1659 | } | |||
1660 | } | |||
1661 | int8_t arg1; | |||
1662 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) { | |||
1663 | return false; | |||
1664 | } | |||
1665 | // NOTE: This assert does NOT call the function. | |||
1666 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteBeforeRequired(Constify(arg0), arg1))>, "Should be returning void here"); | |||
1667 | MOZ_KnownLive(self)(self)->PassOptionalByteBeforeRequired(Constify(arg0), arg1); | |||
1668 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1668); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1668; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1669 | args.rval().setUndefined(); | |||
1670 | return true; | |||
1671 | } | |||
1672 | ||||
1673 | static const JSJitInfo passOptionalByteBeforeRequired_methodinfo = { | |||
1674 | { (JSJitGetterOp)passOptionalByteBeforeRequired }, | |||
1675 | { prototypes::id::TestExampleInterface }, | |||
1676 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1677 | JSJitInfo::Method, | |||
1678 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1679 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1680 | false, /* isInfallible. False in setters. */ | |||
1681 | false, /* isMovable. Not relevant for setters. */ | |||
1682 | false, /* isEliminatable. Not relevant for setters. */ | |||
1683 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1684 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1685 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1686 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1687 | }; | |||
1688 | ||||
1689 | MOZ_CAN_RUN_SCRIPT static bool | |||
1690 | passOptionalByteWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1691 | { | |||
1692 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1695( cx, "TestExampleInterface" , "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1693 | "TestExampleInterface", "passOptionalByteWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1695( cx, "TestExampleInterface" , "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1694 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1695( cx, "TestExampleInterface" , "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1695 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1695( cx, "TestExampleInterface" , "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
1696 | ||||
1697 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1698 | int8_t arg0; | |||
1699 | if (args.hasDefined(0)) { | |||
1700 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
1701 | return false; | |||
1702 | } | |||
1703 | } else { | |||
1704 | arg0 = 0; | |||
1705 | } | |||
1706 | // NOTE: This assert does NOT call the function. | |||
1707 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteWithDefault(arg0))>, "Should be returning void here"); | |||
1708 | MOZ_KnownLive(self)(self)->PassOptionalByteWithDefault(arg0); | |||
1709 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1709); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1709; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1710 | args.rval().setUndefined(); | |||
1711 | return true; | |||
1712 | } | |||
1713 | ||||
1714 | static const JSJitInfo passOptionalByteWithDefault_methodinfo = { | |||
1715 | { (JSJitGetterOp)passOptionalByteWithDefault }, | |||
1716 | { prototypes::id::TestExampleInterface }, | |||
1717 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1718 | JSJitInfo::Method, | |||
1719 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1720 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1721 | false, /* isInfallible. False in setters. */ | |||
1722 | false, /* isMovable. Not relevant for setters. */ | |||
1723 | false, /* isEliminatable. Not relevant for setters. */ | |||
1724 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1725 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1726 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1727 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1728 | }; | |||
1729 | ||||
1730 | MOZ_CAN_RUN_SCRIPT static bool | |||
1731 | passOptionalByteWithDefaultBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1732 | { | |||
1733 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1736( cx, "TestExampleInterface" , "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1734 | "TestExampleInterface", "passOptionalByteWithDefaultBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1736( cx, "TestExampleInterface" , "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1735 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1736( cx, "TestExampleInterface" , "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1736 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1736( cx, "TestExampleInterface" , "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
1737 | ||||
1738 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1739 | if (!args.requireAtLeast(cx, "TestExampleInterface.passOptionalByteWithDefaultBeforeRequired", 2)) { | |||
1740 | return false; | |||
1741 | } | |||
1742 | int8_t arg0; | |||
1743 | if (args.hasDefined(0)) { | |||
1744 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
1745 | return false; | |||
1746 | } | |||
1747 | } else { | |||
1748 | arg0 = 0; | |||
1749 | } | |||
1750 | int8_t arg1; | |||
1751 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) { | |||
1752 | return false; | |||
1753 | } | |||
1754 | // NOTE: This assert does NOT call the function. | |||
1755 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteWithDefaultBeforeRequired(arg0, arg1))>, "Should be returning void here"); | |||
1756 | MOZ_KnownLive(self)(self)->PassOptionalByteWithDefaultBeforeRequired(arg0, arg1); | |||
1757 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1757); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1757; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1758 | args.rval().setUndefined(); | |||
1759 | return true; | |||
1760 | } | |||
1761 | ||||
1762 | static const JSJitInfo passOptionalByteWithDefaultBeforeRequired_methodinfo = { | |||
1763 | { (JSJitGetterOp)passOptionalByteWithDefaultBeforeRequired }, | |||
1764 | { prototypes::id::TestExampleInterface }, | |||
1765 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1766 | JSJitInfo::Method, | |||
1767 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1768 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1769 | false, /* isInfallible. False in setters. */ | |||
1770 | false, /* isMovable. Not relevant for setters. */ | |||
1771 | false, /* isEliminatable. Not relevant for setters. */ | |||
1772 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1773 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1774 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1775 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1776 | }; | |||
1777 | ||||
1778 | MOZ_CAN_RUN_SCRIPT static bool | |||
1779 | passNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1780 | { | |||
1781 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1784( cx, "TestExampleInterface" , "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1782 | "TestExampleInterface", "passNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1784( cx, "TestExampleInterface" , "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1783 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1784( cx, "TestExampleInterface" , "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1784 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1784( cx, "TestExampleInterface" , "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1785 | ||||
1786 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1787 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableByte", 1)) { | |||
1788 | return false; | |||
1789 | } | |||
1790 | Nullable<int8_t> arg0; | |||
1791 | if (args[0].isNullOrUndefined()) { | |||
1792 | arg0.SetNull(); | |||
1793 | } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) { | |||
1794 | return false; | |||
1795 | } | |||
1796 | // NOTE: This assert does NOT call the function. | |||
1797 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableByte(Constify(arg0)))>, "Should be returning void here"); | |||
1798 | MOZ_KnownLive(self)(self)->PassNullableByte(Constify(arg0)); | |||
1799 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1799); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1799; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1800 | args.rval().setUndefined(); | |||
1801 | return true; | |||
1802 | } | |||
1803 | ||||
1804 | static const JSJitInfo passNullableByte_methodinfo = { | |||
1805 | { (JSJitGetterOp)passNullableByte }, | |||
1806 | { prototypes::id::TestExampleInterface }, | |||
1807 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1808 | JSJitInfo::Method, | |||
1809 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1810 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1811 | false, /* isInfallible. False in setters. */ | |||
1812 | false, /* isMovable. Not relevant for setters. */ | |||
1813 | false, /* isEliminatable. Not relevant for setters. */ | |||
1814 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1815 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1816 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1817 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1818 | }; | |||
1819 | ||||
1820 | MOZ_CAN_RUN_SCRIPT static bool | |||
1821 | passOptionalNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1822 | { | |||
1823 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1826( cx, "TestExampleInterface" , "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1824 | "TestExampleInterface", "passOptionalNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1826( cx, "TestExampleInterface" , "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1825 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1826( cx, "TestExampleInterface" , "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
1826 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1826( cx, "TestExampleInterface" , "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
1827 | ||||
1828 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1829 | Optional<Nullable<int8_t>> arg0; | |||
1830 | if (args.hasDefined(0)) { | |||
1831 | arg0.Construct(); | |||
1832 | if (args[0].isNullOrUndefined()) { | |||
1833 | arg0.Value().SetNull(); | |||
1834 | } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value().SetValue())) { | |||
1835 | return false; | |||
1836 | } | |||
1837 | } | |||
1838 | // NOTE: This assert does NOT call the function. | |||
1839 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableByte(Constify(arg0)))>, "Should be returning void here"); | |||
1840 | MOZ_KnownLive(self)(self)->PassOptionalNullableByte(Constify(arg0)); | |||
1841 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1841); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1841; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1842 | args.rval().setUndefined(); | |||
1843 | return true; | |||
1844 | } | |||
1845 | ||||
1846 | static const JSJitInfo passOptionalNullableByte_methodinfo = { | |||
1847 | { (JSJitGetterOp)passOptionalNullableByte }, | |||
1848 | { prototypes::id::TestExampleInterface }, | |||
1849 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1850 | JSJitInfo::Method, | |||
1851 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1852 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1853 | false, /* isInfallible. False in setters. */ | |||
1854 | false, /* isMovable. Not relevant for setters. */ | |||
1855 | false, /* isEliminatable. Not relevant for setters. */ | |||
1856 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1857 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1858 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1859 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1860 | }; | |||
1861 | ||||
1862 | MOZ_CAN_RUN_SCRIPT static bool | |||
1863 | passVariadicByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
1864 | { | |||
1865 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1868( cx, "TestExampleInterface" , "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1866 | "TestExampleInterface", "passVariadicByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1868( cx, "TestExampleInterface" , "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1867 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1868( cx, "TestExampleInterface" , "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1868 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1868( cx, "TestExampleInterface" , "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1869 | ||||
1870 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1871 | AutoSequence<int8_t> arg0; | |||
1872 | if (args.length() > 0) { | |||
1873 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
1874 | JS_ReportOutOfMemory(cx); | |||
1875 | return false; | |||
1876 | } | |||
1877 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
1878 | // OK to do infallible append here, since we ensured capacity already. | |||
1879 | int8_t& slot = *arg0.AppendElement(); | |||
1880 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[variadicArg], "Argument 1", &slot)) { | |||
1881 | return false; | |||
1882 | } | |||
1883 | } | |||
1884 | } | |||
1885 | // NOTE: This assert does NOT call the function. | |||
1886 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicByte(Constify(arg0)))>, "Should be returning void here"); | |||
1887 | MOZ_KnownLive(self)(self)->PassVariadicByte(Constify(arg0)); | |||
1888 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1888); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1888; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1889 | args.rval().setUndefined(); | |||
1890 | return true; | |||
1891 | } | |||
1892 | ||||
1893 | static const JSJitInfo passVariadicByte_methodinfo = { | |||
1894 | { (JSJitGetterOp)passVariadicByte }, | |||
1895 | { prototypes::id::TestExampleInterface }, | |||
1896 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1897 | JSJitInfo::Method, | |||
1898 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
1899 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
1900 | false, /* isInfallible. False in setters. */ | |||
1901 | false, /* isMovable. Not relevant for setters. */ | |||
1902 | false, /* isEliminatable. Not relevant for setters. */ | |||
1903 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1904 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1905 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1906 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1907 | }; | |||
1908 | ||||
1909 | MOZ_CAN_RUN_SCRIPT static bool | |||
1910 | get_cachedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
1911 | { | |||
1912 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1915( cx, "TestExampleInterface" , "cachedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1913 | "TestExampleInterface", "cachedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1915( cx, "TestExampleInterface" , "cachedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1914 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1915( cx, "TestExampleInterface" , "cachedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1915 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1915( cx, "TestExampleInterface" , "cachedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1916 | ||||
1917 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1918 | // Have to either root across the getter call or reget after. | |||
1919 | bool isXray; | |||
1920 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
1921 | if (!slotStorage) { | |||
1922 | return false; | |||
1923 | } | |||
1924 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 0) : (DOM_INSTANCE_RESERVED_SLOTS1 + 0); | |||
1925 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 1925); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 1925; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1926 | { | |||
1927 | // Scope for cachedVal | |||
1928 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
1929 | if (!cachedVal.isUndefined()) { | |||
1930 | args.rval().set(cachedVal); | |||
1931 | // The cached value is in the compartment of slotStorage, | |||
1932 | // so wrap into the caller compartment as needed. | |||
1933 | return MaybeWrapValue(cx, args.rval()); | |||
1934 | } | |||
1935 | } | |||
1936 | ||||
1937 | int8_t result(MOZ_KnownLive(self)(self)->CachedByte()); | |||
1938 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 1938); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 1938; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1939 | { | |||
1940 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
1941 | JSAutoRealm ar(cx, conversionScope); | |||
1942 | do { // block we break out of when done wrapping | |||
1943 | args.rval().setInt32(int32_t(result)); | |||
1944 | break; | |||
1945 | } while (false); | |||
1946 | } | |||
1947 | { // And now store things in the realm of our slotStorage. | |||
1948 | JSAutoRealm ar(cx, slotStorage); | |||
1949 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
1950 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
1951 | if (!MaybeWrapValue(cx, &storedVal)) { | |||
1952 | return false; | |||
1953 | } | |||
1954 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
1955 | if (!isXray) { | |||
1956 | // In the Xray case we don't need to do this, because getting the | |||
1957 | // expando object already preserved our wrapper. | |||
1958 | PreserveWrapper(self); | |||
1959 | } | |||
1960 | } | |||
1961 | // And now make sure args.rval() is in the caller realm. | |||
1962 | return MaybeWrapValue(cx, args.rval()); | |||
1963 | } | |||
1964 | ||||
1965 | static const JSJitInfo cachedByte_getterinfo = { | |||
1966 | { get_cachedByte }, | |||
1967 | { prototypes::id::TestExampleInterface }, | |||
1968 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
1969 | JSJitInfo::Getter, | |||
1970 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
1971 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
1972 | true, /* isInfallible. False in setters. */ | |||
1973 | true, /* isMovable. Not relevant for setters. */ | |||
1974 | true, /* isEliminatable. Not relevant for setters. */ | |||
1975 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
1976 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
1977 | false, /* isTypedMethod. Only relevant for methods. */ | |||
1978 | (DOM_INSTANCE_RESERVED_SLOTS1 + 0) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
1979 | }; | |||
1980 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 0) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
1981 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 0) < 22, "There is no slot for us"); | |||
1982 | ||||
1983 | static bool | |||
1984 | get_cachedConstantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
1985 | { | |||
1986 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1989( cx, "TestExampleInterface" , "cachedConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1987 | "TestExampleInterface", "cachedConstantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1989( cx, "TestExampleInterface" , "cachedConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1988 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1989( cx, "TestExampleInterface" , "cachedConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
1989 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1989( cx, "TestExampleInterface" , "cachedConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
1990 | ||||
1991 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
1992 | // Have to either root across the getter call or reget after. | |||
1993 | bool isXray; | |||
1994 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
1995 | if (!slotStorage) { | |||
1996 | return false; | |||
1997 | } | |||
1998 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 1) : (DOM_INSTANCE_RESERVED_SLOTS1 + 1); | |||
1999 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 1999); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 1999; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2000 | { | |||
2001 | // Scope for cachedVal | |||
2002 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
2003 | if (!cachedVal.isUndefined()) { | |||
2004 | args.rval().set(cachedVal); | |||
2005 | // The cached value is in the compartment of slotStorage, | |||
2006 | // so wrap into the caller compartment as needed. | |||
2007 | return MaybeWrapValue(cx, args.rval()); | |||
2008 | } | |||
2009 | } | |||
2010 | ||||
2011 | int8_t result(MOZ_KnownLive(self)(self)->CachedConstantByte()); | |||
2012 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2012); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2012; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2013 | { | |||
2014 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
2015 | JSAutoRealm ar(cx, conversionScope); | |||
2016 | do { // block we break out of when done wrapping | |||
2017 | args.rval().setInt32(int32_t(result)); | |||
2018 | break; | |||
2019 | } while (false); | |||
2020 | } | |||
2021 | { // And now store things in the realm of our slotStorage. | |||
2022 | JSAutoRealm ar(cx, slotStorage); | |||
2023 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
2024 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
2025 | if (!MaybeWrapValue(cx, &storedVal)) { | |||
2026 | return false; | |||
2027 | } | |||
2028 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
2029 | } | |||
2030 | // And now make sure args.rval() is in the caller realm. | |||
2031 | return MaybeWrapValue(cx, args.rval()); | |||
2032 | } | |||
2033 | ||||
2034 | static const JSJitInfo cachedConstantByte_getterinfo = { | |||
2035 | { get_cachedConstantByte }, | |||
2036 | { prototypes::id::TestExampleInterface }, | |||
2037 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2038 | JSJitInfo::Getter, | |||
2039 | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ | |||
2040 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2041 | true, /* isInfallible. False in setters. */ | |||
2042 | true, /* isMovable. Not relevant for setters. */ | |||
2043 | true, /* isEliminatable. Not relevant for setters. */ | |||
2044 | true, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2045 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2046 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2047 | (DOM_INSTANCE_RESERVED_SLOTS1 + 1) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2048 | }; | |||
2049 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 1) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
2050 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 1) < 22, "There is no slot for us"); | |||
2051 | ||||
2052 | MOZ_CAN_RUN_SCRIPT static bool | |||
2053 | get_cachedWritableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2054 | { | |||
2055 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2058( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2056 | "TestExampleInterface", "cachedWritableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2058( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2057 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2058( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2058 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2058( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2059 | ||||
2060 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2061 | // Have to either root across the getter call or reget after. | |||
2062 | bool isXray; | |||
2063 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
2064 | if (!slotStorage) { | |||
2065 | return false; | |||
2066 | } | |||
2067 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 2) : (DOM_INSTANCE_RESERVED_SLOTS1 + 2); | |||
2068 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 2068); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 2068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2069 | { | |||
2070 | // Scope for cachedVal | |||
2071 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
2072 | if (!cachedVal.isUndefined()) { | |||
2073 | args.rval().set(cachedVal); | |||
2074 | // The cached value is in the compartment of slotStorage, | |||
2075 | // so wrap into the caller compartment as needed. | |||
2076 | return MaybeWrapValue(cx, args.rval()); | |||
2077 | } | |||
2078 | } | |||
2079 | ||||
2080 | int8_t result(MOZ_KnownLive(self)(self)->CachedWritableByte()); | |||
2081 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2081); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2081; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2082 | { | |||
2083 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
2084 | JSAutoRealm ar(cx, conversionScope); | |||
2085 | do { // block we break out of when done wrapping | |||
2086 | args.rval().setInt32(int32_t(result)); | |||
2087 | break; | |||
2088 | } while (false); | |||
2089 | } | |||
2090 | { // And now store things in the realm of our slotStorage. | |||
2091 | JSAutoRealm ar(cx, slotStorage); | |||
2092 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
2093 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
2094 | if (!MaybeWrapValue(cx, &storedVal)) { | |||
2095 | return false; | |||
2096 | } | |||
2097 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
2098 | if (!isXray) { | |||
2099 | // In the Xray case we don't need to do this, because getting the | |||
2100 | // expando object already preserved our wrapper. | |||
2101 | PreserveWrapper(self); | |||
2102 | } | |||
2103 | } | |||
2104 | // And now make sure args.rval() is in the caller realm. | |||
2105 | return MaybeWrapValue(cx, args.rval()); | |||
2106 | } | |||
2107 | ||||
2108 | MOZ_CAN_RUN_SCRIPT static bool | |||
2109 | set_cachedWritableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
2110 | { | |||
2111 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2114( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2112 | "TestExampleInterface", "cachedWritableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2114( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2113 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2114( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2114 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2114( cx, "TestExampleInterface" , "cachedWritableByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2115 | ||||
2116 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2117 | int8_t arg0; | |||
2118 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
2119 | return false; | |||
2120 | } | |||
2121 | // NOTE: This assert does NOT call the function. | |||
2122 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetCachedWritableByte(arg0))>, "Should be returning void here"); | |||
2123 | MOZ_KnownLive(self)(self)->SetCachedWritableByte(arg0); | |||
2124 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2124); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2124; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2125 | ||||
2126 | ClearCachedCachedWritableByteValue(self); | |||
2127 | return true; | |||
2128 | } | |||
2129 | ||||
2130 | static const JSJitInfo cachedWritableByte_getterinfo = { | |||
2131 | { get_cachedWritableByte }, | |||
2132 | { prototypes::id::TestExampleInterface }, | |||
2133 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2134 | JSJitInfo::Getter, | |||
2135 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
2136 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2137 | true, /* isInfallible. False in setters. */ | |||
2138 | true, /* isMovable. Not relevant for setters. */ | |||
2139 | true, /* isEliminatable. Not relevant for setters. */ | |||
2140 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2141 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2142 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2143 | (DOM_INSTANCE_RESERVED_SLOTS1 + 2) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2144 | }; | |||
2145 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 2) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
2146 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 2) < 22, "There is no slot for us"); | |||
2147 | static const JSJitInfo cachedWritableByte_setterinfo = { | |||
2148 | { (JSJitGetterOp)set_cachedWritableByte }, | |||
2149 | { prototypes::id::TestExampleInterface }, | |||
2150 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2151 | JSJitInfo::Setter, | |||
2152 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2153 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2154 | false, /* isInfallible. False in setters. */ | |||
2155 | false, /* isMovable. Not relevant for setters. */ | |||
2156 | false, /* isEliminatable. Not relevant for setters. */ | |||
2157 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2158 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2159 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2160 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2161 | }; | |||
2162 | ||||
2163 | MOZ_CAN_RUN_SCRIPT static bool | |||
2164 | get_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2165 | { | |||
2166 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2169( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2167 | "TestExampleInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2169( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2168 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2169( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2169 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2169( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2170 | ||||
2171 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2172 | int8_t result(MOZ_KnownLive(self)(self)->SideEffectFreeByte()); | |||
2173 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2173); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2173; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2174 | args.rval().setInt32(int32_t(result)); | |||
2175 | return true; | |||
2176 | } | |||
2177 | ||||
2178 | MOZ_CAN_RUN_SCRIPT static bool | |||
2179 | set_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
2180 | { | |||
2181 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2184( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2182 | "TestExampleInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2184( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2183 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2184( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2184 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2184( cx, "TestExampleInterface" , "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2185 | ||||
2186 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2187 | int8_t arg0; | |||
2188 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
2189 | return false; | |||
2190 | } | |||
2191 | // NOTE: This assert does NOT call the function. | |||
2192 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetSideEffectFreeByte(arg0))>, "Should be returning void here"); | |||
2193 | MOZ_KnownLive(self)(self)->SetSideEffectFreeByte(arg0); | |||
2194 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2194); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2194; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2195 | ||||
2196 | return true; | |||
2197 | } | |||
2198 | ||||
2199 | static const JSJitInfo sideEffectFreeByte_getterinfo = { | |||
2200 | { get_sideEffectFreeByte }, | |||
2201 | { prototypes::id::TestExampleInterface }, | |||
2202 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2203 | JSJitInfo::Getter, | |||
2204 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2205 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2206 | true, /* isInfallible. False in setters. */ | |||
2207 | false, /* isMovable. Not relevant for setters. */ | |||
2208 | false, /* isEliminatable. Not relevant for setters. */ | |||
2209 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2210 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2211 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2212 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2213 | }; | |||
2214 | static const JSJitInfo sideEffectFreeByte_setterinfo = { | |||
2215 | { (JSJitGetterOp)set_sideEffectFreeByte }, | |||
2216 | { prototypes::id::TestExampleInterface }, | |||
2217 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2218 | JSJitInfo::Setter, | |||
2219 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2220 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2221 | false, /* isInfallible. False in setters. */ | |||
2222 | false, /* isMovable. Not relevant for setters. */ | |||
2223 | false, /* isEliminatable. Not relevant for setters. */ | |||
2224 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2225 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2226 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2227 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2228 | }; | |||
2229 | ||||
2230 | MOZ_CAN_RUN_SCRIPT static bool | |||
2231 | get_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2232 | { | |||
2233 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2236( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2234 | "TestExampleInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2236( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2235 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2236( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2236 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2236( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2237 | ||||
2238 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2239 | int8_t result(MOZ_KnownLive(self)(self)->DomDependentByte()); | |||
2240 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2240); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2240; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2241 | args.rval().setInt32(int32_t(result)); | |||
2242 | return true; | |||
2243 | } | |||
2244 | ||||
2245 | MOZ_CAN_RUN_SCRIPT static bool | |||
2246 | set_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
2247 | { | |||
2248 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2251( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2249 | "TestExampleInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2251( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2250 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2251( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2251 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2251( cx, "TestExampleInterface" , "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2252 | ||||
2253 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2254 | int8_t arg0; | |||
2255 | if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
2256 | return false; | |||
2257 | } | |||
2258 | // NOTE: This assert does NOT call the function. | |||
2259 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetDomDependentByte(arg0))>, "Should be returning void here"); | |||
2260 | MOZ_KnownLive(self)(self)->SetDomDependentByte(arg0); | |||
2261 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2261); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2261; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2262 | ||||
2263 | return true; | |||
2264 | } | |||
2265 | ||||
2266 | static const JSJitInfo domDependentByte_getterinfo = { | |||
2267 | { get_domDependentByte }, | |||
2268 | { prototypes::id::TestExampleInterface }, | |||
2269 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2270 | JSJitInfo::Getter, | |||
2271 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
2272 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2273 | true, /* isInfallible. False in setters. */ | |||
2274 | true, /* isMovable. Not relevant for setters. */ | |||
2275 | true, /* isEliminatable. Not relevant for setters. */ | |||
2276 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2277 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2278 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2279 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2280 | }; | |||
2281 | static const JSJitInfo domDependentByte_setterinfo = { | |||
2282 | { (JSJitGetterOp)set_domDependentByte }, | |||
2283 | { prototypes::id::TestExampleInterface }, | |||
2284 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2285 | JSJitInfo::Setter, | |||
2286 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2287 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2288 | false, /* isInfallible. False in setters. */ | |||
2289 | false, /* isMovable. Not relevant for setters. */ | |||
2290 | false, /* isEliminatable. Not relevant for setters. */ | |||
2291 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2292 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2293 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2294 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2295 | }; | |||
2296 | ||||
2297 | MOZ_CAN_RUN_SCRIPT static bool | |||
2298 | get_constantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2299 | { | |||
2300 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2303( cx, "TestExampleInterface" , "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2301 | "TestExampleInterface", "constantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2303( cx, "TestExampleInterface" , "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2302 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2303( cx, "TestExampleInterface" , "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2303 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2303( cx, "TestExampleInterface" , "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2304 | ||||
2305 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2306 | int8_t result(MOZ_KnownLive(self)(self)->ConstantByte()); | |||
2307 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2307); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2307; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2308 | args.rval().setInt32(int32_t(result)); | |||
2309 | return true; | |||
2310 | } | |||
2311 | ||||
2312 | static const JSJitInfo constantByte_getterinfo = { | |||
2313 | { get_constantByte }, | |||
2314 | { prototypes::id::TestExampleInterface }, | |||
2315 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2316 | JSJitInfo::Getter, | |||
2317 | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ | |||
2318 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2319 | true, /* isInfallible. False in setters. */ | |||
2320 | true, /* isMovable. Not relevant for setters. */ | |||
2321 | true, /* isEliminatable. Not relevant for setters. */ | |||
2322 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2323 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2324 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2325 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2326 | }; | |||
2327 | ||||
2328 | MOZ_CAN_RUN_SCRIPT static bool | |||
2329 | get_deviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2330 | { | |||
2331 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2334( cx, "TestExampleInterface" , "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2332 | "TestExampleInterface", "deviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2334( cx, "TestExampleInterface" , "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2333 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2334( cx, "TestExampleInterface" , "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2334 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2334( cx, "TestExampleInterface" , "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
2335 | ||||
2336 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2337 | int8_t result(MOZ_KnownLive(self)(self)->DeviceStateDependentByte()); | |||
2338 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2338); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2338; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2339 | args.rval().setInt32(int32_t(result)); | |||
2340 | return true; | |||
2341 | } | |||
2342 | ||||
2343 | static const JSJitInfo deviceStateDependentByte_getterinfo = { | |||
2344 | { get_deviceStateDependentByte }, | |||
2345 | { prototypes::id::TestExampleInterface }, | |||
2346 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2347 | JSJitInfo::Getter, | |||
2348 | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ | |||
2349 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2350 | true, /* isInfallible. False in setters. */ | |||
2351 | false, /* isMovable. Not relevant for setters. */ | |||
2352 | true, /* isEliminatable. Not relevant for setters. */ | |||
2353 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2354 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2355 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2356 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2357 | }; | |||
2358 | ||||
2359 | MOZ_CAN_RUN_SCRIPT static bool | |||
2360 | returnByteSideEffectFree(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2361 | { | |||
2362 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2365( cx, "TestExampleInterface" , "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2363 | "TestExampleInterface", "returnByteSideEffectFree", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2365( cx, "TestExampleInterface" , "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2364 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2365( cx, "TestExampleInterface" , "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2365 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2365( cx, "TestExampleInterface" , "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
2366 | ||||
2367 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2368 | int8_t result(MOZ_KnownLive(self)(self)->ReturnByteSideEffectFree()); | |||
2369 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2369); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2369; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2370 | args.rval().setInt32(int32_t(result)); | |||
2371 | return true; | |||
2372 | } | |||
2373 | ||||
2374 | static const JSJitInfo::ArgType returnByteSideEffectFree_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | |||
2375 | static const JSTypedMethodJitInfo returnByteSideEffectFree_methodinfo = { | |||
2376 | { | |||
2377 | { (JSJitGetterOp)returnByteSideEffectFree }, | |||
2378 | { prototypes::id::TestExampleInterface }, | |||
2379 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2380 | JSJitInfo::Method, | |||
2381 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2382 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2383 | true, /* isInfallible. False in setters. */ | |||
2384 | false, /* isMovable. Not relevant for setters. */ | |||
2385 | false, /* isEliminatable. Not relevant for setters. */ | |||
2386 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2387 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2388 | true, /* isTypedMethod. Only relevant for methods. */ | |||
2389 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2390 | }, | |||
2391 | returnByteSideEffectFree_methodinfo_argTypes | |||
2392 | }; | |||
2393 | ||||
2394 | MOZ_CAN_RUN_SCRIPT static bool | |||
2395 | returnDOMDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2396 | { | |||
2397 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2400( cx, "TestExampleInterface" , "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2398 | "TestExampleInterface", "returnDOMDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2400( cx, "TestExampleInterface" , "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2399 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2400( cx, "TestExampleInterface" , "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2400 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2400( cx, "TestExampleInterface" , "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2401 | ||||
2402 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2403 | int8_t result(MOZ_KnownLive(self)(self)->ReturnDOMDependentByte()); | |||
2404 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2404); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2404; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2405 | args.rval().setInt32(int32_t(result)); | |||
2406 | return true; | |||
2407 | } | |||
2408 | ||||
2409 | static const JSJitInfo::ArgType returnDOMDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | |||
2410 | static const JSTypedMethodJitInfo returnDOMDependentByte_methodinfo = { | |||
2411 | { | |||
2412 | { (JSJitGetterOp)returnDOMDependentByte }, | |||
2413 | { prototypes::id::TestExampleInterface }, | |||
2414 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2415 | JSJitInfo::Method, | |||
2416 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
2417 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2418 | true, /* isInfallible. False in setters. */ | |||
2419 | true, /* isMovable. Not relevant for setters. */ | |||
2420 | true, /* isEliminatable. Not relevant for setters. */ | |||
2421 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2422 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2423 | true, /* isTypedMethod. Only relevant for methods. */ | |||
2424 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2425 | }, | |||
2426 | returnDOMDependentByte_methodinfo_argTypes | |||
2427 | }; | |||
2428 | ||||
2429 | MOZ_CAN_RUN_SCRIPT static bool | |||
2430 | returnConstantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2431 | { | |||
2432 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2435( cx, "TestExampleInterface" , "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2433 | "TestExampleInterface", "returnConstantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2435( cx, "TestExampleInterface" , "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2434 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2435( cx, "TestExampleInterface" , "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2435 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2435( cx, "TestExampleInterface" , "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2436 | ||||
2437 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2438 | int8_t result(MOZ_KnownLive(self)(self)->ReturnConstantByte()); | |||
2439 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2439); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2439; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2440 | args.rval().setInt32(int32_t(result)); | |||
2441 | return true; | |||
2442 | } | |||
2443 | ||||
2444 | static const JSJitInfo::ArgType returnConstantByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | |||
2445 | static const JSTypedMethodJitInfo returnConstantByte_methodinfo = { | |||
2446 | { | |||
2447 | { (JSJitGetterOp)returnConstantByte }, | |||
2448 | { prototypes::id::TestExampleInterface }, | |||
2449 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2450 | JSJitInfo::Method, | |||
2451 | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ | |||
2452 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2453 | true, /* isInfallible. False in setters. */ | |||
2454 | true, /* isMovable. Not relevant for setters. */ | |||
2455 | true, /* isEliminatable. Not relevant for setters. */ | |||
2456 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2457 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2458 | true, /* isTypedMethod. Only relevant for methods. */ | |||
2459 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2460 | }, | |||
2461 | returnConstantByte_methodinfo_argTypes | |||
2462 | }; | |||
2463 | ||||
2464 | MOZ_CAN_RUN_SCRIPT static bool | |||
2465 | returnDeviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2466 | { | |||
2467 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2470( cx, "TestExampleInterface" , "returnDeviceStateDependentByte", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2468 | "TestExampleInterface", "returnDeviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2470( cx, "TestExampleInterface" , "returnDeviceStateDependentByte", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2469 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2470( cx, "TestExampleInterface" , "returnDeviceStateDependentByte", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2470 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2470( cx, "TestExampleInterface" , "returnDeviceStateDependentByte", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
2471 | ||||
2472 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2473 | int8_t result(MOZ_KnownLive(self)(self)->ReturnDeviceStateDependentByte()); | |||
2474 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2474); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2474; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2475 | args.rval().setInt32(int32_t(result)); | |||
2476 | return true; | |||
2477 | } | |||
2478 | ||||
2479 | static const JSJitInfo::ArgType returnDeviceStateDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd }; | |||
2480 | static const JSTypedMethodJitInfo returnDeviceStateDependentByte_methodinfo = { | |||
2481 | { | |||
2482 | { (JSJitGetterOp)returnDeviceStateDependentByte }, | |||
2483 | { prototypes::id::TestExampleInterface }, | |||
2484 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2485 | JSJitInfo::Method, | |||
2486 | JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */ | |||
2487 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2488 | true, /* isInfallible. False in setters. */ | |||
2489 | false, /* isMovable. Not relevant for setters. */ | |||
2490 | true, /* isEliminatable. Not relevant for setters. */ | |||
2491 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2492 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2493 | true, /* isTypedMethod. Only relevant for methods. */ | |||
2494 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2495 | }, | |||
2496 | returnDeviceStateDependentByte_methodinfo_argTypes | |||
2497 | }; | |||
2498 | ||||
2499 | MOZ_CAN_RUN_SCRIPT static bool | |||
2500 | get_readonlyShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2501 | { | |||
2502 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2505( cx, "TestExampleInterface" , "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2503 | "TestExampleInterface", "readonlyShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2505( cx, "TestExampleInterface" , "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2504 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2505( cx, "TestExampleInterface" , "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2505 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2505( cx, "TestExampleInterface" , "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2506 | ||||
2507 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2508 | int16_t result(MOZ_KnownLive(self)(self)->ReadonlyShort()); | |||
2509 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2509); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2509; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2510 | args.rval().setInt32(int32_t(result)); | |||
2511 | return true; | |||
2512 | } | |||
2513 | ||||
2514 | static const JSJitInfo readonlyShort_getterinfo = { | |||
2515 | { get_readonlyShort }, | |||
2516 | { prototypes::id::TestExampleInterface }, | |||
2517 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2518 | JSJitInfo::Getter, | |||
2519 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2520 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2521 | true, /* isInfallible. False in setters. */ | |||
2522 | false, /* isMovable. Not relevant for setters. */ | |||
2523 | false, /* isEliminatable. Not relevant for setters. */ | |||
2524 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2525 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2526 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2527 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2528 | }; | |||
2529 | ||||
2530 | MOZ_CAN_RUN_SCRIPT static bool | |||
2531 | get_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2532 | { | |||
2533 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2536( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2534 | "TestExampleInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2536( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2535 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2536( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2536 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2536( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2537 | ||||
2538 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2539 | int16_t result(MOZ_KnownLive(self)(self)->WritableShort()); | |||
2540 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2540); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2540; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2541 | args.rval().setInt32(int32_t(result)); | |||
2542 | return true; | |||
2543 | } | |||
2544 | ||||
2545 | MOZ_CAN_RUN_SCRIPT static bool | |||
2546 | set_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
2547 | { | |||
2548 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2551( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2549 | "TestExampleInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2551( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2550 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2551( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2551 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2551( cx, "TestExampleInterface" , "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2552 | ||||
2553 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2554 | int16_t arg0; | |||
2555 | if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
2556 | return false; | |||
2557 | } | |||
2558 | // NOTE: This assert does NOT call the function. | |||
2559 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableShort(arg0))>, "Should be returning void here"); | |||
2560 | MOZ_KnownLive(self)(self)->SetWritableShort(arg0); | |||
2561 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2561); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2561; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2562 | ||||
2563 | return true; | |||
2564 | } | |||
2565 | ||||
2566 | static const JSJitInfo writableShort_getterinfo = { | |||
2567 | { get_writableShort }, | |||
2568 | { prototypes::id::TestExampleInterface }, | |||
2569 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2570 | JSJitInfo::Getter, | |||
2571 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2572 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2573 | true, /* isInfallible. False in setters. */ | |||
2574 | false, /* isMovable. Not relevant for setters. */ | |||
2575 | false, /* isEliminatable. Not relevant for setters. */ | |||
2576 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2577 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2578 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2579 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2580 | }; | |||
2581 | static const JSJitInfo writableShort_setterinfo = { | |||
2582 | { (JSJitGetterOp)set_writableShort }, | |||
2583 | { prototypes::id::TestExampleInterface }, | |||
2584 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2585 | JSJitInfo::Setter, | |||
2586 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2587 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2588 | false, /* isInfallible. False in setters. */ | |||
2589 | false, /* isMovable. Not relevant for setters. */ | |||
2590 | false, /* isEliminatable. Not relevant for setters. */ | |||
2591 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2592 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2593 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2594 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2595 | }; | |||
2596 | ||||
2597 | MOZ_CAN_RUN_SCRIPT static bool | |||
2598 | passShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2599 | { | |||
2600 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2603( cx, "TestExampleInterface" , "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
2601 | "TestExampleInterface", "passShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2603( cx, "TestExampleInterface" , "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
2602 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2603( cx, "TestExampleInterface" , "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
2603 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2603( cx, "TestExampleInterface" , "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
2604 | ||||
2605 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2606 | if (!args.requireAtLeast(cx, "TestExampleInterface.passShort", 1)) { | |||
2607 | return false; | |||
2608 | } | |||
2609 | int16_t arg0; | |||
2610 | if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
2611 | return false; | |||
2612 | } | |||
2613 | // NOTE: This assert does NOT call the function. | |||
2614 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassShort(arg0))>, "Should be returning void here"); | |||
2615 | MOZ_KnownLive(self)(self)->PassShort(arg0); | |||
2616 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2616); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2616; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2617 | args.rval().setUndefined(); | |||
2618 | return true; | |||
2619 | } | |||
2620 | ||||
2621 | static const JSJitInfo passShort_methodinfo = { | |||
2622 | { (JSJitGetterOp)passShort }, | |||
2623 | { prototypes::id::TestExampleInterface }, | |||
2624 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2625 | JSJitInfo::Method, | |||
2626 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2627 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2628 | false, /* isInfallible. False in setters. */ | |||
2629 | false, /* isMovable. Not relevant for setters. */ | |||
2630 | false, /* isEliminatable. Not relevant for setters. */ | |||
2631 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2632 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2633 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2634 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2635 | }; | |||
2636 | ||||
2637 | MOZ_CAN_RUN_SCRIPT static bool | |||
2638 | receiveShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2639 | { | |||
2640 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestExampleInterface" , "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2641 | "TestExampleInterface", "receiveShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestExampleInterface" , "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2642 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestExampleInterface" , "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2643 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestExampleInterface" , "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2644 | ||||
2645 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2646 | int16_t result(MOZ_KnownLive(self)(self)->ReceiveShort()); | |||
2647 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2647); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2647; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2648 | args.rval().setInt32(int32_t(result)); | |||
2649 | return true; | |||
2650 | } | |||
2651 | ||||
2652 | static const JSJitInfo receiveShort_methodinfo = { | |||
2653 | { (JSJitGetterOp)receiveShort }, | |||
2654 | { prototypes::id::TestExampleInterface }, | |||
2655 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2656 | JSJitInfo::Method, | |||
2657 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2658 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2659 | true, /* isInfallible. False in setters. */ | |||
2660 | false, /* isMovable. Not relevant for setters. */ | |||
2661 | false, /* isEliminatable. Not relevant for setters. */ | |||
2662 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2663 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2664 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2665 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2666 | }; | |||
2667 | ||||
2668 | MOZ_CAN_RUN_SCRIPT static bool | |||
2669 | passOptionalShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2670 | { | |||
2671 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2674( cx, "TestExampleInterface" , "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2672 | "TestExampleInterface", "passOptionalShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2674( cx, "TestExampleInterface" , "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2673 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2674( cx, "TestExampleInterface" , "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2674 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2674( cx, "TestExampleInterface" , "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2675 | ||||
2676 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2677 | Optional<int16_t> arg0; | |||
2678 | if (args.hasDefined(0)) { | |||
2679 | arg0.Construct(); | |||
2680 | if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
2681 | return false; | |||
2682 | } | |||
2683 | } | |||
2684 | // NOTE: This assert does NOT call the function. | |||
2685 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalShort(Constify(arg0)))>, "Should be returning void here"); | |||
2686 | MOZ_KnownLive(self)(self)->PassOptionalShort(Constify(arg0)); | |||
2687 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2687); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2687; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2688 | args.rval().setUndefined(); | |||
2689 | return true; | |||
2690 | } | |||
2691 | ||||
2692 | static const JSJitInfo passOptionalShort_methodinfo = { | |||
2693 | { (JSJitGetterOp)passOptionalShort }, | |||
2694 | { prototypes::id::TestExampleInterface }, | |||
2695 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2696 | JSJitInfo::Method, | |||
2697 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2698 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2699 | false, /* isInfallible. False in setters. */ | |||
2700 | false, /* isMovable. Not relevant for setters. */ | |||
2701 | false, /* isEliminatable. Not relevant for setters. */ | |||
2702 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2703 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2704 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2705 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2706 | }; | |||
2707 | ||||
2708 | MOZ_CAN_RUN_SCRIPT static bool | |||
2709 | passOptionalShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2710 | { | |||
2711 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2714( cx, "TestExampleInterface" , "passOptionalShortWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2712 | "TestExampleInterface", "passOptionalShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2714( cx, "TestExampleInterface" , "passOptionalShortWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2713 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2714( cx, "TestExampleInterface" , "passOptionalShortWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2714 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2714( cx, "TestExampleInterface" , "passOptionalShortWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
2715 | ||||
2716 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2717 | int16_t arg0; | |||
2718 | if (args.hasDefined(0)) { | |||
2719 | if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
2720 | return false; | |||
2721 | } | |||
2722 | } else { | |||
2723 | arg0 = 5; | |||
2724 | } | |||
2725 | // NOTE: This assert does NOT call the function. | |||
2726 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalShortWithDefault(arg0))>, "Should be returning void here"); | |||
2727 | MOZ_KnownLive(self)(self)->PassOptionalShortWithDefault(arg0); | |||
2728 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2728); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2728; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2729 | args.rval().setUndefined(); | |||
2730 | return true; | |||
2731 | } | |||
2732 | ||||
2733 | static const JSJitInfo passOptionalShortWithDefault_methodinfo = { | |||
2734 | { (JSJitGetterOp)passOptionalShortWithDefault }, | |||
2735 | { prototypes::id::TestExampleInterface }, | |||
2736 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2737 | JSJitInfo::Method, | |||
2738 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2739 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2740 | false, /* isInfallible. False in setters. */ | |||
2741 | false, /* isMovable. Not relevant for setters. */ | |||
2742 | false, /* isEliminatable. Not relevant for setters. */ | |||
2743 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2744 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2745 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2746 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2747 | }; | |||
2748 | ||||
2749 | MOZ_CAN_RUN_SCRIPT static bool | |||
2750 | get_readonlyLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2751 | { | |||
2752 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2755( cx, "TestExampleInterface" , "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2753 | "TestExampleInterface", "readonlyLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2755( cx, "TestExampleInterface" , "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2754 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2755( cx, "TestExampleInterface" , "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2755 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2755( cx, "TestExampleInterface" , "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2756 | ||||
2757 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2758 | int32_t result(MOZ_KnownLive(self)(self)->ReadonlyLong()); | |||
2759 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2759); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2759; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2760 | args.rval().setInt32(int32_t(result)); | |||
2761 | return true; | |||
2762 | } | |||
2763 | ||||
2764 | static const JSJitInfo readonlyLong_getterinfo = { | |||
2765 | { get_readonlyLong }, | |||
2766 | { prototypes::id::TestExampleInterface }, | |||
2767 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2768 | JSJitInfo::Getter, | |||
2769 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2770 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2771 | true, /* isInfallible. False in setters. */ | |||
2772 | false, /* isMovable. Not relevant for setters. */ | |||
2773 | false, /* isEliminatable. Not relevant for setters. */ | |||
2774 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2775 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2776 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2777 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2778 | }; | |||
2779 | ||||
2780 | MOZ_CAN_RUN_SCRIPT static bool | |||
2781 | get_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
2782 | { | |||
2783 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2786( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2784 | "TestExampleInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2786( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2785 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2786( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2786 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2786( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2787 | ||||
2788 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2789 | int32_t result(MOZ_KnownLive(self)(self)->WritableLong()); | |||
2790 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2790); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2790; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2791 | args.rval().setInt32(int32_t(result)); | |||
2792 | return true; | |||
2793 | } | |||
2794 | ||||
2795 | MOZ_CAN_RUN_SCRIPT static bool | |||
2796 | set_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
2797 | { | |||
2798 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2799 | "TestExampleInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2800 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2801 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestExampleInterface" , "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2802 | ||||
2803 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2804 | int32_t arg0; | |||
2805 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
2806 | return false; | |||
2807 | } | |||
2808 | // NOTE: This assert does NOT call the function. | |||
2809 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableLong(arg0))>, "Should be returning void here"); | |||
2810 | MOZ_KnownLive(self)(self)->SetWritableLong(arg0); | |||
2811 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2811); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2811; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2812 | ||||
2813 | return true; | |||
2814 | } | |||
2815 | ||||
2816 | static const JSJitInfo writableLong_getterinfo = { | |||
2817 | { get_writableLong }, | |||
2818 | { prototypes::id::TestExampleInterface }, | |||
2819 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2820 | JSJitInfo::Getter, | |||
2821 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2822 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2823 | true, /* isInfallible. False in setters. */ | |||
2824 | false, /* isMovable. Not relevant for setters. */ | |||
2825 | false, /* isEliminatable. Not relevant for setters. */ | |||
2826 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2827 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2828 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2829 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2830 | }; | |||
2831 | static const JSJitInfo writableLong_setterinfo = { | |||
2832 | { (JSJitGetterOp)set_writableLong }, | |||
2833 | { prototypes::id::TestExampleInterface }, | |||
2834 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2835 | JSJitInfo::Setter, | |||
2836 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2837 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2838 | false, /* isInfallible. False in setters. */ | |||
2839 | false, /* isMovable. Not relevant for setters. */ | |||
2840 | false, /* isEliminatable. Not relevant for setters. */ | |||
2841 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2842 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2843 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2844 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2845 | }; | |||
2846 | ||||
2847 | MOZ_CAN_RUN_SCRIPT static bool | |||
2848 | passLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2849 | { | |||
2850 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2853( cx, "TestExampleInterface" , "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
2851 | "TestExampleInterface", "passLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2853( cx, "TestExampleInterface" , "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
2852 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2853( cx, "TestExampleInterface" , "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
2853 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2853( cx, "TestExampleInterface" , "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
2854 | ||||
2855 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2856 | if (!args.requireAtLeast(cx, "TestExampleInterface.passLong", 1)) { | |||
2857 | return false; | |||
2858 | } | |||
2859 | int32_t arg0; | |||
2860 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
2861 | return false; | |||
2862 | } | |||
2863 | // NOTE: This assert does NOT call the function. | |||
2864 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLong(arg0))>, "Should be returning void here"); | |||
2865 | MOZ_KnownLive(self)(self)->PassLong(arg0); | |||
2866 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2866); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2866; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2867 | args.rval().setUndefined(); | |||
2868 | return true; | |||
2869 | } | |||
2870 | ||||
2871 | static const JSJitInfo passLong_methodinfo = { | |||
2872 | { (JSJitGetterOp)passLong }, | |||
2873 | { prototypes::id::TestExampleInterface }, | |||
2874 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2875 | JSJitInfo::Method, | |||
2876 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2877 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2878 | false, /* isInfallible. False in setters. */ | |||
2879 | false, /* isMovable. Not relevant for setters. */ | |||
2880 | false, /* isEliminatable. Not relevant for setters. */ | |||
2881 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2882 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2883 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2884 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2885 | }; | |||
2886 | ||||
2887 | MOZ_CAN_RUN_SCRIPT static bool | |||
2888 | receiveLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2889 | { | |||
2890 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2893( cx, "TestExampleInterface" , "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2891 | "TestExampleInterface", "receiveLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2893( cx, "TestExampleInterface" , "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2892 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2893( cx, "TestExampleInterface" , "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2893 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2893( cx, "TestExampleInterface" , "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2894 | ||||
2895 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2896 | int32_t result(MOZ_KnownLive(self)(self)->ReceiveLong()); | |||
2897 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2897); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2897; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2898 | args.rval().setInt32(int32_t(result)); | |||
2899 | return true; | |||
2900 | } | |||
2901 | ||||
2902 | static const JSJitInfo receiveLong_methodinfo = { | |||
2903 | { (JSJitGetterOp)receiveLong }, | |||
2904 | { prototypes::id::TestExampleInterface }, | |||
2905 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2906 | JSJitInfo::Method, | |||
2907 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2908 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
2909 | true, /* isInfallible. False in setters. */ | |||
2910 | false, /* isMovable. Not relevant for setters. */ | |||
2911 | false, /* isEliminatable. Not relevant for setters. */ | |||
2912 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2913 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2914 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2915 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2916 | }; | |||
2917 | ||||
2918 | MOZ_CAN_RUN_SCRIPT static bool | |||
2919 | passOptionalLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2920 | { | |||
2921 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2924( cx, "TestExampleInterface" , "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2922 | "TestExampleInterface", "passOptionalLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2924( cx, "TestExampleInterface" , "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2923 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2924( cx, "TestExampleInterface" , "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
2924 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2924( cx, "TestExampleInterface" , "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
2925 | ||||
2926 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2927 | Optional<int32_t> arg0; | |||
2928 | if (args.hasDefined(0)) { | |||
2929 | arg0.Construct(); | |||
2930 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
2931 | return false; | |||
2932 | } | |||
2933 | } | |||
2934 | // NOTE: This assert does NOT call the function. | |||
2935 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLong(Constify(arg0)))>, "Should be returning void here"); | |||
2936 | MOZ_KnownLive(self)(self)->PassOptionalLong(Constify(arg0)); | |||
2937 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2937); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2937; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2938 | args.rval().setUndefined(); | |||
2939 | return true; | |||
2940 | } | |||
2941 | ||||
2942 | static const JSJitInfo passOptionalLong_methodinfo = { | |||
2943 | { (JSJitGetterOp)passOptionalLong }, | |||
2944 | { prototypes::id::TestExampleInterface }, | |||
2945 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2946 | JSJitInfo::Method, | |||
2947 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2948 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2949 | false, /* isInfallible. False in setters. */ | |||
2950 | false, /* isMovable. Not relevant for setters. */ | |||
2951 | false, /* isEliminatable. Not relevant for setters. */ | |||
2952 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2953 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2954 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2955 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2956 | }; | |||
2957 | ||||
2958 | MOZ_CAN_RUN_SCRIPT static bool | |||
2959 | passOptionalLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
2960 | { | |||
2961 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestExampleInterface" , "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2962 | "TestExampleInterface", "passOptionalLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestExampleInterface" , "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2963 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestExampleInterface" , "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
2964 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestExampleInterface" , "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
2965 | ||||
2966 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
2967 | int32_t arg0; | |||
2968 | if (args.hasDefined(0)) { | |||
2969 | if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
2970 | return false; | |||
2971 | } | |||
2972 | } else { | |||
2973 | arg0 = 7; | |||
2974 | } | |||
2975 | // NOTE: This assert does NOT call the function. | |||
2976 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongWithDefault(arg0))>, "Should be returning void here"); | |||
2977 | MOZ_KnownLive(self)(self)->PassOptionalLongWithDefault(arg0); | |||
2978 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 2978); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 2978; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2979 | args.rval().setUndefined(); | |||
2980 | return true; | |||
2981 | } | |||
2982 | ||||
2983 | static const JSJitInfo passOptionalLongWithDefault_methodinfo = { | |||
2984 | { (JSJitGetterOp)passOptionalLongWithDefault }, | |||
2985 | { prototypes::id::TestExampleInterface }, | |||
2986 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
2987 | JSJitInfo::Method, | |||
2988 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
2989 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
2990 | false, /* isInfallible. False in setters. */ | |||
2991 | false, /* isMovable. Not relevant for setters. */ | |||
2992 | false, /* isEliminatable. Not relevant for setters. */ | |||
2993 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
2994 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
2995 | false, /* isTypedMethod. Only relevant for methods. */ | |||
2996 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
2997 | }; | |||
2998 | ||||
2999 | MOZ_CAN_RUN_SCRIPT static bool | |||
3000 | get_readonlyLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3001 | { | |||
3002 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3005( cx, "TestExampleInterface" , "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3003 | "TestExampleInterface", "readonlyLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3005( cx, "TestExampleInterface" , "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3004 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3005( cx, "TestExampleInterface" , "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3005 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3005( cx, "TestExampleInterface" , "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3006 | ||||
3007 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3008 | int64_t result(MOZ_KnownLive(self)(self)->ReadonlyLongLong()); | |||
3009 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3009); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3009; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3010 | args.rval().set(JS_NumberValue(double(result))); | |||
3011 | return true; | |||
3012 | } | |||
3013 | ||||
3014 | static const JSJitInfo readonlyLongLong_getterinfo = { | |||
3015 | { get_readonlyLongLong }, | |||
3016 | { prototypes::id::TestExampleInterface }, | |||
3017 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3018 | JSJitInfo::Getter, | |||
3019 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3020 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
3021 | true, /* isInfallible. False in setters. */ | |||
3022 | false, /* isMovable. Not relevant for setters. */ | |||
3023 | false, /* isEliminatable. Not relevant for setters. */ | |||
3024 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3025 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3026 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3027 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3028 | }; | |||
3029 | ||||
3030 | MOZ_CAN_RUN_SCRIPT static bool | |||
3031 | get_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3032 | { | |||
3033 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3036( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3034 | "TestExampleInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3036( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3035 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3036( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3036 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3036( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3037 | ||||
3038 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3039 | int64_t result(MOZ_KnownLive(self)(self)->WritableLongLong()); | |||
3040 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3040); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3040; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3041 | args.rval().set(JS_NumberValue(double(result))); | |||
3042 | return true; | |||
3043 | } | |||
3044 | ||||
3045 | MOZ_CAN_RUN_SCRIPT static bool | |||
3046 | set_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
3047 | { | |||
3048 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3051( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3049 | "TestExampleInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3051( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3050 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3051( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3051 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3051( cx, "TestExampleInterface" , "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3052 | ||||
3053 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3054 | int64_t arg0; | |||
3055 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
3056 | return false; | |||
3057 | } | |||
3058 | // NOTE: This assert does NOT call the function. | |||
3059 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableLongLong(arg0))>, "Should be returning void here"); | |||
3060 | MOZ_KnownLive(self)(self)->SetWritableLongLong(arg0); | |||
3061 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3061); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3061; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3062 | ||||
3063 | return true; | |||
3064 | } | |||
3065 | ||||
3066 | static const JSJitInfo writableLongLong_getterinfo = { | |||
3067 | { get_writableLongLong }, | |||
3068 | { prototypes::id::TestExampleInterface }, | |||
3069 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3070 | JSJitInfo::Getter, | |||
3071 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3072 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
3073 | true, /* isInfallible. False in setters. */ | |||
3074 | false, /* isMovable. Not relevant for setters. */ | |||
3075 | false, /* isEliminatable. Not relevant for setters. */ | |||
3076 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3077 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3078 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3079 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3080 | }; | |||
3081 | static const JSJitInfo writableLongLong_setterinfo = { | |||
3082 | { (JSJitGetterOp)set_writableLongLong }, | |||
3083 | { prototypes::id::TestExampleInterface }, | |||
3084 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3085 | JSJitInfo::Setter, | |||
3086 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3087 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3088 | false, /* isInfallible. False in setters. */ | |||
3089 | false, /* isMovable. Not relevant for setters. */ | |||
3090 | false, /* isEliminatable. Not relevant for setters. */ | |||
3091 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3092 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3093 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3094 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3095 | }; | |||
3096 | ||||
3097 | MOZ_CAN_RUN_SCRIPT static bool | |||
3098 | passLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3099 | { | |||
3100 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3103( cx, "TestExampleInterface" , "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3101 | "TestExampleInterface", "passLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3103( cx, "TestExampleInterface" , "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3102 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3103( cx, "TestExampleInterface" , "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3103 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3103( cx, "TestExampleInterface" , "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3104 | ||||
3105 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3106 | if (!args.requireAtLeast(cx, "TestExampleInterface.passLongLong", 1)) { | |||
3107 | return false; | |||
3108 | } | |||
3109 | int64_t arg0; | |||
3110 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3111 | return false; | |||
3112 | } | |||
3113 | // NOTE: This assert does NOT call the function. | |||
3114 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLongLong(arg0))>, "Should be returning void here"); | |||
3115 | MOZ_KnownLive(self)(self)->PassLongLong(arg0); | |||
3116 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3116; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3117 | args.rval().setUndefined(); | |||
3118 | return true; | |||
3119 | } | |||
3120 | ||||
3121 | static const JSJitInfo passLongLong_methodinfo = { | |||
3122 | { (JSJitGetterOp)passLongLong }, | |||
3123 | { prototypes::id::TestExampleInterface }, | |||
3124 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3125 | JSJitInfo::Method, | |||
3126 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3127 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3128 | false, /* isInfallible. False in setters. */ | |||
3129 | false, /* isMovable. Not relevant for setters. */ | |||
3130 | false, /* isEliminatable. Not relevant for setters. */ | |||
3131 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3132 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3133 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3134 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3135 | }; | |||
3136 | ||||
3137 | MOZ_CAN_RUN_SCRIPT static bool | |||
3138 | receiveLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3139 | { | |||
3140 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3143( cx, "TestExampleInterface" , "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3141 | "TestExampleInterface", "receiveLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3143( cx, "TestExampleInterface" , "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3142 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3143( cx, "TestExampleInterface" , "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3143 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3143( cx, "TestExampleInterface" , "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3144 | ||||
3145 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3146 | int64_t result(MOZ_KnownLive(self)(self)->ReceiveLongLong()); | |||
3147 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3147); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3147; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3148 | args.rval().set(JS_NumberValue(double(result))); | |||
3149 | return true; | |||
3150 | } | |||
3151 | ||||
3152 | static const JSJitInfo receiveLongLong_methodinfo = { | |||
3153 | { (JSJitGetterOp)receiveLongLong }, | |||
3154 | { prototypes::id::TestExampleInterface }, | |||
3155 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3156 | JSJitInfo::Method, | |||
3157 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3158 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
3159 | true, /* isInfallible. False in setters. */ | |||
3160 | false, /* isMovable. Not relevant for setters. */ | |||
3161 | false, /* isEliminatable. Not relevant for setters. */ | |||
3162 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3163 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3164 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3165 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3166 | }; | |||
3167 | ||||
3168 | MOZ_CAN_RUN_SCRIPT static bool | |||
3169 | passOptionalLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3170 | { | |||
3171 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3174( cx, "TestExampleInterface" , "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3172 | "TestExampleInterface", "passOptionalLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3174( cx, "TestExampleInterface" , "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3173 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3174( cx, "TestExampleInterface" , "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3174 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3174( cx, "TestExampleInterface" , "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3175 | ||||
3176 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3177 | Optional<int64_t> arg0; | |||
3178 | if (args.hasDefined(0)) { | |||
3179 | arg0.Construct(); | |||
3180 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
3181 | return false; | |||
3182 | } | |||
3183 | } | |||
3184 | // NOTE: This assert does NOT call the function. | |||
3185 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongLong(Constify(arg0)))>, "Should be returning void here"); | |||
3186 | MOZ_KnownLive(self)(self)->PassOptionalLongLong(Constify(arg0)); | |||
3187 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3187); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3187; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3188 | args.rval().setUndefined(); | |||
3189 | return true; | |||
3190 | } | |||
3191 | ||||
3192 | static const JSJitInfo passOptionalLongLong_methodinfo = { | |||
3193 | { (JSJitGetterOp)passOptionalLongLong }, | |||
3194 | { prototypes::id::TestExampleInterface }, | |||
3195 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3196 | JSJitInfo::Method, | |||
3197 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3198 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3199 | false, /* isInfallible. False in setters. */ | |||
3200 | false, /* isMovable. Not relevant for setters. */ | |||
3201 | false, /* isEliminatable. Not relevant for setters. */ | |||
3202 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3203 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3204 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3205 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3206 | }; | |||
3207 | ||||
3208 | MOZ_CAN_RUN_SCRIPT static bool | |||
3209 | passOptionalLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3210 | { | |||
3211 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestExampleInterface" , "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3212 | "TestExampleInterface", "passOptionalLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestExampleInterface" , "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3213 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestExampleInterface" , "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3214 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestExampleInterface" , "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
3215 | ||||
3216 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3217 | int64_t arg0; | |||
3218 | if (args.hasDefined(0)) { | |||
3219 | if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3220 | return false; | |||
3221 | } | |||
3222 | } else { | |||
3223 | arg0 = -12LL; | |||
3224 | } | |||
3225 | // NOTE: This assert does NOT call the function. | |||
3226 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongLongWithDefault(arg0))>, "Should be returning void here"); | |||
3227 | MOZ_KnownLive(self)(self)->PassOptionalLongLongWithDefault(arg0); | |||
3228 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3228); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3228; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3229 | args.rval().setUndefined(); | |||
3230 | return true; | |||
3231 | } | |||
3232 | ||||
3233 | static const JSJitInfo passOptionalLongLongWithDefault_methodinfo = { | |||
3234 | { (JSJitGetterOp)passOptionalLongLongWithDefault }, | |||
3235 | { prototypes::id::TestExampleInterface }, | |||
3236 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3237 | JSJitInfo::Method, | |||
3238 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3239 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3240 | false, /* isInfallible. False in setters. */ | |||
3241 | false, /* isMovable. Not relevant for setters. */ | |||
3242 | false, /* isEliminatable. Not relevant for setters. */ | |||
3243 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3244 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3245 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3246 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3247 | }; | |||
3248 | ||||
3249 | MOZ_CAN_RUN_SCRIPT static bool | |||
3250 | get_readonlyOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3251 | { | |||
3252 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3255( cx, "TestExampleInterface" , "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3253 | "TestExampleInterface", "readonlyOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3255( cx, "TestExampleInterface" , "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3254 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3255( cx, "TestExampleInterface" , "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3255 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3255( cx, "TestExampleInterface" , "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3256 | ||||
3257 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3258 | uint8_t result(MOZ_KnownLive(self)(self)->ReadonlyOctet()); | |||
3259 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3259); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3259; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3260 | args.rval().setInt32(int32_t(result)); | |||
3261 | return true; | |||
3262 | } | |||
3263 | ||||
3264 | static const JSJitInfo readonlyOctet_getterinfo = { | |||
3265 | { get_readonlyOctet }, | |||
3266 | { prototypes::id::TestExampleInterface }, | |||
3267 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3268 | JSJitInfo::Getter, | |||
3269 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3270 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
3271 | true, /* isInfallible. False in setters. */ | |||
3272 | false, /* isMovable. Not relevant for setters. */ | |||
3273 | false, /* isEliminatable. Not relevant for setters. */ | |||
3274 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3275 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3276 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3277 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3278 | }; | |||
3279 | ||||
3280 | MOZ_CAN_RUN_SCRIPT static bool | |||
3281 | get_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3282 | { | |||
3283 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3286( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3284 | "TestExampleInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3286( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3285 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3286( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3286 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3286( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3287 | ||||
3288 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3289 | uint8_t result(MOZ_KnownLive(self)(self)->WritableOctet()); | |||
3290 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3290); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3290; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3291 | args.rval().setInt32(int32_t(result)); | |||
3292 | return true; | |||
3293 | } | |||
3294 | ||||
3295 | MOZ_CAN_RUN_SCRIPT static bool | |||
3296 | set_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
3297 | { | |||
3298 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3301( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3299 | "TestExampleInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3301( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3300 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3301( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3301 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3301( cx, "TestExampleInterface" , "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3302 | ||||
3303 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3304 | uint8_t arg0; | |||
3305 | if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
3306 | return false; | |||
3307 | } | |||
3308 | // NOTE: This assert does NOT call the function. | |||
3309 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableOctet(arg0))>, "Should be returning void here"); | |||
3310 | MOZ_KnownLive(self)(self)->SetWritableOctet(arg0); | |||
3311 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3311); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3311; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3312 | ||||
3313 | return true; | |||
3314 | } | |||
3315 | ||||
3316 | static const JSJitInfo writableOctet_getterinfo = { | |||
3317 | { get_writableOctet }, | |||
3318 | { prototypes::id::TestExampleInterface }, | |||
3319 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3320 | JSJitInfo::Getter, | |||
3321 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3322 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
3323 | true, /* isInfallible. False in setters. */ | |||
3324 | false, /* isMovable. Not relevant for setters. */ | |||
3325 | false, /* isEliminatable. Not relevant for setters. */ | |||
3326 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3327 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3328 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3329 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3330 | }; | |||
3331 | static const JSJitInfo writableOctet_setterinfo = { | |||
3332 | { (JSJitGetterOp)set_writableOctet }, | |||
3333 | { prototypes::id::TestExampleInterface }, | |||
3334 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3335 | JSJitInfo::Setter, | |||
3336 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3337 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3338 | false, /* isInfallible. False in setters. */ | |||
3339 | false, /* isMovable. Not relevant for setters. */ | |||
3340 | false, /* isEliminatable. Not relevant for setters. */ | |||
3341 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3342 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3343 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3344 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3345 | }; | |||
3346 | ||||
3347 | MOZ_CAN_RUN_SCRIPT static bool | |||
3348 | passOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3349 | { | |||
3350 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3353( cx, "TestExampleInterface" , "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
3351 | "TestExampleInterface", "passOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3353( cx, "TestExampleInterface" , "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
3352 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3353( cx, "TestExampleInterface" , "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
3353 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3353( cx, "TestExampleInterface" , "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
3354 | ||||
3355 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3356 | if (!args.requireAtLeast(cx, "TestExampleInterface.passOctet", 1)) { | |||
3357 | return false; | |||
3358 | } | |||
3359 | uint8_t arg0; | |||
3360 | if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3361 | return false; | |||
3362 | } | |||
3363 | // NOTE: This assert does NOT call the function. | |||
3364 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOctet(arg0))>, "Should be returning void here"); | |||
3365 | MOZ_KnownLive(self)(self)->PassOctet(arg0); | |||
3366 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3366); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3366; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3367 | args.rval().setUndefined(); | |||
3368 | return true; | |||
3369 | } | |||
3370 | ||||
3371 | static const JSJitInfo passOctet_methodinfo = { | |||
3372 | { (JSJitGetterOp)passOctet }, | |||
3373 | { prototypes::id::TestExampleInterface }, | |||
3374 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3375 | JSJitInfo::Method, | |||
3376 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3377 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3378 | false, /* isInfallible. False in setters. */ | |||
3379 | false, /* isMovable. Not relevant for setters. */ | |||
3380 | false, /* isEliminatable. Not relevant for setters. */ | |||
3381 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3382 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3383 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3384 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3385 | }; | |||
3386 | ||||
3387 | MOZ_CAN_RUN_SCRIPT static bool | |||
3388 | receiveOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3389 | { | |||
3390 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3393( cx, "TestExampleInterface" , "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3391 | "TestExampleInterface", "receiveOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3393( cx, "TestExampleInterface" , "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3392 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3393( cx, "TestExampleInterface" , "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3393 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3393( cx, "TestExampleInterface" , "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3394 | ||||
3395 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3396 | uint8_t result(MOZ_KnownLive(self)(self)->ReceiveOctet()); | |||
3397 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3397); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3397; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3398 | args.rval().setInt32(int32_t(result)); | |||
3399 | return true; | |||
3400 | } | |||
3401 | ||||
3402 | static const JSJitInfo receiveOctet_methodinfo = { | |||
3403 | { (JSJitGetterOp)receiveOctet }, | |||
3404 | { prototypes::id::TestExampleInterface }, | |||
3405 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3406 | JSJitInfo::Method, | |||
3407 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3408 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
3409 | true, /* isInfallible. False in setters. */ | |||
3410 | false, /* isMovable. Not relevant for setters. */ | |||
3411 | false, /* isEliminatable. Not relevant for setters. */ | |||
3412 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3413 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3414 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3415 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3416 | }; | |||
3417 | ||||
3418 | MOZ_CAN_RUN_SCRIPT static bool | |||
3419 | passOptionalOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3420 | { | |||
3421 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3424( cx, "TestExampleInterface" , "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3422 | "TestExampleInterface", "passOptionalOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3424( cx, "TestExampleInterface" , "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3423 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3424( cx, "TestExampleInterface" , "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3424 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3424( cx, "TestExampleInterface" , "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3425 | ||||
3426 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3427 | Optional<uint8_t> arg0; | |||
3428 | if (args.hasDefined(0)) { | |||
3429 | arg0.Construct(); | |||
3430 | if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
3431 | return false; | |||
3432 | } | |||
3433 | } | |||
3434 | // NOTE: This assert does NOT call the function. | |||
3435 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalOctet(Constify(arg0)))>, "Should be returning void here"); | |||
3436 | MOZ_KnownLive(self)(self)->PassOptionalOctet(Constify(arg0)); | |||
3437 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3437); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3437; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3438 | args.rval().setUndefined(); | |||
3439 | return true; | |||
3440 | } | |||
3441 | ||||
3442 | static const JSJitInfo passOptionalOctet_methodinfo = { | |||
3443 | { (JSJitGetterOp)passOptionalOctet }, | |||
3444 | { prototypes::id::TestExampleInterface }, | |||
3445 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3446 | JSJitInfo::Method, | |||
3447 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3448 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3449 | false, /* isInfallible. False in setters. */ | |||
3450 | false, /* isMovable. Not relevant for setters. */ | |||
3451 | false, /* isEliminatable. Not relevant for setters. */ | |||
3452 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3453 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3454 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3455 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3456 | }; | |||
3457 | ||||
3458 | MOZ_CAN_RUN_SCRIPT static bool | |||
3459 | passOptionalOctetWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3460 | { | |||
3461 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3464( cx, "TestExampleInterface" , "passOptionalOctetWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3462 | "TestExampleInterface", "passOptionalOctetWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3464( cx, "TestExampleInterface" , "passOptionalOctetWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3463 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3464( cx, "TestExampleInterface" , "passOptionalOctetWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3464 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3464( cx, "TestExampleInterface" , "passOptionalOctetWithDefault", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
3465 | ||||
3466 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3467 | uint8_t arg0; | |||
3468 | if (args.hasDefined(0)) { | |||
3469 | if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3470 | return false; | |||
3471 | } | |||
3472 | } else { | |||
3473 | arg0 = 19; | |||
3474 | } | |||
3475 | // NOTE: This assert does NOT call the function. | |||
3476 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalOctetWithDefault(arg0))>, "Should be returning void here"); | |||
3477 | MOZ_KnownLive(self)(self)->PassOptionalOctetWithDefault(arg0); | |||
3478 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3478); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3478; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3479 | args.rval().setUndefined(); | |||
3480 | return true; | |||
3481 | } | |||
3482 | ||||
3483 | static const JSJitInfo passOptionalOctetWithDefault_methodinfo = { | |||
3484 | { (JSJitGetterOp)passOptionalOctetWithDefault }, | |||
3485 | { prototypes::id::TestExampleInterface }, | |||
3486 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3487 | JSJitInfo::Method, | |||
3488 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3489 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3490 | false, /* isInfallible. False in setters. */ | |||
3491 | false, /* isMovable. Not relevant for setters. */ | |||
3492 | false, /* isEliminatable. Not relevant for setters. */ | |||
3493 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3494 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3495 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3496 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3497 | }; | |||
3498 | ||||
3499 | MOZ_CAN_RUN_SCRIPT static bool | |||
3500 | get_readonlyUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3501 | { | |||
3502 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3505( cx, "TestExampleInterface" , "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3503 | "TestExampleInterface", "readonlyUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3505( cx, "TestExampleInterface" , "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3504 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3505( cx, "TestExampleInterface" , "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3505 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3505( cx, "TestExampleInterface" , "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3506 | ||||
3507 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3508 | uint16_t result(MOZ_KnownLive(self)(self)->ReadonlyUnsignedShort()); | |||
3509 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3509); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3509; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3510 | args.rval().setInt32(int32_t(result)); | |||
3511 | return true; | |||
3512 | } | |||
3513 | ||||
3514 | static const JSJitInfo readonlyUnsignedShort_getterinfo = { | |||
3515 | { get_readonlyUnsignedShort }, | |||
3516 | { prototypes::id::TestExampleInterface }, | |||
3517 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3518 | JSJitInfo::Getter, | |||
3519 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3520 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
3521 | true, /* isInfallible. False in setters. */ | |||
3522 | false, /* isMovable. Not relevant for setters. */ | |||
3523 | false, /* isEliminatable. Not relevant for setters. */ | |||
3524 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3525 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3526 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3527 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3528 | }; | |||
3529 | ||||
3530 | MOZ_CAN_RUN_SCRIPT static bool | |||
3531 | get_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3532 | { | |||
3533 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3536( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3534 | "TestExampleInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3536( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3535 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3536( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3536 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3536( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3537 | ||||
3538 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3539 | uint16_t result(MOZ_KnownLive(self)(self)->WritableUnsignedShort()); | |||
3540 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3540); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3540; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3541 | args.rval().setInt32(int32_t(result)); | |||
3542 | return true; | |||
3543 | } | |||
3544 | ||||
3545 | MOZ_CAN_RUN_SCRIPT static bool | |||
3546 | set_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
3547 | { | |||
3548 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3551( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3549 | "TestExampleInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3551( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3550 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3551( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3551 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3551( cx, "TestExampleInterface" , "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3552 | ||||
3553 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3554 | uint16_t arg0; | |||
3555 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
3556 | return false; | |||
3557 | } | |||
3558 | // NOTE: This assert does NOT call the function. | |||
3559 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedShort(arg0))>, "Should be returning void here"); | |||
3560 | MOZ_KnownLive(self)(self)->SetWritableUnsignedShort(arg0); | |||
3561 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3561); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3561; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3562 | ||||
3563 | return true; | |||
3564 | } | |||
3565 | ||||
3566 | static const JSJitInfo writableUnsignedShort_getterinfo = { | |||
3567 | { get_writableUnsignedShort }, | |||
3568 | { prototypes::id::TestExampleInterface }, | |||
3569 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3570 | JSJitInfo::Getter, | |||
3571 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3572 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
3573 | true, /* isInfallible. False in setters. */ | |||
3574 | false, /* isMovable. Not relevant for setters. */ | |||
3575 | false, /* isEliminatable. Not relevant for setters. */ | |||
3576 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3577 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3578 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3579 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3580 | }; | |||
3581 | static const JSJitInfo writableUnsignedShort_setterinfo = { | |||
3582 | { (JSJitGetterOp)set_writableUnsignedShort }, | |||
3583 | { prototypes::id::TestExampleInterface }, | |||
3584 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3585 | JSJitInfo::Setter, | |||
3586 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3587 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3588 | false, /* isInfallible. False in setters. */ | |||
3589 | false, /* isMovable. Not relevant for setters. */ | |||
3590 | false, /* isEliminatable. Not relevant for setters. */ | |||
3591 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3592 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3593 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3594 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3595 | }; | |||
3596 | ||||
3597 | MOZ_CAN_RUN_SCRIPT static bool | |||
3598 | passUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3599 | { | |||
3600 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3603( cx, "TestExampleInterface" , "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3601 | "TestExampleInterface", "passUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3603( cx, "TestExampleInterface" , "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3602 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3603( cx, "TestExampleInterface" , "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3603 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3603( cx, "TestExampleInterface" , "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3604 | ||||
3605 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3606 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnsignedShort", 1)) { | |||
3607 | return false; | |||
3608 | } | |||
3609 | uint16_t arg0; | |||
3610 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3611 | return false; | |||
3612 | } | |||
3613 | // NOTE: This assert does NOT call the function. | |||
3614 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedShort(arg0))>, "Should be returning void here"); | |||
3615 | MOZ_KnownLive(self)(self)->PassUnsignedShort(arg0); | |||
3616 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3616); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3616; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3617 | args.rval().setUndefined(); | |||
3618 | return true; | |||
3619 | } | |||
3620 | ||||
3621 | static const JSJitInfo passUnsignedShort_methodinfo = { | |||
3622 | { (JSJitGetterOp)passUnsignedShort }, | |||
3623 | { prototypes::id::TestExampleInterface }, | |||
3624 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3625 | JSJitInfo::Method, | |||
3626 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3627 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3628 | false, /* isInfallible. False in setters. */ | |||
3629 | false, /* isMovable. Not relevant for setters. */ | |||
3630 | false, /* isEliminatable. Not relevant for setters. */ | |||
3631 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3632 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3633 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3634 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3635 | }; | |||
3636 | ||||
3637 | MOZ_CAN_RUN_SCRIPT static bool | |||
3638 | receiveUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3639 | { | |||
3640 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3643( cx, "TestExampleInterface" , "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3641 | "TestExampleInterface", "receiveUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3643( cx, "TestExampleInterface" , "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3642 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3643( cx, "TestExampleInterface" , "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3643 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3643( cx, "TestExampleInterface" , "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3644 | ||||
3645 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3646 | uint16_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedShort()); | |||
3647 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3647); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3647; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3648 | args.rval().setInt32(int32_t(result)); | |||
3649 | return true; | |||
3650 | } | |||
3651 | ||||
3652 | static const JSJitInfo receiveUnsignedShort_methodinfo = { | |||
3653 | { (JSJitGetterOp)receiveUnsignedShort }, | |||
3654 | { prototypes::id::TestExampleInterface }, | |||
3655 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3656 | JSJitInfo::Method, | |||
3657 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3658 | JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */ | |||
3659 | true, /* isInfallible. False in setters. */ | |||
3660 | false, /* isMovable. Not relevant for setters. */ | |||
3661 | false, /* isEliminatable. Not relevant for setters. */ | |||
3662 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3663 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3664 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3665 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3666 | }; | |||
3667 | ||||
3668 | MOZ_CAN_RUN_SCRIPT static bool | |||
3669 | passOptionalUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3670 | { | |||
3671 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3674( cx, "TestExampleInterface" , "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3672 | "TestExampleInterface", "passOptionalUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3674( cx, "TestExampleInterface" , "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3673 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3674( cx, "TestExampleInterface" , "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3674 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3674( cx, "TestExampleInterface" , "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
3675 | ||||
3676 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3677 | Optional<uint16_t> arg0; | |||
3678 | if (args.hasDefined(0)) { | |||
3679 | arg0.Construct(); | |||
3680 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
3681 | return false; | |||
3682 | } | |||
3683 | } | |||
3684 | // NOTE: This assert does NOT call the function. | |||
3685 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedShort(Constify(arg0)))>, "Should be returning void here"); | |||
3686 | MOZ_KnownLive(self)(self)->PassOptionalUnsignedShort(Constify(arg0)); | |||
3687 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3687); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3687; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3688 | args.rval().setUndefined(); | |||
3689 | return true; | |||
3690 | } | |||
3691 | ||||
3692 | static const JSJitInfo passOptionalUnsignedShort_methodinfo = { | |||
3693 | { (JSJitGetterOp)passOptionalUnsignedShort }, | |||
3694 | { prototypes::id::TestExampleInterface }, | |||
3695 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3696 | JSJitInfo::Method, | |||
3697 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3698 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3699 | false, /* isInfallible. False in setters. */ | |||
3700 | false, /* isMovable. Not relevant for setters. */ | |||
3701 | false, /* isEliminatable. Not relevant for setters. */ | |||
3702 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3703 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3704 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3705 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3706 | }; | |||
3707 | ||||
3708 | MOZ_CAN_RUN_SCRIPT static bool | |||
3709 | passOptionalUnsignedShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3710 | { | |||
3711 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3714( cx, "TestExampleInterface" , "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3712 | "TestExampleInterface", "passOptionalUnsignedShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3714( cx, "TestExampleInterface" , "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3713 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3714( cx, "TestExampleInterface" , "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3714 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3714( cx, "TestExampleInterface" , "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
3715 | ||||
3716 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3717 | uint16_t arg0; | |||
3718 | if (args.hasDefined(0)) { | |||
3719 | if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3720 | return false; | |||
3721 | } | |||
3722 | } else { | |||
3723 | arg0 = 2; | |||
3724 | } | |||
3725 | // NOTE: This assert does NOT call the function. | |||
3726 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedShortWithDefault(arg0))>, "Should be returning void here"); | |||
3727 | MOZ_KnownLive(self)(self)->PassOptionalUnsignedShortWithDefault(arg0); | |||
3728 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3728); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3728; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3729 | args.rval().setUndefined(); | |||
3730 | return true; | |||
3731 | } | |||
3732 | ||||
3733 | static const JSJitInfo passOptionalUnsignedShortWithDefault_methodinfo = { | |||
3734 | { (JSJitGetterOp)passOptionalUnsignedShortWithDefault }, | |||
3735 | { prototypes::id::TestExampleInterface }, | |||
3736 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3737 | JSJitInfo::Method, | |||
3738 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3739 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3740 | false, /* isInfallible. False in setters. */ | |||
3741 | false, /* isMovable. Not relevant for setters. */ | |||
3742 | false, /* isEliminatable. Not relevant for setters. */ | |||
3743 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3744 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3745 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3746 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3747 | }; | |||
3748 | ||||
3749 | MOZ_CAN_RUN_SCRIPT static bool | |||
3750 | get_readonlyUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3751 | { | |||
3752 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3755( cx, "TestExampleInterface" , "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3753 | "TestExampleInterface", "readonlyUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3755( cx, "TestExampleInterface" , "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3754 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3755( cx, "TestExampleInterface" , "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3755 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3755( cx, "TestExampleInterface" , "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3756 | ||||
3757 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3758 | uint32_t result(MOZ_KnownLive(self)(self)->ReadonlyUnsignedLong()); | |||
3759 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3759); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3759; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3760 | args.rval().setNumber(result); | |||
3761 | return true; | |||
3762 | } | |||
3763 | ||||
3764 | static const JSJitInfo readonlyUnsignedLong_getterinfo = { | |||
3765 | { get_readonlyUnsignedLong }, | |||
3766 | { prototypes::id::TestExampleInterface }, | |||
3767 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3768 | JSJitInfo::Getter, | |||
3769 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3770 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
3771 | true, /* isInfallible. False in setters. */ | |||
3772 | false, /* isMovable. Not relevant for setters. */ | |||
3773 | false, /* isEliminatable. Not relevant for setters. */ | |||
3774 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3775 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3776 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3777 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3778 | }; | |||
3779 | ||||
3780 | MOZ_CAN_RUN_SCRIPT static bool | |||
3781 | get_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
3782 | { | |||
3783 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3786( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3784 | "TestExampleInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3786( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3785 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3786( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3786 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3786( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3787 | ||||
3788 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3789 | uint32_t result(MOZ_KnownLive(self)(self)->WritableUnsignedLong()); | |||
3790 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3790); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3790; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3791 | args.rval().setNumber(result); | |||
3792 | return true; | |||
3793 | } | |||
3794 | ||||
3795 | MOZ_CAN_RUN_SCRIPT static bool | |||
3796 | set_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
3797 | { | |||
3798 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3801( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3799 | "TestExampleInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3801( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3800 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3801( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3801 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3801( cx, "TestExampleInterface" , "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3802 | ||||
3803 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3804 | uint32_t arg0; | |||
3805 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
3806 | return false; | |||
3807 | } | |||
3808 | // NOTE: This assert does NOT call the function. | |||
3809 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedLong(arg0))>, "Should be returning void here"); | |||
3810 | MOZ_KnownLive(self)(self)->SetWritableUnsignedLong(arg0); | |||
3811 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3811); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3811; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3812 | ||||
3813 | return true; | |||
3814 | } | |||
3815 | ||||
3816 | static const JSJitInfo writableUnsignedLong_getterinfo = { | |||
3817 | { get_writableUnsignedLong }, | |||
3818 | { prototypes::id::TestExampleInterface }, | |||
3819 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3820 | JSJitInfo::Getter, | |||
3821 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3822 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
3823 | true, /* isInfallible. False in setters. */ | |||
3824 | false, /* isMovable. Not relevant for setters. */ | |||
3825 | false, /* isEliminatable. Not relevant for setters. */ | |||
3826 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3827 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3828 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3829 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3830 | }; | |||
3831 | static const JSJitInfo writableUnsignedLong_setterinfo = { | |||
3832 | { (JSJitGetterOp)set_writableUnsignedLong }, | |||
3833 | { prototypes::id::TestExampleInterface }, | |||
3834 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3835 | JSJitInfo::Setter, | |||
3836 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3837 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3838 | false, /* isInfallible. False in setters. */ | |||
3839 | false, /* isMovable. Not relevant for setters. */ | |||
3840 | false, /* isEliminatable. Not relevant for setters. */ | |||
3841 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3842 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3843 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3844 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3845 | }; | |||
3846 | ||||
3847 | MOZ_CAN_RUN_SCRIPT static bool | |||
3848 | passUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3849 | { | |||
3850 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3853( cx, "TestExampleInterface" , "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3851 | "TestExampleInterface", "passUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3853( cx, "TestExampleInterface" , "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3852 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3853( cx, "TestExampleInterface" , "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3853 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3853( cx, "TestExampleInterface" , "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3854 | ||||
3855 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3856 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnsignedLong", 1)) { | |||
3857 | return false; | |||
3858 | } | |||
3859 | uint32_t arg0; | |||
3860 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3861 | return false; | |||
3862 | } | |||
3863 | // NOTE: This assert does NOT call the function. | |||
3864 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedLong(arg0))>, "Should be returning void here"); | |||
3865 | MOZ_KnownLive(self)(self)->PassUnsignedLong(arg0); | |||
3866 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3866); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3866; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3867 | args.rval().setUndefined(); | |||
3868 | return true; | |||
3869 | } | |||
3870 | ||||
3871 | static const JSJitInfo passUnsignedLong_methodinfo = { | |||
3872 | { (JSJitGetterOp)passUnsignedLong }, | |||
3873 | { prototypes::id::TestExampleInterface }, | |||
3874 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3875 | JSJitInfo::Method, | |||
3876 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3877 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3878 | false, /* isInfallible. False in setters. */ | |||
3879 | false, /* isMovable. Not relevant for setters. */ | |||
3880 | false, /* isEliminatable. Not relevant for setters. */ | |||
3881 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3882 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3883 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3884 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3885 | }; | |||
3886 | ||||
3887 | MOZ_CAN_RUN_SCRIPT static bool | |||
3888 | receiveUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3889 | { | |||
3890 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3893( cx, "TestExampleInterface" , "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3891 | "TestExampleInterface", "receiveUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3893( cx, "TestExampleInterface" , "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3892 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3893( cx, "TestExampleInterface" , "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
3893 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3893( cx, "TestExampleInterface" , "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
3894 | ||||
3895 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3896 | uint32_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLong()); | |||
3897 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3897); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3897; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3898 | args.rval().setNumber(result); | |||
3899 | return true; | |||
3900 | } | |||
3901 | ||||
3902 | static const JSJitInfo receiveUnsignedLong_methodinfo = { | |||
3903 | { (JSJitGetterOp)receiveUnsignedLong }, | |||
3904 | { prototypes::id::TestExampleInterface }, | |||
3905 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3906 | JSJitInfo::Method, | |||
3907 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3908 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
3909 | true, /* isInfallible. False in setters. */ | |||
3910 | false, /* isMovable. Not relevant for setters. */ | |||
3911 | false, /* isEliminatable. Not relevant for setters. */ | |||
3912 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3913 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3914 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3915 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3916 | }; | |||
3917 | ||||
3918 | MOZ_CAN_RUN_SCRIPT static bool | |||
3919 | passOptionalUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3920 | { | |||
3921 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3924( cx, "TestExampleInterface" , "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3922 | "TestExampleInterface", "passOptionalUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3924( cx, "TestExampleInterface" , "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3923 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3924( cx, "TestExampleInterface" , "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3924 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3924( cx, "TestExampleInterface" , "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
3925 | ||||
3926 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3927 | Optional<uint32_t> arg0; | |||
3928 | if (args.hasDefined(0)) { | |||
3929 | arg0.Construct(); | |||
3930 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
3931 | return false; | |||
3932 | } | |||
3933 | } | |||
3934 | // NOTE: This assert does NOT call the function. | |||
3935 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLong(Constify(arg0)))>, "Should be returning void here"); | |||
3936 | MOZ_KnownLive(self)(self)->PassOptionalUnsignedLong(Constify(arg0)); | |||
3937 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3937); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3937; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3938 | args.rval().setUndefined(); | |||
3939 | return true; | |||
3940 | } | |||
3941 | ||||
3942 | static const JSJitInfo passOptionalUnsignedLong_methodinfo = { | |||
3943 | { (JSJitGetterOp)passOptionalUnsignedLong }, | |||
3944 | { prototypes::id::TestExampleInterface }, | |||
3945 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3946 | JSJitInfo::Method, | |||
3947 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3948 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3949 | false, /* isInfallible. False in setters. */ | |||
3950 | false, /* isMovable. Not relevant for setters. */ | |||
3951 | false, /* isEliminatable. Not relevant for setters. */ | |||
3952 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3953 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3954 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3955 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3956 | }; | |||
3957 | ||||
3958 | MOZ_CAN_RUN_SCRIPT static bool | |||
3959 | passOptionalUnsignedLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
3960 | { | |||
3961 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3964( cx, "TestExampleInterface" , "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3962 | "TestExampleInterface", "passOptionalUnsignedLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3964( cx, "TestExampleInterface" , "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3963 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3964( cx, "TestExampleInterface" , "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
3964 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3964( cx, "TestExampleInterface" , "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
3965 | ||||
3966 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
3967 | uint32_t arg0; | |||
3968 | if (args.hasDefined(0)) { | |||
3969 | if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
3970 | return false; | |||
3971 | } | |||
3972 | } else { | |||
3973 | arg0 = 6U; | |||
3974 | } | |||
3975 | // NOTE: This assert does NOT call the function. | |||
3976 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongWithDefault(arg0))>, "Should be returning void here"); | |||
3977 | MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongWithDefault(arg0); | |||
3978 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 3978); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 3978; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3979 | args.rval().setUndefined(); | |||
3980 | return true; | |||
3981 | } | |||
3982 | ||||
3983 | static const JSJitInfo passOptionalUnsignedLongWithDefault_methodinfo = { | |||
3984 | { (JSJitGetterOp)passOptionalUnsignedLongWithDefault }, | |||
3985 | { prototypes::id::TestExampleInterface }, | |||
3986 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
3987 | JSJitInfo::Method, | |||
3988 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
3989 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
3990 | false, /* isInfallible. False in setters. */ | |||
3991 | false, /* isMovable. Not relevant for setters. */ | |||
3992 | false, /* isEliminatable. Not relevant for setters. */ | |||
3993 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
3994 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
3995 | false, /* isTypedMethod. Only relevant for methods. */ | |||
3996 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
3997 | }; | |||
3998 | ||||
3999 | MOZ_CAN_RUN_SCRIPT static bool | |||
4000 | get_readonlyUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4001 | { | |||
4002 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4005( cx, "TestExampleInterface" , "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4003 | "TestExampleInterface", "readonlyUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4005( cx, "TestExampleInterface" , "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4004 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4005( cx, "TestExampleInterface" , "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4005 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4005( cx, "TestExampleInterface" , "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4006 | ||||
4007 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4008 | uint64_t result(MOZ_KnownLive(self)(self)->ReadonlyUnsignedLongLong()); | |||
4009 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4009); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4009; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4010 | args.rval().set(JS_NumberValue(double(result))); | |||
4011 | return true; | |||
4012 | } | |||
4013 | ||||
4014 | static const JSJitInfo readonlyUnsignedLongLong_getterinfo = { | |||
4015 | { get_readonlyUnsignedLongLong }, | |||
4016 | { prototypes::id::TestExampleInterface }, | |||
4017 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4018 | JSJitInfo::Getter, | |||
4019 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4020 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
4021 | true, /* isInfallible. False in setters. */ | |||
4022 | false, /* isMovable. Not relevant for setters. */ | |||
4023 | false, /* isEliminatable. Not relevant for setters. */ | |||
4024 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4025 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4026 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4027 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4028 | }; | |||
4029 | ||||
4030 | MOZ_CAN_RUN_SCRIPT static bool | |||
4031 | get_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4032 | { | |||
4033 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4036( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4034 | "TestExampleInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4036( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4035 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4036( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4036 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4036( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4037 | ||||
4038 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4039 | uint64_t result(MOZ_KnownLive(self)(self)->WritableUnsignedLongLong()); | |||
4040 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4040); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4040; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4041 | args.rval().set(JS_NumberValue(double(result))); | |||
4042 | return true; | |||
4043 | } | |||
4044 | ||||
4045 | MOZ_CAN_RUN_SCRIPT static bool | |||
4046 | set_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4047 | { | |||
4048 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4051( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4049 | "TestExampleInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4051( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4050 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4051( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4051 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4051( cx, "TestExampleInterface" , "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4052 | ||||
4053 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4054 | uint64_t arg0; | |||
4055 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
4056 | return false; | |||
4057 | } | |||
4058 | // NOTE: This assert does NOT call the function. | |||
4059 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedLongLong(arg0))>, "Should be returning void here"); | |||
4060 | MOZ_KnownLive(self)(self)->SetWritableUnsignedLongLong(arg0); | |||
4061 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4061); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4061; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4062 | ||||
4063 | return true; | |||
4064 | } | |||
4065 | ||||
4066 | static const JSJitInfo writableUnsignedLongLong_getterinfo = { | |||
4067 | { get_writableUnsignedLongLong }, | |||
4068 | { prototypes::id::TestExampleInterface }, | |||
4069 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4070 | JSJitInfo::Getter, | |||
4071 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4072 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
4073 | true, /* isInfallible. False in setters. */ | |||
4074 | false, /* isMovable. Not relevant for setters. */ | |||
4075 | false, /* isEliminatable. Not relevant for setters. */ | |||
4076 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4077 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4078 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4079 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4080 | }; | |||
4081 | static const JSJitInfo writableUnsignedLongLong_setterinfo = { | |||
4082 | { (JSJitGetterOp)set_writableUnsignedLongLong }, | |||
4083 | { prototypes::id::TestExampleInterface }, | |||
4084 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4085 | JSJitInfo::Setter, | |||
4086 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4087 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4088 | false, /* isInfallible. False in setters. */ | |||
4089 | false, /* isMovable. Not relevant for setters. */ | |||
4090 | false, /* isEliminatable. Not relevant for setters. */ | |||
4091 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4092 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4093 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4094 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4095 | }; | |||
4096 | ||||
4097 | MOZ_CAN_RUN_SCRIPT static bool | |||
4098 | passUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
4099 | { | |||
4100 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4103( cx, "TestExampleInterface" , "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4101 | "TestExampleInterface", "passUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4103( cx, "TestExampleInterface" , "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4102 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4103( cx, "TestExampleInterface" , "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4103 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4103( cx, "TestExampleInterface" , "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4104 | ||||
4105 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4106 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnsignedLongLong", 1)) { | |||
4107 | return false; | |||
4108 | } | |||
4109 | uint64_t arg0; | |||
4110 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
4111 | return false; | |||
4112 | } | |||
4113 | // NOTE: This assert does NOT call the function. | |||
4114 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedLongLong(arg0))>, "Should be returning void here"); | |||
4115 | MOZ_KnownLive(self)(self)->PassUnsignedLongLong(arg0); | |||
4116 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4116; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4117 | args.rval().setUndefined(); | |||
4118 | return true; | |||
4119 | } | |||
4120 | ||||
4121 | static const JSJitInfo passUnsignedLongLong_methodinfo = { | |||
4122 | { (JSJitGetterOp)passUnsignedLongLong }, | |||
4123 | { prototypes::id::TestExampleInterface }, | |||
4124 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4125 | JSJitInfo::Method, | |||
4126 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4127 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4128 | false, /* isInfallible. False in setters. */ | |||
4129 | false, /* isMovable. Not relevant for setters. */ | |||
4130 | false, /* isEliminatable. Not relevant for setters. */ | |||
4131 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4132 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4133 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4134 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4135 | }; | |||
4136 | ||||
4137 | MOZ_CAN_RUN_SCRIPT static bool | |||
4138 | receiveUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
4139 | { | |||
4140 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4143( cx, "TestExampleInterface" , "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4141 | "TestExampleInterface", "receiveUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4143( cx, "TestExampleInterface" , "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4142 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4143( cx, "TestExampleInterface" , "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4143 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4143( cx, "TestExampleInterface" , "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4144 | ||||
4145 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4146 | uint64_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLongLong()); | |||
4147 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4147); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4147; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4148 | args.rval().set(JS_NumberValue(double(result))); | |||
4149 | return true; | |||
4150 | } | |||
4151 | ||||
4152 | static const JSJitInfo receiveUnsignedLongLong_methodinfo = { | |||
4153 | { (JSJitGetterOp)receiveUnsignedLongLong }, | |||
4154 | { prototypes::id::TestExampleInterface }, | |||
4155 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4156 | JSJitInfo::Method, | |||
4157 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4158 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
4159 | true, /* isInfallible. False in setters. */ | |||
4160 | false, /* isMovable. Not relevant for setters. */ | |||
4161 | false, /* isEliminatable. Not relevant for setters. */ | |||
4162 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4163 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4164 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4165 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4166 | }; | |||
4167 | ||||
4168 | MOZ_CAN_RUN_SCRIPT static bool | |||
4169 | passOptionalUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
4170 | { | |||
4171 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4174( cx, "TestExampleInterface" , "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4172 | "TestExampleInterface", "passOptionalUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4174( cx, "TestExampleInterface" , "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4173 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4174( cx, "TestExampleInterface" , "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4174 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4174( cx, "TestExampleInterface" , "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4175 | ||||
4176 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4177 | Optional<uint64_t> arg0; | |||
4178 | if (args.hasDefined(0)) { | |||
4179 | arg0.Construct(); | |||
4180 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) { | |||
4181 | return false; | |||
4182 | } | |||
4183 | } | |||
4184 | // NOTE: This assert does NOT call the function. | |||
4185 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLong(Constify(arg0)))>, "Should be returning void here"); | |||
4186 | MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLong(Constify(arg0)); | |||
4187 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4187); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4187; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4188 | args.rval().setUndefined(); | |||
4189 | return true; | |||
4190 | } | |||
4191 | ||||
4192 | static const JSJitInfo passOptionalUnsignedLongLong_methodinfo = { | |||
4193 | { (JSJitGetterOp)passOptionalUnsignedLongLong }, | |||
4194 | { prototypes::id::TestExampleInterface }, | |||
4195 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4196 | JSJitInfo::Method, | |||
4197 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4198 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4199 | false, /* isInfallible. False in setters. */ | |||
4200 | false, /* isMovable. Not relevant for setters. */ | |||
4201 | false, /* isEliminatable. Not relevant for setters. */ | |||
4202 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4203 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4204 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4205 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4206 | }; | |||
4207 | ||||
4208 | MOZ_CAN_RUN_SCRIPT static bool | |||
4209 | passOptionalUnsignedLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
4210 | { | |||
4211 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4214( cx, "TestExampleInterface" , "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4212 | "TestExampleInterface", "passOptionalUnsignedLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4214( cx, "TestExampleInterface" , "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4213 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4214( cx, "TestExampleInterface" , "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4214 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4214( cx, "TestExampleInterface" , "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4215 | ||||
4216 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4217 | uint64_t arg0; | |||
4218 | if (args.hasDefined(0)) { | |||
4219 | if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
4220 | return false; | |||
4221 | } | |||
4222 | } else { | |||
4223 | arg0 = 17ULL; | |||
4224 | } | |||
4225 | // NOTE: This assert does NOT call the function. | |||
4226 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLongWithDefault(arg0))>, "Should be returning void here"); | |||
4227 | MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLongWithDefault(arg0); | |||
4228 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4228); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4228; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4229 | args.rval().setUndefined(); | |||
4230 | return true; | |||
4231 | } | |||
4232 | ||||
4233 | static const JSJitInfo passOptionalUnsignedLongLongWithDefault_methodinfo = { | |||
4234 | { (JSJitGetterOp)passOptionalUnsignedLongLongWithDefault }, | |||
4235 | { prototypes::id::TestExampleInterface }, | |||
4236 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4237 | JSJitInfo::Method, | |||
4238 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4239 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4240 | false, /* isInfallible. False in setters. */ | |||
4241 | false, /* isMovable. Not relevant for setters. */ | |||
4242 | false, /* isEliminatable. Not relevant for setters. */ | |||
4243 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4244 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4245 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4246 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4247 | }; | |||
4248 | ||||
4249 | MOZ_CAN_RUN_SCRIPT static bool | |||
4250 | get_writableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4251 | { | |||
4252 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4255( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4253 | "TestExampleInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4255( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4254 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4255( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4255 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4255( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4256 | ||||
4257 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4258 | float result(MOZ_KnownLive(self)(self)->WritableFloat()); | |||
4259 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4259); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4259; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4260 | args.rval().set(JS_NumberValue(double(result))); | |||
4261 | return true; | |||
4262 | } | |||
4263 | ||||
4264 | MOZ_CAN_RUN_SCRIPT static bool | |||
4265 | set_writableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4266 | { | |||
4267 | BindingCallContext cx(cx_, "TestExampleInterface.writableFloat setter"); | |||
4268 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4271( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4269 | "TestExampleInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4271( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4270 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4271( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4271 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4271( cx, "TestExampleInterface" , "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4272 | ||||
4273 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4274 | float arg0; | |||
4275 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
4276 | return false; | |||
4277 | } else if (!std::isfinite(arg0)) { | |||
4278 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned"); | |||
4279 | return false; | |||
4280 | } | |||
4281 | // NOTE: This assert does NOT call the function. | |||
4282 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableFloat(arg0))>, "Should be returning void here"); | |||
4283 | MOZ_KnownLive(self)(self)->SetWritableFloat(arg0); | |||
4284 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4284); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4284; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4285 | ||||
4286 | return true; | |||
4287 | } | |||
4288 | ||||
4289 | static const JSJitInfo writableFloat_getterinfo = { | |||
4290 | { get_writableFloat }, | |||
4291 | { prototypes::id::TestExampleInterface }, | |||
4292 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4293 | JSJitInfo::Getter, | |||
4294 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4295 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
4296 | true, /* isInfallible. False in setters. */ | |||
4297 | false, /* isMovable. Not relevant for setters. */ | |||
4298 | false, /* isEliminatable. Not relevant for setters. */ | |||
4299 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4300 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4301 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4302 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4303 | }; | |||
4304 | static const JSJitInfo writableFloat_setterinfo = { | |||
4305 | { (JSJitGetterOp)set_writableFloat }, | |||
4306 | { prototypes::id::TestExampleInterface }, | |||
4307 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4308 | JSJitInfo::Setter, | |||
4309 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4310 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4311 | false, /* isInfallible. False in setters. */ | |||
4312 | false, /* isMovable. Not relevant for setters. */ | |||
4313 | false, /* isEliminatable. Not relevant for setters. */ | |||
4314 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4315 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4316 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4317 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4318 | }; | |||
4319 | ||||
4320 | MOZ_CAN_RUN_SCRIPT static bool | |||
4321 | get_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4322 | { | |||
4323 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4326( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4324 | "TestExampleInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4326( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4325 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4326( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4326 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4326( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4327 | ||||
4328 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4329 | float result(MOZ_KnownLive(self)(self)->WritableUnrestrictedFloat()); | |||
4330 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4330); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4330; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4331 | args.rval().set(JS_NumberValue(double(result))); | |||
4332 | return true; | |||
4333 | } | |||
4334 | ||||
4335 | MOZ_CAN_RUN_SCRIPT static bool | |||
4336 | set_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4337 | { | |||
4338 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4341( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4339 | "TestExampleInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4341( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4340 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4341( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4341 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4341( cx, "TestExampleInterface" , "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4342 | ||||
4343 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4344 | float arg0; | |||
4345 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
4346 | return false; | |||
4347 | } | |||
4348 | // NOTE: This assert does NOT call the function. | |||
4349 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnrestrictedFloat(arg0))>, "Should be returning void here"); | |||
4350 | MOZ_KnownLive(self)(self)->SetWritableUnrestrictedFloat(arg0); | |||
4351 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4351); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4351; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4352 | ||||
4353 | return true; | |||
4354 | } | |||
4355 | ||||
4356 | static const JSJitInfo writableUnrestrictedFloat_getterinfo = { | |||
4357 | { get_writableUnrestrictedFloat }, | |||
4358 | { prototypes::id::TestExampleInterface }, | |||
4359 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4360 | JSJitInfo::Getter, | |||
4361 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4362 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
4363 | true, /* isInfallible. False in setters. */ | |||
4364 | false, /* isMovable. Not relevant for setters. */ | |||
4365 | false, /* isEliminatable. Not relevant for setters. */ | |||
4366 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4367 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4368 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4369 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4370 | }; | |||
4371 | static const JSJitInfo writableUnrestrictedFloat_setterinfo = { | |||
4372 | { (JSJitGetterOp)set_writableUnrestrictedFloat }, | |||
4373 | { prototypes::id::TestExampleInterface }, | |||
4374 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4375 | JSJitInfo::Setter, | |||
4376 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4377 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4378 | false, /* isInfallible. False in setters. */ | |||
4379 | false, /* isMovable. Not relevant for setters. */ | |||
4380 | false, /* isEliminatable. Not relevant for setters. */ | |||
4381 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4382 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4383 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4384 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4385 | }; | |||
4386 | ||||
4387 | MOZ_CAN_RUN_SCRIPT static bool | |||
4388 | get_writableNullableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4389 | { | |||
4390 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4393( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4391 | "TestExampleInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4393( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4392 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4393( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4393 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4393( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4394 | ||||
4395 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4396 | Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableFloat()); | |||
4397 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4397); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4397; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4398 | if (result.IsNull()) { | |||
4399 | args.rval().setNull(); | |||
4400 | return true; | |||
4401 | } | |||
4402 | args.rval().set(JS_NumberValue(double(result.Value()))); | |||
4403 | return true; | |||
4404 | } | |||
4405 | ||||
4406 | MOZ_CAN_RUN_SCRIPT static bool | |||
4407 | set_writableNullableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4408 | { | |||
4409 | BindingCallContext cx(cx_, "TestExampleInterface.writableNullableFloat setter"); | |||
4410 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4413( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4411 | "TestExampleInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4413( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4412 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4413( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4413 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4413( cx, "TestExampleInterface" , "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4414 | ||||
4415 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4416 | Nullable<float> arg0; | |||
4417 | if (args[0].isNullOrUndefined()) { | |||
4418 | arg0.SetNull(); | |||
4419 | } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) { | |||
4420 | return false; | |||
4421 | } else if (!std::isfinite(arg0.Value())) { | |||
4422 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned"); | |||
4423 | return false; | |||
4424 | } | |||
4425 | // NOTE: This assert does NOT call the function. | |||
4426 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableFloat(Constify(arg0)))>, "Should be returning void here"); | |||
4427 | MOZ_KnownLive(self)(self)->SetWritableNullableFloat(Constify(arg0)); | |||
4428 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4428); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4428; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4429 | ||||
4430 | return true; | |||
4431 | } | |||
4432 | ||||
4433 | static const JSJitInfo writableNullableFloat_getterinfo = { | |||
4434 | { get_writableNullableFloat }, | |||
4435 | { prototypes::id::TestExampleInterface }, | |||
4436 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4437 | JSJitInfo::Getter, | |||
4438 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4439 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
4440 | true, /* isInfallible. False in setters. */ | |||
4441 | false, /* isMovable. Not relevant for setters. */ | |||
4442 | false, /* isEliminatable. Not relevant for setters. */ | |||
4443 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4444 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4445 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4446 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4447 | }; | |||
4448 | static const JSJitInfo writableNullableFloat_setterinfo = { | |||
4449 | { (JSJitGetterOp)set_writableNullableFloat }, | |||
4450 | { prototypes::id::TestExampleInterface }, | |||
4451 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4452 | JSJitInfo::Setter, | |||
4453 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4454 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4455 | false, /* isInfallible. False in setters. */ | |||
4456 | false, /* isMovable. Not relevant for setters. */ | |||
4457 | false, /* isEliminatable. Not relevant for setters. */ | |||
4458 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4459 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4460 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4461 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4462 | }; | |||
4463 | ||||
4464 | MOZ_CAN_RUN_SCRIPT static bool | |||
4465 | get_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4466 | { | |||
4467 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4470( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4468 | "TestExampleInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4470( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4469 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4470( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4470 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4470( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4471 | ||||
4472 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4473 | Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableUnrestrictedFloat()); | |||
4474 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4474); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4474; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4475 | if (result.IsNull()) { | |||
4476 | args.rval().setNull(); | |||
4477 | return true; | |||
4478 | } | |||
4479 | args.rval().set(JS_NumberValue(double(result.Value()))); | |||
4480 | return true; | |||
4481 | } | |||
4482 | ||||
4483 | MOZ_CAN_RUN_SCRIPT static bool | |||
4484 | set_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4485 | { | |||
4486 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4489( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4487 | "TestExampleInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4489( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4488 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4489( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4489 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4489( cx, "TestExampleInterface" , "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4490 | ||||
4491 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4492 | Nullable<float> arg0; | |||
4493 | if (args[0].isNullOrUndefined()) { | |||
4494 | arg0.SetNull(); | |||
4495 | } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) { | |||
4496 | return false; | |||
4497 | } | |||
4498 | // NOTE: This assert does NOT call the function. | |||
4499 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedFloat(Constify(arg0)))>, "Should be returning void here"); | |||
4500 | MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedFloat(Constify(arg0)); | |||
4501 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4501); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4501; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4502 | ||||
4503 | return true; | |||
4504 | } | |||
4505 | ||||
4506 | static const JSJitInfo writableNullableUnrestrictedFloat_getterinfo = { | |||
4507 | { get_writableNullableUnrestrictedFloat }, | |||
4508 | { prototypes::id::TestExampleInterface }, | |||
4509 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4510 | JSJitInfo::Getter, | |||
4511 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4512 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
4513 | true, /* isInfallible. False in setters. */ | |||
4514 | false, /* isMovable. Not relevant for setters. */ | |||
4515 | false, /* isEliminatable. Not relevant for setters. */ | |||
4516 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4517 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4518 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4519 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4520 | }; | |||
4521 | static const JSJitInfo writableNullableUnrestrictedFloat_setterinfo = { | |||
4522 | { (JSJitGetterOp)set_writableNullableUnrestrictedFloat }, | |||
4523 | { prototypes::id::TestExampleInterface }, | |||
4524 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4525 | JSJitInfo::Setter, | |||
4526 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4527 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4528 | false, /* isInfallible. False in setters. */ | |||
4529 | false, /* isMovable. Not relevant for setters. */ | |||
4530 | false, /* isEliminatable. Not relevant for setters. */ | |||
4531 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4532 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4533 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4534 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4535 | }; | |||
4536 | ||||
4537 | MOZ_CAN_RUN_SCRIPT static bool | |||
4538 | get_writableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4539 | { | |||
4540 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4543( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4541 | "TestExampleInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4543( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4542 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4543( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4543 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4543( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4544 | ||||
4545 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4546 | double result(MOZ_KnownLive(self)(self)->WritableDouble()); | |||
4547 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4547); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4547; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4548 | args.rval().set(JS_NumberValue(double(result))); | |||
4549 | return true; | |||
4550 | } | |||
4551 | ||||
4552 | MOZ_CAN_RUN_SCRIPT static bool | |||
4553 | set_writableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4554 | { | |||
4555 | BindingCallContext cx(cx_, "TestExampleInterface.writableDouble setter"); | |||
4556 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4559( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4557 | "TestExampleInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4559( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4558 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4559( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4559 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4559( cx, "TestExampleInterface" , "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4560 | ||||
4561 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4562 | double arg0; | |||
4563 | if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
4564 | return false; | |||
4565 | } else if (!std::isfinite(arg0)) { | |||
4566 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned"); | |||
4567 | return false; | |||
4568 | } | |||
4569 | // NOTE: This assert does NOT call the function. | |||
4570 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableDouble(arg0))>, "Should be returning void here"); | |||
4571 | MOZ_KnownLive(self)(self)->SetWritableDouble(arg0); | |||
4572 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4572); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4572; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4573 | ||||
4574 | return true; | |||
4575 | } | |||
4576 | ||||
4577 | static const JSJitInfo writableDouble_getterinfo = { | |||
4578 | { get_writableDouble }, | |||
4579 | { prototypes::id::TestExampleInterface }, | |||
4580 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4581 | JSJitInfo::Getter, | |||
4582 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4583 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
4584 | true, /* isInfallible. False in setters. */ | |||
4585 | false, /* isMovable. Not relevant for setters. */ | |||
4586 | false, /* isEliminatable. Not relevant for setters. */ | |||
4587 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4588 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4589 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4590 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4591 | }; | |||
4592 | static const JSJitInfo writableDouble_setterinfo = { | |||
4593 | { (JSJitGetterOp)set_writableDouble }, | |||
4594 | { prototypes::id::TestExampleInterface }, | |||
4595 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4596 | JSJitInfo::Setter, | |||
4597 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4598 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4599 | false, /* isInfallible. False in setters. */ | |||
4600 | false, /* isMovable. Not relevant for setters. */ | |||
4601 | false, /* isEliminatable. Not relevant for setters. */ | |||
4602 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4603 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4604 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4605 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4606 | }; | |||
4607 | ||||
4608 | MOZ_CAN_RUN_SCRIPT static bool | |||
4609 | get_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4610 | { | |||
4611 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4614( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4612 | "TestExampleInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4614( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4613 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4614( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4614 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4614( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4615 | ||||
4616 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4617 | double result(MOZ_KnownLive(self)(self)->WritableUnrestrictedDouble()); | |||
4618 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4618); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4618; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4619 | args.rval().set(JS_NumberValue(double(result))); | |||
4620 | return true; | |||
4621 | } | |||
4622 | ||||
4623 | MOZ_CAN_RUN_SCRIPT static bool | |||
4624 | set_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4625 | { | |||
4626 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4629( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4627 | "TestExampleInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4629( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4628 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4629( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4629 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4629( cx, "TestExampleInterface" , "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4630 | ||||
4631 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4632 | double arg0; | |||
4633 | if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
4634 | return false; | |||
4635 | } | |||
4636 | // NOTE: This assert does NOT call the function. | |||
4637 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnrestrictedDouble(arg0))>, "Should be returning void here"); | |||
4638 | MOZ_KnownLive(self)(self)->SetWritableUnrestrictedDouble(arg0); | |||
4639 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4639); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4639; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4640 | ||||
4641 | return true; | |||
4642 | } | |||
4643 | ||||
4644 | static const JSJitInfo writableUnrestrictedDouble_getterinfo = { | |||
4645 | { get_writableUnrestrictedDouble }, | |||
4646 | { prototypes::id::TestExampleInterface }, | |||
4647 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4648 | JSJitInfo::Getter, | |||
4649 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4650 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
4651 | true, /* isInfallible. False in setters. */ | |||
4652 | false, /* isMovable. Not relevant for setters. */ | |||
4653 | false, /* isEliminatable. Not relevant for setters. */ | |||
4654 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4655 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4656 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4657 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4658 | }; | |||
4659 | static const JSJitInfo writableUnrestrictedDouble_setterinfo = { | |||
4660 | { (JSJitGetterOp)set_writableUnrestrictedDouble }, | |||
4661 | { prototypes::id::TestExampleInterface }, | |||
4662 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4663 | JSJitInfo::Setter, | |||
4664 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4665 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4666 | false, /* isInfallible. False in setters. */ | |||
4667 | false, /* isMovable. Not relevant for setters. */ | |||
4668 | false, /* isEliminatable. Not relevant for setters. */ | |||
4669 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4670 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4671 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4672 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4673 | }; | |||
4674 | ||||
4675 | MOZ_CAN_RUN_SCRIPT static bool | |||
4676 | get_writableNullableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4677 | { | |||
4678 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4681( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4679 | "TestExampleInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4681( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4680 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4681( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4681 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4681( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4682 | ||||
4683 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4684 | Nullable<double> result(MOZ_KnownLive(self)(self)->GetWritableNullableDouble()); | |||
4685 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4685); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4685; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4686 | if (result.IsNull()) { | |||
4687 | args.rval().setNull(); | |||
4688 | return true; | |||
4689 | } | |||
4690 | args.rval().set(JS_NumberValue(double(result.Value()))); | |||
4691 | return true; | |||
4692 | } | |||
4693 | ||||
4694 | MOZ_CAN_RUN_SCRIPT static bool | |||
4695 | set_writableNullableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4696 | { | |||
4697 | BindingCallContext cx(cx_, "TestExampleInterface.writableNullableDouble setter"); | |||
4698 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4699 | "TestExampleInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4700 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
4701 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestExampleInterface" , "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
4702 | ||||
4703 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4704 | Nullable<double> arg0; | |||
4705 | if (args[0].isNullOrUndefined()) { | |||
4706 | arg0.SetNull(); | |||
4707 | } else if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) { | |||
4708 | return false; | |||
4709 | } else if (!std::isfinite(arg0.Value())) { | |||
4710 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned"); | |||
4711 | return false; | |||
4712 | } | |||
4713 | // NOTE: This assert does NOT call the function. | |||
4714 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableDouble(Constify(arg0)))>, "Should be returning void here"); | |||
4715 | MOZ_KnownLive(self)(self)->SetWritableNullableDouble(Constify(arg0)); | |||
4716 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4716); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4716; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4717 | ||||
4718 | return true; | |||
4719 | } | |||
4720 | ||||
4721 | static const JSJitInfo writableNullableDouble_getterinfo = { | |||
4722 | { get_writableNullableDouble }, | |||
4723 | { prototypes::id::TestExampleInterface }, | |||
4724 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4725 | JSJitInfo::Getter, | |||
4726 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4727 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
4728 | true, /* isInfallible. False in setters. */ | |||
4729 | false, /* isMovable. Not relevant for setters. */ | |||
4730 | false, /* isEliminatable. Not relevant for setters. */ | |||
4731 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4732 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4733 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4734 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4735 | }; | |||
4736 | static const JSJitInfo writableNullableDouble_setterinfo = { | |||
4737 | { (JSJitGetterOp)set_writableNullableDouble }, | |||
4738 | { prototypes::id::TestExampleInterface }, | |||
4739 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4740 | JSJitInfo::Setter, | |||
4741 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4742 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4743 | false, /* isInfallible. False in setters. */ | |||
4744 | false, /* isMovable. Not relevant for setters. */ | |||
4745 | false, /* isEliminatable. Not relevant for setters. */ | |||
4746 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4747 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4748 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4749 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4750 | }; | |||
4751 | ||||
4752 | MOZ_CAN_RUN_SCRIPT static bool | |||
4753 | get_writableNullableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
4754 | { | |||
4755 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4758( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4756 | "TestExampleInterface", "writableNullableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4758( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4757 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4758( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4758 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4758( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4759 | ||||
4760 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4761 | Nullable<double> result(MOZ_KnownLive(self)(self)->GetWritableNullableUnrestrictedDouble()); | |||
4762 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4762); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4762; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4763 | if (result.IsNull()) { | |||
4764 | args.rval().setNull(); | |||
4765 | return true; | |||
4766 | } | |||
4767 | args.rval().set(JS_NumberValue(double(result.Value()))); | |||
4768 | return true; | |||
4769 | } | |||
4770 | ||||
4771 | MOZ_CAN_RUN_SCRIPT static bool | |||
4772 | set_writableNullableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
4773 | { | |||
4774 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4777( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4775 | "TestExampleInterface", "writableNullableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4777( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4776 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4777( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
4777 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4777( cx, "TestExampleInterface" , "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
4778 | ||||
4779 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4780 | Nullable<double> arg0; | |||
4781 | if (args[0].isNullOrUndefined()) { | |||
4782 | arg0.SetNull(); | |||
4783 | } else if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) { | |||
4784 | return false; | |||
4785 | } | |||
4786 | // NOTE: This assert does NOT call the function. | |||
4787 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedDouble(Constify(arg0)))>, "Should be returning void here"); | |||
4788 | MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedDouble(Constify(arg0)); | |||
4789 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 4789); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 4789; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4790 | ||||
4791 | return true; | |||
4792 | } | |||
4793 | ||||
4794 | static const JSJitInfo writableNullableUnrestrictedDouble_getterinfo = { | |||
4795 | { get_writableNullableUnrestrictedDouble }, | |||
4796 | { prototypes::id::TestExampleInterface }, | |||
4797 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4798 | JSJitInfo::Getter, | |||
4799 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4800 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
4801 | true, /* isInfallible. False in setters. */ | |||
4802 | false, /* isMovable. Not relevant for setters. */ | |||
4803 | false, /* isEliminatable. Not relevant for setters. */ | |||
4804 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4805 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4806 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4807 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4808 | }; | |||
4809 | static const JSJitInfo writableNullableUnrestrictedDouble_setterinfo = { | |||
4810 | { (JSJitGetterOp)set_writableNullableUnrestrictedDouble }, | |||
4811 | { prototypes::id::TestExampleInterface }, | |||
4812 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
4813 | JSJitInfo::Setter, | |||
4814 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
4815 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
4816 | false, /* isInfallible. False in setters. */ | |||
4817 | false, /* isMovable. Not relevant for setters. */ | |||
4818 | false, /* isEliminatable. Not relevant for setters. */ | |||
4819 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
4820 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
4821 | false, /* isTypedMethod. Only relevant for methods. */ | |||
4822 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
4823 | }; | |||
4824 | ||||
4825 | MOZ_CAN_RUN_SCRIPT static bool | |||
4826 | passFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
4827 | { | |||
4828 | BindingCallContext cx(cx_, "TestExampleInterface.passFloat"); | |||
4829 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4832( cx, "TestExampleInterface" , "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
4830 | "TestExampleInterface", "passFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4832( cx, "TestExampleInterface" , "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
4831 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4832( cx, "TestExampleInterface" , "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
4832 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4832( cx, "TestExampleInterface" , "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
4833 | ||||
4834 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
4835 | if (!args.requireAtLeast(cx, "TestExampleInterface.passFloat", 16)) { | |||
4836 | return false; | |||
4837 | } | |||
4838 | float arg0; | |||
4839 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
4840 | return false; | |||
4841 | } else if (!std::isfinite(arg0)) { | |||
4842 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1"); | |||
4843 | return false; | |||
4844 | } | |||
4845 | float arg1; | |||
4846 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) { | |||
4847 | return false; | |||
4848 | } | |||
4849 | Nullable<float> arg2; | |||
4850 | if (args[2].isNullOrUndefined()) { | |||
4851 | arg2.SetNull(); | |||
4852 | } else if (!ValueToPrimitive<float, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) { | |||
4853 | return false; | |||
4854 | } else if (!std::isfinite(arg2.Value())) { | |||
4855 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 3"); | |||
4856 | return false; | |||
4857 | } | |||
4858 | Nullable<float> arg3; | |||
4859 | if (args[3].isNullOrUndefined()) { | |||
4860 | arg3.SetNull(); | |||
4861 | } else if (!ValueToPrimitive<float, eDefault>(cx, args[3], "Argument 4", &arg3.SetValue())) { | |||
4862 | return false; | |||
4863 | } | |||
4864 | double arg4; | |||
4865 | if (!ValueToPrimitive<double, eDefault>(cx, args[4], "Argument 5", &arg4)) { | |||
4866 | return false; | |||
4867 | } else if (!std::isfinite(arg4)) { | |||
4868 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 5"); | |||
4869 | return false; | |||
4870 | } | |||
4871 | double arg5; | |||
4872 | if (!ValueToPrimitive<double, eDefault>(cx, args[5], "Argument 6", &arg5)) { | |||
4873 | return false; | |||
4874 | } | |||
4875 | Nullable<double> arg6; | |||
4876 | if (args[6].isNullOrUndefined()) { | |||
4877 | arg6.SetNull(); | |||
4878 | } else if (!ValueToPrimitive<double, eDefault>(cx, args[6], "Argument 7", &arg6.SetValue())) { | |||
4879 | return false; | |||
4880 | } else if (!std::isfinite(arg6.Value())) { | |||
4881 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 7"); | |||
4882 | return false; | |||
4883 | } | |||
4884 | Nullable<double> arg7; | |||
4885 | if (args[7].isNullOrUndefined()) { | |||
4886 | arg7.SetNull(); | |||
4887 | } else if (!ValueToPrimitive<double, eDefault>(cx, args[7], "Argument 8", &arg7.SetValue())) { | |||
4888 | return false; | |||
4889 | } | |||
4890 | binding_detail::AutoSequence<float> arg8; | |||
4891 | if (args[8].isObject()) { | |||
4892 | JS::ForOfIterator iter(cx); | |||
4893 | if (!iter.init(args[8], JS::ForOfIterator::AllowNonIterable)) { | |||
4894 | return false; | |||
4895 | } | |||
4896 | if (!iter.valueIsIterable()) { | |||
4897 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence"); | |||
4898 | return false; | |||
4899 | } | |||
4900 | binding_detail::AutoSequence<float> &arr = arg8; | |||
4901 | JS::Rooted<JS::Value> temp(cx); | |||
4902 | while (true) { | |||
4903 | bool done; | |||
4904 | if (!iter.next(&temp, &done)) { | |||
4905 | return false; | |||
4906 | } | |||
4907 | if (done) { | |||
4908 | break; | |||
4909 | } | |||
4910 | float* slotPtr = arr.AppendElement(mozilla::fallible); | |||
4911 | if (!slotPtr) { | |||
4912 | JS_ReportOutOfMemory(cx); | |||
4913 | return false; | |||
4914 | } | |||
4915 | float& slot = *slotPtr; | |||
4916 | if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 9", &slot)) { | |||
4917 | return false; | |||
4918 | } else if (!std::isfinite(slot)) { | |||
4919 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 9"); | |||
4920 | return false; | |||
4921 | } | |||
4922 | } | |||
4923 | } else { | |||
4924 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence"); | |||
4925 | return false; | |||
4926 | } | |||
4927 | binding_detail::AutoSequence<float> arg9; | |||
4928 | if (args[9].isObject()) { | |||
4929 | JS::ForOfIterator iter(cx); | |||
4930 | if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) { | |||
4931 | return false; | |||
4932 | } | |||
4933 | if (!iter.valueIsIterable()) { | |||
4934 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence"); | |||
4935 | return false; | |||
4936 | } | |||
4937 | binding_detail::AutoSequence<float> &arr = arg9; | |||
4938 | JS::Rooted<JS::Value> temp(cx); | |||
4939 | while (true) { | |||
4940 | bool done; | |||
4941 | if (!iter.next(&temp, &done)) { | |||
4942 | return false; | |||
4943 | } | |||
4944 | if (done) { | |||
4945 | break; | |||
4946 | } | |||
4947 | float* slotPtr = arr.AppendElement(mozilla::fallible); | |||
4948 | if (!slotPtr) { | |||
4949 | JS_ReportOutOfMemory(cx); | |||
4950 | return false; | |||
4951 | } | |||
4952 | float& slot = *slotPtr; | |||
4953 | if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 10", &slot)) { | |||
4954 | return false; | |||
4955 | } | |||
4956 | } | |||
4957 | } else { | |||
4958 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence"); | |||
4959 | return false; | |||
4960 | } | |||
4961 | binding_detail::AutoSequence<Nullable<float>> arg10; | |||
4962 | if (args[10].isObject()) { | |||
4963 | JS::ForOfIterator iter(cx); | |||
4964 | if (!iter.init(args[10], JS::ForOfIterator::AllowNonIterable)) { | |||
4965 | return false; | |||
4966 | } | |||
4967 | if (!iter.valueIsIterable()) { | |||
4968 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence"); | |||
4969 | return false; | |||
4970 | } | |||
4971 | binding_detail::AutoSequence<Nullable<float>> &arr = arg10; | |||
4972 | JS::Rooted<JS::Value> temp(cx); | |||
4973 | while (true) { | |||
4974 | bool done; | |||
4975 | if (!iter.next(&temp, &done)) { | |||
4976 | return false; | |||
4977 | } | |||
4978 | if (done) { | |||
4979 | break; | |||
4980 | } | |||
4981 | Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
4982 | if (!slotPtr) { | |||
4983 | JS_ReportOutOfMemory(cx); | |||
4984 | return false; | |||
4985 | } | |||
4986 | Nullable<float>& slot = *slotPtr; | |||
4987 | if (temp.isNullOrUndefined()) { | |||
4988 | slot.SetNull(); | |||
4989 | } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 11", &slot.SetValue())) { | |||
4990 | return false; | |||
4991 | } else if (!std::isfinite(slot.Value())) { | |||
4992 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 11"); | |||
4993 | return false; | |||
4994 | } | |||
4995 | } | |||
4996 | } else { | |||
4997 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence"); | |||
4998 | return false; | |||
4999 | } | |||
5000 | binding_detail::AutoSequence<Nullable<float>> arg11; | |||
5001 | if (args[11].isObject()) { | |||
5002 | JS::ForOfIterator iter(cx); | |||
5003 | if (!iter.init(args[11], JS::ForOfIterator::AllowNonIterable)) { | |||
5004 | return false; | |||
5005 | } | |||
5006 | if (!iter.valueIsIterable()) { | |||
5007 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence"); | |||
5008 | return false; | |||
5009 | } | |||
5010 | binding_detail::AutoSequence<Nullable<float>> &arr = arg11; | |||
5011 | JS::Rooted<JS::Value> temp(cx); | |||
5012 | while (true) { | |||
5013 | bool done; | |||
5014 | if (!iter.next(&temp, &done)) { | |||
5015 | return false; | |||
5016 | } | |||
5017 | if (done) { | |||
5018 | break; | |||
5019 | } | |||
5020 | Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5021 | if (!slotPtr) { | |||
5022 | JS_ReportOutOfMemory(cx); | |||
5023 | return false; | |||
5024 | } | |||
5025 | Nullable<float>& slot = *slotPtr; | |||
5026 | if (temp.isNullOrUndefined()) { | |||
5027 | slot.SetNull(); | |||
5028 | } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 12", &slot.SetValue())) { | |||
5029 | return false; | |||
5030 | } | |||
5031 | } | |||
5032 | } else { | |||
5033 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence"); | |||
5034 | return false; | |||
5035 | } | |||
5036 | binding_detail::AutoSequence<double> arg12; | |||
5037 | if (args[12].isObject()) { | |||
5038 | JS::ForOfIterator iter(cx); | |||
5039 | if (!iter.init(args[12], JS::ForOfIterator::AllowNonIterable)) { | |||
5040 | return false; | |||
5041 | } | |||
5042 | if (!iter.valueIsIterable()) { | |||
5043 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence"); | |||
5044 | return false; | |||
5045 | } | |||
5046 | binding_detail::AutoSequence<double> &arr = arg12; | |||
5047 | JS::Rooted<JS::Value> temp(cx); | |||
5048 | while (true) { | |||
5049 | bool done; | |||
5050 | if (!iter.next(&temp, &done)) { | |||
5051 | return false; | |||
5052 | } | |||
5053 | if (done) { | |||
5054 | break; | |||
5055 | } | |||
5056 | double* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5057 | if (!slotPtr) { | |||
5058 | JS_ReportOutOfMemory(cx); | |||
5059 | return false; | |||
5060 | } | |||
5061 | double& slot = *slotPtr; | |||
5062 | if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 13", &slot)) { | |||
5063 | return false; | |||
5064 | } else if (!std::isfinite(slot)) { | |||
5065 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 13"); | |||
5066 | return false; | |||
5067 | } | |||
5068 | } | |||
5069 | } else { | |||
5070 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence"); | |||
5071 | return false; | |||
5072 | } | |||
5073 | binding_detail::AutoSequence<double> arg13; | |||
5074 | if (args[13].isObject()) { | |||
5075 | JS::ForOfIterator iter(cx); | |||
5076 | if (!iter.init(args[13], JS::ForOfIterator::AllowNonIterable)) { | |||
5077 | return false; | |||
5078 | } | |||
5079 | if (!iter.valueIsIterable()) { | |||
5080 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence"); | |||
5081 | return false; | |||
5082 | } | |||
5083 | binding_detail::AutoSequence<double> &arr = arg13; | |||
5084 | JS::Rooted<JS::Value> temp(cx); | |||
5085 | while (true) { | |||
5086 | bool done; | |||
5087 | if (!iter.next(&temp, &done)) { | |||
5088 | return false; | |||
5089 | } | |||
5090 | if (done) { | |||
5091 | break; | |||
5092 | } | |||
5093 | double* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5094 | if (!slotPtr) { | |||
5095 | JS_ReportOutOfMemory(cx); | |||
5096 | return false; | |||
5097 | } | |||
5098 | double& slot = *slotPtr; | |||
5099 | if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 14", &slot)) { | |||
5100 | return false; | |||
5101 | } | |||
5102 | } | |||
5103 | } else { | |||
5104 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence"); | |||
5105 | return false; | |||
5106 | } | |||
5107 | binding_detail::AutoSequence<Nullable<double>> arg14; | |||
5108 | if (args[14].isObject()) { | |||
5109 | JS::ForOfIterator iter(cx); | |||
5110 | if (!iter.init(args[14], JS::ForOfIterator::AllowNonIterable)) { | |||
5111 | return false; | |||
5112 | } | |||
5113 | if (!iter.valueIsIterable()) { | |||
5114 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence"); | |||
5115 | return false; | |||
5116 | } | |||
5117 | binding_detail::AutoSequence<Nullable<double>> &arr = arg14; | |||
5118 | JS::Rooted<JS::Value> temp(cx); | |||
5119 | while (true) { | |||
5120 | bool done; | |||
5121 | if (!iter.next(&temp, &done)) { | |||
5122 | return false; | |||
5123 | } | |||
5124 | if (done) { | |||
5125 | break; | |||
5126 | } | |||
5127 | Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5128 | if (!slotPtr) { | |||
5129 | JS_ReportOutOfMemory(cx); | |||
5130 | return false; | |||
5131 | } | |||
5132 | Nullable<double>& slot = *slotPtr; | |||
5133 | if (temp.isNullOrUndefined()) { | |||
5134 | slot.SetNull(); | |||
5135 | } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 15", &slot.SetValue())) { | |||
5136 | return false; | |||
5137 | } else if (!std::isfinite(slot.Value())) { | |||
5138 | cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 15"); | |||
5139 | return false; | |||
5140 | } | |||
5141 | } | |||
5142 | } else { | |||
5143 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence"); | |||
5144 | return false; | |||
5145 | } | |||
5146 | binding_detail::AutoSequence<Nullable<double>> arg15; | |||
5147 | if (args[15].isObject()) { | |||
5148 | JS::ForOfIterator iter(cx); | |||
5149 | if (!iter.init(args[15], JS::ForOfIterator::AllowNonIterable)) { | |||
5150 | return false; | |||
5151 | } | |||
5152 | if (!iter.valueIsIterable()) { | |||
5153 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence"); | |||
5154 | return false; | |||
5155 | } | |||
5156 | binding_detail::AutoSequence<Nullable<double>> &arr = arg15; | |||
5157 | JS::Rooted<JS::Value> temp(cx); | |||
5158 | while (true) { | |||
5159 | bool done; | |||
5160 | if (!iter.next(&temp, &done)) { | |||
5161 | return false; | |||
5162 | } | |||
5163 | if (done) { | |||
5164 | break; | |||
5165 | } | |||
5166 | Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5167 | if (!slotPtr) { | |||
5168 | JS_ReportOutOfMemory(cx); | |||
5169 | return false; | |||
5170 | } | |||
5171 | Nullable<double>& slot = *slotPtr; | |||
5172 | if (temp.isNullOrUndefined()) { | |||
5173 | slot.SetNull(); | |||
5174 | } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 16", &slot.SetValue())) { | |||
5175 | return false; | |||
5176 | } | |||
5177 | } | |||
5178 | } else { | |||
5179 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence"); | |||
5180 | return false; | |||
5181 | } | |||
5182 | // NOTE: This assert does NOT call the function. | |||
5183 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15)))>, "Should be returning void here"); | |||
5184 | MOZ_KnownLive(self)(self)->PassFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15)); | |||
5185 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5185); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5185; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5186 | args.rval().setUndefined(); | |||
5187 | return true; | |||
5188 | } | |||
5189 | ||||
5190 | static const JSJitInfo passFloat_methodinfo = { | |||
5191 | { (JSJitGetterOp)passFloat }, | |||
5192 | { prototypes::id::TestExampleInterface }, | |||
5193 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5194 | JSJitInfo::Method, | |||
5195 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5196 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
5197 | false, /* isInfallible. False in setters. */ | |||
5198 | false, /* isMovable. Not relevant for setters. */ | |||
5199 | false, /* isEliminatable. Not relevant for setters. */ | |||
5200 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5201 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5202 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5203 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5204 | }; | |||
5205 | ||||
5206 | MOZ_CAN_RUN_SCRIPT static bool | |||
5207 | passLenientFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
5208 | { | |||
5209 | BindingCallContext cx(cx_, "TestExampleInterface.passLenientFloat"); | |||
5210 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5213( cx, "TestExampleInterface" , "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5211 | "TestExampleInterface", "passLenientFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5213( cx, "TestExampleInterface" , "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5212 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5213( cx, "TestExampleInterface" , "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5213 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5213( cx, "TestExampleInterface" , "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5214 | ||||
5215 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5216 | if (!args.requireAtLeast(cx, "TestExampleInterface.passLenientFloat", 16)) { | |||
5217 | return false; | |||
5218 | } | |||
5219 | bool foundNonFiniteFloat = false; | |||
5220 | float arg0; | |||
5221 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) { | |||
5222 | return false; | |||
5223 | } else if (!std::isfinite(arg0)) { | |||
5224 | foundNonFiniteFloat = true; | |||
5225 | } | |||
5226 | float arg1; | |||
5227 | if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) { | |||
5228 | return false; | |||
5229 | } | |||
5230 | Nullable<float> arg2; | |||
5231 | if (args[2].isNullOrUndefined()) { | |||
5232 | arg2.SetNull(); | |||
5233 | } else if (!ValueToPrimitive<float, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) { | |||
5234 | return false; | |||
5235 | } else if (!std::isfinite(arg2.Value())) { | |||
5236 | foundNonFiniteFloat = true; | |||
5237 | } | |||
5238 | Nullable<float> arg3; | |||
5239 | if (args[3].isNullOrUndefined()) { | |||
5240 | arg3.SetNull(); | |||
5241 | } else if (!ValueToPrimitive<float, eDefault>(cx, args[3], "Argument 4", &arg3.SetValue())) { | |||
5242 | return false; | |||
5243 | } | |||
5244 | double arg4; | |||
5245 | if (!ValueToPrimitive<double, eDefault>(cx, args[4], "Argument 5", &arg4)) { | |||
5246 | return false; | |||
5247 | } else if (!std::isfinite(arg4)) { | |||
5248 | foundNonFiniteFloat = true; | |||
5249 | } | |||
5250 | double arg5; | |||
5251 | if (!ValueToPrimitive<double, eDefault>(cx, args[5], "Argument 6", &arg5)) { | |||
5252 | return false; | |||
5253 | } | |||
5254 | Nullable<double> arg6; | |||
5255 | if (args[6].isNullOrUndefined()) { | |||
5256 | arg6.SetNull(); | |||
5257 | } else if (!ValueToPrimitive<double, eDefault>(cx, args[6], "Argument 7", &arg6.SetValue())) { | |||
5258 | return false; | |||
5259 | } else if (!std::isfinite(arg6.Value())) { | |||
5260 | foundNonFiniteFloat = true; | |||
5261 | } | |||
5262 | Nullable<double> arg7; | |||
5263 | if (args[7].isNullOrUndefined()) { | |||
5264 | arg7.SetNull(); | |||
5265 | } else if (!ValueToPrimitive<double, eDefault>(cx, args[7], "Argument 8", &arg7.SetValue())) { | |||
5266 | return false; | |||
5267 | } | |||
5268 | binding_detail::AutoSequence<float> arg8; | |||
5269 | if (args[8].isObject()) { | |||
5270 | JS::ForOfIterator iter(cx); | |||
5271 | if (!iter.init(args[8], JS::ForOfIterator::AllowNonIterable)) { | |||
5272 | return false; | |||
5273 | } | |||
5274 | if (!iter.valueIsIterable()) { | |||
5275 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence"); | |||
5276 | return false; | |||
5277 | } | |||
5278 | binding_detail::AutoSequence<float> &arr = arg8; | |||
5279 | JS::Rooted<JS::Value> temp(cx); | |||
5280 | while (true) { | |||
5281 | bool done; | |||
5282 | if (!iter.next(&temp, &done)) { | |||
5283 | return false; | |||
5284 | } | |||
5285 | if (done) { | |||
5286 | break; | |||
5287 | } | |||
5288 | float* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5289 | if (!slotPtr) { | |||
5290 | JS_ReportOutOfMemory(cx); | |||
5291 | return false; | |||
5292 | } | |||
5293 | float& slot = *slotPtr; | |||
5294 | if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 9", &slot)) { | |||
5295 | return false; | |||
5296 | } else if (!std::isfinite(slot)) { | |||
5297 | foundNonFiniteFloat = true; | |||
5298 | } | |||
5299 | } | |||
5300 | } else { | |||
5301 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence"); | |||
5302 | return false; | |||
5303 | } | |||
5304 | binding_detail::AutoSequence<float> arg9; | |||
5305 | if (args[9].isObject()) { | |||
5306 | JS::ForOfIterator iter(cx); | |||
5307 | if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) { | |||
5308 | return false; | |||
5309 | } | |||
5310 | if (!iter.valueIsIterable()) { | |||
5311 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence"); | |||
5312 | return false; | |||
5313 | } | |||
5314 | binding_detail::AutoSequence<float> &arr = arg9; | |||
5315 | JS::Rooted<JS::Value> temp(cx); | |||
5316 | while (true) { | |||
5317 | bool done; | |||
5318 | if (!iter.next(&temp, &done)) { | |||
5319 | return false; | |||
5320 | } | |||
5321 | if (done) { | |||
5322 | break; | |||
5323 | } | |||
5324 | float* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5325 | if (!slotPtr) { | |||
5326 | JS_ReportOutOfMemory(cx); | |||
5327 | return false; | |||
5328 | } | |||
5329 | float& slot = *slotPtr; | |||
5330 | if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 10", &slot)) { | |||
5331 | return false; | |||
5332 | } | |||
5333 | } | |||
5334 | } else { | |||
5335 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence"); | |||
5336 | return false; | |||
5337 | } | |||
5338 | binding_detail::AutoSequence<Nullable<float>> arg10; | |||
5339 | if (args[10].isObject()) { | |||
5340 | JS::ForOfIterator iter(cx); | |||
5341 | if (!iter.init(args[10], JS::ForOfIterator::AllowNonIterable)) { | |||
5342 | return false; | |||
5343 | } | |||
5344 | if (!iter.valueIsIterable()) { | |||
5345 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence"); | |||
5346 | return false; | |||
5347 | } | |||
5348 | binding_detail::AutoSequence<Nullable<float>> &arr = arg10; | |||
5349 | JS::Rooted<JS::Value> temp(cx); | |||
5350 | while (true) { | |||
5351 | bool done; | |||
5352 | if (!iter.next(&temp, &done)) { | |||
5353 | return false; | |||
5354 | } | |||
5355 | if (done) { | |||
5356 | break; | |||
5357 | } | |||
5358 | Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5359 | if (!slotPtr) { | |||
5360 | JS_ReportOutOfMemory(cx); | |||
5361 | return false; | |||
5362 | } | |||
5363 | Nullable<float>& slot = *slotPtr; | |||
5364 | if (temp.isNullOrUndefined()) { | |||
5365 | slot.SetNull(); | |||
5366 | } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 11", &slot.SetValue())) { | |||
5367 | return false; | |||
5368 | } else if (!std::isfinite(slot.Value())) { | |||
5369 | foundNonFiniteFloat = true; | |||
5370 | } | |||
5371 | } | |||
5372 | } else { | |||
5373 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence"); | |||
5374 | return false; | |||
5375 | } | |||
5376 | binding_detail::AutoSequence<Nullable<float>> arg11; | |||
5377 | if (args[11].isObject()) { | |||
5378 | JS::ForOfIterator iter(cx); | |||
5379 | if (!iter.init(args[11], JS::ForOfIterator::AllowNonIterable)) { | |||
5380 | return false; | |||
5381 | } | |||
5382 | if (!iter.valueIsIterable()) { | |||
5383 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence"); | |||
5384 | return false; | |||
5385 | } | |||
5386 | binding_detail::AutoSequence<Nullable<float>> &arr = arg11; | |||
5387 | JS::Rooted<JS::Value> temp(cx); | |||
5388 | while (true) { | |||
5389 | bool done; | |||
5390 | if (!iter.next(&temp, &done)) { | |||
5391 | return false; | |||
5392 | } | |||
5393 | if (done) { | |||
5394 | break; | |||
5395 | } | |||
5396 | Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5397 | if (!slotPtr) { | |||
5398 | JS_ReportOutOfMemory(cx); | |||
5399 | return false; | |||
5400 | } | |||
5401 | Nullable<float>& slot = *slotPtr; | |||
5402 | if (temp.isNullOrUndefined()) { | |||
5403 | slot.SetNull(); | |||
5404 | } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 12", &slot.SetValue())) { | |||
5405 | return false; | |||
5406 | } | |||
5407 | } | |||
5408 | } else { | |||
5409 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence"); | |||
5410 | return false; | |||
5411 | } | |||
5412 | binding_detail::AutoSequence<double> arg12; | |||
5413 | if (args[12].isObject()) { | |||
5414 | JS::ForOfIterator iter(cx); | |||
5415 | if (!iter.init(args[12], JS::ForOfIterator::AllowNonIterable)) { | |||
5416 | return false; | |||
5417 | } | |||
5418 | if (!iter.valueIsIterable()) { | |||
5419 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence"); | |||
5420 | return false; | |||
5421 | } | |||
5422 | binding_detail::AutoSequence<double> &arr = arg12; | |||
5423 | JS::Rooted<JS::Value> temp(cx); | |||
5424 | while (true) { | |||
5425 | bool done; | |||
5426 | if (!iter.next(&temp, &done)) { | |||
5427 | return false; | |||
5428 | } | |||
5429 | if (done) { | |||
5430 | break; | |||
5431 | } | |||
5432 | double* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5433 | if (!slotPtr) { | |||
5434 | JS_ReportOutOfMemory(cx); | |||
5435 | return false; | |||
5436 | } | |||
5437 | double& slot = *slotPtr; | |||
5438 | if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 13", &slot)) { | |||
5439 | return false; | |||
5440 | } else if (!std::isfinite(slot)) { | |||
5441 | foundNonFiniteFloat = true; | |||
5442 | } | |||
5443 | } | |||
5444 | } else { | |||
5445 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence"); | |||
5446 | return false; | |||
5447 | } | |||
5448 | binding_detail::AutoSequence<double> arg13; | |||
5449 | if (args[13].isObject()) { | |||
5450 | JS::ForOfIterator iter(cx); | |||
5451 | if (!iter.init(args[13], JS::ForOfIterator::AllowNonIterable)) { | |||
5452 | return false; | |||
5453 | } | |||
5454 | if (!iter.valueIsIterable()) { | |||
5455 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence"); | |||
5456 | return false; | |||
5457 | } | |||
5458 | binding_detail::AutoSequence<double> &arr = arg13; | |||
5459 | JS::Rooted<JS::Value> temp(cx); | |||
5460 | while (true) { | |||
5461 | bool done; | |||
5462 | if (!iter.next(&temp, &done)) { | |||
5463 | return false; | |||
5464 | } | |||
5465 | if (done) { | |||
5466 | break; | |||
5467 | } | |||
5468 | double* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5469 | if (!slotPtr) { | |||
5470 | JS_ReportOutOfMemory(cx); | |||
5471 | return false; | |||
5472 | } | |||
5473 | double& slot = *slotPtr; | |||
5474 | if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 14", &slot)) { | |||
5475 | return false; | |||
5476 | } | |||
5477 | } | |||
5478 | } else { | |||
5479 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence"); | |||
5480 | return false; | |||
5481 | } | |||
5482 | binding_detail::AutoSequence<Nullable<double>> arg14; | |||
5483 | if (args[14].isObject()) { | |||
5484 | JS::ForOfIterator iter(cx); | |||
5485 | if (!iter.init(args[14], JS::ForOfIterator::AllowNonIterable)) { | |||
5486 | return false; | |||
5487 | } | |||
5488 | if (!iter.valueIsIterable()) { | |||
5489 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence"); | |||
5490 | return false; | |||
5491 | } | |||
5492 | binding_detail::AutoSequence<Nullable<double>> &arr = arg14; | |||
5493 | JS::Rooted<JS::Value> temp(cx); | |||
5494 | while (true) { | |||
5495 | bool done; | |||
5496 | if (!iter.next(&temp, &done)) { | |||
5497 | return false; | |||
5498 | } | |||
5499 | if (done) { | |||
5500 | break; | |||
5501 | } | |||
5502 | Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5503 | if (!slotPtr) { | |||
5504 | JS_ReportOutOfMemory(cx); | |||
5505 | return false; | |||
5506 | } | |||
5507 | Nullable<double>& slot = *slotPtr; | |||
5508 | if (temp.isNullOrUndefined()) { | |||
5509 | slot.SetNull(); | |||
5510 | } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 15", &slot.SetValue())) { | |||
5511 | return false; | |||
5512 | } else if (!std::isfinite(slot.Value())) { | |||
5513 | foundNonFiniteFloat = true; | |||
5514 | } | |||
5515 | } | |||
5516 | } else { | |||
5517 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence"); | |||
5518 | return false; | |||
5519 | } | |||
5520 | binding_detail::AutoSequence<Nullable<double>> arg15; | |||
5521 | if (args[15].isObject()) { | |||
5522 | JS::ForOfIterator iter(cx); | |||
5523 | if (!iter.init(args[15], JS::ForOfIterator::AllowNonIterable)) { | |||
5524 | return false; | |||
5525 | } | |||
5526 | if (!iter.valueIsIterable()) { | |||
5527 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence"); | |||
5528 | return false; | |||
5529 | } | |||
5530 | binding_detail::AutoSequence<Nullable<double>> &arr = arg15; | |||
5531 | JS::Rooted<JS::Value> temp(cx); | |||
5532 | while (true) { | |||
5533 | bool done; | |||
5534 | if (!iter.next(&temp, &done)) { | |||
5535 | return false; | |||
5536 | } | |||
5537 | if (done) { | |||
5538 | break; | |||
5539 | } | |||
5540 | Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
5541 | if (!slotPtr) { | |||
5542 | JS_ReportOutOfMemory(cx); | |||
5543 | return false; | |||
5544 | } | |||
5545 | Nullable<double>& slot = *slotPtr; | |||
5546 | if (temp.isNullOrUndefined()) { | |||
5547 | slot.SetNull(); | |||
5548 | } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 16", &slot.SetValue())) { | |||
5549 | return false; | |||
5550 | } | |||
5551 | } | |||
5552 | } else { | |||
5553 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence"); | |||
5554 | return false; | |||
5555 | } | |||
5556 | if (foundNonFiniteFloat) { | |||
5557 | args.rval().setUndefined(); | |||
5558 | return true; | |||
5559 | } | |||
5560 | // NOTE: This assert does NOT call the function. | |||
5561 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLenientFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15)))>, "Should be returning void here"); | |||
5562 | MOZ_KnownLive(self)(self)->PassLenientFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15)); | |||
5563 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5563); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5563; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5564 | args.rval().setUndefined(); | |||
5565 | return true; | |||
5566 | } | |||
5567 | ||||
5568 | static const JSJitInfo passLenientFloat_methodinfo = { | |||
5569 | { (JSJitGetterOp)passLenientFloat }, | |||
5570 | { prototypes::id::TestExampleInterface }, | |||
5571 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5572 | JSJitInfo::Method, | |||
5573 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5574 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
5575 | false, /* isInfallible. False in setters. */ | |||
5576 | false, /* isMovable. Not relevant for setters. */ | |||
5577 | false, /* isEliminatable. Not relevant for setters. */ | |||
5578 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5579 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5580 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5581 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5582 | }; | |||
5583 | ||||
5584 | MOZ_CAN_RUN_SCRIPT static bool | |||
5585 | get_lenientFloatAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
5586 | { | |||
5587 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5590( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5588 | "TestExampleInterface", "lenientFloatAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5590( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5589 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject5590( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5590 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5590( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5591 | ||||
5592 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5593 | float result(MOZ_KnownLive(self)(self)->LenientFloatAttr()); | |||
5594 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5594); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5594; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5595 | args.rval().set(JS_NumberValue(double(result))); | |||
5596 | return true; | |||
5597 | } | |||
5598 | ||||
5599 | MOZ_CAN_RUN_SCRIPT static bool | |||
5600 | set_lenientFloatAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
5601 | { | |||
5602 | BindingCallContext cx(cx_, "TestExampleInterface.lenientFloatAttr setter"); | |||
5603 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5606( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5604 | "TestExampleInterface", "lenientFloatAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5606( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5605 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject5606( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5606 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5606( cx, "TestExampleInterface" , "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5607 | ||||
5608 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5609 | bool foundNonFiniteFloat = false; | |||
5610 | float arg0; | |||
5611 | if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
5612 | return false; | |||
5613 | } else if (!std::isfinite(arg0)) { | |||
5614 | foundNonFiniteFloat = true; | |||
5615 | } | |||
5616 | if (foundNonFiniteFloat) { | |||
5617 | return true; | |||
5618 | } | |||
5619 | // NOTE: This assert does NOT call the function. | |||
5620 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetLenientFloatAttr(arg0))>, "Should be returning void here"); | |||
5621 | MOZ_KnownLive(self)(self)->SetLenientFloatAttr(arg0); | |||
5622 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5622); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5622; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5623 | ||||
5624 | return true; | |||
5625 | } | |||
5626 | ||||
5627 | static const JSJitInfo lenientFloatAttr_getterinfo = { | |||
5628 | { get_lenientFloatAttr }, | |||
5629 | { prototypes::id::TestExampleInterface }, | |||
5630 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5631 | JSJitInfo::Getter, | |||
5632 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5633 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
5634 | true, /* isInfallible. False in setters. */ | |||
5635 | false, /* isMovable. Not relevant for setters. */ | |||
5636 | false, /* isEliminatable. Not relevant for setters. */ | |||
5637 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5638 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5639 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5640 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5641 | }; | |||
5642 | static const JSJitInfo lenientFloatAttr_setterinfo = { | |||
5643 | { (JSJitGetterOp)set_lenientFloatAttr }, | |||
5644 | { prototypes::id::TestExampleInterface }, | |||
5645 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5646 | JSJitInfo::Setter, | |||
5647 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5648 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
5649 | false, /* isInfallible. False in setters. */ | |||
5650 | false, /* isMovable. Not relevant for setters. */ | |||
5651 | false, /* isEliminatable. Not relevant for setters. */ | |||
5652 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5653 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5654 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5655 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5656 | }; | |||
5657 | ||||
5658 | MOZ_CAN_RUN_SCRIPT static bool | |||
5659 | get_lenientDoubleAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
5660 | { | |||
5661 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5664( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5662 | "TestExampleInterface", "lenientDoubleAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5664( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5663 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject5664( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5664 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5664( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5665 | ||||
5666 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5667 | double result(MOZ_KnownLive(self)(self)->LenientDoubleAttr()); | |||
5668 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5668); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5668; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5669 | args.rval().set(JS_NumberValue(double(result))); | |||
5670 | return true; | |||
5671 | } | |||
5672 | ||||
5673 | MOZ_CAN_RUN_SCRIPT static bool | |||
5674 | set_lenientDoubleAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
5675 | { | |||
5676 | BindingCallContext cx(cx_, "TestExampleInterface.lenientDoubleAttr setter"); | |||
5677 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5680( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5678 | "TestExampleInterface", "lenientDoubleAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5680( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5679 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject5680( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5680 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5680( cx, "TestExampleInterface" , "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5681 | ||||
5682 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5683 | bool foundNonFiniteFloat = false; | |||
5684 | double arg0; | |||
5685 | if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) { | |||
5686 | return false; | |||
5687 | } else if (!std::isfinite(arg0)) { | |||
5688 | foundNonFiniteFloat = true; | |||
5689 | } | |||
5690 | if (foundNonFiniteFloat) { | |||
5691 | return true; | |||
5692 | } | |||
5693 | // NOTE: This assert does NOT call the function. | |||
5694 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetLenientDoubleAttr(arg0))>, "Should be returning void here"); | |||
5695 | MOZ_KnownLive(self)(self)->SetLenientDoubleAttr(arg0); | |||
5696 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5696); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5696; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5697 | ||||
5698 | return true; | |||
5699 | } | |||
5700 | ||||
5701 | static const JSJitInfo lenientDoubleAttr_getterinfo = { | |||
5702 | { get_lenientDoubleAttr }, | |||
5703 | { prototypes::id::TestExampleInterface }, | |||
5704 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5705 | JSJitInfo::Getter, | |||
5706 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5707 | JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */ | |||
5708 | true, /* isInfallible. False in setters. */ | |||
5709 | false, /* isMovable. Not relevant for setters. */ | |||
5710 | false, /* isEliminatable. Not relevant for setters. */ | |||
5711 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5712 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5713 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5714 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5715 | }; | |||
5716 | static const JSJitInfo lenientDoubleAttr_setterinfo = { | |||
5717 | { (JSJitGetterOp)set_lenientDoubleAttr }, | |||
5718 | { prototypes::id::TestExampleInterface }, | |||
5719 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5720 | JSJitInfo::Setter, | |||
5721 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5722 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
5723 | false, /* isInfallible. False in setters. */ | |||
5724 | false, /* isMovable. Not relevant for setters. */ | |||
5725 | false, /* isEliminatable. Not relevant for setters. */ | |||
5726 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5727 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5728 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5729 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5730 | }; | |||
5731 | ||||
5732 | MOZ_CAN_RUN_SCRIPT static bool | |||
5733 | receiveSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
5734 | { | |||
5735 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5738( cx, "TestExampleInterface" , "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5736 | "TestExampleInterface", "receiveSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5738( cx, "TestExampleInterface" , "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5737 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5738( cx, "TestExampleInterface" , "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5738 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5738( cx, "TestExampleInterface" , "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5739 | ||||
5740 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5741 | auto result(StrongOrRawPtr<mozilla::dom::TestInterface>(MOZ_KnownLive(self)(self)->ReceiveSelf())); | |||
5742 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5742); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5742; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5743 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | |||
5744 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5744); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 5744; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
5745 | return false; | |||
5746 | } | |||
5747 | return true; | |||
5748 | } | |||
5749 | ||||
5750 | static const JSJitInfo receiveSelf_methodinfo = { | |||
5751 | { (JSJitGetterOp)receiveSelf }, | |||
5752 | { prototypes::id::TestExampleInterface }, | |||
5753 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5754 | JSJitInfo::Method, | |||
5755 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5756 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
5757 | false, /* isInfallible. False in setters. */ | |||
5758 | false, /* isMovable. Not relevant for setters. */ | |||
5759 | false, /* isEliminatable. Not relevant for setters. */ | |||
5760 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5761 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5762 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5763 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5764 | }; | |||
5765 | ||||
5766 | MOZ_CAN_RUN_SCRIPT static bool | |||
5767 | receiveNullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
5768 | { | |||
5769 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5772( cx, "TestExampleInterface" , "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5770 | "TestExampleInterface", "receiveNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5772( cx, "TestExampleInterface" , "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5771 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5772( cx, "TestExampleInterface" , "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5772 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5772( cx, "TestExampleInterface" , "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5773 | ||||
5774 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5775 | auto result(StrongOrRawPtr<mozilla::dom::TestInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableSelf())); | |||
5776 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5776); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5776; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5777 | if (!result) { | |||
5778 | args.rval().setNull(); | |||
5779 | return true; | |||
5780 | } | |||
5781 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | |||
5782 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5782); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 5782; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
5783 | return false; | |||
5784 | } | |||
5785 | return true; | |||
5786 | } | |||
5787 | ||||
5788 | static const JSJitInfo receiveNullableSelf_methodinfo = { | |||
5789 | { (JSJitGetterOp)receiveNullableSelf }, | |||
5790 | { prototypes::id::TestExampleInterface }, | |||
5791 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5792 | JSJitInfo::Method, | |||
5793 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5794 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
5795 | false, /* isInfallible. False in setters. */ | |||
5796 | false, /* isMovable. Not relevant for setters. */ | |||
5797 | false, /* isEliminatable. Not relevant for setters. */ | |||
5798 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5799 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5800 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5801 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5802 | }; | |||
5803 | ||||
5804 | MOZ_CAN_RUN_SCRIPT static bool | |||
5805 | receiveWeakSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
5806 | { | |||
5807 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5810( cx, "TestExampleInterface" , "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5808 | "TestExampleInterface", "receiveWeakSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5810( cx, "TestExampleInterface" , "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5809 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5810( cx, "TestExampleInterface" , "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5810 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5810( cx, "TestExampleInterface" , "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5811 | ||||
5812 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5813 | auto result(StrongOrRawPtr<mozilla::dom::TestInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakSelf())); | |||
5814 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5814); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5814; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5815 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | |||
5816 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5816); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 5816; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
5817 | return false; | |||
5818 | } | |||
5819 | return true; | |||
5820 | } | |||
5821 | ||||
5822 | static const JSJitInfo receiveWeakSelf_methodinfo = { | |||
5823 | { (JSJitGetterOp)receiveWeakSelf }, | |||
5824 | { prototypes::id::TestExampleInterface }, | |||
5825 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5826 | JSJitInfo::Method, | |||
5827 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5828 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
5829 | false, /* isInfallible. False in setters. */ | |||
5830 | false, /* isMovable. Not relevant for setters. */ | |||
5831 | false, /* isEliminatable. Not relevant for setters. */ | |||
5832 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5833 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5834 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5835 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5836 | }; | |||
5837 | ||||
5838 | MOZ_CAN_RUN_SCRIPT static bool | |||
5839 | receiveWeakNullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
5840 | { | |||
5841 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5844( cx, "TestExampleInterface" , "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5842 | "TestExampleInterface", "receiveWeakNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5844( cx, "TestExampleInterface" , "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5843 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5844( cx, "TestExampleInterface" , "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5844 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5844( cx, "TestExampleInterface" , "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5845 | ||||
5846 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5847 | auto result(StrongOrRawPtr<mozilla::dom::TestInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableSelf())); | |||
5848 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5848); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5848; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5849 | if (!result) { | |||
5850 | args.rval().setNull(); | |||
5851 | return true; | |||
5852 | } | |||
5853 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | |||
5854 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5854); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 5854; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
5855 | return false; | |||
5856 | } | |||
5857 | return true; | |||
5858 | } | |||
5859 | ||||
5860 | static const JSJitInfo receiveWeakNullableSelf_methodinfo = { | |||
5861 | { (JSJitGetterOp)receiveWeakNullableSelf }, | |||
5862 | { prototypes::id::TestExampleInterface }, | |||
5863 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5864 | JSJitInfo::Method, | |||
5865 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5866 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
5867 | false, /* isInfallible. False in setters. */ | |||
5868 | false, /* isMovable. Not relevant for setters. */ | |||
5869 | false, /* isEliminatable. Not relevant for setters. */ | |||
5870 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5871 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5872 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5873 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5874 | }; | |||
5875 | ||||
5876 | MOZ_CAN_RUN_SCRIPT static bool | |||
5877 | passSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
5878 | { | |||
5879 | BindingCallContext cx(cx_, "TestExampleInterface.passSelf"); | |||
5880 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5883( cx, "TestExampleInterface" , "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
5881 | "TestExampleInterface", "passSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5883( cx, "TestExampleInterface" , "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
5882 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5883( cx, "TestExampleInterface" , "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
5883 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5883( cx, "TestExampleInterface" , "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
5884 | ||||
5885 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5886 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSelf", 1)) { | |||
5887 | return false; | |||
5888 | } | |||
5889 | NonNull<mozilla::dom::TestInterface> arg0; | |||
5890 | if (args[0].isObject()) { | |||
5891 | { | |||
5892 | // Our JSContext should be in the right global to do unwrapping in. | |||
5893 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx); | |||
5894 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
5895 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | |||
5896 | return false; | |||
5897 | } | |||
5898 | } | |||
5899 | } else { | |||
5900 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
5901 | return false; | |||
5902 | } | |||
5903 | // NOTE: This assert does NOT call the function. | |||
5904 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))))>, "Should be returning void here"); | |||
5905 | MOZ_KnownLive(self)(self)->PassSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))); | |||
5906 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5906); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5906; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5907 | args.rval().setUndefined(); | |||
5908 | return true; | |||
5909 | } | |||
5910 | ||||
5911 | static const JSJitInfo passSelf_methodinfo = { | |||
5912 | { (JSJitGetterOp)passSelf }, | |||
5913 | { prototypes::id::TestExampleInterface }, | |||
5914 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5915 | JSJitInfo::Method, | |||
5916 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5917 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
5918 | false, /* isInfallible. False in setters. */ | |||
5919 | false, /* isMovable. Not relevant for setters. */ | |||
5920 | false, /* isEliminatable. Not relevant for setters. */ | |||
5921 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5922 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5923 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5924 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5925 | }; | |||
5926 | ||||
5927 | MOZ_CAN_RUN_SCRIPT static bool | |||
5928 | passNullableSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
5929 | { | |||
5930 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableSelf"); | |||
5931 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5934( cx, "TestExampleInterface" , "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5932 | "TestExampleInterface", "passNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5934( cx, "TestExampleInterface" , "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5933 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5934( cx, "TestExampleInterface" , "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5934 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5934( cx, "TestExampleInterface" , "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5935 | ||||
5936 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5937 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableSelf", 1)) { | |||
5938 | return false; | |||
5939 | } | |||
5940 | mozilla::dom::TestInterface* arg0; | |||
5941 | if (args[0].isObject()) { | |||
5942 | { | |||
5943 | // Our JSContext should be in the right global to do unwrapping in. | |||
5944 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx); | |||
5945 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
5946 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | |||
5947 | return false; | |||
5948 | } | |||
5949 | } | |||
5950 | } else if (args[0].isNullOrUndefined()) { | |||
5951 | arg0 = nullptr; | |||
5952 | } else { | |||
5953 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
5954 | return false; | |||
5955 | } | |||
5956 | // NOTE: This assert does NOT call the function. | |||
5957 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
5958 | MOZ_KnownLive(self)(self)->PassNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
5959 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5959); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5959; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5960 | args.rval().setUndefined(); | |||
5961 | return true; | |||
5962 | } | |||
5963 | ||||
5964 | static const JSJitInfo passNullableSelf_methodinfo = { | |||
5965 | { (JSJitGetterOp)passNullableSelf }, | |||
5966 | { prototypes::id::TestExampleInterface }, | |||
5967 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
5968 | JSJitInfo::Method, | |||
5969 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
5970 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
5971 | false, /* isInfallible. False in setters. */ | |||
5972 | false, /* isMovable. Not relevant for setters. */ | |||
5973 | false, /* isEliminatable. Not relevant for setters. */ | |||
5974 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
5975 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
5976 | false, /* isTypedMethod. Only relevant for methods. */ | |||
5977 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
5978 | }; | |||
5979 | ||||
5980 | MOZ_CAN_RUN_SCRIPT static bool | |||
5981 | get_nonNullSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
5982 | { | |||
5983 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5986( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5984 | "TestExampleInterface", "nonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5986( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5985 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject5986( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
5986 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5986( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
5987 | ||||
5988 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
5989 | auto result(StrongOrRawPtr<mozilla::dom::TestInterface>(MOZ_KnownLive(self)(self)->NonNullSelf())); | |||
5990 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5990); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 5990; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
5991 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | |||
5992 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 5992); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 5992; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
5993 | return false; | |||
5994 | } | |||
5995 | return true; | |||
5996 | } | |||
5997 | ||||
5998 | MOZ_CAN_RUN_SCRIPT static bool | |||
5999 | set_nonNullSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
6000 | { | |||
6001 | BindingCallContext cx(cx_, "TestExampleInterface.nonNullSelf setter"); | |||
6002 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6005( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6003 | "TestExampleInterface", "nonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6005( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6004 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject6005( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6005 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6005( cx, "TestExampleInterface" , "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6006 | ||||
6007 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6008 | NonNull<mozilla::dom::TestInterface> arg0; | |||
6009 | if (args[0].isObject()) { | |||
6010 | { | |||
6011 | // Our JSContext should be in the right global to do unwrapping in. | |||
6012 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx); | |||
6013 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
6014 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestInterface"); | |||
6015 | return false; | |||
6016 | } | |||
6017 | } | |||
6018 | } else { | |||
6019 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | |||
6020 | return false; | |||
6021 | } | |||
6022 | // NOTE: This assert does NOT call the function. | |||
6023 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNonNullSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))))>, "Should be returning void here"); | |||
6024 | MOZ_KnownLive(self)(self)->SetNonNullSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))); | |||
6025 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6025); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6025; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6026 | ||||
6027 | return true; | |||
6028 | } | |||
6029 | ||||
6030 | static const JSJitInfo nonNullSelf_getterinfo = { | |||
6031 | { get_nonNullSelf }, | |||
6032 | { prototypes::id::TestExampleInterface }, | |||
6033 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6034 | JSJitInfo::Getter, | |||
6035 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6036 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
6037 | false, /* isInfallible. False in setters. */ | |||
6038 | false, /* isMovable. Not relevant for setters. */ | |||
6039 | false, /* isEliminatable. Not relevant for setters. */ | |||
6040 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6041 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6042 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6043 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6044 | }; | |||
6045 | static const JSJitInfo nonNullSelf_setterinfo = { | |||
6046 | { (JSJitGetterOp)set_nonNullSelf }, | |||
6047 | { prototypes::id::TestExampleInterface }, | |||
6048 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6049 | JSJitInfo::Setter, | |||
6050 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6051 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
6052 | false, /* isInfallible. False in setters. */ | |||
6053 | false, /* isMovable. Not relevant for setters. */ | |||
6054 | false, /* isEliminatable. Not relevant for setters. */ | |||
6055 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6056 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6057 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6058 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6059 | }; | |||
6060 | ||||
6061 | MOZ_CAN_RUN_SCRIPT static bool | |||
6062 | get_nullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
6063 | { | |||
6064 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6067( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6065 | "TestExampleInterface", "nullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6067( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6066 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject6067( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6067 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6067( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6068 | ||||
6069 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6070 | auto result(StrongOrRawPtr<mozilla::dom::TestInterface>(MOZ_KnownLive(self)(self)->GetNullableSelf())); | |||
6071 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6071); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6071; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6072 | if (!result) { | |||
6073 | args.rval().setNull(); | |||
6074 | return true; | |||
6075 | } | |||
6076 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | |||
6077 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6077); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6077; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6078 | return false; | |||
6079 | } | |||
6080 | return true; | |||
6081 | } | |||
6082 | ||||
6083 | MOZ_CAN_RUN_SCRIPT static bool | |||
6084 | set_nullableSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
6085 | { | |||
6086 | BindingCallContext cx(cx_, "TestExampleInterface.nullableSelf setter"); | |||
6087 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6090( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6088 | "TestExampleInterface", "nullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6090( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6089 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject6090( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6090 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6090( cx, "TestExampleInterface" , "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6091 | ||||
6092 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6093 | mozilla::dom::TestInterface* arg0; | |||
6094 | if (args[0].isObject()) { | |||
6095 | { | |||
6096 | // Our JSContext should be in the right global to do unwrapping in. | |||
6097 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx); | |||
6098 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
6099 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestInterface"); | |||
6100 | return false; | |||
6101 | } | |||
6102 | } | |||
6103 | } else if (args[0].isNullOrUndefined()) { | |||
6104 | arg0 = nullptr; | |||
6105 | } else { | |||
6106 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | |||
6107 | return false; | |||
6108 | } | |||
6109 | // NOTE: This assert does NOT call the function. | |||
6110 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
6111 | MOZ_KnownLive(self)(self)->SetNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
6112 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6112); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6112; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6113 | ||||
6114 | return true; | |||
6115 | } | |||
6116 | ||||
6117 | static const JSJitInfo nullableSelf_getterinfo = { | |||
6118 | { get_nullableSelf }, | |||
6119 | { prototypes::id::TestExampleInterface }, | |||
6120 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6121 | JSJitInfo::Getter, | |||
6122 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6123 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
6124 | false, /* isInfallible. False in setters. */ | |||
6125 | false, /* isMovable. Not relevant for setters. */ | |||
6126 | false, /* isEliminatable. Not relevant for setters. */ | |||
6127 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6128 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6129 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6130 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6131 | }; | |||
6132 | static const JSJitInfo nullableSelf_setterinfo = { | |||
6133 | { (JSJitGetterOp)set_nullableSelf }, | |||
6134 | { prototypes::id::TestExampleInterface }, | |||
6135 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6136 | JSJitInfo::Setter, | |||
6137 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6138 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
6139 | false, /* isInfallible. False in setters. */ | |||
6140 | false, /* isMovable. Not relevant for setters. */ | |||
6141 | false, /* isEliminatable. Not relevant for setters. */ | |||
6142 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6143 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6144 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6145 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6146 | }; | |||
6147 | ||||
6148 | MOZ_CAN_RUN_SCRIPT static bool | |||
6149 | get_cachedSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
6150 | { | |||
6151 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6154( cx, "TestExampleInterface" , "cachedSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6152 | "TestExampleInterface", "cachedSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6154( cx, "TestExampleInterface" , "cachedSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6153 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject6154( cx, "TestExampleInterface" , "cachedSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6154 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6154( cx, "TestExampleInterface" , "cachedSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6155 | ||||
6156 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6157 | // Have to either root across the getter call or reget after. | |||
6158 | JS::Rooted<JSObject*> slotStorage(cx, js::UncheckedUnwrap(obj, /* stopAtWindowProxy = */ false)); | |||
6159 | MOZ_ASSERT(IsDOMObject(slotStorage))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsDOMObject(slotStorage))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsDOMObject(slotStorage)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsDOMObject(slotStorage)" , "../TestExampleGenBinding.cpp", 6159); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "IsDOMObject(slotStorage)" ")"); do { *((volatile int*)__null) = 6159; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6160 | const size_t slotIndex = (DOM_INSTANCE_RESERVED_SLOTS1 + 3); | |||
6161 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 6161); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 6161; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
6162 | { | |||
6163 | // Scope for cachedVal | |||
6164 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
6165 | if (!cachedVal.isUndefined()) { | |||
6166 | args.rval().set(cachedVal); | |||
6167 | // The cached value is in the compartment of slotStorage, | |||
6168 | // so wrap into the caller compartment as needed. | |||
6169 | return MaybeWrapValue(cx, args.rval()); | |||
6170 | } | |||
6171 | } | |||
6172 | ||||
6173 | auto result(StrongOrRawPtr<mozilla::dom::TestInterface>(MOZ_KnownLive(self)(self)->CachedSelf())); | |||
6174 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6174); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6174; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6175 | { | |||
6176 | JS::Rooted<JSObject*> conversionScope(cx, slotStorage); | |||
6177 | JSAutoRealm ar(cx, conversionScope); | |||
6178 | do { // block we break out of when done wrapping | |||
6179 | if (!GetOrCreateDOMReflector(cx, result, args.rval())) { | |||
6180 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6180); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6180; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6181 | return false; | |||
6182 | } | |||
6183 | break; | |||
6184 | } while (false); | |||
6185 | } | |||
6186 | { // And now store things in the realm of our slotStorage. | |||
6187 | JSAutoRealm ar(cx, slotStorage); | |||
6188 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
6189 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
6190 | if (!MaybeWrapValue(cx, &storedVal)) { | |||
6191 | return false; | |||
6192 | } | |||
6193 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
6194 | PreserveWrapper(self); | |||
6195 | } | |||
6196 | // And now make sure args.rval() is in the caller realm. | |||
6197 | return MaybeWrapValue(cx, args.rval()); | |||
6198 | } | |||
6199 | ||||
6200 | static const JSJitInfo cachedSelf_getterinfo = { | |||
6201 | { get_cachedSelf }, | |||
6202 | { prototypes::id::TestExampleInterface }, | |||
6203 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6204 | JSJitInfo::Getter, | |||
6205 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
6206 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
6207 | false, /* isInfallible. False in setters. */ | |||
6208 | true, /* isMovable. Not relevant for setters. */ | |||
6209 | true, /* isEliminatable. Not relevant for setters. */ | |||
6210 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6211 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6212 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6213 | (DOM_INSTANCE_RESERVED_SLOTS1 + 3) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6214 | }; | |||
6215 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 3) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
6216 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 3) < 22, "There is no slot for us"); | |||
6217 | ||||
6218 | MOZ_CAN_RUN_SCRIPT static bool | |||
6219 | passOptionalSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6220 | { | |||
6221 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalSelf"); | |||
6222 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6225( cx, "TestExampleInterface" , "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6223 | "TestExampleInterface", "passOptionalSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6225( cx, "TestExampleInterface" , "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6224 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6225( cx, "TestExampleInterface" , "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6225 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6225( cx, "TestExampleInterface" , "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6226 | ||||
6227 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6228 | Optional<mozilla::dom::TestInterface*> arg0; | |||
6229 | if (args.hasDefined(0)) { | |||
6230 | arg0.Construct(); | |||
6231 | if (args[0].isObject()) { | |||
6232 | { | |||
6233 | // Our JSContext should be in the right global to do unwrapping in. | |||
6234 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx); | |||
6235 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
6236 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | |||
6237 | return false; | |||
6238 | } | |||
6239 | } | |||
6240 | } else if (args[0].isNullOrUndefined()) { | |||
6241 | arg0.Value() = nullptr; | |||
6242 | } else { | |||
6243 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
6244 | return false; | |||
6245 | } | |||
6246 | } | |||
6247 | // NOTE: This assert does NOT call the function. | |||
6248 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
6249 | MOZ_KnownLive(self)(self)->PassOptionalSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
6250 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6250); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6250; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6251 | args.rval().setUndefined(); | |||
6252 | return true; | |||
6253 | } | |||
6254 | ||||
6255 | static const JSJitInfo passOptionalSelf_methodinfo = { | |||
6256 | { (JSJitGetterOp)passOptionalSelf }, | |||
6257 | { prototypes::id::TestExampleInterface }, | |||
6258 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6259 | JSJitInfo::Method, | |||
6260 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6261 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
6262 | false, /* isInfallible. False in setters. */ | |||
6263 | false, /* isMovable. Not relevant for setters. */ | |||
6264 | false, /* isEliminatable. Not relevant for setters. */ | |||
6265 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6266 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6267 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6268 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6269 | }; | |||
6270 | ||||
6271 | MOZ_CAN_RUN_SCRIPT static bool | |||
6272 | passOptionalNonNullSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6273 | { | |||
6274 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNonNullSelf"); | |||
6275 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestExampleInterface" , "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6276 | "TestExampleInterface", "passOptionalNonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestExampleInterface" , "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6277 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestExampleInterface" , "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6278 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestExampleInterface" , "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6279 | ||||
6280 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6281 | Optional<NonNull<mozilla::dom::TestInterface>> arg0; | |||
6282 | if (args.hasDefined(0)) { | |||
6283 | arg0.Construct(); | |||
6284 | if (args[0].isObject()) { | |||
6285 | { | |||
6286 | // Our JSContext should be in the right global to do unwrapping in. | |||
6287 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx); | |||
6288 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
6289 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | |||
6290 | return false; | |||
6291 | } | |||
6292 | } | |||
6293 | } else { | |||
6294 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
6295 | return false; | |||
6296 | } | |||
6297 | } | |||
6298 | // NOTE: This assert does NOT call the function. | |||
6299 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNonNullSelf(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))))>, "Should be returning void here"); | |||
6300 | MOZ_KnownLive(self)(self)->PassOptionalNonNullSelf(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))); | |||
6301 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6301); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6301; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6302 | args.rval().setUndefined(); | |||
6303 | return true; | |||
6304 | } | |||
6305 | ||||
6306 | static const JSJitInfo passOptionalNonNullSelf_methodinfo = { | |||
6307 | { (JSJitGetterOp)passOptionalNonNullSelf }, | |||
6308 | { prototypes::id::TestExampleInterface }, | |||
6309 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6310 | JSJitInfo::Method, | |||
6311 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6312 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
6313 | false, /* isInfallible. False in setters. */ | |||
6314 | false, /* isMovable. Not relevant for setters. */ | |||
6315 | false, /* isEliminatable. Not relevant for setters. */ | |||
6316 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6317 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6318 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6319 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6320 | }; | |||
6321 | ||||
6322 | MOZ_CAN_RUN_SCRIPT static bool | |||
6323 | passOptionalSelfWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6324 | { | |||
6325 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalSelfWithDefault"); | |||
6326 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6329( cx, "TestExampleInterface" , "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6327 | "TestExampleInterface", "passOptionalSelfWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6329( cx, "TestExampleInterface" , "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6328 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6329( cx, "TestExampleInterface" , "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6329 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6329( cx, "TestExampleInterface" , "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
6330 | ||||
6331 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6332 | mozilla::dom::TestInterface* arg0; | |||
6333 | if (args.hasDefined(0)) { | |||
6334 | if (args[0].isObject()) { | |||
6335 | { | |||
6336 | // Our JSContext should be in the right global to do unwrapping in. | |||
6337 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx); | |||
6338 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
6339 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface"); | |||
6340 | return false; | |||
6341 | } | |||
6342 | } | |||
6343 | } else if (args[0].isNullOrUndefined()) { | |||
6344 | arg0 = nullptr; | |||
6345 | } else { | |||
6346 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
6347 | return false; | |||
6348 | } | |||
6349 | } else { | |||
6350 | arg0 = nullptr; | |||
6351 | } | |||
6352 | // NOTE: This assert does NOT call the function. | |||
6353 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSelfWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
6354 | MOZ_KnownLive(self)(self)->PassOptionalSelfWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
6355 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6355); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6355; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6356 | args.rval().setUndefined(); | |||
6357 | return true; | |||
6358 | } | |||
6359 | ||||
6360 | static const JSJitInfo passOptionalSelfWithDefault_methodinfo = { | |||
6361 | { (JSJitGetterOp)passOptionalSelfWithDefault }, | |||
6362 | { prototypes::id::TestExampleInterface }, | |||
6363 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6364 | JSJitInfo::Method, | |||
6365 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6366 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
6367 | false, /* isInfallible. False in setters. */ | |||
6368 | false, /* isMovable. Not relevant for setters. */ | |||
6369 | false, /* isEliminatable. Not relevant for setters. */ | |||
6370 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6371 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6372 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6373 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6374 | }; | |||
6375 | ||||
6376 | MOZ_CAN_RUN_SCRIPT static bool | |||
6377 | receiveNonWrapperCacheInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6378 | { | |||
6379 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6382( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6380 | "TestExampleInterface", "receiveNonWrapperCacheInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6382( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6381 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6382( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6382 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6382( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
6383 | ||||
6384 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6385 | auto result(StrongOrRawPtr<mozilla::dom::TestNonWrapperCacheInterface>(MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterface())); | |||
6386 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6386); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6386; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6387 | static_assert(!std::is_pointer_v<decltype(result)>, | |||
6388 | "NewObject implies that we need to keep the object alive with a strong reference."); | |||
6389 | if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) { | |||
6390 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6390); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6390; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6391 | return false; | |||
6392 | } | |||
6393 | return true; | |||
6394 | } | |||
6395 | ||||
6396 | static const JSJitInfo receiveNonWrapperCacheInterface_methodinfo = { | |||
6397 | { (JSJitGetterOp)receiveNonWrapperCacheInterface }, | |||
6398 | { prototypes::id::TestExampleInterface }, | |||
6399 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6400 | JSJitInfo::Method, | |||
6401 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6402 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
6403 | false, /* isInfallible. False in setters. */ | |||
6404 | false, /* isMovable. Not relevant for setters. */ | |||
6405 | false, /* isEliminatable. Not relevant for setters. */ | |||
6406 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6407 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6408 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6409 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6410 | }; | |||
6411 | ||||
6412 | MOZ_CAN_RUN_SCRIPT static bool | |||
6413 | receiveNullableNonWrapperCacheInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6414 | { | |||
6415 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6418( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6416 | "TestExampleInterface", "receiveNullableNonWrapperCacheInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6418( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6417 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6418( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6418 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6418( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
6419 | ||||
6420 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6421 | auto result(StrongOrRawPtr<mozilla::dom::TestNonWrapperCacheInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterface())); | |||
6422 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6422); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6422; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6423 | static_assert(!std::is_pointer_v<decltype(result)>, | |||
6424 | "NewObject implies that we need to keep the object alive with a strong reference."); | |||
6425 | if (!result) { | |||
6426 | args.rval().setNull(); | |||
6427 | return true; | |||
6428 | } | |||
6429 | if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) { | |||
6430 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6430); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6430; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6431 | return false; | |||
6432 | } | |||
6433 | return true; | |||
6434 | } | |||
6435 | ||||
6436 | static const JSJitInfo receiveNullableNonWrapperCacheInterface_methodinfo = { | |||
6437 | { (JSJitGetterOp)receiveNullableNonWrapperCacheInterface }, | |||
6438 | { prototypes::id::TestExampleInterface }, | |||
6439 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6440 | JSJitInfo::Method, | |||
6441 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6442 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
6443 | false, /* isInfallible. False in setters. */ | |||
6444 | false, /* isMovable. Not relevant for setters. */ | |||
6445 | false, /* isEliminatable. Not relevant for setters. */ | |||
6446 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6447 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6448 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6449 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6450 | }; | |||
6451 | ||||
6452 | MOZ_CAN_RUN_SCRIPT static bool | |||
6453 | receiveNonWrapperCacheInterfaceSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6454 | { | |||
6455 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6458( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6456 | "TestExampleInterface", "receiveNonWrapperCacheInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6458( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6457 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6458( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6458 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6458( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
6459 | ||||
6460 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6461 | nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>> result; | |||
6462 | // NOTE: This assert does NOT call the function. | |||
6463 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceSequence(result))>, "Should be returning void here"); | |||
6464 | MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceSequence(result); | |||
6465 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6465); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6465; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6466 | ||||
6467 | uint32_t length = result.Length(); | |||
6468 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
6469 | if (!returnArray) { | |||
6470 | return false; | |||
6471 | } | |||
6472 | // Scope for 'tmp' | |||
6473 | { | |||
6474 | JS::Rooted<JS::Value> tmp(cx); | |||
6475 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
6476 | // Control block to let us common up the JS_DefineElement calls when there | |||
6477 | // are different ways to succeed at wrapping the object. | |||
6478 | do { | |||
6479 | if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result[sequenceIdx0], &tmp)) { | |||
6480 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6480); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6480; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6481 | return false; | |||
6482 | } | |||
6483 | break; | |||
6484 | } while (false); | |||
6485 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
6486 | JSPROP_ENUMERATE)) { | |||
6487 | return false; | |||
6488 | } | |||
6489 | } | |||
6490 | } | |||
6491 | args.rval().setObject(*returnArray); | |||
6492 | return true; | |||
6493 | } | |||
6494 | ||||
6495 | static const JSJitInfo receiveNonWrapperCacheInterfaceSequence_methodinfo = { | |||
6496 | { (JSJitGetterOp)receiveNonWrapperCacheInterfaceSequence }, | |||
6497 | { prototypes::id::TestExampleInterface }, | |||
6498 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6499 | JSJitInfo::Method, | |||
6500 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6501 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
6502 | false, /* isInfallible. False in setters. */ | |||
6503 | false, /* isMovable. Not relevant for setters. */ | |||
6504 | false, /* isEliminatable. Not relevant for setters. */ | |||
6505 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6506 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6507 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6508 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6509 | }; | |||
6510 | ||||
6511 | MOZ_CAN_RUN_SCRIPT static bool | |||
6512 | receiveNullableNonWrapperCacheInterfaceSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6513 | { | |||
6514 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6517( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6515 | "TestExampleInterface", "receiveNullableNonWrapperCacheInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6517( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6516 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6517( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6517 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6517( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
6518 | ||||
6519 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6520 | nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>> result; | |||
6521 | // NOTE: This assert does NOT call the function. | |||
6522 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceSequence(result))>, "Should be returning void here"); | |||
6523 | MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceSequence(result); | |||
6524 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6524); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6524; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6525 | ||||
6526 | uint32_t length = result.Length(); | |||
6527 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
6528 | if (!returnArray) { | |||
6529 | return false; | |||
6530 | } | |||
6531 | // Scope for 'tmp' | |||
6532 | { | |||
6533 | JS::Rooted<JS::Value> tmp(cx); | |||
6534 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
6535 | // Control block to let us common up the JS_DefineElement calls when there | |||
6536 | // are different ways to succeed at wrapping the object. | |||
6537 | do { | |||
6538 | if (!result[sequenceIdx0]) { | |||
6539 | tmp.setNull(); | |||
6540 | break; | |||
6541 | } | |||
6542 | if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result[sequenceIdx0], &tmp)) { | |||
6543 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6543); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6543; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6544 | return false; | |||
6545 | } | |||
6546 | break; | |||
6547 | } while (false); | |||
6548 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
6549 | JSPROP_ENUMERATE)) { | |||
6550 | return false; | |||
6551 | } | |||
6552 | } | |||
6553 | } | |||
6554 | args.rval().setObject(*returnArray); | |||
6555 | return true; | |||
6556 | } | |||
6557 | ||||
6558 | static const JSJitInfo receiveNullableNonWrapperCacheInterfaceSequence_methodinfo = { | |||
6559 | { (JSJitGetterOp)receiveNullableNonWrapperCacheInterfaceSequence }, | |||
6560 | { prototypes::id::TestExampleInterface }, | |||
6561 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6562 | JSJitInfo::Method, | |||
6563 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6564 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
6565 | false, /* isInfallible. False in setters. */ | |||
6566 | false, /* isMovable. Not relevant for setters. */ | |||
6567 | false, /* isEliminatable. Not relevant for setters. */ | |||
6568 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6569 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6570 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6571 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6572 | }; | |||
6573 | ||||
6574 | MOZ_CAN_RUN_SCRIPT static bool | |||
6575 | receiveNonWrapperCacheInterfaceNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6576 | { | |||
6577 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6580( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6578 | "TestExampleInterface", "receiveNonWrapperCacheInterfaceNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6580( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6579 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6580( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6580 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6580( cx, "TestExampleInterface" , "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
6581 | ||||
6582 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6583 | Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>>> result; | |||
6584 | // NOTE: This assert does NOT call the function. | |||
6585 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceNullableSequence(result))>, "Should be returning void here"); | |||
6586 | MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceNullableSequence(result); | |||
6587 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6587); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6587; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6588 | ||||
6589 | if (result.IsNull()) { | |||
6590 | args.rval().setNull(); | |||
6591 | return true; | |||
6592 | } | |||
6593 | ||||
6594 | uint32_t length = result.Value().Length(); | |||
6595 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
6596 | if (!returnArray) { | |||
6597 | return false; | |||
6598 | } | |||
6599 | // Scope for 'tmp' | |||
6600 | { | |||
6601 | JS::Rooted<JS::Value> tmp(cx); | |||
6602 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
6603 | // Control block to let us common up the JS_DefineElement calls when there | |||
6604 | // are different ways to succeed at wrapping the object. | |||
6605 | do { | |||
6606 | if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result.Value()[sequenceIdx0], &tmp)) { | |||
6607 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6607); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6607; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6608 | return false; | |||
6609 | } | |||
6610 | break; | |||
6611 | } while (false); | |||
6612 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
6613 | JSPROP_ENUMERATE)) { | |||
6614 | return false; | |||
6615 | } | |||
6616 | } | |||
6617 | } | |||
6618 | args.rval().setObject(*returnArray); | |||
6619 | return true; | |||
6620 | } | |||
6621 | ||||
6622 | static const JSJitInfo receiveNonWrapperCacheInterfaceNullableSequence_methodinfo = { | |||
6623 | { (JSJitGetterOp)receiveNonWrapperCacheInterfaceNullableSequence }, | |||
6624 | { prototypes::id::TestExampleInterface }, | |||
6625 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6626 | JSJitInfo::Method, | |||
6627 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6628 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
6629 | false, /* isInfallible. False in setters. */ | |||
6630 | false, /* isMovable. Not relevant for setters. */ | |||
6631 | false, /* isEliminatable. Not relevant for setters. */ | |||
6632 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6633 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6634 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6635 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6636 | }; | |||
6637 | ||||
6638 | MOZ_CAN_RUN_SCRIPT static bool | |||
6639 | receiveNullableNonWrapperCacheInterfaceNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6640 | { | |||
6641 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6644( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
6642 | "TestExampleInterface", "receiveNullableNonWrapperCacheInterfaceNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6644( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
6643 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6644( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
6644 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6644( cx, "TestExampleInterface" , "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
6645 | ||||
6646 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6647 | Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>>> result; | |||
6648 | // NOTE: This assert does NOT call the function. | |||
6649 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(result))>, "Should be returning void here"); | |||
6650 | MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(result); | |||
6651 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6651); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6651; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6652 | ||||
6653 | if (result.IsNull()) { | |||
6654 | args.rval().setNull(); | |||
6655 | return true; | |||
6656 | } | |||
6657 | ||||
6658 | uint32_t length = result.Value().Length(); | |||
6659 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
6660 | if (!returnArray) { | |||
6661 | return false; | |||
6662 | } | |||
6663 | // Scope for 'tmp' | |||
6664 | { | |||
6665 | JS::Rooted<JS::Value> tmp(cx); | |||
6666 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
6667 | // Control block to let us common up the JS_DefineElement calls when there | |||
6668 | // are different ways to succeed at wrapping the object. | |||
6669 | do { | |||
6670 | if (!result.Value()[sequenceIdx0]) { | |||
6671 | tmp.setNull(); | |||
6672 | break; | |||
6673 | } | |||
6674 | if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result.Value()[sequenceIdx0], &tmp)) { | |||
6675 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6675); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 6675; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
6676 | return false; | |||
6677 | } | |||
6678 | break; | |||
6679 | } while (false); | |||
6680 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
6681 | JSPROP_ENUMERATE)) { | |||
6682 | return false; | |||
6683 | } | |||
6684 | } | |||
6685 | } | |||
6686 | args.rval().setObject(*returnArray); | |||
6687 | return true; | |||
6688 | } | |||
6689 | ||||
6690 | static const JSJitInfo receiveNullableNonWrapperCacheInterfaceNullableSequence_methodinfo = { | |||
6691 | { (JSJitGetterOp)receiveNullableNonWrapperCacheInterfaceNullableSequence }, | |||
6692 | { prototypes::id::TestExampleInterface }, | |||
6693 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6694 | JSJitInfo::Method, | |||
6695 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6696 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
6697 | false, /* isInfallible. False in setters. */ | |||
6698 | false, /* isMovable. Not relevant for setters. */ | |||
6699 | false, /* isEliminatable. Not relevant for setters. */ | |||
6700 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6701 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6702 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6703 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6704 | }; | |||
6705 | ||||
6706 | MOZ_CAN_RUN_SCRIPT static bool | |||
6707 | receiveExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6708 | { | |||
6709 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6712( cx, "TestExampleInterface" , "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6710 | "TestExampleInterface", "receiveExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6712( cx, "TestExampleInterface" , "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6711 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6712( cx, "TestExampleInterface" , "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6712 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6712( cx, "TestExampleInterface" , "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6713 | ||||
6714 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6715 | auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveExternal())); | |||
6716 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6716); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6716; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6717 | if (!WrapObject(cx, result, args.rval())) { | |||
6718 | return false; | |||
6719 | } | |||
6720 | return true; | |||
6721 | } | |||
6722 | ||||
6723 | static const JSJitInfo receiveExternal_methodinfo = { | |||
6724 | { (JSJitGetterOp)receiveExternal }, | |||
6725 | { prototypes::id::TestExampleInterface }, | |||
6726 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6727 | JSJitInfo::Method, | |||
6728 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6729 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
6730 | false, /* isInfallible. False in setters. */ | |||
6731 | false, /* isMovable. Not relevant for setters. */ | |||
6732 | false, /* isEliminatable. Not relevant for setters. */ | |||
6733 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6734 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6735 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6736 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6737 | }; | |||
6738 | ||||
6739 | MOZ_CAN_RUN_SCRIPT static bool | |||
6740 | receiveNullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6741 | { | |||
6742 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6745( cx, "TestExampleInterface" , "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6743 | "TestExampleInterface", "receiveNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6745( cx, "TestExampleInterface" , "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6744 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6745( cx, "TestExampleInterface" , "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6745 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6745( cx, "TestExampleInterface" , "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6746 | ||||
6747 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6748 | auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableExternal())); | |||
6749 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6749); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6749; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6750 | if (!result) { | |||
6751 | args.rval().setNull(); | |||
6752 | return true; | |||
6753 | } | |||
6754 | if (!WrapObject(cx, result, args.rval())) { | |||
6755 | return false; | |||
6756 | } | |||
6757 | return true; | |||
6758 | } | |||
6759 | ||||
6760 | static const JSJitInfo receiveNullableExternal_methodinfo = { | |||
6761 | { (JSJitGetterOp)receiveNullableExternal }, | |||
6762 | { prototypes::id::TestExampleInterface }, | |||
6763 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6764 | JSJitInfo::Method, | |||
6765 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6766 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
6767 | false, /* isInfallible. False in setters. */ | |||
6768 | false, /* isMovable. Not relevant for setters. */ | |||
6769 | false, /* isEliminatable. Not relevant for setters. */ | |||
6770 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6771 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6772 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6773 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6774 | }; | |||
6775 | ||||
6776 | MOZ_CAN_RUN_SCRIPT static bool | |||
6777 | receiveWeakExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6778 | { | |||
6779 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6782( cx, "TestExampleInterface" , "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6780 | "TestExampleInterface", "receiveWeakExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6782( cx, "TestExampleInterface" , "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6781 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6782( cx, "TestExampleInterface" , "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6782 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6782( cx, "TestExampleInterface" , "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6783 | ||||
6784 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6785 | auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakExternal())); | |||
6786 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6786); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6786; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6787 | if (!WrapObject(cx, result, args.rval())) { | |||
6788 | return false; | |||
6789 | } | |||
6790 | return true; | |||
6791 | } | |||
6792 | ||||
6793 | static const JSJitInfo receiveWeakExternal_methodinfo = { | |||
6794 | { (JSJitGetterOp)receiveWeakExternal }, | |||
6795 | { prototypes::id::TestExampleInterface }, | |||
6796 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6797 | JSJitInfo::Method, | |||
6798 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6799 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
6800 | false, /* isInfallible. False in setters. */ | |||
6801 | false, /* isMovable. Not relevant for setters. */ | |||
6802 | false, /* isEliminatable. Not relevant for setters. */ | |||
6803 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6804 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6805 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6806 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6807 | }; | |||
6808 | ||||
6809 | MOZ_CAN_RUN_SCRIPT static bool | |||
6810 | receiveWeakNullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6811 | { | |||
6812 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6815( cx, "TestExampleInterface" , "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6813 | "TestExampleInterface", "receiveWeakNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6815( cx, "TestExampleInterface" , "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6814 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6815( cx, "TestExampleInterface" , "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
6815 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6815( cx, "TestExampleInterface" , "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
6816 | ||||
6817 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6818 | auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableExternal())); | |||
6819 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6819); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6819; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6820 | if (!result) { | |||
6821 | args.rval().setNull(); | |||
6822 | return true; | |||
6823 | } | |||
6824 | if (!WrapObject(cx, result, args.rval())) { | |||
6825 | return false; | |||
6826 | } | |||
6827 | return true; | |||
6828 | } | |||
6829 | ||||
6830 | static const JSJitInfo receiveWeakNullableExternal_methodinfo = { | |||
6831 | { (JSJitGetterOp)receiveWeakNullableExternal }, | |||
6832 | { prototypes::id::TestExampleInterface }, | |||
6833 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6834 | JSJitInfo::Method, | |||
6835 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6836 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
6837 | false, /* isInfallible. False in setters. */ | |||
6838 | false, /* isMovable. Not relevant for setters. */ | |||
6839 | false, /* isEliminatable. Not relevant for setters. */ | |||
6840 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6841 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6842 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6843 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6844 | }; | |||
6845 | ||||
6846 | MOZ_CAN_RUN_SCRIPT static bool | |||
6847 | passExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6848 | { | |||
6849 | BindingCallContext cx(cx_, "TestExampleInterface.passExternal"); | |||
6850 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6853( cx, "TestExampleInterface" , "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6851 | "TestExampleInterface", "passExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6853( cx, "TestExampleInterface" , "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6852 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6853( cx, "TestExampleInterface" , "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6853 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6853( cx, "TestExampleInterface" , "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6854 | ||||
6855 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6856 | if (!args.requireAtLeast(cx, "TestExampleInterface.passExternal", 1)) { | |||
6857 | return false; | |||
6858 | } | |||
6859 | mozilla::dom::TestExternalInterface* arg0; | |||
6860 | RefPtr<mozilla::dom::TestExternalInterface> arg0_holder; | |||
6861 | if (args[0].isObject()) { | |||
6862 | JS::Rooted<JSObject*> source(cx, &args[0].toObject()); | |||
6863 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder )))), 0)))) { | |||
6864 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface"); | |||
6865 | return false; | |||
6866 | } | |||
6867 | MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(arg0_holder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestExampleGenBinding.cpp" , 6867); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder" ")"); do { *((volatile int*)__null) = 6867; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
6868 | arg0 = arg0_holder; | |||
6869 | } else { | |||
6870 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
6871 | return false; | |||
6872 | } | |||
6873 | // NOTE: This assert does NOT call the function. | |||
6874 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))))>, "Should be returning void here"); | |||
6875 | MOZ_KnownLive(self)(self)->PassExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))); | |||
6876 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6876); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6876; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6877 | args.rval().setUndefined(); | |||
6878 | return true; | |||
6879 | } | |||
6880 | ||||
6881 | static const JSJitInfo passExternal_methodinfo = { | |||
6882 | { (JSJitGetterOp)passExternal }, | |||
6883 | { prototypes::id::TestExampleInterface }, | |||
6884 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6885 | JSJitInfo::Method, | |||
6886 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6887 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
6888 | false, /* isInfallible. False in setters. */ | |||
6889 | false, /* isMovable. Not relevant for setters. */ | |||
6890 | false, /* isEliminatable. Not relevant for setters. */ | |||
6891 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6892 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6893 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6894 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6895 | }; | |||
6896 | ||||
6897 | MOZ_CAN_RUN_SCRIPT static bool | |||
6898 | passNullableExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
6899 | { | |||
6900 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableExternal"); | |||
6901 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6904( cx, "TestExampleInterface" , "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6902 | "TestExampleInterface", "passNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6904( cx, "TestExampleInterface" , "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6903 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6904( cx, "TestExampleInterface" , "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6904 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6904( cx, "TestExampleInterface" , "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6905 | ||||
6906 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6907 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableExternal", 1)) { | |||
6908 | return false; | |||
6909 | } | |||
6910 | mozilla::dom::TestExternalInterface* arg0; | |||
6911 | RefPtr<mozilla::dom::TestExternalInterface> arg0_holder; | |||
6912 | if (args[0].isObject()) { | |||
6913 | JS::Rooted<JSObject*> source(cx, &args[0].toObject()); | |||
6914 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder )))), 0)))) { | |||
6915 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface"); | |||
6916 | return false; | |||
6917 | } | |||
6918 | MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(arg0_holder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestExampleGenBinding.cpp" , 6918); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder" ")"); do { *((volatile int*)__null) = 6918; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
6919 | arg0 = arg0_holder; | |||
6920 | } else if (args[0].isNullOrUndefined()) { | |||
6921 | arg0 = nullptr; | |||
6922 | } else { | |||
6923 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
6924 | return false; | |||
6925 | } | |||
6926 | // NOTE: This assert does NOT call the function. | |||
6927 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
6928 | MOZ_KnownLive(self)(self)->PassNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
6929 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6929); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6929; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6930 | args.rval().setUndefined(); | |||
6931 | return true; | |||
6932 | } | |||
6933 | ||||
6934 | static const JSJitInfo passNullableExternal_methodinfo = { | |||
6935 | { (JSJitGetterOp)passNullableExternal }, | |||
6936 | { prototypes::id::TestExampleInterface }, | |||
6937 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
6938 | JSJitInfo::Method, | |||
6939 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
6940 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
6941 | false, /* isInfallible. False in setters. */ | |||
6942 | false, /* isMovable. Not relevant for setters. */ | |||
6943 | false, /* isEliminatable. Not relevant for setters. */ | |||
6944 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
6945 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
6946 | false, /* isTypedMethod. Only relevant for methods. */ | |||
6947 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
6948 | }; | |||
6949 | ||||
6950 | MOZ_CAN_RUN_SCRIPT static bool | |||
6951 | get_nonNullExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
6952 | { | |||
6953 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6956( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6954 | "TestExampleInterface", "nonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6956( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6955 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject6956( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6956 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6956( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6957 | ||||
6958 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6959 | auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->NonNullExternal())); | |||
6960 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6960); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6960; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6961 | if (!WrapObject(cx, result, args.rval())) { | |||
6962 | return false; | |||
6963 | } | |||
6964 | return true; | |||
6965 | } | |||
6966 | ||||
6967 | MOZ_CAN_RUN_SCRIPT static bool | |||
6968 | set_nonNullExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
6969 | { | |||
6970 | BindingCallContext cx(cx_, "TestExampleInterface.nonNullExternal setter"); | |||
6971 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6974( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6972 | "TestExampleInterface", "nonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6974( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6973 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject6974( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
6974 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6974( cx, "TestExampleInterface" , "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
6975 | ||||
6976 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
6977 | mozilla::dom::TestExternalInterface* arg0; | |||
6978 | RefPtr<mozilla::dom::TestExternalInterface> arg0_holder; | |||
6979 | if (args[0].isObject()) { | |||
6980 | JS::Rooted<JSObject*> source(cx, &args[0].toObject()); | |||
6981 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder )))), 0)))) { | |||
6982 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestExternalInterface"); | |||
6983 | return false; | |||
6984 | } | |||
6985 | MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(arg0_holder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestExampleGenBinding.cpp" , 6985); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder" ")"); do { *((volatile int*)__null) = 6985; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
6986 | arg0 = arg0_holder; | |||
6987 | } else { | |||
6988 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | |||
6989 | return false; | |||
6990 | } | |||
6991 | // NOTE: This assert does NOT call the function. | |||
6992 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNonNullExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))))>, "Should be returning void here"); | |||
6993 | MOZ_KnownLive(self)(self)->SetNonNullExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))); | |||
6994 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 6994); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 6994; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
6995 | ||||
6996 | return true; | |||
6997 | } | |||
6998 | ||||
6999 | static const JSJitInfo nonNullExternal_getterinfo = { | |||
7000 | { get_nonNullExternal }, | |||
7001 | { prototypes::id::TestExampleInterface }, | |||
7002 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7003 | JSJitInfo::Getter, | |||
7004 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7005 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
7006 | false, /* isInfallible. False in setters. */ | |||
7007 | false, /* isMovable. Not relevant for setters. */ | |||
7008 | false, /* isEliminatable. Not relevant for setters. */ | |||
7009 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7010 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7011 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7012 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7013 | }; | |||
7014 | static const JSJitInfo nonNullExternal_setterinfo = { | |||
7015 | { (JSJitGetterOp)set_nonNullExternal }, | |||
7016 | { prototypes::id::TestExampleInterface }, | |||
7017 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7018 | JSJitInfo::Setter, | |||
7019 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7020 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7021 | false, /* isInfallible. False in setters. */ | |||
7022 | false, /* isMovable. Not relevant for setters. */ | |||
7023 | false, /* isEliminatable. Not relevant for setters. */ | |||
7024 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7025 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7026 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7027 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7028 | }; | |||
7029 | ||||
7030 | MOZ_CAN_RUN_SCRIPT static bool | |||
7031 | get_nullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
7032 | { | |||
7033 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7036( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7034 | "TestExampleInterface", "nullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7036( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7035 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7036( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7036 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7036( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
7037 | ||||
7038 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7039 | auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->GetNullableExternal())); | |||
7040 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7040); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7040; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7041 | if (!result) { | |||
7042 | args.rval().setNull(); | |||
7043 | return true; | |||
7044 | } | |||
7045 | if (!WrapObject(cx, result, args.rval())) { | |||
7046 | return false; | |||
7047 | } | |||
7048 | return true; | |||
7049 | } | |||
7050 | ||||
7051 | MOZ_CAN_RUN_SCRIPT static bool | |||
7052 | set_nullableExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
7053 | { | |||
7054 | BindingCallContext cx(cx_, "TestExampleInterface.nullableExternal setter"); | |||
7055 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7058( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7056 | "TestExampleInterface", "nullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7058( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7057 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject7058( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7058 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7058( cx, "TestExampleInterface" , "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
7059 | ||||
7060 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7061 | mozilla::dom::TestExternalInterface* arg0; | |||
7062 | RefPtr<mozilla::dom::TestExternalInterface> arg0_holder; | |||
7063 | if (args[0].isObject()) { | |||
7064 | JS::Rooted<JSObject*> source(cx, &args[0].toObject()); | |||
7065 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder )))), 0)))) { | |||
7066 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestExternalInterface"); | |||
7067 | return false; | |||
7068 | } | |||
7069 | MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(arg0_holder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestExampleGenBinding.cpp" , 7069); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder" ")"); do { *((volatile int*)__null) = 7069; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
7070 | arg0 = arg0_holder; | |||
7071 | } else if (args[0].isNullOrUndefined()) { | |||
7072 | arg0 = nullptr; | |||
7073 | } else { | |||
7074 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | |||
7075 | return false; | |||
7076 | } | |||
7077 | // NOTE: This assert does NOT call the function. | |||
7078 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
7079 | MOZ_KnownLive(self)(self)->SetNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
7080 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7080); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7080; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7081 | ||||
7082 | return true; | |||
7083 | } | |||
7084 | ||||
7085 | static const JSJitInfo nullableExternal_getterinfo = { | |||
7086 | { get_nullableExternal }, | |||
7087 | { prototypes::id::TestExampleInterface }, | |||
7088 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7089 | JSJitInfo::Getter, | |||
7090 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7091 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
7092 | false, /* isInfallible. False in setters. */ | |||
7093 | false, /* isMovable. Not relevant for setters. */ | |||
7094 | false, /* isEliminatable. Not relevant for setters. */ | |||
7095 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7096 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7097 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7098 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7099 | }; | |||
7100 | static const JSJitInfo nullableExternal_setterinfo = { | |||
7101 | { (JSJitGetterOp)set_nullableExternal }, | |||
7102 | { prototypes::id::TestExampleInterface }, | |||
7103 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7104 | JSJitInfo::Setter, | |||
7105 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7106 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7107 | false, /* isInfallible. False in setters. */ | |||
7108 | false, /* isMovable. Not relevant for setters. */ | |||
7109 | false, /* isEliminatable. Not relevant for setters. */ | |||
7110 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7111 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7112 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7113 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7114 | }; | |||
7115 | ||||
7116 | MOZ_CAN_RUN_SCRIPT static bool | |||
7117 | passOptionalExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7118 | { | |||
7119 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalExternal"); | |||
7120 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7123( cx, "TestExampleInterface" , "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7121 | "TestExampleInterface", "passOptionalExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7123( cx, "TestExampleInterface" , "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7122 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7123( cx, "TestExampleInterface" , "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7123 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7123( cx, "TestExampleInterface" , "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
7124 | ||||
7125 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7126 | Optional<mozilla::dom::TestExternalInterface*> arg0; | |||
7127 | Maybe<RefPtr<mozilla::dom::TestExternalInterface>> arg0_holder; | |||
7128 | if (args.hasDefined(0)) { | |||
7129 | arg0.Construct(); | |||
7130 | arg0_holder.emplace(); | |||
7131 | if (args[0].isObject()) { | |||
7132 | JS::Rooted<JSObject*> source(cx, &args[0].toObject()); | |||
7133 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder.ref())))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder .ref())))), 0)))) { | |||
7134 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface"); | |||
7135 | return false; | |||
7136 | } | |||
7137 | MOZ_ASSERT(arg0_holder.ref())do { static_assert( mozilla::detail::AssertionConditionType< decltype(arg0_holder.ref())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arg0_holder.ref()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arg0_holder.ref()" , "../TestExampleGenBinding.cpp", 7137); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "arg0_holder.ref()" ")"); do { *((volatile int *)__null) = 7137; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
7138 | arg0.Value() = arg0_holder.ref(); | |||
7139 | } else if (args[0].isNullOrUndefined()) { | |||
7140 | arg0.Value() = nullptr; | |||
7141 | } else { | |||
7142 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7143 | return false; | |||
7144 | } | |||
7145 | } | |||
7146 | // NOTE: This assert does NOT call the function. | |||
7147 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
7148 | MOZ_KnownLive(self)(self)->PassOptionalExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
7149 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7149); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7149; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7150 | args.rval().setUndefined(); | |||
7151 | return true; | |||
7152 | } | |||
7153 | ||||
7154 | static const JSJitInfo passOptionalExternal_methodinfo = { | |||
7155 | { (JSJitGetterOp)passOptionalExternal }, | |||
7156 | { prototypes::id::TestExampleInterface }, | |||
7157 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7158 | JSJitInfo::Method, | |||
7159 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7160 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7161 | false, /* isInfallible. False in setters. */ | |||
7162 | false, /* isMovable. Not relevant for setters. */ | |||
7163 | false, /* isEliminatable. Not relevant for setters. */ | |||
7164 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7165 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7166 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7167 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7168 | }; | |||
7169 | ||||
7170 | MOZ_CAN_RUN_SCRIPT static bool | |||
7171 | passOptionalNonNullExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7172 | { | |||
7173 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNonNullExternal"); | |||
7174 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7177( cx, "TestExampleInterface" , "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7175 | "TestExampleInterface", "passOptionalNonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7177( cx, "TestExampleInterface" , "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7176 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7177( cx, "TestExampleInterface" , "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7177 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7177( cx, "TestExampleInterface" , "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7178 | ||||
7179 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7180 | Optional<mozilla::dom::TestExternalInterface*> arg0; | |||
7181 | Maybe<RefPtr<mozilla::dom::TestExternalInterface>> arg0_holder; | |||
7182 | if (args.hasDefined(0)) { | |||
7183 | arg0.Construct(); | |||
7184 | arg0_holder.emplace(); | |||
7185 | if (args[0].isObject()) { | |||
7186 | JS::Rooted<JSObject*> source(cx, &args[0].toObject()); | |||
7187 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder.ref())))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder .ref())))), 0)))) { | |||
7188 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface"); | |||
7189 | return false; | |||
7190 | } | |||
7191 | MOZ_ASSERT(arg0_holder.ref())do { static_assert( mozilla::detail::AssertionConditionType< decltype(arg0_holder.ref())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arg0_holder.ref()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arg0_holder.ref()" , "../TestExampleGenBinding.cpp", 7191); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "arg0_holder.ref()" ")"); do { *((volatile int *)__null) = 7191; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
7192 | arg0.Value() = arg0_holder.ref(); | |||
7193 | } else { | |||
7194 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7195 | return false; | |||
7196 | } | |||
7197 | } | |||
7198 | // NOTE: This assert does NOT call the function. | |||
7199 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNonNullExternal(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))))>, "Should be returning void here"); | |||
7200 | MOZ_KnownLive(self)(self)->PassOptionalNonNullExternal(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))); | |||
7201 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7201); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7201; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7202 | args.rval().setUndefined(); | |||
7203 | return true; | |||
7204 | } | |||
7205 | ||||
7206 | static const JSJitInfo passOptionalNonNullExternal_methodinfo = { | |||
7207 | { (JSJitGetterOp)passOptionalNonNullExternal }, | |||
7208 | { prototypes::id::TestExampleInterface }, | |||
7209 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7210 | JSJitInfo::Method, | |||
7211 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7212 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7213 | false, /* isInfallible. False in setters. */ | |||
7214 | false, /* isMovable. Not relevant for setters. */ | |||
7215 | false, /* isEliminatable. Not relevant for setters. */ | |||
7216 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7217 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7218 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7219 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7220 | }; | |||
7221 | ||||
7222 | MOZ_CAN_RUN_SCRIPT static bool | |||
7223 | passOptionalExternalWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7224 | { | |||
7225 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalExternalWithDefault"); | |||
7226 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7229( cx, "TestExampleInterface" , "passOptionalExternalWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7227 | "TestExampleInterface", "passOptionalExternalWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7229( cx, "TestExampleInterface" , "passOptionalExternalWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7228 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7229( cx, "TestExampleInterface" , "passOptionalExternalWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7229 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7229( cx, "TestExampleInterface" , "passOptionalExternalWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7230 | ||||
7231 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7232 | mozilla::dom::TestExternalInterface* arg0; | |||
7233 | RefPtr<mozilla::dom::TestExternalInterface> arg0_holder; | |||
7234 | if (args.hasDefined(0)) { | |||
7235 | if (args[0].isObject()) { | |||
7236 | JS::Rooted<JSObject*> source(cx, &args[0].toObject()); | |||
7237 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder )))), 0)))) { | |||
7238 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface"); | |||
7239 | return false; | |||
7240 | } | |||
7241 | MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(arg0_holder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestExampleGenBinding.cpp" , 7241); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder" ")"); do { *((volatile int*)__null) = 7241; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
7242 | arg0 = arg0_holder; | |||
7243 | } else if (args[0].isNullOrUndefined()) { | |||
7244 | arg0 = nullptr; | |||
7245 | } else { | |||
7246 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7247 | return false; | |||
7248 | } | |||
7249 | } else { | |||
7250 | arg0 = nullptr; | |||
7251 | } | |||
7252 | // NOTE: This assert does NOT call the function. | |||
7253 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalExternalWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
7254 | MOZ_KnownLive(self)(self)->PassOptionalExternalWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
7255 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7255); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7255; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7256 | args.rval().setUndefined(); | |||
7257 | return true; | |||
7258 | } | |||
7259 | ||||
7260 | static const JSJitInfo passOptionalExternalWithDefault_methodinfo = { | |||
7261 | { (JSJitGetterOp)passOptionalExternalWithDefault }, | |||
7262 | { prototypes::id::TestExampleInterface }, | |||
7263 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7264 | JSJitInfo::Method, | |||
7265 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7266 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7267 | false, /* isInfallible. False in setters. */ | |||
7268 | false, /* isMovable. Not relevant for setters. */ | |||
7269 | false, /* isEliminatable. Not relevant for setters. */ | |||
7270 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7271 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7272 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7273 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7274 | }; | |||
7275 | ||||
7276 | MOZ_CAN_RUN_SCRIPT static bool | |||
7277 | receiveCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7278 | { | |||
7279 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7282( cx, "TestExampleInterface" , "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7280 | "TestExampleInterface", "receiveCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7282( cx, "TestExampleInterface" , "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7281 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7282( cx, "TestExampleInterface" , "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7282 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7282( cx, "TestExampleInterface" , "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7283 | ||||
7284 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7285 | auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveCallbackInterface())); | |||
7286 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7286); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7286; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7287 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
7288 | if (!MaybeWrapObjectValue(cx, args.rval())) { | |||
7289 | return false; | |||
7290 | } | |||
7291 | return true; | |||
7292 | } | |||
7293 | ||||
7294 | static const JSJitInfo receiveCallbackInterface_methodinfo = { | |||
7295 | { (JSJitGetterOp)receiveCallbackInterface }, | |||
7296 | { prototypes::id::TestExampleInterface }, | |||
7297 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7298 | JSJitInfo::Method, | |||
7299 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7300 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
7301 | false, /* isInfallible. False in setters. */ | |||
7302 | false, /* isMovable. Not relevant for setters. */ | |||
7303 | false, /* isEliminatable. Not relevant for setters. */ | |||
7304 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7305 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7306 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7307 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7308 | }; | |||
7309 | ||||
7310 | MOZ_CAN_RUN_SCRIPT static bool | |||
7311 | receiveNullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7312 | { | |||
7313 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7316( cx, "TestExampleInterface" , "receiveNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7314 | "TestExampleInterface", "receiveNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7316( cx, "TestExampleInterface" , "receiveNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7315 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7316( cx, "TestExampleInterface" , "receiveNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7316 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7316( cx, "TestExampleInterface" , "receiveNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7317 | ||||
7318 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7319 | auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableCallbackInterface())); | |||
7320 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7320); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7320; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7321 | if (result) { | |||
7322 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
7323 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { | |||
7324 | return false; | |||
7325 | } | |||
7326 | return true; | |||
7327 | } else { | |||
7328 | args.rval().setNull(); | |||
7329 | return true; | |||
7330 | } | |||
7331 | } | |||
7332 | ||||
7333 | static const JSJitInfo receiveNullableCallbackInterface_methodinfo = { | |||
7334 | { (JSJitGetterOp)receiveNullableCallbackInterface }, | |||
7335 | { prototypes::id::TestExampleInterface }, | |||
7336 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7337 | JSJitInfo::Method, | |||
7338 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7339 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
7340 | false, /* isInfallible. False in setters. */ | |||
7341 | false, /* isMovable. Not relevant for setters. */ | |||
7342 | false, /* isEliminatable. Not relevant for setters. */ | |||
7343 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7344 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7345 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7346 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7347 | }; | |||
7348 | ||||
7349 | MOZ_CAN_RUN_SCRIPT static bool | |||
7350 | receiveWeakCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7351 | { | |||
7352 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7355( cx, "TestExampleInterface" , "receiveWeakCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7353 | "TestExampleInterface", "receiveWeakCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7355( cx, "TestExampleInterface" , "receiveWeakCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7354 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7355( cx, "TestExampleInterface" , "receiveWeakCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7355 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7355( cx, "TestExampleInterface" , "receiveWeakCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7356 | ||||
7357 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7358 | auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakCallbackInterface())); | |||
7359 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7359); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7359; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7360 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
7361 | if (!MaybeWrapObjectValue(cx, args.rval())) { | |||
7362 | return false; | |||
7363 | } | |||
7364 | return true; | |||
7365 | } | |||
7366 | ||||
7367 | static const JSJitInfo receiveWeakCallbackInterface_methodinfo = { | |||
7368 | { (JSJitGetterOp)receiveWeakCallbackInterface }, | |||
7369 | { prototypes::id::TestExampleInterface }, | |||
7370 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7371 | JSJitInfo::Method, | |||
7372 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7373 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
7374 | false, /* isInfallible. False in setters. */ | |||
7375 | false, /* isMovable. Not relevant for setters. */ | |||
7376 | false, /* isEliminatable. Not relevant for setters. */ | |||
7377 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7378 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7379 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7380 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7381 | }; | |||
7382 | ||||
7383 | MOZ_CAN_RUN_SCRIPT static bool | |||
7384 | receiveWeakNullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7385 | { | |||
7386 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7389( cx, "TestExampleInterface" , "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7387 | "TestExampleInterface", "receiveWeakNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7389( cx, "TestExampleInterface" , "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7388 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7389( cx, "TestExampleInterface" , "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7389 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7389( cx, "TestExampleInterface" , "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7390 | ||||
7391 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7392 | auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableCallbackInterface())); | |||
7393 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7393); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7393; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7394 | if (result) { | |||
7395 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
7396 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { | |||
7397 | return false; | |||
7398 | } | |||
7399 | return true; | |||
7400 | } else { | |||
7401 | args.rval().setNull(); | |||
7402 | return true; | |||
7403 | } | |||
7404 | } | |||
7405 | ||||
7406 | static const JSJitInfo receiveWeakNullableCallbackInterface_methodinfo = { | |||
7407 | { (JSJitGetterOp)receiveWeakNullableCallbackInterface }, | |||
7408 | { prototypes::id::TestExampleInterface }, | |||
7409 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7410 | JSJitInfo::Method, | |||
7411 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7412 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
7413 | false, /* isInfallible. False in setters. */ | |||
7414 | false, /* isMovable. Not relevant for setters. */ | |||
7415 | false, /* isEliminatable. Not relevant for setters. */ | |||
7416 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7417 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7418 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7419 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7420 | }; | |||
7421 | ||||
7422 | MOZ_CAN_RUN_SCRIPT static bool | |||
7423 | passCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7424 | { | |||
7425 | BindingCallContext cx(cx_, "TestExampleInterface.passCallbackInterface"); | |||
7426 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7429( cx, "TestExampleInterface" , "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7427 | "TestExampleInterface", "passCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7429( cx, "TestExampleInterface" , "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7428 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7429( cx, "TestExampleInterface" , "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7429 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7429( cx, "TestExampleInterface" , "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
7430 | ||||
7431 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7432 | if (!args.requireAtLeast(cx, "TestExampleInterface.passCallbackInterface", 1)) { | |||
7433 | return false; | |||
7434 | } | |||
7435 | RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx); | |||
7436 | if (args[0].isObject()) { | |||
7437 | { // scope for tempRoot and tempGlobalRoot if needed | |||
7438 | arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
7439 | } | |||
7440 | } else { | |||
7441 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7442 | return false; | |||
7443 | } | |||
7444 | // NOTE: This assert does NOT call the function. | |||
7445 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))))>, "Should be returning void here"); | |||
7446 | MOZ_KnownLive(self)(self)->PassCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))); | |||
7447 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7447); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7447; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7448 | args.rval().setUndefined(); | |||
7449 | return true; | |||
7450 | } | |||
7451 | ||||
7452 | static const JSJitInfo passCallbackInterface_methodinfo = { | |||
7453 | { (JSJitGetterOp)passCallbackInterface }, | |||
7454 | { prototypes::id::TestExampleInterface }, | |||
7455 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7456 | JSJitInfo::Method, | |||
7457 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7458 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7459 | false, /* isInfallible. False in setters. */ | |||
7460 | false, /* isMovable. Not relevant for setters. */ | |||
7461 | false, /* isEliminatable. Not relevant for setters. */ | |||
7462 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7463 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7464 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7465 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7466 | }; | |||
7467 | ||||
7468 | MOZ_CAN_RUN_SCRIPT static bool | |||
7469 | passNullableCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7470 | { | |||
7471 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableCallbackInterface"); | |||
7472 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7475( cx, "TestExampleInterface" , "passNullableCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7473 | "TestExampleInterface", "passNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7475( cx, "TestExampleInterface" , "passNullableCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7474 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7475( cx, "TestExampleInterface" , "passNullableCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7475 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7475( cx, "TestExampleInterface" , "passNullableCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7476 | ||||
7477 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7478 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableCallbackInterface", 1)) { | |||
7479 | return false; | |||
7480 | } | |||
7481 | RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx); | |||
7482 | if (args[0].isObject()) { | |||
7483 | { // scope for tempRoot and tempGlobalRoot if needed | |||
7484 | arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
7485 | } | |||
7486 | } else if (args[0].isNullOrUndefined()) { | |||
7487 | arg0 = nullptr; | |||
7488 | } else { | |||
7489 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7490 | return false; | |||
7491 | } | |||
7492 | // NOTE: This assert does NOT call the function. | |||
7493 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
7494 | MOZ_KnownLive(self)(self)->PassNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
7495 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7495); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7495; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7496 | args.rval().setUndefined(); | |||
7497 | return true; | |||
7498 | } | |||
7499 | ||||
7500 | static const JSJitInfo passNullableCallbackInterface_methodinfo = { | |||
7501 | { (JSJitGetterOp)passNullableCallbackInterface }, | |||
7502 | { prototypes::id::TestExampleInterface }, | |||
7503 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7504 | JSJitInfo::Method, | |||
7505 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7506 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7507 | false, /* isInfallible. False in setters. */ | |||
7508 | false, /* isMovable. Not relevant for setters. */ | |||
7509 | false, /* isEliminatable. Not relevant for setters. */ | |||
7510 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7511 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7512 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7513 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7514 | }; | |||
7515 | ||||
7516 | MOZ_CAN_RUN_SCRIPT static bool | |||
7517 | get_nonNullCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
7518 | { | |||
7519 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7522( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7520 | "TestExampleInterface", "nonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7522( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7521 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7522( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7522 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7522( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7523 | ||||
7524 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7525 | auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->NonNullCallbackInterface())); | |||
7526 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7526); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7526; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7527 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
7528 | if (!MaybeWrapObjectValue(cx, args.rval())) { | |||
7529 | return false; | |||
7530 | } | |||
7531 | return true; | |||
7532 | } | |||
7533 | ||||
7534 | MOZ_CAN_RUN_SCRIPT static bool | |||
7535 | set_nonNullCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
7536 | { | |||
7537 | BindingCallContext cx(cx_, "TestExampleInterface.nonNullCallbackInterface setter"); | |||
7538 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7541( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7539 | "TestExampleInterface", "nonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7541( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7540 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject7541( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7541 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7541( cx, "TestExampleInterface" , "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7542 | ||||
7543 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7544 | RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx); | |||
7545 | if (args[0].isObject()) { | |||
7546 | { // scope for tempRoot and tempGlobalRoot if needed | |||
7547 | arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
7548 | } | |||
7549 | } else { | |||
7550 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | |||
7551 | return false; | |||
7552 | } | |||
7553 | // NOTE: This assert does NOT call the function. | |||
7554 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))))>, "Should be returning void here"); | |||
7555 | MOZ_KnownLive(self)(self)->SetNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))); | |||
7556 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7556); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7556; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7557 | ||||
7558 | return true; | |||
7559 | } | |||
7560 | ||||
7561 | static const JSJitInfo nonNullCallbackInterface_getterinfo = { | |||
7562 | { get_nonNullCallbackInterface }, | |||
7563 | { prototypes::id::TestExampleInterface }, | |||
7564 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7565 | JSJitInfo::Getter, | |||
7566 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7567 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
7568 | false, /* isInfallible. False in setters. */ | |||
7569 | false, /* isMovable. Not relevant for setters. */ | |||
7570 | false, /* isEliminatable. Not relevant for setters. */ | |||
7571 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7572 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7573 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7574 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7575 | }; | |||
7576 | static const JSJitInfo nonNullCallbackInterface_setterinfo = { | |||
7577 | { (JSJitGetterOp)set_nonNullCallbackInterface }, | |||
7578 | { prototypes::id::TestExampleInterface }, | |||
7579 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7580 | JSJitInfo::Setter, | |||
7581 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7582 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7583 | false, /* isInfallible. False in setters. */ | |||
7584 | false, /* isMovable. Not relevant for setters. */ | |||
7585 | false, /* isEliminatable. Not relevant for setters. */ | |||
7586 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7587 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7588 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7589 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7590 | }; | |||
7591 | ||||
7592 | MOZ_CAN_RUN_SCRIPT static bool | |||
7593 | get_nullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
7594 | { | |||
7595 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7598( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7596 | "TestExampleInterface", "nullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7598( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7597 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7598( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7598 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7598( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7599 | ||||
7600 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7601 | auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetNullableCallbackInterface())); | |||
7602 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7602); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7602; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7603 | if (result) { | |||
7604 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
7605 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { | |||
7606 | return false; | |||
7607 | } | |||
7608 | return true; | |||
7609 | } else { | |||
7610 | args.rval().setNull(); | |||
7611 | return true; | |||
7612 | } | |||
7613 | } | |||
7614 | ||||
7615 | MOZ_CAN_RUN_SCRIPT static bool | |||
7616 | set_nullableCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
7617 | { | |||
7618 | BindingCallContext cx(cx_, "TestExampleInterface.nullableCallbackInterface setter"); | |||
7619 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7622( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7620 | "TestExampleInterface", "nullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7622( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7621 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject7622( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7622 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7622( cx, "TestExampleInterface" , "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7623 | ||||
7624 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7625 | RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx); | |||
7626 | if (args[0].isObject()) { | |||
7627 | { // scope for tempRoot and tempGlobalRoot if needed | |||
7628 | arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
7629 | } | |||
7630 | } else if (args[0].isNullOrUndefined()) { | |||
7631 | arg0 = nullptr; | |||
7632 | } else { | |||
7633 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | |||
7634 | return false; | |||
7635 | } | |||
7636 | // NOTE: This assert does NOT call the function. | |||
7637 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
7638 | MOZ_KnownLive(self)(self)->SetNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
7639 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7639); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7639; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7640 | ||||
7641 | return true; | |||
7642 | } | |||
7643 | ||||
7644 | static const JSJitInfo nullableCallbackInterface_getterinfo = { | |||
7645 | { get_nullableCallbackInterface }, | |||
7646 | { prototypes::id::TestExampleInterface }, | |||
7647 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7648 | JSJitInfo::Getter, | |||
7649 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7650 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
7651 | false, /* isInfallible. False in setters. */ | |||
7652 | false, /* isMovable. Not relevant for setters. */ | |||
7653 | false, /* isEliminatable. Not relevant for setters. */ | |||
7654 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7655 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7656 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7657 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7658 | }; | |||
7659 | static const JSJitInfo nullableCallbackInterface_setterinfo = { | |||
7660 | { (JSJitGetterOp)set_nullableCallbackInterface }, | |||
7661 | { prototypes::id::TestExampleInterface }, | |||
7662 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7663 | JSJitInfo::Setter, | |||
7664 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7665 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7666 | false, /* isInfallible. False in setters. */ | |||
7667 | false, /* isMovable. Not relevant for setters. */ | |||
7668 | false, /* isEliminatable. Not relevant for setters. */ | |||
7669 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7670 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7671 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7672 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7673 | }; | |||
7674 | ||||
7675 | MOZ_CAN_RUN_SCRIPT static bool | |||
7676 | passOptionalCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7677 | { | |||
7678 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalCallbackInterface"); | |||
7679 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7682( cx, "TestExampleInterface" , "passOptionalCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7680 | "TestExampleInterface", "passOptionalCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7682( cx, "TestExampleInterface" , "passOptionalCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7681 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7682( cx, "TestExampleInterface" , "passOptionalCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7682 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7682( cx, "TestExampleInterface" , "passOptionalCallbackInterface", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7683 | ||||
7684 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7685 | Optional<RefPtr<TestCallbackInterface>> arg0; | |||
7686 | if (args.hasDefined(0)) { | |||
7687 | arg0.Construct(); | |||
7688 | if (args[0].isObject()) { | |||
7689 | { // scope for tempRoot and tempGlobalRoot if needed | |||
7690 | JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject()); | |||
7691 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | |||
7692 | arg0.Value() = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | |||
7693 | } | |||
7694 | } else if (args[0].isNullOrUndefined()) { | |||
7695 | arg0.Value() = nullptr; | |||
7696 | } else { | |||
7697 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7698 | return false; | |||
7699 | } | |||
7700 | } | |||
7701 | // NOTE: This assert does NOT call the function. | |||
7702 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
7703 | MOZ_KnownLive(self)(self)->PassOptionalCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
7704 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7704); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7704; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7705 | args.rval().setUndefined(); | |||
7706 | return true; | |||
7707 | } | |||
7708 | ||||
7709 | static const JSJitInfo passOptionalCallbackInterface_methodinfo = { | |||
7710 | { (JSJitGetterOp)passOptionalCallbackInterface }, | |||
7711 | { prototypes::id::TestExampleInterface }, | |||
7712 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7713 | JSJitInfo::Method, | |||
7714 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7715 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7716 | false, /* isInfallible. False in setters. */ | |||
7717 | false, /* isMovable. Not relevant for setters. */ | |||
7718 | false, /* isEliminatable. Not relevant for setters. */ | |||
7719 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7720 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7721 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7722 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7723 | }; | |||
7724 | ||||
7725 | MOZ_CAN_RUN_SCRIPT static bool | |||
7726 | passOptionalNonNullCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7727 | { | |||
7728 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNonNullCallbackInterface"); | |||
7729 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestExampleInterface" , "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7730 | "TestExampleInterface", "passOptionalNonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestExampleInterface" , "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7731 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestExampleInterface" , "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7732 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestExampleInterface" , "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7733 | ||||
7734 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7735 | Optional<OwningNonNull<TestCallbackInterface>> arg0; | |||
7736 | if (args.hasDefined(0)) { | |||
7737 | arg0.Construct(); | |||
7738 | if (args[0].isObject()) { | |||
7739 | { // scope for tempRoot and tempGlobalRoot if needed | |||
7740 | JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject()); | |||
7741 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | |||
7742 | arg0.Value() = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | |||
7743 | } | |||
7744 | } else { | |||
7745 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7746 | return false; | |||
7747 | } | |||
7748 | } | |||
7749 | // NOTE: This assert does NOT call the function. | |||
7750 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))))>, "Should be returning void here"); | |||
7751 | MOZ_KnownLive(self)(self)->PassOptionalNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))); | |||
7752 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7752); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7752; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7753 | args.rval().setUndefined(); | |||
7754 | return true; | |||
7755 | } | |||
7756 | ||||
7757 | static const JSJitInfo passOptionalNonNullCallbackInterface_methodinfo = { | |||
7758 | { (JSJitGetterOp)passOptionalNonNullCallbackInterface }, | |||
7759 | { prototypes::id::TestExampleInterface }, | |||
7760 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7761 | JSJitInfo::Method, | |||
7762 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7763 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7764 | false, /* isInfallible. False in setters. */ | |||
7765 | false, /* isMovable. Not relevant for setters. */ | |||
7766 | false, /* isEliminatable. Not relevant for setters. */ | |||
7767 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7768 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7769 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7770 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7771 | }; | |||
7772 | ||||
7773 | MOZ_CAN_RUN_SCRIPT static bool | |||
7774 | passOptionalCallbackInterfaceWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
7775 | { | |||
7776 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalCallbackInterfaceWithDefault"); | |||
7777 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7780( cx, "TestExampleInterface" , "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7778 | "TestExampleInterface", "passOptionalCallbackInterfaceWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7780( cx, "TestExampleInterface" , "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7779 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7780( cx, "TestExampleInterface" , "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7780 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7780( cx, "TestExampleInterface" , "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7781 | ||||
7782 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7783 | RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx); | |||
7784 | if (args.hasDefined(0)) { | |||
7785 | if (args[0].isObject()) { | |||
7786 | { // scope for tempRoot and tempGlobalRoot if needed | |||
7787 | arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
7788 | } | |||
7789 | } else if (args[0].isNullOrUndefined()) { | |||
7790 | arg0 = nullptr; | |||
7791 | } else { | |||
7792 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
7793 | return false; | |||
7794 | } | |||
7795 | } else { | |||
7796 | arg0 = nullptr; | |||
7797 | } | |||
7798 | // NOTE: This assert does NOT call the function. | |||
7799 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalCallbackInterfaceWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
7800 | MOZ_KnownLive(self)(self)->PassOptionalCallbackInterfaceWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
7801 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7801); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7801; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7802 | args.rval().setUndefined(); | |||
7803 | return true; | |||
7804 | } | |||
7805 | ||||
7806 | static const JSJitInfo passOptionalCallbackInterfaceWithDefault_methodinfo = { | |||
7807 | { (JSJitGetterOp)passOptionalCallbackInterfaceWithDefault }, | |||
7808 | { prototypes::id::TestExampleInterface }, | |||
7809 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7810 | JSJitInfo::Method, | |||
7811 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
7812 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
7813 | false, /* isInfallible. False in setters. */ | |||
7814 | false, /* isMovable. Not relevant for setters. */ | |||
7815 | false, /* isEliminatable. Not relevant for setters. */ | |||
7816 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7817 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7818 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7819 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7820 | }; | |||
7821 | ||||
7822 | MOZ_CAN_RUN_SCRIPT static bool | |||
7823 | get_readonlySequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
7824 | { | |||
7825 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7828( cx, "TestExampleInterface" , "readonlySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7826 | "TestExampleInterface", "readonlySequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7828( cx, "TestExampleInterface" , "readonlySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7827 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7828( cx, "TestExampleInterface" , "readonlySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
7828 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7828( cx, "TestExampleInterface" , "readonlySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
7829 | ||||
7830 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7831 | // Have to either root across the getter call or reget after. | |||
7832 | bool isXray; | |||
7833 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
7834 | if (!slotStorage) { | |||
7835 | return false; | |||
7836 | } | |||
7837 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 4) : (DOM_INSTANCE_RESERVED_SLOTS1 + 4); | |||
7838 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 7838); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 7838; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
7839 | { | |||
7840 | // Scope for cachedVal | |||
7841 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
7842 | if (!cachedVal.isUndefined()) { | |||
7843 | args.rval().set(cachedVal); | |||
7844 | // The cached value is in the compartment of slotStorage, | |||
7845 | // so wrap into the caller compartment as needed. | |||
7846 | return MaybeWrapNonDOMObjectValue(cx, args.rval()); | |||
7847 | } | |||
7848 | } | |||
7849 | ||||
7850 | nsTArray<int32_t> result; | |||
7851 | // NOTE: This assert does NOT call the function. | |||
7852 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetReadonlySequence(result))>, "Should be returning void here"); | |||
7853 | MOZ_KnownLive(self)(self)->GetReadonlySequence(result); | |||
7854 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7854); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7854; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7855 | { | |||
7856 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
7857 | JSAutoRealm ar(cx, conversionScope); | |||
7858 | do { // block we break out of when done wrapping | |||
7859 | ||||
7860 | uint32_t length = result.Length(); | |||
7861 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
7862 | if (!returnArray) { | |||
7863 | return false; | |||
7864 | } | |||
7865 | // Scope for 'tmp' | |||
7866 | { | |||
7867 | JS::Rooted<JS::Value> tmp(cx); | |||
7868 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
7869 | // Control block to let us common up the JS_DefineElement calls when there | |||
7870 | // are different ways to succeed at wrapping the object. | |||
7871 | do { | |||
7872 | tmp.setInt32(int32_t(result[sequenceIdx0])); | |||
7873 | break; | |||
7874 | } while (false); | |||
7875 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
7876 | JSPROP_ENUMERATE)) { | |||
7877 | return false; | |||
7878 | } | |||
7879 | } | |||
7880 | } | |||
7881 | args.rval().setObject(*returnArray); | |||
7882 | break; | |||
7883 | } while (false); | |||
7884 | } | |||
7885 | { // And now store things in the realm of our slotStorage. | |||
7886 | JSAutoRealm ar(cx, slotStorage); | |||
7887 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
7888 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
7889 | if (!MaybeWrapNonDOMObjectValue(cx, &storedVal)) { | |||
7890 | return false; | |||
7891 | } | |||
7892 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
7893 | if (!isXray) { | |||
7894 | // In the Xray case we don't need to do this, because getting the | |||
7895 | // expando object already preserved our wrapper. | |||
7896 | PreserveWrapper(self); | |||
7897 | } | |||
7898 | } | |||
7899 | // And now make sure args.rval() is in the caller realm. | |||
7900 | return MaybeWrapNonDOMObjectValue(cx, args.rval()); | |||
7901 | } | |||
7902 | ||||
7903 | static const JSJitInfo readonlySequence_getterinfo = { | |||
7904 | { get_readonlySequence }, | |||
7905 | { prototypes::id::TestExampleInterface }, | |||
7906 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
7907 | JSJitInfo::Getter, | |||
7908 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
7909 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
7910 | false, /* isInfallible. False in setters. */ | |||
7911 | true, /* isMovable. Not relevant for setters. */ | |||
7912 | true, /* isEliminatable. Not relevant for setters. */ | |||
7913 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
7914 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
7915 | false, /* isTypedMethod. Only relevant for methods. */ | |||
7916 | (DOM_INSTANCE_RESERVED_SLOTS1 + 4) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
7917 | }; | |||
7918 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 4) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
7919 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 4) < 22, "There is no slot for us"); | |||
7920 | ||||
7921 | MOZ_CAN_RUN_SCRIPT static bool | |||
7922 | get_readonlySequenceOfDictionaries(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
7923 | { | |||
7924 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7927( cx, "TestExampleInterface" , "readonlySequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7925 | "TestExampleInterface", "readonlySequenceOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7927( cx, "TestExampleInterface" , "readonlySequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7926 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7927( cx, "TestExampleInterface" , "readonlySequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
7927 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7927( cx, "TestExampleInterface" , "readonlySequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
7928 | ||||
7929 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
7930 | // Have to either root across the getter call or reget after. | |||
7931 | bool isXray; | |||
7932 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
7933 | if (!slotStorage) { | |||
7934 | return false; | |||
7935 | } | |||
7936 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 5) : (DOM_INSTANCE_RESERVED_SLOTS1 + 5); | |||
7937 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 7937); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 7937; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
7938 | { | |||
7939 | // Scope for cachedVal | |||
7940 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
7941 | if (!cachedVal.isUndefined()) { | |||
7942 | args.rval().set(cachedVal); | |||
7943 | // The cached value is in the compartment of slotStorage, | |||
7944 | // so wrap into the caller compartment as needed. | |||
7945 | return MaybeWrapNonDOMObjectValue(cx, args.rval()); | |||
7946 | } | |||
7947 | } | |||
7948 | ||||
7949 | nsTArray<Dict> result; | |||
7950 | SequenceRooter<Dict > resultRooter(cx, &result); | |||
7951 | // NOTE: This assert does NOT call the function. | |||
7952 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetReadonlySequenceOfDictionaries(cx, result))>, "Should be returning void here"); | |||
7953 | MOZ_KnownLive(self)(self)->GetReadonlySequenceOfDictionaries(cx, result); | |||
7954 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 7954); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 7954; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
7955 | { | |||
7956 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
7957 | JSAutoRealm ar(cx, conversionScope); | |||
7958 | do { // block we break out of when done wrapping | |||
7959 | ||||
7960 | uint32_t length = result.Length(); | |||
7961 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
7962 | if (!returnArray) { | |||
7963 | return false; | |||
7964 | } | |||
7965 | // Scope for 'tmp' | |||
7966 | { | |||
7967 | JS::Rooted<JS::Value> tmp(cx); | |||
7968 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
7969 | // Control block to let us common up the JS_DefineElement calls when there | |||
7970 | // are different ways to succeed at wrapping the object. | |||
7971 | do { | |||
7972 | if (!result[sequenceIdx0].ToObjectInternal(cx, &tmp)) { | |||
7973 | return false; | |||
7974 | } | |||
7975 | break; | |||
7976 | } while (false); | |||
7977 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
7978 | JSPROP_ENUMERATE)) { | |||
7979 | return false; | |||
7980 | } | |||
7981 | } | |||
7982 | } | |||
7983 | args.rval().setObject(*returnArray); | |||
7984 | break; | |||
7985 | } while (false); | |||
7986 | } | |||
7987 | { // And now store things in the realm of our slotStorage. | |||
7988 | JSAutoRealm ar(cx, slotStorage); | |||
7989 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
7990 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
7991 | if (!MaybeWrapNonDOMObjectValue(cx, &storedVal)) { | |||
7992 | return false; | |||
7993 | } | |||
7994 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
7995 | if (!isXray) { | |||
7996 | // In the Xray case we don't need to do this, because getting the | |||
7997 | // expando object already preserved our wrapper. | |||
7998 | PreserveWrapper(self); | |||
7999 | } | |||
8000 | } | |||
8001 | // And now make sure args.rval() is in the caller realm. | |||
8002 | return MaybeWrapNonDOMObjectValue(cx, args.rval()); | |||
8003 | } | |||
8004 | ||||
8005 | static const JSJitInfo readonlySequenceOfDictionaries_getterinfo = { | |||
8006 | { get_readonlySequenceOfDictionaries }, | |||
8007 | { prototypes::id::TestExampleInterface }, | |||
8008 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8009 | JSJitInfo::Getter, | |||
8010 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
8011 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
8012 | false, /* isInfallible. False in setters. */ | |||
8013 | true, /* isMovable. Not relevant for setters. */ | |||
8014 | true, /* isEliminatable. Not relevant for setters. */ | |||
8015 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8016 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8017 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8018 | (DOM_INSTANCE_RESERVED_SLOTS1 + 5) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8019 | }; | |||
8020 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 5) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
8021 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 5) < 22, "There is no slot for us"); | |||
8022 | ||||
8023 | MOZ_CAN_RUN_SCRIPT static bool | |||
8024 | get_readonlyNullableSequenceOfDictionaries(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
8025 | { | |||
8026 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8029( cx, "TestExampleInterface" , "readonlyNullableSequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8027 | "TestExampleInterface", "readonlyNullableSequenceOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8029( cx, "TestExampleInterface" , "readonlyNullableSequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8028 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject8029( cx, "TestExampleInterface" , "readonlyNullableSequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8029 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8029( cx, "TestExampleInterface" , "readonlyNullableSequenceOfDictionaries", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8030 | ||||
8031 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8032 | // Have to either root across the getter call or reget after. | |||
8033 | bool isXray; | |||
8034 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
8035 | if (!slotStorage) { | |||
8036 | return false; | |||
8037 | } | |||
8038 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 6) : (DOM_INSTANCE_RESERVED_SLOTS1 + 6); | |||
8039 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 8039); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 8039; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
8040 | { | |||
8041 | // Scope for cachedVal | |||
8042 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
8043 | if (!cachedVal.isUndefined()) { | |||
8044 | args.rval().set(cachedVal); | |||
8045 | // The cached value is in the compartment of slotStorage, | |||
8046 | // so wrap into the caller compartment as needed. | |||
8047 | return MaybeWrapNonDOMObjectOrNullValue(cx, args.rval()); | |||
8048 | } | |||
8049 | } | |||
8050 | ||||
8051 | Nullable<nsTArray<Dict>> result; | |||
8052 | SequenceRooter<Dict > resultRooter(cx, &result); | |||
8053 | // NOTE: This assert does NOT call the function. | |||
8054 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetReadonlyNullableSequenceOfDictionaries(cx, result))>, "Should be returning void here"); | |||
8055 | MOZ_KnownLive(self)(self)->GetReadonlyNullableSequenceOfDictionaries(cx, result); | |||
8056 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8056); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8056; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8057 | { | |||
8058 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
8059 | JSAutoRealm ar(cx, conversionScope); | |||
8060 | do { // block we break out of when done wrapping | |||
8061 | ||||
8062 | if (result.IsNull()) { | |||
8063 | args.rval().setNull(); | |||
8064 | break; | |||
8065 | } | |||
8066 | ||||
8067 | uint32_t length = result.Value().Length(); | |||
8068 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8069 | if (!returnArray) { | |||
8070 | return false; | |||
8071 | } | |||
8072 | // Scope for 'tmp' | |||
8073 | { | |||
8074 | JS::Rooted<JS::Value> tmp(cx); | |||
8075 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8076 | // Control block to let us common up the JS_DefineElement calls when there | |||
8077 | // are different ways to succeed at wrapping the object. | |||
8078 | do { | |||
8079 | if (!result.Value()[sequenceIdx0].ToObjectInternal(cx, &tmp)) { | |||
8080 | return false; | |||
8081 | } | |||
8082 | break; | |||
8083 | } while (false); | |||
8084 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8085 | JSPROP_ENUMERATE)) { | |||
8086 | return false; | |||
8087 | } | |||
8088 | } | |||
8089 | } | |||
8090 | args.rval().setObject(*returnArray); | |||
8091 | break; | |||
8092 | } while (false); | |||
8093 | } | |||
8094 | { // And now store things in the realm of our slotStorage. | |||
8095 | JSAutoRealm ar(cx, slotStorage); | |||
8096 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
8097 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
8098 | if (!MaybeWrapNonDOMObjectOrNullValue(cx, &storedVal)) { | |||
8099 | return false; | |||
8100 | } | |||
8101 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
8102 | if (!isXray) { | |||
8103 | // In the Xray case we don't need to do this, because getting the | |||
8104 | // expando object already preserved our wrapper. | |||
8105 | PreserveWrapper(self); | |||
8106 | } | |||
8107 | } | |||
8108 | // And now make sure args.rval() is in the caller realm. | |||
8109 | return MaybeWrapNonDOMObjectOrNullValue(cx, args.rval()); | |||
8110 | } | |||
8111 | ||||
8112 | static const JSJitInfo readonlyNullableSequenceOfDictionaries_getterinfo = { | |||
8113 | { get_readonlyNullableSequenceOfDictionaries }, | |||
8114 | { prototypes::id::TestExampleInterface }, | |||
8115 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8116 | JSJitInfo::Getter, | |||
8117 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
8118 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
8119 | false, /* isInfallible. False in setters. */ | |||
8120 | true, /* isMovable. Not relevant for setters. */ | |||
8121 | true, /* isEliminatable. Not relevant for setters. */ | |||
8122 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8123 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8124 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8125 | (DOM_INSTANCE_RESERVED_SLOTS1 + 6) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8126 | }; | |||
8127 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 6) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
8128 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 6) < 22, "There is no slot for us"); | |||
8129 | ||||
8130 | MOZ_CAN_RUN_SCRIPT static bool | |||
8131 | get_readonlyFrozenSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
8132 | { | |||
8133 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8136( cx, "TestExampleInterface" , "readonlyFrozenSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8134 | "TestExampleInterface", "readonlyFrozenSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8136( cx, "TestExampleInterface" , "readonlyFrozenSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8135 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject8136( cx, "TestExampleInterface" , "readonlyFrozenSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8136 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8136( cx, "TestExampleInterface" , "readonlyFrozenSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
8137 | ||||
8138 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8139 | // Have to either root across the getter call or reget after. | |||
8140 | bool isXray; | |||
8141 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
8142 | if (!slotStorage) { | |||
8143 | return false; | |||
8144 | } | |||
8145 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 7) : (DOM_INSTANCE_RESERVED_SLOTS1 + 7); | |||
8146 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 8146); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 8146; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
8147 | { | |||
8148 | // Scope for cachedVal | |||
8149 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
8150 | if (!cachedVal.isUndefined()) { | |||
8151 | args.rval().set(cachedVal); | |||
8152 | // The cached value is in the compartment of slotStorage, | |||
8153 | // so wrap into the caller compartment as needed. | |||
8154 | return MaybeWrapNonDOMObjectValue(cx, args.rval()); | |||
8155 | } | |||
8156 | } | |||
8157 | ||||
8158 | nsTArray<int32_t> result; | |||
8159 | // NOTE: This assert does NOT call the function. | |||
8160 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetReadonlyFrozenSequence(result))>, "Should be returning void here"); | |||
8161 | MOZ_KnownLive(self)(self)->GetReadonlyFrozenSequence(result); | |||
8162 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8162); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8162; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8163 | { | |||
8164 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
8165 | JSAutoRealm ar(cx, conversionScope); | |||
8166 | do { // block we break out of when done wrapping | |||
8167 | ||||
8168 | uint32_t length = result.Length(); | |||
8169 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8170 | if (!returnArray) { | |||
8171 | return false; | |||
8172 | } | |||
8173 | // Scope for 'tmp' | |||
8174 | { | |||
8175 | JS::Rooted<JS::Value> tmp(cx); | |||
8176 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8177 | // Control block to let us common up the JS_DefineElement calls when there | |||
8178 | // are different ways to succeed at wrapping the object. | |||
8179 | do { | |||
8180 | tmp.setInt32(int32_t(result[sequenceIdx0])); | |||
8181 | break; | |||
8182 | } while (false); | |||
8183 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8184 | JSPROP_ENUMERATE)) { | |||
8185 | return false; | |||
8186 | } | |||
8187 | } | |||
8188 | } | |||
8189 | args.rval().setObject(*returnArray); | |||
8190 | break; | |||
8191 | } while (false); | |||
8192 | JS::Rooted<JSObject*> rvalObj(cx, &args.rval().toObject()); | |||
8193 | if (!JS_FreezeObject(cx, rvalObj)) { | |||
8194 | return false; | |||
8195 | } | |||
8196 | } | |||
8197 | { // And now store things in the realm of our slotStorage. | |||
8198 | JSAutoRealm ar(cx, slotStorage); | |||
8199 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
8200 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
8201 | if (!MaybeWrapNonDOMObjectValue(cx, &storedVal)) { | |||
8202 | return false; | |||
8203 | } | |||
8204 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
8205 | if (!isXray) { | |||
8206 | // In the Xray case we don't need to do this, because getting the | |||
8207 | // expando object already preserved our wrapper. | |||
8208 | PreserveWrapper(self); | |||
8209 | } | |||
8210 | } | |||
8211 | // And now make sure args.rval() is in the caller realm. | |||
8212 | return MaybeWrapNonDOMObjectValue(cx, args.rval()); | |||
8213 | } | |||
8214 | ||||
8215 | static const JSJitInfo readonlyFrozenSequence_getterinfo = { | |||
8216 | { get_readonlyFrozenSequence }, | |||
8217 | { prototypes::id::TestExampleInterface }, | |||
8218 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8219 | JSJitInfo::Getter, | |||
8220 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
8221 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
8222 | false, /* isInfallible. False in setters. */ | |||
8223 | true, /* isMovable. Not relevant for setters. */ | |||
8224 | true, /* isEliminatable. Not relevant for setters. */ | |||
8225 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8226 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8227 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8228 | (DOM_INSTANCE_RESERVED_SLOTS1 + 7) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8229 | }; | |||
8230 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 7) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
8231 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 7) < 22, "There is no slot for us"); | |||
8232 | ||||
8233 | MOZ_CAN_RUN_SCRIPT static bool | |||
8234 | get_readonlyFrozenNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
8235 | { | |||
8236 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8239( cx, "TestExampleInterface" , "readonlyFrozenNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8237 | "TestExampleInterface", "readonlyFrozenNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8239( cx, "TestExampleInterface" , "readonlyFrozenNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8238 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject8239( cx, "TestExampleInterface" , "readonlyFrozenNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8239 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8239( cx, "TestExampleInterface" , "readonlyFrozenNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8240 | ||||
8241 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8242 | // Have to either root across the getter call or reget after. | |||
8243 | bool isXray; | |||
8244 | JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray)); | |||
8245 | if (!slotStorage) { | |||
8246 | return false; | |||
8247 | } | |||
8248 | const size_t slotIndex = isXray ? (DOM_EXPANDO_RESERVED_SLOTS + 8) : (DOM_INSTANCE_RESERVED_SLOTS1 + 8); | |||
8249 | MOZ_ASSERT(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" , "../TestExampleGenBinding.cpp", 8249); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "slotIndex < JSCLASS_RESERVED_SLOTS(JS::GetClass(slotStorage))" ")"); do { *((volatile int*)__null) = 8249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
8250 | { | |||
8251 | // Scope for cachedVal | |||
8252 | JS::Value cachedVal = JS::GetReservedSlot(slotStorage, slotIndex); | |||
8253 | if (!cachedVal.isUndefined()) { | |||
8254 | args.rval().set(cachedVal); | |||
8255 | // The cached value is in the compartment of slotStorage, | |||
8256 | // so wrap into the caller compartment as needed. | |||
8257 | return MaybeWrapNonDOMObjectOrNullValue(cx, args.rval()); | |||
8258 | } | |||
8259 | } | |||
8260 | ||||
8261 | Nullable<nsTArray<int32_t>> result; | |||
8262 | // NOTE: This assert does NOT call the function. | |||
8263 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetReadonlyFrozenNullableSequence(result))>, "Should be returning void here"); | |||
8264 | MOZ_KnownLive(self)(self)->GetReadonlyFrozenNullableSequence(result); | |||
8265 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8265); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8265; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8266 | { | |||
8267 | JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage); | |||
8268 | JSAutoRealm ar(cx, conversionScope); | |||
8269 | do { // block we break out of when done wrapping | |||
8270 | ||||
8271 | if (result.IsNull()) { | |||
8272 | args.rval().setNull(); | |||
8273 | break; | |||
8274 | } | |||
8275 | ||||
8276 | uint32_t length = result.Value().Length(); | |||
8277 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8278 | if (!returnArray) { | |||
8279 | return false; | |||
8280 | } | |||
8281 | // Scope for 'tmp' | |||
8282 | { | |||
8283 | JS::Rooted<JS::Value> tmp(cx); | |||
8284 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8285 | // Control block to let us common up the JS_DefineElement calls when there | |||
8286 | // are different ways to succeed at wrapping the object. | |||
8287 | do { | |||
8288 | tmp.setInt32(int32_t(result.Value()[sequenceIdx0])); | |||
8289 | break; | |||
8290 | } while (false); | |||
8291 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8292 | JSPROP_ENUMERATE)) { | |||
8293 | return false; | |||
8294 | } | |||
8295 | } | |||
8296 | } | |||
8297 | args.rval().setObject(*returnArray); | |||
8298 | break; | |||
8299 | } while (false); | |||
8300 | if (args.rval().isObject()) { | |||
8301 | JS::Rooted<JSObject*> rvalObj(cx, &args.rval().toObject()); | |||
8302 | if (!JS_FreezeObject(cx, rvalObj)) { | |||
8303 | return false; | |||
8304 | } | |||
8305 | } | |||
8306 | } | |||
8307 | { // And now store things in the realm of our slotStorage. | |||
8308 | JSAutoRealm ar(cx, slotStorage); | |||
8309 | // Make a copy so that we don't do unnecessary wrapping on args.rval(). | |||
8310 | JS::Rooted<JS::Value> storedVal(cx, args.rval()); | |||
8311 | if (!MaybeWrapNonDOMObjectOrNullValue(cx, &storedVal)) { | |||
8312 | return false; | |||
8313 | } | |||
8314 | JS::SetReservedSlot(slotStorage, slotIndex, storedVal); | |||
8315 | if (!isXray) { | |||
8316 | // In the Xray case we don't need to do this, because getting the | |||
8317 | // expando object already preserved our wrapper. | |||
8318 | PreserveWrapper(self); | |||
8319 | } | |||
8320 | } | |||
8321 | // And now make sure args.rval() is in the caller realm. | |||
8322 | return MaybeWrapNonDOMObjectOrNullValue(cx, args.rval()); | |||
8323 | } | |||
8324 | ||||
8325 | static const JSJitInfo readonlyFrozenNullableSequence_getterinfo = { | |||
8326 | { get_readonlyFrozenNullableSequence }, | |||
8327 | { prototypes::id::TestExampleInterface }, | |||
8328 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8329 | JSJitInfo::Getter, | |||
8330 | JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */ | |||
8331 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
8332 | false, /* isInfallible. False in setters. */ | |||
8333 | true, /* isMovable. Not relevant for setters. */ | |||
8334 | true, /* isEliminatable. Not relevant for setters. */ | |||
8335 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8336 | true, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8337 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8338 | (DOM_INSTANCE_RESERVED_SLOTS1 + 8) /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8339 | }; | |||
8340 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 8) <= JSJitInfo::maxSlotIndex, "We won't fit"); | |||
8341 | static_assert((DOM_INSTANCE_RESERVED_SLOTS1 + 8) < 22, "There is no slot for us"); | |||
8342 | ||||
8343 | MOZ_CAN_RUN_SCRIPT static bool | |||
8344 | receiveSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8345 | { | |||
8346 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8349( cx, "TestExampleInterface" , "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8347 | "TestExampleInterface", "receiveSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8349( cx, "TestExampleInterface" , "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8348 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8349( cx, "TestExampleInterface" , "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8349 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8349( cx, "TestExampleInterface" , "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
8350 | ||||
8351 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8352 | nsTArray<int32_t> result; | |||
8353 | // NOTE: This assert does NOT call the function. | |||
8354 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveSequence(result))>, "Should be returning void here"); | |||
8355 | MOZ_KnownLive(self)(self)->ReceiveSequence(result); | |||
8356 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8356); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8356; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8357 | ||||
8358 | uint32_t length = result.Length(); | |||
8359 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8360 | if (!returnArray) { | |||
8361 | return false; | |||
8362 | } | |||
8363 | // Scope for 'tmp' | |||
8364 | { | |||
8365 | JS::Rooted<JS::Value> tmp(cx); | |||
8366 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8367 | // Control block to let us common up the JS_DefineElement calls when there | |||
8368 | // are different ways to succeed at wrapping the object. | |||
8369 | do { | |||
8370 | tmp.setInt32(int32_t(result[sequenceIdx0])); | |||
8371 | break; | |||
8372 | } while (false); | |||
8373 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8374 | JSPROP_ENUMERATE)) { | |||
8375 | return false; | |||
8376 | } | |||
8377 | } | |||
8378 | } | |||
8379 | args.rval().setObject(*returnArray); | |||
8380 | return true; | |||
8381 | } | |||
8382 | ||||
8383 | static const JSJitInfo receiveSequence_methodinfo = { | |||
8384 | { (JSJitGetterOp)receiveSequence }, | |||
8385 | { prototypes::id::TestExampleInterface }, | |||
8386 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8387 | JSJitInfo::Method, | |||
8388 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8389 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
8390 | false, /* isInfallible. False in setters. */ | |||
8391 | false, /* isMovable. Not relevant for setters. */ | |||
8392 | false, /* isEliminatable. Not relevant for setters. */ | |||
8393 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8394 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8395 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8396 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8397 | }; | |||
8398 | ||||
8399 | MOZ_CAN_RUN_SCRIPT static bool | |||
8400 | receiveNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8401 | { | |||
8402 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8405( cx, "TestExampleInterface" , "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8403 | "TestExampleInterface", "receiveNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8405( cx, "TestExampleInterface" , "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8404 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8405( cx, "TestExampleInterface" , "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8405 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8405( cx, "TestExampleInterface" , "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
8406 | ||||
8407 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8408 | Nullable<nsTArray<int32_t>> result; | |||
8409 | // NOTE: This assert does NOT call the function. | |||
8410 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableSequence(result))>, "Should be returning void here"); | |||
8411 | MOZ_KnownLive(self)(self)->ReceiveNullableSequence(result); | |||
8412 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8412); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8412; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8413 | ||||
8414 | if (result.IsNull()) { | |||
8415 | args.rval().setNull(); | |||
8416 | return true; | |||
8417 | } | |||
8418 | ||||
8419 | uint32_t length = result.Value().Length(); | |||
8420 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8421 | if (!returnArray) { | |||
8422 | return false; | |||
8423 | } | |||
8424 | // Scope for 'tmp' | |||
8425 | { | |||
8426 | JS::Rooted<JS::Value> tmp(cx); | |||
8427 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8428 | // Control block to let us common up the JS_DefineElement calls when there | |||
8429 | // are different ways to succeed at wrapping the object. | |||
8430 | do { | |||
8431 | tmp.setInt32(int32_t(result.Value()[sequenceIdx0])); | |||
8432 | break; | |||
8433 | } while (false); | |||
8434 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8435 | JSPROP_ENUMERATE)) { | |||
8436 | return false; | |||
8437 | } | |||
8438 | } | |||
8439 | } | |||
8440 | args.rval().setObject(*returnArray); | |||
8441 | return true; | |||
8442 | } | |||
8443 | ||||
8444 | static const JSJitInfo receiveNullableSequence_methodinfo = { | |||
8445 | { (JSJitGetterOp)receiveNullableSequence }, | |||
8446 | { prototypes::id::TestExampleInterface }, | |||
8447 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8448 | JSJitInfo::Method, | |||
8449 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8450 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
8451 | false, /* isInfallible. False in setters. */ | |||
8452 | false, /* isMovable. Not relevant for setters. */ | |||
8453 | false, /* isEliminatable. Not relevant for setters. */ | |||
8454 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8455 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8456 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8457 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8458 | }; | |||
8459 | ||||
8460 | MOZ_CAN_RUN_SCRIPT static bool | |||
8461 | receiveSequenceOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8462 | { | |||
8463 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8466( cx, "TestExampleInterface" , "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8464 | "TestExampleInterface", "receiveSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8466( cx, "TestExampleInterface" , "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8465 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8466( cx, "TestExampleInterface" , "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8466 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8466( cx, "TestExampleInterface" , "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8467 | ||||
8468 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8469 | nsTArray<Nullable<int32_t>> result; | |||
8470 | // NOTE: This assert does NOT call the function. | |||
8471 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveSequenceOfNullableInts(result))>, "Should be returning void here"); | |||
8472 | MOZ_KnownLive(self)(self)->ReceiveSequenceOfNullableInts(result); | |||
8473 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8473); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8473; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8474 | ||||
8475 | uint32_t length = result.Length(); | |||
8476 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8477 | if (!returnArray) { | |||
8478 | return false; | |||
8479 | } | |||
8480 | // Scope for 'tmp' | |||
8481 | { | |||
8482 | JS::Rooted<JS::Value> tmp(cx); | |||
8483 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8484 | // Control block to let us common up the JS_DefineElement calls when there | |||
8485 | // are different ways to succeed at wrapping the object. | |||
8486 | do { | |||
8487 | if (result[sequenceIdx0].IsNull()) { | |||
8488 | tmp.setNull(); | |||
8489 | break; | |||
8490 | } | |||
8491 | tmp.setInt32(int32_t(result[sequenceIdx0].Value())); | |||
8492 | break; | |||
8493 | } while (false); | |||
8494 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8495 | JSPROP_ENUMERATE)) { | |||
8496 | return false; | |||
8497 | } | |||
8498 | } | |||
8499 | } | |||
8500 | args.rval().setObject(*returnArray); | |||
8501 | return true; | |||
8502 | } | |||
8503 | ||||
8504 | static const JSJitInfo receiveSequenceOfNullableInts_methodinfo = { | |||
8505 | { (JSJitGetterOp)receiveSequenceOfNullableInts }, | |||
8506 | { prototypes::id::TestExampleInterface }, | |||
8507 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8508 | JSJitInfo::Method, | |||
8509 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8510 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
8511 | false, /* isInfallible. False in setters. */ | |||
8512 | false, /* isMovable. Not relevant for setters. */ | |||
8513 | false, /* isEliminatable. Not relevant for setters. */ | |||
8514 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8515 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8516 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8517 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8518 | }; | |||
8519 | ||||
8520 | MOZ_CAN_RUN_SCRIPT static bool | |||
8521 | receiveNullableSequenceOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8522 | { | |||
8523 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8526( cx, "TestExampleInterface" , "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8524 | "TestExampleInterface", "receiveNullableSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8526( cx, "TestExampleInterface" , "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8525 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8526( cx, "TestExampleInterface" , "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8526 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8526( cx, "TestExampleInterface" , "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8527 | ||||
8528 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8529 | Nullable<nsTArray<Nullable<int32_t>>> result; | |||
8530 | // NOTE: This assert does NOT call the function. | |||
8531 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableSequenceOfNullableInts(result))>, "Should be returning void here"); | |||
8532 | MOZ_KnownLive(self)(self)->ReceiveNullableSequenceOfNullableInts(result); | |||
8533 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8533); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8533; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8534 | ||||
8535 | if (result.IsNull()) { | |||
8536 | args.rval().setNull(); | |||
8537 | return true; | |||
8538 | } | |||
8539 | ||||
8540 | uint32_t length = result.Value().Length(); | |||
8541 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8542 | if (!returnArray) { | |||
8543 | return false; | |||
8544 | } | |||
8545 | // Scope for 'tmp' | |||
8546 | { | |||
8547 | JS::Rooted<JS::Value> tmp(cx); | |||
8548 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8549 | // Control block to let us common up the JS_DefineElement calls when there | |||
8550 | // are different ways to succeed at wrapping the object. | |||
8551 | do { | |||
8552 | if (result.Value()[sequenceIdx0].IsNull()) { | |||
8553 | tmp.setNull(); | |||
8554 | break; | |||
8555 | } | |||
8556 | tmp.setInt32(int32_t(result.Value()[sequenceIdx0].Value())); | |||
8557 | break; | |||
8558 | } while (false); | |||
8559 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8560 | JSPROP_ENUMERATE)) { | |||
8561 | return false; | |||
8562 | } | |||
8563 | } | |||
8564 | } | |||
8565 | args.rval().setObject(*returnArray); | |||
8566 | return true; | |||
8567 | } | |||
8568 | ||||
8569 | static const JSJitInfo receiveNullableSequenceOfNullableInts_methodinfo = { | |||
8570 | { (JSJitGetterOp)receiveNullableSequenceOfNullableInts }, | |||
8571 | { prototypes::id::TestExampleInterface }, | |||
8572 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8573 | JSJitInfo::Method, | |||
8574 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8575 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
8576 | false, /* isInfallible. False in setters. */ | |||
8577 | false, /* isMovable. Not relevant for setters. */ | |||
8578 | false, /* isEliminatable. Not relevant for setters. */ | |||
8579 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8580 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8581 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8582 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8583 | }; | |||
8584 | ||||
8585 | MOZ_CAN_RUN_SCRIPT static bool | |||
8586 | passSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8587 | { | |||
8588 | BindingCallContext cx(cx_, "TestExampleInterface.passSequence"); | |||
8589 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8592( cx, "TestExampleInterface" , "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8590 | "TestExampleInterface", "passSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8592( cx, "TestExampleInterface" , "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8591 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8592( cx, "TestExampleInterface" , "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8592 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8592( cx, "TestExampleInterface" , "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
8593 | ||||
8594 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8595 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequence", 1)) { | |||
8596 | return false; | |||
8597 | } | |||
8598 | binding_detail::AutoSequence<int32_t> arg0; | |||
8599 | if (args[0].isObject()) { | |||
8600 | JS::ForOfIterator iter(cx); | |||
8601 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
8602 | return false; | |||
8603 | } | |||
8604 | if (!iter.valueIsIterable()) { | |||
8605 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8606 | return false; | |||
8607 | } | |||
8608 | binding_detail::AutoSequence<int32_t> &arr = arg0; | |||
8609 | JS::Rooted<JS::Value> temp(cx); | |||
8610 | while (true) { | |||
8611 | bool done; | |||
8612 | if (!iter.next(&temp, &done)) { | |||
8613 | return false; | |||
8614 | } | |||
8615 | if (done) { | |||
8616 | break; | |||
8617 | } | |||
8618 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | |||
8619 | if (!slotPtr) { | |||
8620 | JS_ReportOutOfMemory(cx); | |||
8621 | return false; | |||
8622 | } | |||
8623 | int32_t& slot = *slotPtr; | |||
8624 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | |||
8625 | return false; | |||
8626 | } | |||
8627 | } | |||
8628 | } else { | |||
8629 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8630 | return false; | |||
8631 | } | |||
8632 | // NOTE: This assert does NOT call the function. | |||
8633 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequence(Constify(arg0)))>, "Should be returning void here"); | |||
8634 | MOZ_KnownLive(self)(self)->PassSequence(Constify(arg0)); | |||
8635 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8635); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8635; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8636 | args.rval().setUndefined(); | |||
8637 | return true; | |||
8638 | } | |||
8639 | ||||
8640 | static const JSJitInfo passSequence_methodinfo = { | |||
8641 | { (JSJitGetterOp)passSequence }, | |||
8642 | { prototypes::id::TestExampleInterface }, | |||
8643 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8644 | JSJitInfo::Method, | |||
8645 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8646 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
8647 | false, /* isInfallible. False in setters. */ | |||
8648 | false, /* isMovable. Not relevant for setters. */ | |||
8649 | false, /* isEliminatable. Not relevant for setters. */ | |||
8650 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8651 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8652 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8653 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8654 | }; | |||
8655 | ||||
8656 | MOZ_CAN_RUN_SCRIPT static bool | |||
8657 | passNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8658 | { | |||
8659 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableSequence"); | |||
8660 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8663( cx, "TestExampleInterface" , "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8661 | "TestExampleInterface", "passNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8663( cx, "TestExampleInterface" , "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8662 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8663( cx, "TestExampleInterface" , "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
8663 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8663( cx, "TestExampleInterface" , "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
8664 | ||||
8665 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8666 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableSequence", 1)) { | |||
8667 | return false; | |||
8668 | } | |||
8669 | Nullable<Sequence<int32_t>> arg0; | |||
8670 | if (args[0].isObject()) { | |||
8671 | JS::ForOfIterator iter(cx); | |||
8672 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
8673 | return false; | |||
8674 | } | |||
8675 | if (!iter.valueIsIterable()) { | |||
8676 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8677 | return false; | |||
8678 | } | |||
8679 | Sequence<int32_t> &arr = arg0.SetValue(); | |||
8680 | JS::Rooted<JS::Value> temp(cx); | |||
8681 | while (true) { | |||
8682 | bool done; | |||
8683 | if (!iter.next(&temp, &done)) { | |||
8684 | return false; | |||
8685 | } | |||
8686 | if (done) { | |||
8687 | break; | |||
8688 | } | |||
8689 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | |||
8690 | if (!slotPtr) { | |||
8691 | JS_ReportOutOfMemory(cx); | |||
8692 | return false; | |||
8693 | } | |||
8694 | int32_t& slot = *slotPtr; | |||
8695 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | |||
8696 | return false; | |||
8697 | } | |||
8698 | } | |||
8699 | } else if (args[0].isNullOrUndefined()) { | |||
8700 | arg0.SetNull(); | |||
8701 | } else { | |||
8702 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8703 | return false; | |||
8704 | } | |||
8705 | // NOTE: This assert does NOT call the function. | |||
8706 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequence(Constify(arg0)))>, "Should be returning void here"); | |||
8707 | MOZ_KnownLive(self)(self)->PassNullableSequence(Constify(arg0)); | |||
8708 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8708); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8708; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8709 | args.rval().setUndefined(); | |||
8710 | return true; | |||
8711 | } | |||
8712 | ||||
8713 | static const JSJitInfo passNullableSequence_methodinfo = { | |||
8714 | { (JSJitGetterOp)passNullableSequence }, | |||
8715 | { prototypes::id::TestExampleInterface }, | |||
8716 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8717 | JSJitInfo::Method, | |||
8718 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8719 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
8720 | false, /* isInfallible. False in setters. */ | |||
8721 | false, /* isMovable. Not relevant for setters. */ | |||
8722 | false, /* isEliminatable. Not relevant for setters. */ | |||
8723 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8724 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8725 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8726 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8727 | }; | |||
8728 | ||||
8729 | MOZ_CAN_RUN_SCRIPT static bool | |||
8730 | passSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8731 | { | |||
8732 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfNullableInts"); | |||
8733 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8736( cx, "TestExampleInterface" , "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8734 | "TestExampleInterface", "passSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8736( cx, "TestExampleInterface" , "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8735 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8736( cx, "TestExampleInterface" , "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8736 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8736( cx, "TestExampleInterface" , "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8737 | ||||
8738 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8739 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfNullableInts", 1)) { | |||
8740 | return false; | |||
8741 | } | |||
8742 | binding_detail::AutoSequence<Nullable<int32_t>> arg0; | |||
8743 | if (args[0].isObject()) { | |||
8744 | JS::ForOfIterator iter(cx); | |||
8745 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
8746 | return false; | |||
8747 | } | |||
8748 | if (!iter.valueIsIterable()) { | |||
8749 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8750 | return false; | |||
8751 | } | |||
8752 | binding_detail::AutoSequence<Nullable<int32_t>> &arr = arg0; | |||
8753 | JS::Rooted<JS::Value> temp(cx); | |||
8754 | while (true) { | |||
8755 | bool done; | |||
8756 | if (!iter.next(&temp, &done)) { | |||
8757 | return false; | |||
8758 | } | |||
8759 | if (done) { | |||
8760 | break; | |||
8761 | } | |||
8762 | Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
8763 | if (!slotPtr) { | |||
8764 | JS_ReportOutOfMemory(cx); | |||
8765 | return false; | |||
8766 | } | |||
8767 | Nullable<int32_t>& slot = *slotPtr; | |||
8768 | if (temp.isNullOrUndefined()) { | |||
8769 | slot.SetNull(); | |||
8770 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) { | |||
8771 | return false; | |||
8772 | } | |||
8773 | } | |||
8774 | } else { | |||
8775 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8776 | return false; | |||
8777 | } | |||
8778 | // NOTE: This assert does NOT call the function. | |||
8779 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableInts(Constify(arg0)))>, "Should be returning void here"); | |||
8780 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableInts(Constify(arg0)); | |||
8781 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8781); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8781; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8782 | args.rval().setUndefined(); | |||
8783 | return true; | |||
8784 | } | |||
8785 | ||||
8786 | static const JSJitInfo passSequenceOfNullableInts_methodinfo = { | |||
8787 | { (JSJitGetterOp)passSequenceOfNullableInts }, | |||
8788 | { prototypes::id::TestExampleInterface }, | |||
8789 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8790 | JSJitInfo::Method, | |||
8791 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8792 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
8793 | false, /* isInfallible. False in setters. */ | |||
8794 | false, /* isMovable. Not relevant for setters. */ | |||
8795 | false, /* isEliminatable. Not relevant for setters. */ | |||
8796 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8797 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8798 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8799 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8800 | }; | |||
8801 | ||||
8802 | MOZ_CAN_RUN_SCRIPT static bool | |||
8803 | passOptionalSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8804 | { | |||
8805 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalSequenceOfNullableInts"); | |||
8806 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8809( cx, "TestExampleInterface" , "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8807 | "TestExampleInterface", "passOptionalSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8809( cx, "TestExampleInterface" , "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8808 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8809( cx, "TestExampleInterface" , "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8809 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8809( cx, "TestExampleInterface" , "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8810 | ||||
8811 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8812 | Optional<Sequence<Nullable<int32_t>>> arg0; | |||
8813 | if (args.hasDefined(0)) { | |||
8814 | arg0.Construct(); | |||
8815 | if (args[0].isObject()) { | |||
8816 | JS::ForOfIterator iter(cx); | |||
8817 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
8818 | return false; | |||
8819 | } | |||
8820 | if (!iter.valueIsIterable()) { | |||
8821 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8822 | return false; | |||
8823 | } | |||
8824 | Sequence<Nullable<int32_t>> &arr = arg0.Value(); | |||
8825 | JS::Rooted<JS::Value> temp(cx); | |||
8826 | while (true) { | |||
8827 | bool done; | |||
8828 | if (!iter.next(&temp, &done)) { | |||
8829 | return false; | |||
8830 | } | |||
8831 | if (done) { | |||
8832 | break; | |||
8833 | } | |||
8834 | Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
8835 | if (!slotPtr) { | |||
8836 | JS_ReportOutOfMemory(cx); | |||
8837 | return false; | |||
8838 | } | |||
8839 | Nullable<int32_t>& slot = *slotPtr; | |||
8840 | if (temp.isNullOrUndefined()) { | |||
8841 | slot.SetNull(); | |||
8842 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) { | |||
8843 | return false; | |||
8844 | } | |||
8845 | } | |||
8846 | } else { | |||
8847 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8848 | return false; | |||
8849 | } | |||
8850 | } | |||
8851 | // NOTE: This assert does NOT call the function. | |||
8852 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceOfNullableInts(Constify(arg0)))>, "Should be returning void here"); | |||
8853 | MOZ_KnownLive(self)(self)->PassOptionalSequenceOfNullableInts(Constify(arg0)); | |||
8854 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8854); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8854; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8855 | args.rval().setUndefined(); | |||
8856 | return true; | |||
8857 | } | |||
8858 | ||||
8859 | static const JSJitInfo passOptionalSequenceOfNullableInts_methodinfo = { | |||
8860 | { (JSJitGetterOp)passOptionalSequenceOfNullableInts }, | |||
8861 | { prototypes::id::TestExampleInterface }, | |||
8862 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8863 | JSJitInfo::Method, | |||
8864 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8865 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
8866 | false, /* isInfallible. False in setters. */ | |||
8867 | false, /* isMovable. Not relevant for setters. */ | |||
8868 | false, /* isEliminatable. Not relevant for setters. */ | |||
8869 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8870 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8871 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8872 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8873 | }; | |||
8874 | ||||
8875 | MOZ_CAN_RUN_SCRIPT static bool | |||
8876 | passOptionalNullableSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8877 | { | |||
8878 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceOfNullableInts"); | |||
8879 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8882( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8880 | "TestExampleInterface", "passOptionalNullableSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8882( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8881 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8882( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8882 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8882( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8883 | ||||
8884 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8885 | Optional<Nullable<Sequence<Nullable<int32_t>>>> arg0; | |||
8886 | if (args.hasDefined(0)) { | |||
8887 | arg0.Construct(); | |||
8888 | if (args[0].isObject()) { | |||
8889 | JS::ForOfIterator iter(cx); | |||
8890 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
8891 | return false; | |||
8892 | } | |||
8893 | if (!iter.valueIsIterable()) { | |||
8894 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8895 | return false; | |||
8896 | } | |||
8897 | Sequence<Nullable<int32_t>> &arr = arg0.Value().SetValue(); | |||
8898 | JS::Rooted<JS::Value> temp(cx); | |||
8899 | while (true) { | |||
8900 | bool done; | |||
8901 | if (!iter.next(&temp, &done)) { | |||
8902 | return false; | |||
8903 | } | |||
8904 | if (done) { | |||
8905 | break; | |||
8906 | } | |||
8907 | Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
8908 | if (!slotPtr) { | |||
8909 | JS_ReportOutOfMemory(cx); | |||
8910 | return false; | |||
8911 | } | |||
8912 | Nullable<int32_t>& slot = *slotPtr; | |||
8913 | if (temp.isNullOrUndefined()) { | |||
8914 | slot.SetNull(); | |||
8915 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) { | |||
8916 | return false; | |||
8917 | } | |||
8918 | } | |||
8919 | } else if (args[0].isNullOrUndefined()) { | |||
8920 | arg0.Value().SetNull(); | |||
8921 | } else { | |||
8922 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
8923 | return false; | |||
8924 | } | |||
8925 | } | |||
8926 | // NOTE: This assert does NOT call the function. | |||
8927 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableInts(Constify(arg0)))>, "Should be returning void here"); | |||
8928 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableInts(Constify(arg0)); | |||
8929 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8929); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8929; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8930 | args.rval().setUndefined(); | |||
8931 | return true; | |||
8932 | } | |||
8933 | ||||
8934 | static const JSJitInfo passOptionalNullableSequenceOfNullableInts_methodinfo = { | |||
8935 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableInts }, | |||
8936 | { prototypes::id::TestExampleInterface }, | |||
8937 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8938 | JSJitInfo::Method, | |||
8939 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8940 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
8941 | false, /* isInfallible. False in setters. */ | |||
8942 | false, /* isMovable. Not relevant for setters. */ | |||
8943 | false, /* isEliminatable. Not relevant for setters. */ | |||
8944 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
8945 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
8946 | false, /* isTypedMethod. Only relevant for methods. */ | |||
8947 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
8948 | }; | |||
8949 | ||||
8950 | MOZ_CAN_RUN_SCRIPT static bool | |||
8951 | receiveCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
8952 | { | |||
8953 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8956( cx, "TestExampleInterface" , "receiveCastableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8954 | "TestExampleInterface", "receiveCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8956( cx, "TestExampleInterface" , "receiveCastableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8955 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8956( cx, "TestExampleInterface" , "receiveCastableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
8956 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8956( cx, "TestExampleInterface" , "receiveCastableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
8957 | ||||
8958 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
8959 | nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>> result; | |||
8960 | // NOTE: This assert does NOT call the function. | |||
8961 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveCastableObjectSequence(result))>, "Should be returning void here"); | |||
8962 | MOZ_KnownLive(self)(self)->ReceiveCastableObjectSequence(result); | |||
8963 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8963); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 8963; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
8964 | ||||
8965 | uint32_t length = result.Length(); | |||
8966 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
8967 | if (!returnArray) { | |||
8968 | return false; | |||
8969 | } | |||
8970 | // Scope for 'tmp' | |||
8971 | { | |||
8972 | JS::Rooted<JS::Value> tmp(cx); | |||
8973 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
8974 | // Control block to let us common up the JS_DefineElement calls when there | |||
8975 | // are different ways to succeed at wrapping the object. | |||
8976 | do { | |||
8977 | if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) { | |||
8978 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 8978); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 8978; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
8979 | return false; | |||
8980 | } | |||
8981 | break; | |||
8982 | } while (false); | |||
8983 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
8984 | JSPROP_ENUMERATE)) { | |||
8985 | return false; | |||
8986 | } | |||
8987 | } | |||
8988 | } | |||
8989 | args.rval().setObject(*returnArray); | |||
8990 | return true; | |||
8991 | } | |||
8992 | ||||
8993 | static const JSJitInfo receiveCastableObjectSequence_methodinfo = { | |||
8994 | { (JSJitGetterOp)receiveCastableObjectSequence }, | |||
8995 | { prototypes::id::TestExampleInterface }, | |||
8996 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
8997 | JSJitInfo::Method, | |||
8998 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
8999 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
9000 | false, /* isInfallible. False in setters. */ | |||
9001 | false, /* isMovable. Not relevant for setters. */ | |||
9002 | false, /* isEliminatable. Not relevant for setters. */ | |||
9003 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9004 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9005 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9006 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9007 | }; | |||
9008 | ||||
9009 | MOZ_CAN_RUN_SCRIPT static bool | |||
9010 | receiveCallbackObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9011 | { | |||
9012 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9015( cx, "TestExampleInterface" , "receiveCallbackObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9013 | "TestExampleInterface", "receiveCallbackObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9015( cx, "TestExampleInterface" , "receiveCallbackObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9014 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9015( cx, "TestExampleInterface" , "receiveCallbackObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9015 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9015( cx, "TestExampleInterface" , "receiveCallbackObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9016 | ||||
9017 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9018 | nsTArray<StrongPtrForMember<mozilla::dom::TestCallbackInterface>> result; | |||
9019 | // NOTE: This assert does NOT call the function. | |||
9020 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveCallbackObjectSequence(result))>, "Should be returning void here"); | |||
9021 | MOZ_KnownLive(self)(self)->ReceiveCallbackObjectSequence(result); | |||
9022 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9022); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9022; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9023 | ||||
9024 | uint32_t length = result.Length(); | |||
9025 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9026 | if (!returnArray) { | |||
9027 | return false; | |||
9028 | } | |||
9029 | // Scope for 'tmp' | |||
9030 | { | |||
9031 | JS::Rooted<JS::Value> tmp(cx); | |||
9032 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9033 | // Control block to let us common up the JS_DefineElement calls when there | |||
9034 | // are different ways to succeed at wrapping the object. | |||
9035 | do { | |||
9036 | tmp.setObjectOrNull(GetCallbackFromCallbackObject(cx, result[sequenceIdx0])); | |||
9037 | if (!MaybeWrapObjectValue(cx, &tmp)) { | |||
9038 | return false; | |||
9039 | } | |||
9040 | break; | |||
9041 | } while (false); | |||
9042 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9043 | JSPROP_ENUMERATE)) { | |||
9044 | return false; | |||
9045 | } | |||
9046 | } | |||
9047 | } | |||
9048 | args.rval().setObject(*returnArray); | |||
9049 | return true; | |||
9050 | } | |||
9051 | ||||
9052 | static const JSJitInfo receiveCallbackObjectSequence_methodinfo = { | |||
9053 | { (JSJitGetterOp)receiveCallbackObjectSequence }, | |||
9054 | { prototypes::id::TestExampleInterface }, | |||
9055 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9056 | JSJitInfo::Method, | |||
9057 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9058 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
9059 | false, /* isInfallible. False in setters. */ | |||
9060 | false, /* isMovable. Not relevant for setters. */ | |||
9061 | false, /* isEliminatable. Not relevant for setters. */ | |||
9062 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9063 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9064 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9065 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9066 | }; | |||
9067 | ||||
9068 | MOZ_CAN_RUN_SCRIPT static bool | |||
9069 | receiveNullableCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9070 | { | |||
9071 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9074( cx, "TestExampleInterface" , "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9072 | "TestExampleInterface", "receiveNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9074( cx, "TestExampleInterface" , "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9073 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9074( cx, "TestExampleInterface" , "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9074 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9074( cx, "TestExampleInterface" , "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9075 | ||||
9076 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9077 | nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>> result; | |||
9078 | // NOTE: This assert does NOT call the function. | |||
9079 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectSequence(result))>, "Should be returning void here"); | |||
9080 | MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectSequence(result); | |||
9081 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9081); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9081; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9082 | ||||
9083 | uint32_t length = result.Length(); | |||
9084 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9085 | if (!returnArray) { | |||
9086 | return false; | |||
9087 | } | |||
9088 | // Scope for 'tmp' | |||
9089 | { | |||
9090 | JS::Rooted<JS::Value> tmp(cx); | |||
9091 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9092 | // Control block to let us common up the JS_DefineElement calls when there | |||
9093 | // are different ways to succeed at wrapping the object. | |||
9094 | do { | |||
9095 | if (!result[sequenceIdx0]) { | |||
9096 | tmp.setNull(); | |||
9097 | break; | |||
9098 | } | |||
9099 | if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) { | |||
9100 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9100); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 9100; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
9101 | return false; | |||
9102 | } | |||
9103 | break; | |||
9104 | } while (false); | |||
9105 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9106 | JSPROP_ENUMERATE)) { | |||
9107 | return false; | |||
9108 | } | |||
9109 | } | |||
9110 | } | |||
9111 | args.rval().setObject(*returnArray); | |||
9112 | return true; | |||
9113 | } | |||
9114 | ||||
9115 | static const JSJitInfo receiveNullableCastableObjectSequence_methodinfo = { | |||
9116 | { (JSJitGetterOp)receiveNullableCastableObjectSequence }, | |||
9117 | { prototypes::id::TestExampleInterface }, | |||
9118 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9119 | JSJitInfo::Method, | |||
9120 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9121 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
9122 | false, /* isInfallible. False in setters. */ | |||
9123 | false, /* isMovable. Not relevant for setters. */ | |||
9124 | false, /* isEliminatable. Not relevant for setters. */ | |||
9125 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9126 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9127 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9128 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9129 | }; | |||
9130 | ||||
9131 | MOZ_CAN_RUN_SCRIPT static bool | |||
9132 | receiveNullableCallbackObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9133 | { | |||
9134 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9137( cx, "TestExampleInterface" , "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9135 | "TestExampleInterface", "receiveNullableCallbackObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9137( cx, "TestExampleInterface" , "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9136 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9137( cx, "TestExampleInterface" , "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9137 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9137( cx, "TestExampleInterface" , "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9138 | ||||
9139 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9140 | nsTArray<StrongPtrForMember<mozilla::dom::TestCallbackInterface>> result; | |||
9141 | // NOTE: This assert does NOT call the function. | |||
9142 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableCallbackObjectSequence(result))>, "Should be returning void here"); | |||
9143 | MOZ_KnownLive(self)(self)->ReceiveNullableCallbackObjectSequence(result); | |||
9144 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9144); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9144; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9145 | ||||
9146 | uint32_t length = result.Length(); | |||
9147 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9148 | if (!returnArray) { | |||
9149 | return false; | |||
9150 | } | |||
9151 | // Scope for 'tmp' | |||
9152 | { | |||
9153 | JS::Rooted<JS::Value> tmp(cx); | |||
9154 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9155 | // Control block to let us common up the JS_DefineElement calls when there | |||
9156 | // are different ways to succeed at wrapping the object. | |||
9157 | do { | |||
9158 | if (result[sequenceIdx0]) { | |||
9159 | tmp.setObjectOrNull(GetCallbackFromCallbackObject(cx, result[sequenceIdx0])); | |||
9160 | if (!MaybeWrapObjectOrNullValue(cx, &tmp)) { | |||
9161 | return false; | |||
9162 | } | |||
9163 | break; | |||
9164 | } else { | |||
9165 | tmp.setNull(); | |||
9166 | break; | |||
9167 | } | |||
9168 | } while (false); | |||
9169 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9170 | JSPROP_ENUMERATE)) { | |||
9171 | return false; | |||
9172 | } | |||
9173 | } | |||
9174 | } | |||
9175 | args.rval().setObject(*returnArray); | |||
9176 | return true; | |||
9177 | } | |||
9178 | ||||
9179 | static const JSJitInfo receiveNullableCallbackObjectSequence_methodinfo = { | |||
9180 | { (JSJitGetterOp)receiveNullableCallbackObjectSequence }, | |||
9181 | { prototypes::id::TestExampleInterface }, | |||
9182 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9183 | JSJitInfo::Method, | |||
9184 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9185 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
9186 | false, /* isInfallible. False in setters. */ | |||
9187 | false, /* isMovable. Not relevant for setters. */ | |||
9188 | false, /* isEliminatable. Not relevant for setters. */ | |||
9189 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9190 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9191 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9192 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9193 | }; | |||
9194 | ||||
9195 | MOZ_CAN_RUN_SCRIPT static bool | |||
9196 | receiveCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9197 | { | |||
9198 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9201( cx, "TestExampleInterface" , "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9199 | "TestExampleInterface", "receiveCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9201( cx, "TestExampleInterface" , "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9200 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9201( cx, "TestExampleInterface" , "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9201 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9201( cx, "TestExampleInterface" , "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9202 | ||||
9203 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9204 | Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>>> result; | |||
9205 | // NOTE: This assert does NOT call the function. | |||
9206 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveCastableObjectNullableSequence(result))>, "Should be returning void here"); | |||
9207 | MOZ_KnownLive(self)(self)->ReceiveCastableObjectNullableSequence(result); | |||
9208 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9208); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9208; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9209 | ||||
9210 | if (result.IsNull()) { | |||
9211 | args.rval().setNull(); | |||
9212 | return true; | |||
9213 | } | |||
9214 | ||||
9215 | uint32_t length = result.Value().Length(); | |||
9216 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9217 | if (!returnArray) { | |||
9218 | return false; | |||
9219 | } | |||
9220 | // Scope for 'tmp' | |||
9221 | { | |||
9222 | JS::Rooted<JS::Value> tmp(cx); | |||
9223 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9224 | // Control block to let us common up the JS_DefineElement calls when there | |||
9225 | // are different ways to succeed at wrapping the object. | |||
9226 | do { | |||
9227 | if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) { | |||
9228 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9228); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 9228; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
9229 | return false; | |||
9230 | } | |||
9231 | break; | |||
9232 | } while (false); | |||
9233 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9234 | JSPROP_ENUMERATE)) { | |||
9235 | return false; | |||
9236 | } | |||
9237 | } | |||
9238 | } | |||
9239 | args.rval().setObject(*returnArray); | |||
9240 | return true; | |||
9241 | } | |||
9242 | ||||
9243 | static const JSJitInfo receiveCastableObjectNullableSequence_methodinfo = { | |||
9244 | { (JSJitGetterOp)receiveCastableObjectNullableSequence }, | |||
9245 | { prototypes::id::TestExampleInterface }, | |||
9246 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9247 | JSJitInfo::Method, | |||
9248 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9249 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
9250 | false, /* isInfallible. False in setters. */ | |||
9251 | false, /* isMovable. Not relevant for setters. */ | |||
9252 | false, /* isEliminatable. Not relevant for setters. */ | |||
9253 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9254 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9255 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9256 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9257 | }; | |||
9258 | ||||
9259 | MOZ_CAN_RUN_SCRIPT static bool | |||
9260 | receiveNullableCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9261 | { | |||
9262 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9265( cx, "TestExampleInterface" , "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9263 | "TestExampleInterface", "receiveNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9265( cx, "TestExampleInterface" , "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9264 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9265( cx, "TestExampleInterface" , "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9265 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9265( cx, "TestExampleInterface" , "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9266 | ||||
9267 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9268 | Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>>> result; | |||
9269 | // NOTE: This assert does NOT call the function. | |||
9270 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectNullableSequence(result))>, "Should be returning void here"); | |||
9271 | MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectNullableSequence(result); | |||
9272 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9272); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9272; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9273 | ||||
9274 | if (result.IsNull()) { | |||
9275 | args.rval().setNull(); | |||
9276 | return true; | |||
9277 | } | |||
9278 | ||||
9279 | uint32_t length = result.Value().Length(); | |||
9280 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9281 | if (!returnArray) { | |||
9282 | return false; | |||
9283 | } | |||
9284 | // Scope for 'tmp' | |||
9285 | { | |||
9286 | JS::Rooted<JS::Value> tmp(cx); | |||
9287 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9288 | // Control block to let us common up the JS_DefineElement calls when there | |||
9289 | // are different ways to succeed at wrapping the object. | |||
9290 | do { | |||
9291 | if (!result.Value()[sequenceIdx0]) { | |||
9292 | tmp.setNull(); | |||
9293 | break; | |||
9294 | } | |||
9295 | if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) { | |||
9296 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9296); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 9296; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
9297 | return false; | |||
9298 | } | |||
9299 | break; | |||
9300 | } while (false); | |||
9301 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9302 | JSPROP_ENUMERATE)) { | |||
9303 | return false; | |||
9304 | } | |||
9305 | } | |||
9306 | } | |||
9307 | args.rval().setObject(*returnArray); | |||
9308 | return true; | |||
9309 | } | |||
9310 | ||||
9311 | static const JSJitInfo receiveNullableCastableObjectNullableSequence_methodinfo = { | |||
9312 | { (JSJitGetterOp)receiveNullableCastableObjectNullableSequence }, | |||
9313 | { prototypes::id::TestExampleInterface }, | |||
9314 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9315 | JSJitInfo::Method, | |||
9316 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9317 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
9318 | false, /* isInfallible. False in setters. */ | |||
9319 | false, /* isMovable. Not relevant for setters. */ | |||
9320 | false, /* isEliminatable. Not relevant for setters. */ | |||
9321 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9322 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9323 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9324 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9325 | }; | |||
9326 | ||||
9327 | MOZ_CAN_RUN_SCRIPT static bool | |||
9328 | receiveWeakCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9329 | { | |||
9330 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9333( cx, "TestExampleInterface" , "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9331 | "TestExampleInterface", "receiveWeakCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9333( cx, "TestExampleInterface" , "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9332 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9333( cx, "TestExampleInterface" , "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9333 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9333( cx, "TestExampleInterface" , "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9334 | ||||
9335 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9336 | nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>> result; | |||
9337 | // NOTE: This assert does NOT call the function. | |||
9338 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectSequence(result))>, "Should be returning void here"); | |||
9339 | MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectSequence(result); | |||
9340 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9340); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9340; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9341 | ||||
9342 | uint32_t length = result.Length(); | |||
9343 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9344 | if (!returnArray) { | |||
9345 | return false; | |||
9346 | } | |||
9347 | // Scope for 'tmp' | |||
9348 | { | |||
9349 | JS::Rooted<JS::Value> tmp(cx); | |||
9350 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9351 | // Control block to let us common up the JS_DefineElement calls when there | |||
9352 | // are different ways to succeed at wrapping the object. | |||
9353 | do { | |||
9354 | if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) { | |||
9355 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9355); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 9355; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
9356 | return false; | |||
9357 | } | |||
9358 | break; | |||
9359 | } while (false); | |||
9360 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9361 | JSPROP_ENUMERATE)) { | |||
9362 | return false; | |||
9363 | } | |||
9364 | } | |||
9365 | } | |||
9366 | args.rval().setObject(*returnArray); | |||
9367 | return true; | |||
9368 | } | |||
9369 | ||||
9370 | static const JSJitInfo receiveWeakCastableObjectSequence_methodinfo = { | |||
9371 | { (JSJitGetterOp)receiveWeakCastableObjectSequence }, | |||
9372 | { prototypes::id::TestExampleInterface }, | |||
9373 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9374 | JSJitInfo::Method, | |||
9375 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9376 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
9377 | false, /* isInfallible. False in setters. */ | |||
9378 | false, /* isMovable. Not relevant for setters. */ | |||
9379 | false, /* isEliminatable. Not relevant for setters. */ | |||
9380 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9381 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9382 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9383 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9384 | }; | |||
9385 | ||||
9386 | MOZ_CAN_RUN_SCRIPT static bool | |||
9387 | receiveWeakNullableCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9388 | { | |||
9389 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9392( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9390 | "TestExampleInterface", "receiveWeakNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9392( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9391 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9392( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9392 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9392( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9393 | ||||
9394 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9395 | nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>> result; | |||
9396 | // NOTE: This assert does NOT call the function. | |||
9397 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectSequence(result))>, "Should be returning void here"); | |||
9398 | MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectSequence(result); | |||
9399 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9399); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9399; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9400 | ||||
9401 | uint32_t length = result.Length(); | |||
9402 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9403 | if (!returnArray) { | |||
9404 | return false; | |||
9405 | } | |||
9406 | // Scope for 'tmp' | |||
9407 | { | |||
9408 | JS::Rooted<JS::Value> tmp(cx); | |||
9409 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9410 | // Control block to let us common up the JS_DefineElement calls when there | |||
9411 | // are different ways to succeed at wrapping the object. | |||
9412 | do { | |||
9413 | if (!result[sequenceIdx0]) { | |||
9414 | tmp.setNull(); | |||
9415 | break; | |||
9416 | } | |||
9417 | if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) { | |||
9418 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9418); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 9418; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
9419 | return false; | |||
9420 | } | |||
9421 | break; | |||
9422 | } while (false); | |||
9423 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9424 | JSPROP_ENUMERATE)) { | |||
9425 | return false; | |||
9426 | } | |||
9427 | } | |||
9428 | } | |||
9429 | args.rval().setObject(*returnArray); | |||
9430 | return true; | |||
9431 | } | |||
9432 | ||||
9433 | static const JSJitInfo receiveWeakNullableCastableObjectSequence_methodinfo = { | |||
9434 | { (JSJitGetterOp)receiveWeakNullableCastableObjectSequence }, | |||
9435 | { prototypes::id::TestExampleInterface }, | |||
9436 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9437 | JSJitInfo::Method, | |||
9438 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9439 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
9440 | false, /* isInfallible. False in setters. */ | |||
9441 | false, /* isMovable. Not relevant for setters. */ | |||
9442 | false, /* isEliminatable. Not relevant for setters. */ | |||
9443 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9444 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9445 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9446 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9447 | }; | |||
9448 | ||||
9449 | MOZ_CAN_RUN_SCRIPT static bool | |||
9450 | receiveWeakCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9451 | { | |||
9452 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9455( cx, "TestExampleInterface" , "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9453 | "TestExampleInterface", "receiveWeakCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9455( cx, "TestExampleInterface" , "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9454 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9455( cx, "TestExampleInterface" , "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9455 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9455( cx, "TestExampleInterface" , "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9456 | ||||
9457 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9458 | Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>>> result; | |||
9459 | // NOTE: This assert does NOT call the function. | |||
9460 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectNullableSequence(result))>, "Should be returning void here"); | |||
9461 | MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectNullableSequence(result); | |||
9462 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9462); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9462; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9463 | ||||
9464 | if (result.IsNull()) { | |||
9465 | args.rval().setNull(); | |||
9466 | return true; | |||
9467 | } | |||
9468 | ||||
9469 | uint32_t length = result.Value().Length(); | |||
9470 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9471 | if (!returnArray) { | |||
9472 | return false; | |||
9473 | } | |||
9474 | // Scope for 'tmp' | |||
9475 | { | |||
9476 | JS::Rooted<JS::Value> tmp(cx); | |||
9477 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9478 | // Control block to let us common up the JS_DefineElement calls when there | |||
9479 | // are different ways to succeed at wrapping the object. | |||
9480 | do { | |||
9481 | if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) { | |||
9482 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9482); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 9482; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
9483 | return false; | |||
9484 | } | |||
9485 | break; | |||
9486 | } while (false); | |||
9487 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9488 | JSPROP_ENUMERATE)) { | |||
9489 | return false; | |||
9490 | } | |||
9491 | } | |||
9492 | } | |||
9493 | args.rval().setObject(*returnArray); | |||
9494 | return true; | |||
9495 | } | |||
9496 | ||||
9497 | static const JSJitInfo receiveWeakCastableObjectNullableSequence_methodinfo = { | |||
9498 | { (JSJitGetterOp)receiveWeakCastableObjectNullableSequence }, | |||
9499 | { prototypes::id::TestExampleInterface }, | |||
9500 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9501 | JSJitInfo::Method, | |||
9502 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9503 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
9504 | false, /* isInfallible. False in setters. */ | |||
9505 | false, /* isMovable. Not relevant for setters. */ | |||
9506 | false, /* isEliminatable. Not relevant for setters. */ | |||
9507 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9508 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9509 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9510 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9511 | }; | |||
9512 | ||||
9513 | MOZ_CAN_RUN_SCRIPT static bool | |||
9514 | receiveWeakNullableCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9515 | { | |||
9516 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9519( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9517 | "TestExampleInterface", "receiveWeakNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9519( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9518 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9519( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9519 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9519( cx, "TestExampleInterface" , "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9520 | ||||
9521 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9522 | Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestInterface>>> result; | |||
9523 | // NOTE: This assert does NOT call the function. | |||
9524 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectNullableSequence(result))>, "Should be returning void here"); | |||
9525 | MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectNullableSequence(result); | |||
9526 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9526); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9526; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9527 | ||||
9528 | if (result.IsNull()) { | |||
9529 | args.rval().setNull(); | |||
9530 | return true; | |||
9531 | } | |||
9532 | ||||
9533 | uint32_t length = result.Value().Length(); | |||
9534 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
9535 | if (!returnArray) { | |||
9536 | return false; | |||
9537 | } | |||
9538 | // Scope for 'tmp' | |||
9539 | { | |||
9540 | JS::Rooted<JS::Value> tmp(cx); | |||
9541 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
9542 | // Control block to let us common up the JS_DefineElement calls when there | |||
9543 | // are different ways to succeed at wrapping the object. | |||
9544 | do { | |||
9545 | if (!result.Value()[sequenceIdx0]) { | |||
9546 | tmp.setNull(); | |||
9547 | break; | |||
9548 | } | |||
9549 | if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) { | |||
9550 | MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9550); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile int*)__null) = 9550; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
9551 | return false; | |||
9552 | } | |||
9553 | break; | |||
9554 | } while (false); | |||
9555 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
9556 | JSPROP_ENUMERATE)) { | |||
9557 | return false; | |||
9558 | } | |||
9559 | } | |||
9560 | } | |||
9561 | args.rval().setObject(*returnArray); | |||
9562 | return true; | |||
9563 | } | |||
9564 | ||||
9565 | static const JSJitInfo receiveWeakNullableCastableObjectNullableSequence_methodinfo = { | |||
9566 | { (JSJitGetterOp)receiveWeakNullableCastableObjectNullableSequence }, | |||
9567 | { prototypes::id::TestExampleInterface }, | |||
9568 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9569 | JSJitInfo::Method, | |||
9570 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9571 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
9572 | false, /* isInfallible. False in setters. */ | |||
9573 | false, /* isMovable. Not relevant for setters. */ | |||
9574 | false, /* isEliminatable. Not relevant for setters. */ | |||
9575 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9576 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9577 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9578 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9579 | }; | |||
9580 | ||||
9581 | MOZ_CAN_RUN_SCRIPT static bool | |||
9582 | passCastableObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9583 | { | |||
9584 | BindingCallContext cx(cx_, "TestExampleInterface.passCastableObjectSequence"); | |||
9585 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9588( cx, "TestExampleInterface" , "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9586 | "TestExampleInterface", "passCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9588( cx, "TestExampleInterface" , "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9587 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9588( cx, "TestExampleInterface" , "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9588 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9588( cx, "TestExampleInterface" , "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9589 | ||||
9590 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9591 | if (!args.requireAtLeast(cx, "TestExampleInterface.passCastableObjectSequence", 1)) { | |||
9592 | return false; | |||
9593 | } | |||
9594 | binding_detail::AutoSequence<OwningNonNull<mozilla::dom::TestInterface>> arg0; | |||
9595 | if (args[0].isObject()) { | |||
9596 | JS::ForOfIterator iter(cx); | |||
9597 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
9598 | return false; | |||
9599 | } | |||
9600 | if (!iter.valueIsIterable()) { | |||
9601 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9602 | return false; | |||
9603 | } | |||
9604 | binding_detail::AutoSequence<OwningNonNull<mozilla::dom::TestInterface>> &arr = arg0; | |||
9605 | JS::Rooted<JS::Value> temp(cx); | |||
9606 | while (true) { | |||
9607 | bool done; | |||
9608 | if (!iter.next(&temp, &done)) { | |||
9609 | return false; | |||
9610 | } | |||
9611 | if (done) { | |||
9612 | break; | |||
9613 | } | |||
9614 | OwningNonNull<mozilla::dom::TestInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
9615 | if (!slotPtr) { | |||
9616 | JS_ReportOutOfMemory(cx); | |||
9617 | return false; | |||
9618 | } | |||
9619 | OwningNonNull<mozilla::dom::TestInterface>& slot = *slotPtr; | |||
9620 | if (temp.isObject()) { | |||
9621 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
9622 | { | |||
9623 | // Our JSContext should be in the right global to do unwrapping in. | |||
9624 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
9625 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
9626 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestInterface"); | |||
9627 | return false; | |||
9628 | } | |||
9629 | } | |||
9630 | } else { | |||
9631 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
9632 | return false; | |||
9633 | } | |||
9634 | } | |||
9635 | } else { | |||
9636 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9637 | return false; | |||
9638 | } | |||
9639 | // NOTE: This assert does NOT call the function. | |||
9640 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectSequence(Constify(arg0)))>, "Should be returning void here"); | |||
9641 | MOZ_KnownLive(self)(self)->PassCastableObjectSequence(Constify(arg0)); | |||
9642 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9642); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9642; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9643 | args.rval().setUndefined(); | |||
9644 | return true; | |||
9645 | } | |||
9646 | ||||
9647 | static const JSJitInfo passCastableObjectSequence_methodinfo = { | |||
9648 | { (JSJitGetterOp)passCastableObjectSequence }, | |||
9649 | { prototypes::id::TestExampleInterface }, | |||
9650 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9651 | JSJitInfo::Method, | |||
9652 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9653 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
9654 | false, /* isInfallible. False in setters. */ | |||
9655 | false, /* isMovable. Not relevant for setters. */ | |||
9656 | false, /* isEliminatable. Not relevant for setters. */ | |||
9657 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9658 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9659 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9660 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9661 | }; | |||
9662 | ||||
9663 | MOZ_CAN_RUN_SCRIPT static bool | |||
9664 | passNullableCastableObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9665 | { | |||
9666 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableCastableObjectSequence"); | |||
9667 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9670( cx, "TestExampleInterface" , "passNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9668 | "TestExampleInterface", "passNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9670( cx, "TestExampleInterface" , "passNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9669 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9670( cx, "TestExampleInterface" , "passNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9670 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9670( cx, "TestExampleInterface" , "passNullableCastableObjectSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9671 | ||||
9672 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9673 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableCastableObjectSequence", 1)) { | |||
9674 | return false; | |||
9675 | } | |||
9676 | binding_detail::AutoSequence<RefPtr<mozilla::dom::TestInterface>> arg0; | |||
9677 | if (args[0].isObject()) { | |||
9678 | JS::ForOfIterator iter(cx); | |||
9679 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
9680 | return false; | |||
9681 | } | |||
9682 | if (!iter.valueIsIterable()) { | |||
9683 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9684 | return false; | |||
9685 | } | |||
9686 | binding_detail::AutoSequence<RefPtr<mozilla::dom::TestInterface>> &arr = arg0; | |||
9687 | JS::Rooted<JS::Value> temp(cx); | |||
9688 | while (true) { | |||
9689 | bool done; | |||
9690 | if (!iter.next(&temp, &done)) { | |||
9691 | return false; | |||
9692 | } | |||
9693 | if (done) { | |||
9694 | break; | |||
9695 | } | |||
9696 | RefPtr<mozilla::dom::TestInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
9697 | if (!slotPtr) { | |||
9698 | JS_ReportOutOfMemory(cx); | |||
9699 | return false; | |||
9700 | } | |||
9701 | RefPtr<mozilla::dom::TestInterface>& slot = *slotPtr; | |||
9702 | if (temp.isObject()) { | |||
9703 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
9704 | { | |||
9705 | // Our JSContext should be in the right global to do unwrapping in. | |||
9706 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
9707 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
9708 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestInterface"); | |||
9709 | return false; | |||
9710 | } | |||
9711 | } | |||
9712 | } else if (temp.isNullOrUndefined()) { | |||
9713 | slot = nullptr; | |||
9714 | } else { | |||
9715 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
9716 | return false; | |||
9717 | } | |||
9718 | } | |||
9719 | } else { | |||
9720 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9721 | return false; | |||
9722 | } | |||
9723 | // NOTE: This assert does NOT call the function. | |||
9724 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectSequence(Constify(arg0)))>, "Should be returning void here"); | |||
9725 | MOZ_KnownLive(self)(self)->PassNullableCastableObjectSequence(Constify(arg0)); | |||
9726 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9726); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9726; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9727 | args.rval().setUndefined(); | |||
9728 | return true; | |||
9729 | } | |||
9730 | ||||
9731 | static const JSJitInfo passNullableCastableObjectSequence_methodinfo = { | |||
9732 | { (JSJitGetterOp)passNullableCastableObjectSequence }, | |||
9733 | { prototypes::id::TestExampleInterface }, | |||
9734 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9735 | JSJitInfo::Method, | |||
9736 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9737 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
9738 | false, /* isInfallible. False in setters. */ | |||
9739 | false, /* isMovable. Not relevant for setters. */ | |||
9740 | false, /* isEliminatable. Not relevant for setters. */ | |||
9741 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9742 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9743 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9744 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9745 | }; | |||
9746 | ||||
9747 | MOZ_CAN_RUN_SCRIPT static bool | |||
9748 | passCastableObjectNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9749 | { | |||
9750 | BindingCallContext cx(cx_, "TestExampleInterface.passCastableObjectNullableSequence"); | |||
9751 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9754( cx, "TestExampleInterface" , "passCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9752 | "TestExampleInterface", "passCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9754( cx, "TestExampleInterface" , "passCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9753 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9754( cx, "TestExampleInterface" , "passCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9754 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9754( cx, "TestExampleInterface" , "passCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9755 | ||||
9756 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9757 | if (!args.requireAtLeast(cx, "TestExampleInterface.passCastableObjectNullableSequence", 1)) { | |||
9758 | return false; | |||
9759 | } | |||
9760 | Nullable<Sequence<OwningNonNull<mozilla::dom::TestInterface>>> arg0; | |||
9761 | if (args[0].isObject()) { | |||
9762 | JS::ForOfIterator iter(cx); | |||
9763 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
9764 | return false; | |||
9765 | } | |||
9766 | if (!iter.valueIsIterable()) { | |||
9767 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9768 | return false; | |||
9769 | } | |||
9770 | Sequence<OwningNonNull<mozilla::dom::TestInterface>> &arr = arg0.SetValue(); | |||
9771 | JS::Rooted<JS::Value> temp(cx); | |||
9772 | while (true) { | |||
9773 | bool done; | |||
9774 | if (!iter.next(&temp, &done)) { | |||
9775 | return false; | |||
9776 | } | |||
9777 | if (done) { | |||
9778 | break; | |||
9779 | } | |||
9780 | OwningNonNull<mozilla::dom::TestInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
9781 | if (!slotPtr) { | |||
9782 | JS_ReportOutOfMemory(cx); | |||
9783 | return false; | |||
9784 | } | |||
9785 | OwningNonNull<mozilla::dom::TestInterface>& slot = *slotPtr; | |||
9786 | if (temp.isObject()) { | |||
9787 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
9788 | { | |||
9789 | // Our JSContext should be in the right global to do unwrapping in. | |||
9790 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
9791 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
9792 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestInterface"); | |||
9793 | return false; | |||
9794 | } | |||
9795 | } | |||
9796 | } else { | |||
9797 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
9798 | return false; | |||
9799 | } | |||
9800 | } | |||
9801 | } else if (args[0].isNullOrUndefined()) { | |||
9802 | arg0.SetNull(); | |||
9803 | } else { | |||
9804 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9805 | return false; | |||
9806 | } | |||
9807 | // NOTE: This assert does NOT call the function. | |||
9808 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectNullableSequence(Constify(arg0)))>, "Should be returning void here"); | |||
9809 | MOZ_KnownLive(self)(self)->PassCastableObjectNullableSequence(Constify(arg0)); | |||
9810 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9810); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9810; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9811 | args.rval().setUndefined(); | |||
9812 | return true; | |||
9813 | } | |||
9814 | ||||
9815 | static const JSJitInfo passCastableObjectNullableSequence_methodinfo = { | |||
9816 | { (JSJitGetterOp)passCastableObjectNullableSequence }, | |||
9817 | { prototypes::id::TestExampleInterface }, | |||
9818 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9819 | JSJitInfo::Method, | |||
9820 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9821 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
9822 | false, /* isInfallible. False in setters. */ | |||
9823 | false, /* isMovable. Not relevant for setters. */ | |||
9824 | false, /* isEliminatable. Not relevant for setters. */ | |||
9825 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9826 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9827 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9828 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9829 | }; | |||
9830 | ||||
9831 | MOZ_CAN_RUN_SCRIPT static bool | |||
9832 | passNullableCastableObjectNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9833 | { | |||
9834 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableCastableObjectNullableSequence"); | |||
9835 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9838( cx, "TestExampleInterface" , "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9836 | "TestExampleInterface", "passNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9838( cx, "TestExampleInterface" , "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9837 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9838( cx, "TestExampleInterface" , "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9838 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9838( cx, "TestExampleInterface" , "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9839 | ||||
9840 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9841 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableCastableObjectNullableSequence", 1)) { | |||
9842 | return false; | |||
9843 | } | |||
9844 | Nullable<Sequence<RefPtr<mozilla::dom::TestInterface>>> arg0; | |||
9845 | if (args[0].isObject()) { | |||
9846 | JS::ForOfIterator iter(cx); | |||
9847 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
9848 | return false; | |||
9849 | } | |||
9850 | if (!iter.valueIsIterable()) { | |||
9851 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9852 | return false; | |||
9853 | } | |||
9854 | Sequence<RefPtr<mozilla::dom::TestInterface>> &arr = arg0.SetValue(); | |||
9855 | JS::Rooted<JS::Value> temp(cx); | |||
9856 | while (true) { | |||
9857 | bool done; | |||
9858 | if (!iter.next(&temp, &done)) { | |||
9859 | return false; | |||
9860 | } | |||
9861 | if (done) { | |||
9862 | break; | |||
9863 | } | |||
9864 | RefPtr<mozilla::dom::TestInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
9865 | if (!slotPtr) { | |||
9866 | JS_ReportOutOfMemory(cx); | |||
9867 | return false; | |||
9868 | } | |||
9869 | RefPtr<mozilla::dom::TestInterface>& slot = *slotPtr; | |||
9870 | if (temp.isObject()) { | |||
9871 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
9872 | { | |||
9873 | // Our JSContext should be in the right global to do unwrapping in. | |||
9874 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
9875 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
9876 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestInterface"); | |||
9877 | return false; | |||
9878 | } | |||
9879 | } | |||
9880 | } else if (temp.isNullOrUndefined()) { | |||
9881 | slot = nullptr; | |||
9882 | } else { | |||
9883 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
9884 | return false; | |||
9885 | } | |||
9886 | } | |||
9887 | } else if (args[0].isNullOrUndefined()) { | |||
9888 | arg0.SetNull(); | |||
9889 | } else { | |||
9890 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9891 | return false; | |||
9892 | } | |||
9893 | // NOTE: This assert does NOT call the function. | |||
9894 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableSequence(Constify(arg0)))>, "Should be returning void here"); | |||
9895 | MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableSequence(Constify(arg0)); | |||
9896 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9896); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9896; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9897 | args.rval().setUndefined(); | |||
9898 | return true; | |||
9899 | } | |||
9900 | ||||
9901 | static const JSJitInfo passNullableCastableObjectNullableSequence_methodinfo = { | |||
9902 | { (JSJitGetterOp)passNullableCastableObjectNullableSequence }, | |||
9903 | { prototypes::id::TestExampleInterface }, | |||
9904 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9905 | JSJitInfo::Method, | |||
9906 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9907 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
9908 | false, /* isInfallible. False in setters. */ | |||
9909 | false, /* isMovable. Not relevant for setters. */ | |||
9910 | false, /* isEliminatable. Not relevant for setters. */ | |||
9911 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9912 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9913 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9914 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9915 | }; | |||
9916 | ||||
9917 | MOZ_CAN_RUN_SCRIPT static bool | |||
9918 | passOptionalSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9919 | { | |||
9920 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalSequence"); | |||
9921 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9924( cx, "TestExampleInterface" , "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
9922 | "TestExampleInterface", "passOptionalSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9924( cx, "TestExampleInterface" , "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
9923 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9924( cx, "TestExampleInterface" , "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
9924 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9924( cx, "TestExampleInterface" , "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
9925 | ||||
9926 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9927 | Optional<Sequence<int32_t>> arg0; | |||
9928 | if (args.hasDefined(0)) { | |||
9929 | arg0.Construct(); | |||
9930 | if (args[0].isObject()) { | |||
9931 | JS::ForOfIterator iter(cx); | |||
9932 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
9933 | return false; | |||
9934 | } | |||
9935 | if (!iter.valueIsIterable()) { | |||
9936 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9937 | return false; | |||
9938 | } | |||
9939 | Sequence<int32_t> &arr = arg0.Value(); | |||
9940 | JS::Rooted<JS::Value> temp(cx); | |||
9941 | while (true) { | |||
9942 | bool done; | |||
9943 | if (!iter.next(&temp, &done)) { | |||
9944 | return false; | |||
9945 | } | |||
9946 | if (done) { | |||
9947 | break; | |||
9948 | } | |||
9949 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | |||
9950 | if (!slotPtr) { | |||
9951 | JS_ReportOutOfMemory(cx); | |||
9952 | return false; | |||
9953 | } | |||
9954 | int32_t& slot = *slotPtr; | |||
9955 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | |||
9956 | return false; | |||
9957 | } | |||
9958 | } | |||
9959 | } else { | |||
9960 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
9961 | return false; | |||
9962 | } | |||
9963 | } | |||
9964 | // NOTE: This assert does NOT call the function. | |||
9965 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequence(Constify(arg0)))>, "Should be returning void here"); | |||
9966 | MOZ_KnownLive(self)(self)->PassOptionalSequence(Constify(arg0)); | |||
9967 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 9967); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 9967; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
9968 | args.rval().setUndefined(); | |||
9969 | return true; | |||
9970 | } | |||
9971 | ||||
9972 | static const JSJitInfo passOptionalSequence_methodinfo = { | |||
9973 | { (JSJitGetterOp)passOptionalSequence }, | |||
9974 | { prototypes::id::TestExampleInterface }, | |||
9975 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
9976 | JSJitInfo::Method, | |||
9977 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
9978 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
9979 | false, /* isInfallible. False in setters. */ | |||
9980 | false, /* isMovable. Not relevant for setters. */ | |||
9981 | false, /* isEliminatable. Not relevant for setters. */ | |||
9982 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
9983 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
9984 | false, /* isTypedMethod. Only relevant for methods. */ | |||
9985 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
9986 | }; | |||
9987 | ||||
9988 | MOZ_CAN_RUN_SCRIPT static bool | |||
9989 | passOptionalSequenceWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
9990 | { | |||
9991 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalSequenceWithDefaultValue"); | |||
9992 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9995( cx, "TestExampleInterface" , "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9993 | "TestExampleInterface", "passOptionalSequenceWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9995( cx, "TestExampleInterface" , "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9994 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9995( cx, "TestExampleInterface" , "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
9995 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9995( cx, "TestExampleInterface" , "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
9996 | ||||
9997 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
9998 | binding_detail::AutoSequence<int32_t> arg0; | |||
9999 | if (args.hasDefined(0)) { | |||
10000 | if (args[0].isObject()) { | |||
10001 | JS::ForOfIterator iter(cx); | |||
10002 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10003 | return false; | |||
10004 | } | |||
10005 | if (!iter.valueIsIterable()) { | |||
10006 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10007 | return false; | |||
10008 | } | |||
10009 | binding_detail::AutoSequence<int32_t> &arr = arg0; | |||
10010 | JS::Rooted<JS::Value> temp(cx); | |||
10011 | while (true) { | |||
10012 | bool done; | |||
10013 | if (!iter.next(&temp, &done)) { | |||
10014 | return false; | |||
10015 | } | |||
10016 | if (done) { | |||
10017 | break; | |||
10018 | } | |||
10019 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10020 | if (!slotPtr) { | |||
10021 | JS_ReportOutOfMemory(cx); | |||
10022 | return false; | |||
10023 | } | |||
10024 | int32_t& slot = *slotPtr; | |||
10025 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | |||
10026 | return false; | |||
10027 | } | |||
10028 | } | |||
10029 | } else { | |||
10030 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10031 | return false; | |||
10032 | } | |||
10033 | } else { | |||
10034 | /* arg0 array is already empty; nothing to do */ | |||
10035 | } | |||
10036 | // NOTE: This assert does NOT call the function. | |||
10037 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
10038 | MOZ_KnownLive(self)(self)->PassOptionalSequenceWithDefaultValue(Constify(arg0)); | |||
10039 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10039); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10039; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10040 | args.rval().setUndefined(); | |||
10041 | return true; | |||
10042 | } | |||
10043 | ||||
10044 | static const JSJitInfo passOptionalSequenceWithDefaultValue_methodinfo = { | |||
10045 | { (JSJitGetterOp)passOptionalSequenceWithDefaultValue }, | |||
10046 | { prototypes::id::TestExampleInterface }, | |||
10047 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10048 | JSJitInfo::Method, | |||
10049 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10050 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10051 | false, /* isInfallible. False in setters. */ | |||
10052 | false, /* isMovable. Not relevant for setters. */ | |||
10053 | false, /* isEliminatable. Not relevant for setters. */ | |||
10054 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10055 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10056 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10057 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10058 | }; | |||
10059 | ||||
10060 | MOZ_CAN_RUN_SCRIPT static bool | |||
10061 | passOptionalNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10062 | { | |||
10063 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequence"); | |||
10064 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10067( cx, "TestExampleInterface" , "passOptionalNullableSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10065 | "TestExampleInterface", "passOptionalNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10067( cx, "TestExampleInterface" , "passOptionalNullableSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10066 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10067( cx, "TestExampleInterface" , "passOptionalNullableSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10067 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10067( cx, "TestExampleInterface" , "passOptionalNullableSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10068 | ||||
10069 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10070 | Optional<Nullable<Sequence<int32_t>>> arg0; | |||
10071 | if (args.hasDefined(0)) { | |||
10072 | arg0.Construct(); | |||
10073 | if (args[0].isObject()) { | |||
10074 | JS::ForOfIterator iter(cx); | |||
10075 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10076 | return false; | |||
10077 | } | |||
10078 | if (!iter.valueIsIterable()) { | |||
10079 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10080 | return false; | |||
10081 | } | |||
10082 | Sequence<int32_t> &arr = arg0.Value().SetValue(); | |||
10083 | JS::Rooted<JS::Value> temp(cx); | |||
10084 | while (true) { | |||
10085 | bool done; | |||
10086 | if (!iter.next(&temp, &done)) { | |||
10087 | return false; | |||
10088 | } | |||
10089 | if (done) { | |||
10090 | break; | |||
10091 | } | |||
10092 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10093 | if (!slotPtr) { | |||
10094 | JS_ReportOutOfMemory(cx); | |||
10095 | return false; | |||
10096 | } | |||
10097 | int32_t& slot = *slotPtr; | |||
10098 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | |||
10099 | return false; | |||
10100 | } | |||
10101 | } | |||
10102 | } else if (args[0].isNullOrUndefined()) { | |||
10103 | arg0.Value().SetNull(); | |||
10104 | } else { | |||
10105 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10106 | return false; | |||
10107 | } | |||
10108 | } | |||
10109 | // NOTE: This assert does NOT call the function. | |||
10110 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequence(Constify(arg0)))>, "Should be returning void here"); | |||
10111 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequence(Constify(arg0)); | |||
10112 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10112); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10112; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10113 | args.rval().setUndefined(); | |||
10114 | return true; | |||
10115 | } | |||
10116 | ||||
10117 | static const JSJitInfo passOptionalNullableSequence_methodinfo = { | |||
10118 | { (JSJitGetterOp)passOptionalNullableSequence }, | |||
10119 | { prototypes::id::TestExampleInterface }, | |||
10120 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10121 | JSJitInfo::Method, | |||
10122 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10123 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10124 | false, /* isInfallible. False in setters. */ | |||
10125 | false, /* isMovable. Not relevant for setters. */ | |||
10126 | false, /* isEliminatable. Not relevant for setters. */ | |||
10127 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10128 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10129 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10130 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10131 | }; | |||
10132 | ||||
10133 | MOZ_CAN_RUN_SCRIPT static bool | |||
10134 | passOptionalNullableSequenceWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10135 | { | |||
10136 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceWithDefaultValue"); | |||
10137 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10140( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10138 | "TestExampleInterface", "passOptionalNullableSequenceWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10140( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10139 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10140( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10140 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10140( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10141 | ||||
10142 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10143 | Nullable<Sequence<int32_t>> arg0; | |||
10144 | if (args.hasDefined(0)) { | |||
10145 | if (args[0].isObject()) { | |||
10146 | JS::ForOfIterator iter(cx); | |||
10147 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10148 | return false; | |||
10149 | } | |||
10150 | if (!iter.valueIsIterable()) { | |||
10151 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10152 | return false; | |||
10153 | } | |||
10154 | Sequence<int32_t> &arr = arg0.SetValue(); | |||
10155 | JS::Rooted<JS::Value> temp(cx); | |||
10156 | while (true) { | |||
10157 | bool done; | |||
10158 | if (!iter.next(&temp, &done)) { | |||
10159 | return false; | |||
10160 | } | |||
10161 | if (done) { | |||
10162 | break; | |||
10163 | } | |||
10164 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10165 | if (!slotPtr) { | |||
10166 | JS_ReportOutOfMemory(cx); | |||
10167 | return false; | |||
10168 | } | |||
10169 | int32_t& slot = *slotPtr; | |||
10170 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | |||
10171 | return false; | |||
10172 | } | |||
10173 | } | |||
10174 | } else if (args[0].isNullOrUndefined()) { | |||
10175 | arg0.SetNull(); | |||
10176 | } else { | |||
10177 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10178 | return false; | |||
10179 | } | |||
10180 | } else { | |||
10181 | arg0.SetNull(); | |||
10182 | } | |||
10183 | // NOTE: This assert does NOT call the function. | |||
10184 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
10185 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue(Constify(arg0)); | |||
10186 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10186); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10186; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10187 | args.rval().setUndefined(); | |||
10188 | return true; | |||
10189 | } | |||
10190 | ||||
10191 | static const JSJitInfo passOptionalNullableSequenceWithDefaultValue_methodinfo = { | |||
10192 | { (JSJitGetterOp)passOptionalNullableSequenceWithDefaultValue }, | |||
10193 | { prototypes::id::TestExampleInterface }, | |||
10194 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10195 | JSJitInfo::Method, | |||
10196 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10197 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10198 | false, /* isInfallible. False in setters. */ | |||
10199 | false, /* isMovable. Not relevant for setters. */ | |||
10200 | false, /* isEliminatable. Not relevant for setters. */ | |||
10201 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10202 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10203 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10204 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10205 | }; | |||
10206 | ||||
10207 | MOZ_CAN_RUN_SCRIPT static bool | |||
10208 | passOptionalNullableSequenceWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10209 | { | |||
10210 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceWithDefaultValue2"); | |||
10211 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10214( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10212 | "TestExampleInterface", "passOptionalNullableSequenceWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10214( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10213 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10214( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10214 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10214( cx, "TestExampleInterface" , "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10215 | ||||
10216 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10217 | Nullable<Sequence<int32_t>> arg0; | |||
10218 | if (args.hasDefined(0)) { | |||
10219 | if (args[0].isObject()) { | |||
10220 | JS::ForOfIterator iter(cx); | |||
10221 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10222 | return false; | |||
10223 | } | |||
10224 | if (!iter.valueIsIterable()) { | |||
10225 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10226 | return false; | |||
10227 | } | |||
10228 | Sequence<int32_t> &arr = arg0.SetValue(); | |||
10229 | JS::Rooted<JS::Value> temp(cx); | |||
10230 | while (true) { | |||
10231 | bool done; | |||
10232 | if (!iter.next(&temp, &done)) { | |||
10233 | return false; | |||
10234 | } | |||
10235 | if (done) { | |||
10236 | break; | |||
10237 | } | |||
10238 | int32_t* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10239 | if (!slotPtr) { | |||
10240 | JS_ReportOutOfMemory(cx); | |||
10241 | return false; | |||
10242 | } | |||
10243 | int32_t& slot = *slotPtr; | |||
10244 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) { | |||
10245 | return false; | |||
10246 | } | |||
10247 | } | |||
10248 | } else if (args[0].isNullOrUndefined()) { | |||
10249 | arg0.SetNull(); | |||
10250 | } else { | |||
10251 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10252 | return false; | |||
10253 | } | |||
10254 | } else { | |||
10255 | arg0.SetValue(); | |||
10256 | } | |||
10257 | // NOTE: This assert does NOT call the function. | |||
10258 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue2(Constify(arg0)))>, "Should be returning void here"); | |||
10259 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue2(Constify(arg0)); | |||
10260 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10260); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10260; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10261 | args.rval().setUndefined(); | |||
10262 | return true; | |||
10263 | } | |||
10264 | ||||
10265 | static const JSJitInfo passOptionalNullableSequenceWithDefaultValue2_methodinfo = { | |||
10266 | { (JSJitGetterOp)passOptionalNullableSequenceWithDefaultValue2 }, | |||
10267 | { prototypes::id::TestExampleInterface }, | |||
10268 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10269 | JSJitInfo::Method, | |||
10270 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10271 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10272 | false, /* isInfallible. False in setters. */ | |||
10273 | false, /* isMovable. Not relevant for setters. */ | |||
10274 | false, /* isEliminatable. Not relevant for setters. */ | |||
10275 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10276 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10277 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10278 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10279 | }; | |||
10280 | ||||
10281 | MOZ_CAN_RUN_SCRIPT static bool | |||
10282 | passOptionalObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10283 | { | |||
10284 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalObjectSequence"); | |||
10285 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10288( cx, "TestExampleInterface" , "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10286 | "TestExampleInterface", "passOptionalObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10288( cx, "TestExampleInterface" , "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10287 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10288( cx, "TestExampleInterface" , "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10288 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10288( cx, "TestExampleInterface" , "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10289 | ||||
10290 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10291 | Optional<Sequence<OwningNonNull<mozilla::dom::TestInterface>>> arg0; | |||
10292 | if (args.hasDefined(0)) { | |||
10293 | arg0.Construct(); | |||
10294 | if (args[0].isObject()) { | |||
10295 | JS::ForOfIterator iter(cx); | |||
10296 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10297 | return false; | |||
10298 | } | |||
10299 | if (!iter.valueIsIterable()) { | |||
10300 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10301 | return false; | |||
10302 | } | |||
10303 | Sequence<OwningNonNull<mozilla::dom::TestInterface>> &arr = arg0.Value(); | |||
10304 | JS::Rooted<JS::Value> temp(cx); | |||
10305 | while (true) { | |||
10306 | bool done; | |||
10307 | if (!iter.next(&temp, &done)) { | |||
10308 | return false; | |||
10309 | } | |||
10310 | if (done) { | |||
10311 | break; | |||
10312 | } | |||
10313 | OwningNonNull<mozilla::dom::TestInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10314 | if (!slotPtr) { | |||
10315 | JS_ReportOutOfMemory(cx); | |||
10316 | return false; | |||
10317 | } | |||
10318 | OwningNonNull<mozilla::dom::TestInterface>& slot = *slotPtr; | |||
10319 | if (temp.isObject()) { | |||
10320 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
10321 | { | |||
10322 | // Our JSContext should be in the right global to do unwrapping in. | |||
10323 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
10324 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
10325 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestInterface"); | |||
10326 | return false; | |||
10327 | } | |||
10328 | } | |||
10329 | } else { | |||
10330 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
10331 | return false; | |||
10332 | } | |||
10333 | } | |||
10334 | } else { | |||
10335 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10336 | return false; | |||
10337 | } | |||
10338 | } | |||
10339 | // NOTE: This assert does NOT call the function. | |||
10340 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalObjectSequence(Constify(arg0)))>, "Should be returning void here"); | |||
10341 | MOZ_KnownLive(self)(self)->PassOptionalObjectSequence(Constify(arg0)); | |||
10342 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10342); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10342; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10343 | args.rval().setUndefined(); | |||
10344 | return true; | |||
10345 | } | |||
10346 | ||||
10347 | static const JSJitInfo passOptionalObjectSequence_methodinfo = { | |||
10348 | { (JSJitGetterOp)passOptionalObjectSequence }, | |||
10349 | { prototypes::id::TestExampleInterface }, | |||
10350 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10351 | JSJitInfo::Method, | |||
10352 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10353 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10354 | false, /* isInfallible. False in setters. */ | |||
10355 | false, /* isMovable. Not relevant for setters. */ | |||
10356 | false, /* isEliminatable. Not relevant for setters. */ | |||
10357 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10358 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10359 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10360 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10361 | }; | |||
10362 | ||||
10363 | MOZ_CAN_RUN_SCRIPT static bool | |||
10364 | passExternalInterfaceSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10365 | { | |||
10366 | BindingCallContext cx(cx_, "TestExampleInterface.passExternalInterfaceSequence"); | |||
10367 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestExampleInterface" , "passExternalInterfaceSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10368 | "TestExampleInterface", "passExternalInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestExampleInterface" , "passExternalInterfaceSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10369 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestExampleInterface" , "passExternalInterfaceSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10370 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestExampleInterface" , "passExternalInterfaceSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10371 | ||||
10372 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10373 | if (!args.requireAtLeast(cx, "TestExampleInterface.passExternalInterfaceSequence", 1)) { | |||
10374 | return false; | |||
10375 | } | |||
10376 | binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> arg0; | |||
10377 | if (args[0].isObject()) { | |||
10378 | JS::ForOfIterator iter(cx); | |||
10379 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10380 | return false; | |||
10381 | } | |||
10382 | if (!iter.valueIsIterable()) { | |||
10383 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10384 | return false; | |||
10385 | } | |||
10386 | binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> &arr = arg0; | |||
10387 | JS::Rooted<JS::Value> temp(cx); | |||
10388 | while (true) { | |||
10389 | bool done; | |||
10390 | if (!iter.next(&temp, &done)) { | |||
10391 | return false; | |||
10392 | } | |||
10393 | if (done) { | |||
10394 | break; | |||
10395 | } | |||
10396 | RefPtr<mozilla::dom::TestExternalInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10397 | if (!slotPtr) { | |||
10398 | JS_ReportOutOfMemory(cx); | |||
10399 | return false; | |||
10400 | } | |||
10401 | RefPtr<mozilla::dom::TestExternalInterface>& slot = *slotPtr; | |||
10402 | if (temp.isObject()) { | |||
10403 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | |||
10404 | RefPtr<mozilla::dom::TestExternalInterface> tempHolder; | |||
10405 | JS::Rooted<JSObject*> source(cx, &temp.toObject()); | |||
10406 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder )))), 0)))) { | |||
10407 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestExternalInterface"); | |||
10408 | return false; | |||
10409 | } | |||
10410 | MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(tempHolder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestExampleGenBinding.cpp" , 10410); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder" ")"); do { *((volatile int*)__null) = 10410; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
10411 | slot = tempHolder; | |||
10412 | } else { | |||
10413 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
10414 | return false; | |||
10415 | } | |||
10416 | } | |||
10417 | } else { | |||
10418 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10419 | return false; | |||
10420 | } | |||
10421 | // NOTE: This assert does NOT call the function. | |||
10422 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassExternalInterfaceSequence(Constify(arg0)))>, "Should be returning void here"); | |||
10423 | MOZ_KnownLive(self)(self)->PassExternalInterfaceSequence(Constify(arg0)); | |||
10424 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10424); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10424; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10425 | args.rval().setUndefined(); | |||
10426 | return true; | |||
10427 | } | |||
10428 | ||||
10429 | static const JSJitInfo passExternalInterfaceSequence_methodinfo = { | |||
10430 | { (JSJitGetterOp)passExternalInterfaceSequence }, | |||
10431 | { prototypes::id::TestExampleInterface }, | |||
10432 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10433 | JSJitInfo::Method, | |||
10434 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10435 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10436 | false, /* isInfallible. False in setters. */ | |||
10437 | false, /* isMovable. Not relevant for setters. */ | |||
10438 | false, /* isEliminatable. Not relevant for setters. */ | |||
10439 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10440 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10441 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10442 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10443 | }; | |||
10444 | ||||
10445 | MOZ_CAN_RUN_SCRIPT static bool | |||
10446 | passNullableExternalInterfaceSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10447 | { | |||
10448 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableExternalInterfaceSequence"); | |||
10449 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10452( cx, "TestExampleInterface" , "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10450 | "TestExampleInterface", "passNullableExternalInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10452( cx, "TestExampleInterface" , "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10451 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10452( cx, "TestExampleInterface" , "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10452 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10452( cx, "TestExampleInterface" , "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10453 | ||||
10454 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10455 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableExternalInterfaceSequence", 1)) { | |||
10456 | return false; | |||
10457 | } | |||
10458 | binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> arg0; | |||
10459 | if (args[0].isObject()) { | |||
10460 | JS::ForOfIterator iter(cx); | |||
10461 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10462 | return false; | |||
10463 | } | |||
10464 | if (!iter.valueIsIterable()) { | |||
10465 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10466 | return false; | |||
10467 | } | |||
10468 | binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> &arr = arg0; | |||
10469 | JS::Rooted<JS::Value> temp(cx); | |||
10470 | while (true) { | |||
10471 | bool done; | |||
10472 | if (!iter.next(&temp, &done)) { | |||
10473 | return false; | |||
10474 | } | |||
10475 | if (done) { | |||
10476 | break; | |||
10477 | } | |||
10478 | RefPtr<mozilla::dom::TestExternalInterface>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10479 | if (!slotPtr) { | |||
10480 | JS_ReportOutOfMemory(cx); | |||
10481 | return false; | |||
10482 | } | |||
10483 | RefPtr<mozilla::dom::TestExternalInterface>& slot = *slotPtr; | |||
10484 | if (temp.isObject()) { | |||
10485 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | |||
10486 | RefPtr<mozilla::dom::TestExternalInterface> tempHolder; | |||
10487 | JS::Rooted<JSObject*> source(cx, &temp.toObject()); | |||
10488 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder )))), 0)))) { | |||
10489 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestExternalInterface"); | |||
10490 | return false; | |||
10491 | } | |||
10492 | MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(tempHolder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestExampleGenBinding.cpp" , 10492); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder" ")"); do { *((volatile int*)__null) = 10492; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
10493 | slot = tempHolder; | |||
10494 | } else if (temp.isNullOrUndefined()) { | |||
10495 | slot = nullptr; | |||
10496 | } else { | |||
10497 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
10498 | return false; | |||
10499 | } | |||
10500 | } | |||
10501 | } else { | |||
10502 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10503 | return false; | |||
10504 | } | |||
10505 | // NOTE: This assert does NOT call the function. | |||
10506 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceSequence(Constify(arg0)))>, "Should be returning void here"); | |||
10507 | MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceSequence(Constify(arg0)); | |||
10508 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10508); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10508; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10509 | args.rval().setUndefined(); | |||
10510 | return true; | |||
10511 | } | |||
10512 | ||||
10513 | static const JSJitInfo passNullableExternalInterfaceSequence_methodinfo = { | |||
10514 | { (JSJitGetterOp)passNullableExternalInterfaceSequence }, | |||
10515 | { prototypes::id::TestExampleInterface }, | |||
10516 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10517 | JSJitInfo::Method, | |||
10518 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10519 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10520 | false, /* isInfallible. False in setters. */ | |||
10521 | false, /* isMovable. Not relevant for setters. */ | |||
10522 | false, /* isEliminatable. Not relevant for setters. */ | |||
10523 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10524 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10525 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10526 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10527 | }; | |||
10528 | ||||
10529 | MOZ_CAN_RUN_SCRIPT static bool | |||
10530 | receiveStringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10531 | { | |||
10532 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10535( cx, "TestExampleInterface" , "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10533 | "TestExampleInterface", "receiveStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10535( cx, "TestExampleInterface" , "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10534 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10535( cx, "TestExampleInterface" , "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10535 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10535( cx, "TestExampleInterface" , "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
10536 | ||||
10537 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10538 | nsTArray<nsString> result; | |||
10539 | // NOTE: This assert does NOT call the function. | |||
10540 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveStringSequence(result))>, "Should be returning void here"); | |||
10541 | MOZ_KnownLive(self)(self)->ReceiveStringSequence(result); | |||
10542 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10542); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10542; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10543 | ||||
10544 | uint32_t length = result.Length(); | |||
10545 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
10546 | if (!returnArray) { | |||
10547 | return false; | |||
10548 | } | |||
10549 | // Scope for 'tmp' | |||
10550 | { | |||
10551 | JS::Rooted<JS::Value> tmp(cx); | |||
10552 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
10553 | // Control block to let us common up the JS_DefineElement calls when there | |||
10554 | // are different ways to succeed at wrapping the object. | |||
10555 | do { | |||
10556 | if (!xpc::NonVoidStringToJsval(cx, result[sequenceIdx0], &tmp)) { | |||
10557 | return false; | |||
10558 | } | |||
10559 | break; | |||
10560 | } while (false); | |||
10561 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
10562 | JSPROP_ENUMERATE)) { | |||
10563 | return false; | |||
10564 | } | |||
10565 | } | |||
10566 | } | |||
10567 | args.rval().setObject(*returnArray); | |||
10568 | return true; | |||
10569 | } | |||
10570 | ||||
10571 | static const JSJitInfo receiveStringSequence_methodinfo = { | |||
10572 | { (JSJitGetterOp)receiveStringSequence }, | |||
10573 | { prototypes::id::TestExampleInterface }, | |||
10574 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10575 | JSJitInfo::Method, | |||
10576 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10577 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
10578 | false, /* isInfallible. False in setters. */ | |||
10579 | false, /* isMovable. Not relevant for setters. */ | |||
10580 | false, /* isEliminatable. Not relevant for setters. */ | |||
10581 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10582 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10583 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10584 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10585 | }; | |||
10586 | ||||
10587 | MOZ_CAN_RUN_SCRIPT static bool | |||
10588 | passStringSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10589 | { | |||
10590 | BindingCallContext cx(cx_, "TestExampleInterface.passStringSequence"); | |||
10591 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10594( cx, "TestExampleInterface" , "passStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10592 | "TestExampleInterface", "passStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10594( cx, "TestExampleInterface" , "passStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10593 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10594( cx, "TestExampleInterface" , "passStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10594 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10594( cx, "TestExampleInterface" , "passStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
10595 | ||||
10596 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10597 | if (!args.requireAtLeast(cx, "TestExampleInterface.passStringSequence", 1)) { | |||
10598 | return false; | |||
10599 | } | |||
10600 | binding_detail::AutoSequence<nsString> arg0; | |||
10601 | if (args[0].isObject()) { | |||
10602 | JS::ForOfIterator iter(cx); | |||
10603 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10604 | return false; | |||
10605 | } | |||
10606 | if (!iter.valueIsIterable()) { | |||
10607 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10608 | return false; | |||
10609 | } | |||
10610 | binding_detail::AutoSequence<nsString> &arr = arg0; | |||
10611 | JS::Rooted<JS::Value> temp(cx); | |||
10612 | while (true) { | |||
10613 | bool done; | |||
10614 | if (!iter.next(&temp, &done)) { | |||
10615 | return false; | |||
10616 | } | |||
10617 | if (done) { | |||
10618 | break; | |||
10619 | } | |||
10620 | nsString* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10621 | if (!slotPtr) { | |||
10622 | JS_ReportOutOfMemory(cx); | |||
10623 | return false; | |||
10624 | } | |||
10625 | nsString& slot = *slotPtr; | |||
10626 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | |||
10627 | return false; | |||
10628 | } | |||
10629 | } | |||
10630 | } else { | |||
10631 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10632 | return false; | |||
10633 | } | |||
10634 | // NOTE: This assert does NOT call the function. | |||
10635 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassStringSequence(Constify(arg0)))>, "Should be returning void here"); | |||
10636 | MOZ_KnownLive(self)(self)->PassStringSequence(Constify(arg0)); | |||
10637 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10637); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10637; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10638 | args.rval().setUndefined(); | |||
10639 | return true; | |||
10640 | } | |||
10641 | ||||
10642 | static const JSJitInfo passStringSequence_methodinfo = { | |||
10643 | { (JSJitGetterOp)passStringSequence }, | |||
10644 | { prototypes::id::TestExampleInterface }, | |||
10645 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10646 | JSJitInfo::Method, | |||
10647 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10648 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10649 | false, /* isInfallible. False in setters. */ | |||
10650 | false, /* isMovable. Not relevant for setters. */ | |||
10651 | false, /* isEliminatable. Not relevant for setters. */ | |||
10652 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10653 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10654 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10655 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10656 | }; | |||
10657 | ||||
10658 | MOZ_CAN_RUN_SCRIPT static bool | |||
10659 | receiveByteStringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10660 | { | |||
10661 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10664( cx, "TestExampleInterface" , "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10662 | "TestExampleInterface", "receiveByteStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10664( cx, "TestExampleInterface" , "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10663 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10664( cx, "TestExampleInterface" , "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10664 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10664( cx, "TestExampleInterface" , "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10665 | ||||
10666 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10667 | nsTArray<nsCString> result; | |||
10668 | // NOTE: This assert does NOT call the function. | |||
10669 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveByteStringSequence(result))>, "Should be returning void here"); | |||
10670 | MOZ_KnownLive(self)(self)->ReceiveByteStringSequence(result); | |||
10671 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10671); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10671; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10672 | ||||
10673 | uint32_t length = result.Length(); | |||
10674 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
10675 | if (!returnArray) { | |||
10676 | return false; | |||
10677 | } | |||
10678 | // Scope for 'tmp' | |||
10679 | { | |||
10680 | JS::Rooted<JS::Value> tmp(cx); | |||
10681 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
10682 | // Control block to let us common up the JS_DefineElement calls when there | |||
10683 | // are different ways to succeed at wrapping the object. | |||
10684 | do { | |||
10685 | if (!NonVoidByteStringToJsval(cx, result[sequenceIdx0], &tmp)) { | |||
10686 | return false; | |||
10687 | } | |||
10688 | break; | |||
10689 | } while (false); | |||
10690 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
10691 | JSPROP_ENUMERATE)) { | |||
10692 | return false; | |||
10693 | } | |||
10694 | } | |||
10695 | } | |||
10696 | args.rval().setObject(*returnArray); | |||
10697 | return true; | |||
10698 | } | |||
10699 | ||||
10700 | static const JSJitInfo receiveByteStringSequence_methodinfo = { | |||
10701 | { (JSJitGetterOp)receiveByteStringSequence }, | |||
10702 | { prototypes::id::TestExampleInterface }, | |||
10703 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10704 | JSJitInfo::Method, | |||
10705 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10706 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
10707 | false, /* isInfallible. False in setters. */ | |||
10708 | false, /* isMovable. Not relevant for setters. */ | |||
10709 | false, /* isEliminatable. Not relevant for setters. */ | |||
10710 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10711 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10712 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10713 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10714 | }; | |||
10715 | ||||
10716 | MOZ_CAN_RUN_SCRIPT static bool | |||
10717 | passByteStringSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10718 | { | |||
10719 | BindingCallContext cx(cx_, "TestExampleInterface.passByteStringSequence"); | |||
10720 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10723( cx, "TestExampleInterface" , "passByteStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10721 | "TestExampleInterface", "passByteStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10723( cx, "TestExampleInterface" , "passByteStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10722 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10723( cx, "TestExampleInterface" , "passByteStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10723 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10723( cx, "TestExampleInterface" , "passByteStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
10724 | ||||
10725 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10726 | if (!args.requireAtLeast(cx, "TestExampleInterface.passByteStringSequence", 1)) { | |||
10727 | return false; | |||
10728 | } | |||
10729 | binding_detail::AutoSequence<nsCString> arg0; | |||
10730 | if (args[0].isObject()) { | |||
10731 | JS::ForOfIterator iter(cx); | |||
10732 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10733 | return false; | |||
10734 | } | |||
10735 | if (!iter.valueIsIterable()) { | |||
10736 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10737 | return false; | |||
10738 | } | |||
10739 | binding_detail::AutoSequence<nsCString> &arr = arg0; | |||
10740 | JS::Rooted<JS::Value> temp(cx); | |||
10741 | while (true) { | |||
10742 | bool done; | |||
10743 | if (!iter.next(&temp, &done)) { | |||
10744 | return false; | |||
10745 | } | |||
10746 | if (done) { | |||
10747 | break; | |||
10748 | } | |||
10749 | nsCString* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10750 | if (!slotPtr) { | |||
10751 | JS_ReportOutOfMemory(cx); | |||
10752 | return false; | |||
10753 | } | |||
10754 | nsCString& slot = *slotPtr; | |||
10755 | if (!ConvertJSValueToByteString(cx, temp, false, "element of argument 1", slot)) { | |||
10756 | return false; | |||
10757 | } | |||
10758 | } | |||
10759 | } else { | |||
10760 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10761 | return false; | |||
10762 | } | |||
10763 | // NOTE: This assert does NOT call the function. | |||
10764 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByteStringSequence(Constify(arg0)))>, "Should be returning void here"); | |||
10765 | MOZ_KnownLive(self)(self)->PassByteStringSequence(Constify(arg0)); | |||
10766 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10766); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10766; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10767 | args.rval().setUndefined(); | |||
10768 | return true; | |||
10769 | } | |||
10770 | ||||
10771 | static const JSJitInfo passByteStringSequence_methodinfo = { | |||
10772 | { (JSJitGetterOp)passByteStringSequence }, | |||
10773 | { prototypes::id::TestExampleInterface }, | |||
10774 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10775 | JSJitInfo::Method, | |||
10776 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10777 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10778 | false, /* isInfallible. False in setters. */ | |||
10779 | false, /* isMovable. Not relevant for setters. */ | |||
10780 | false, /* isEliminatable. Not relevant for setters. */ | |||
10781 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10782 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10783 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10784 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10785 | }; | |||
10786 | ||||
10787 | MOZ_CAN_RUN_SCRIPT static bool | |||
10788 | receiveUTF8StringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10789 | { | |||
10790 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10793( cx, "TestExampleInterface" , "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10791 | "TestExampleInterface", "receiveUTF8StringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10793( cx, "TestExampleInterface" , "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10792 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10793( cx, "TestExampleInterface" , "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10793 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10793( cx, "TestExampleInterface" , "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10794 | ||||
10795 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10796 | nsTArray<nsCString> result; | |||
10797 | // NOTE: This assert does NOT call the function. | |||
10798 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveUTF8StringSequence(result))>, "Should be returning void here"); | |||
10799 | MOZ_KnownLive(self)(self)->ReceiveUTF8StringSequence(result); | |||
10800 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10800); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10800; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10801 | ||||
10802 | uint32_t length = result.Length(); | |||
10803 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
10804 | if (!returnArray) { | |||
10805 | return false; | |||
10806 | } | |||
10807 | // Scope for 'tmp' | |||
10808 | { | |||
10809 | JS::Rooted<JS::Value> tmp(cx); | |||
10810 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
10811 | // Control block to let us common up the JS_DefineElement calls when there | |||
10812 | // are different ways to succeed at wrapping the object. | |||
10813 | do { | |||
10814 | if (!NonVoidUTF8StringToJsval(cx, result[sequenceIdx0], &tmp)) { | |||
10815 | return false; | |||
10816 | } | |||
10817 | break; | |||
10818 | } while (false); | |||
10819 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
10820 | JSPROP_ENUMERATE)) { | |||
10821 | return false; | |||
10822 | } | |||
10823 | } | |||
10824 | } | |||
10825 | args.rval().setObject(*returnArray); | |||
10826 | return true; | |||
10827 | } | |||
10828 | ||||
10829 | static const JSJitInfo receiveUTF8StringSequence_methodinfo = { | |||
10830 | { (JSJitGetterOp)receiveUTF8StringSequence }, | |||
10831 | { prototypes::id::TestExampleInterface }, | |||
10832 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10833 | JSJitInfo::Method, | |||
10834 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10835 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
10836 | false, /* isInfallible. False in setters. */ | |||
10837 | false, /* isMovable. Not relevant for setters. */ | |||
10838 | false, /* isEliminatable. Not relevant for setters. */ | |||
10839 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10840 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10841 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10842 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10843 | }; | |||
10844 | ||||
10845 | MOZ_CAN_RUN_SCRIPT static bool | |||
10846 | passUTF8StringSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10847 | { | |||
10848 | BindingCallContext cx(cx_, "TestExampleInterface.passUTF8StringSequence"); | |||
10849 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestExampleInterface" , "passUTF8StringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10850 | "TestExampleInterface", "passUTF8StringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestExampleInterface" , "passUTF8StringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10851 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestExampleInterface" , "passUTF8StringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10852 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestExampleInterface" , "passUTF8StringSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
10853 | ||||
10854 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10855 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUTF8StringSequence", 1)) { | |||
10856 | return false; | |||
10857 | } | |||
10858 | binding_detail::AutoSequence<nsCString> arg0; | |||
10859 | if (args[0].isObject()) { | |||
10860 | JS::ForOfIterator iter(cx); | |||
10861 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
10862 | return false; | |||
10863 | } | |||
10864 | if (!iter.valueIsIterable()) { | |||
10865 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10866 | return false; | |||
10867 | } | |||
10868 | binding_detail::AutoSequence<nsCString> &arr = arg0; | |||
10869 | JS::Rooted<JS::Value> temp(cx); | |||
10870 | while (true) { | |||
10871 | bool done; | |||
10872 | if (!iter.next(&temp, &done)) { | |||
10873 | return false; | |||
10874 | } | |||
10875 | if (done) { | |||
10876 | break; | |||
10877 | } | |||
10878 | nsCString* slotPtr = arr.AppendElement(mozilla::fallible); | |||
10879 | if (!slotPtr) { | |||
10880 | JS_ReportOutOfMemory(cx); | |||
10881 | return false; | |||
10882 | } | |||
10883 | nsCString& slot = *slotPtr; | |||
10884 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | |||
10885 | return false; | |||
10886 | } | |||
10887 | } | |||
10888 | } else { | |||
10889 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
10890 | return false; | |||
10891 | } | |||
10892 | // NOTE: This assert does NOT call the function. | |||
10893 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUTF8StringSequence(Constify(arg0)))>, "Should be returning void here"); | |||
10894 | MOZ_KnownLive(self)(self)->PassUTF8StringSequence(Constify(arg0)); | |||
10895 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10895); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10895; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10896 | args.rval().setUndefined(); | |||
10897 | return true; | |||
10898 | } | |||
10899 | ||||
10900 | static const JSJitInfo passUTF8StringSequence_methodinfo = { | |||
10901 | { (JSJitGetterOp)passUTF8StringSequence }, | |||
10902 | { prototypes::id::TestExampleInterface }, | |||
10903 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10904 | JSJitInfo::Method, | |||
10905 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10906 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
10907 | false, /* isInfallible. False in setters. */ | |||
10908 | false, /* isMovable. Not relevant for setters. */ | |||
10909 | false, /* isEliminatable. Not relevant for setters. */ | |||
10910 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10911 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10912 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10913 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10914 | }; | |||
10915 | ||||
10916 | MOZ_CAN_RUN_SCRIPT static bool | |||
10917 | receiveAnySequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10918 | { | |||
10919 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10922( cx, "TestExampleInterface" , "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10920 | "TestExampleInterface", "receiveAnySequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10922( cx, "TestExampleInterface" , "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10921 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10922( cx, "TestExampleInterface" , "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
10922 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10922( cx, "TestExampleInterface" , "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
10923 | ||||
10924 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10925 | nsTArray<JS::Value> result; | |||
10926 | SequenceRooter<JS::Value > resultRooter(cx, &result); | |||
10927 | // NOTE: This assert does NOT call the function. | |||
10928 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveAnySequence(cx, result))>, "Should be returning void here"); | |||
10929 | MOZ_KnownLive(self)(self)->ReceiveAnySequence(cx, result); | |||
10930 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10930); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10930; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10931 | ||||
10932 | uint32_t length = result.Length(); | |||
10933 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
10934 | if (!returnArray) { | |||
10935 | return false; | |||
10936 | } | |||
10937 | // Scope for 'tmp' | |||
10938 | { | |||
10939 | JS::Rooted<JS::Value> tmp(cx); | |||
10940 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
10941 | // Control block to let us common up the JS_DefineElement calls when there | |||
10942 | // are different ways to succeed at wrapping the object. | |||
10943 | do { | |||
10944 | JS::ExposeValueToActiveJS(result[sequenceIdx0]); | |||
10945 | tmp.set(result[sequenceIdx0]); | |||
10946 | if (!MaybeWrapValue(cx, &tmp)) { | |||
10947 | return false; | |||
10948 | } | |||
10949 | break; | |||
10950 | } while (false); | |||
10951 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
10952 | JSPROP_ENUMERATE)) { | |||
10953 | return false; | |||
10954 | } | |||
10955 | } | |||
10956 | } | |||
10957 | args.rval().setObject(*returnArray); | |||
10958 | return true; | |||
10959 | } | |||
10960 | ||||
10961 | static const JSJitInfo receiveAnySequence_methodinfo = { | |||
10962 | { (JSJitGetterOp)receiveAnySequence }, | |||
10963 | { prototypes::id::TestExampleInterface }, | |||
10964 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
10965 | JSJitInfo::Method, | |||
10966 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
10967 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
10968 | false, /* isInfallible. False in setters. */ | |||
10969 | false, /* isMovable. Not relevant for setters. */ | |||
10970 | false, /* isEliminatable. Not relevant for setters. */ | |||
10971 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
10972 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
10973 | false, /* isTypedMethod. Only relevant for methods. */ | |||
10974 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
10975 | }; | |||
10976 | ||||
10977 | MOZ_CAN_RUN_SCRIPT static bool | |||
10978 | receiveNullableAnySequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
10979 | { | |||
10980 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10983( cx, "TestExampleInterface" , "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10981 | "TestExampleInterface", "receiveNullableAnySequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10983( cx, "TestExampleInterface" , "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10982 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10983( cx, "TestExampleInterface" , "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
10983 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10983( cx, "TestExampleInterface" , "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
10984 | ||||
10985 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
10986 | Nullable<nsTArray<JS::Value>> result; | |||
10987 | SequenceRooter<JS::Value > resultRooter(cx, &result); | |||
10988 | // NOTE: This assert does NOT call the function. | |||
10989 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableAnySequence(cx, result))>, "Should be returning void here"); | |||
10990 | MOZ_KnownLive(self)(self)->ReceiveNullableAnySequence(cx, result); | |||
10991 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 10991); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 10991; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
10992 | ||||
10993 | if (result.IsNull()) { | |||
10994 | args.rval().setNull(); | |||
10995 | return true; | |||
10996 | } | |||
10997 | ||||
10998 | uint32_t length = result.Value().Length(); | |||
10999 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
11000 | if (!returnArray) { | |||
11001 | return false; | |||
11002 | } | |||
11003 | // Scope for 'tmp' | |||
11004 | { | |||
11005 | JS::Rooted<JS::Value> tmp(cx); | |||
11006 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
11007 | // Control block to let us common up the JS_DefineElement calls when there | |||
11008 | // are different ways to succeed at wrapping the object. | |||
11009 | do { | |||
11010 | JS::ExposeValueToActiveJS(result.Value()[sequenceIdx0]); | |||
11011 | tmp.set(result.Value()[sequenceIdx0]); | |||
11012 | if (!MaybeWrapValue(cx, &tmp)) { | |||
11013 | return false; | |||
11014 | } | |||
11015 | break; | |||
11016 | } while (false); | |||
11017 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
11018 | JSPROP_ENUMERATE)) { | |||
11019 | return false; | |||
11020 | } | |||
11021 | } | |||
11022 | } | |||
11023 | args.rval().setObject(*returnArray); | |||
11024 | return true; | |||
11025 | } | |||
11026 | ||||
11027 | static const JSJitInfo receiveNullableAnySequence_methodinfo = { | |||
11028 | { (JSJitGetterOp)receiveNullableAnySequence }, | |||
11029 | { prototypes::id::TestExampleInterface }, | |||
11030 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11031 | JSJitInfo::Method, | |||
11032 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11033 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
11034 | false, /* isInfallible. False in setters. */ | |||
11035 | false, /* isMovable. Not relevant for setters. */ | |||
11036 | false, /* isEliminatable. Not relevant for setters. */ | |||
11037 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11038 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11039 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11040 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11041 | }; | |||
11042 | ||||
11043 | MOZ_CAN_RUN_SCRIPT static bool | |||
11044 | receiveObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11045 | { | |||
11046 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11049( cx, "TestExampleInterface" , "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11047 | "TestExampleInterface", "receiveObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11049( cx, "TestExampleInterface" , "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11048 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11049( cx, "TestExampleInterface" , "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11049 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11049( cx, "TestExampleInterface" , "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
11050 | ||||
11051 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11052 | nsTArray<JSObject*> result; | |||
11053 | SequenceRooter<JSObject* > resultRooter(cx, &result); | |||
11054 | // NOTE: This assert does NOT call the function. | |||
11055 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveObjectSequence(cx, result))>, "Should be returning void here"); | |||
11056 | MOZ_KnownLive(self)(self)->ReceiveObjectSequence(cx, result); | |||
11057 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11057); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11057; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11058 | ||||
11059 | uint32_t length = result.Length(); | |||
11060 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
11061 | if (!returnArray) { | |||
11062 | return false; | |||
11063 | } | |||
11064 | // Scope for 'tmp' | |||
11065 | { | |||
11066 | JS::Rooted<JS::Value> tmp(cx); | |||
11067 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
11068 | // Control block to let us common up the JS_DefineElement calls when there | |||
11069 | // are different ways to succeed at wrapping the object. | |||
11070 | do { | |||
11071 | JS::ExposeObjectToActiveJS(result[sequenceIdx0]); | |||
11072 | tmp.setObject(*result[sequenceIdx0]); | |||
11073 | if (!MaybeWrapObjectValue(cx, &tmp)) { | |||
11074 | return false; | |||
11075 | } | |||
11076 | break; | |||
11077 | } while (false); | |||
11078 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
11079 | JSPROP_ENUMERATE)) { | |||
11080 | return false; | |||
11081 | } | |||
11082 | } | |||
11083 | } | |||
11084 | args.rval().setObject(*returnArray); | |||
11085 | return true; | |||
11086 | } | |||
11087 | ||||
11088 | static const JSJitInfo receiveObjectSequence_methodinfo = { | |||
11089 | { (JSJitGetterOp)receiveObjectSequence }, | |||
11090 | { prototypes::id::TestExampleInterface }, | |||
11091 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11092 | JSJitInfo::Method, | |||
11093 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11094 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
11095 | false, /* isInfallible. False in setters. */ | |||
11096 | false, /* isMovable. Not relevant for setters. */ | |||
11097 | false, /* isEliminatable. Not relevant for setters. */ | |||
11098 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11099 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11100 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11101 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11102 | }; | |||
11103 | ||||
11104 | MOZ_CAN_RUN_SCRIPT static bool | |||
11105 | receiveNullableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11106 | { | |||
11107 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11110( cx, "TestExampleInterface" , "receiveNullableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11108 | "TestExampleInterface", "receiveNullableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11110( cx, "TestExampleInterface" , "receiveNullableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11109 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11110( cx, "TestExampleInterface" , "receiveNullableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11110 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11110( cx, "TestExampleInterface" , "receiveNullableObjectSequence", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
11111 | ||||
11112 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11113 | nsTArray<JSObject*> result; | |||
11114 | SequenceRooter<JSObject* > resultRooter(cx, &result); | |||
11115 | // NOTE: This assert does NOT call the function. | |||
11116 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableObjectSequence(cx, result))>, "Should be returning void here"); | |||
11117 | MOZ_KnownLive(self)(self)->ReceiveNullableObjectSequence(cx, result); | |||
11118 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11118); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11118; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11119 | ||||
11120 | uint32_t length = result.Length(); | |||
11121 | JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length)); | |||
11122 | if (!returnArray) { | |||
11123 | return false; | |||
11124 | } | |||
11125 | // Scope for 'tmp' | |||
11126 | { | |||
11127 | JS::Rooted<JS::Value> tmp(cx); | |||
11128 | for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) { | |||
11129 | // Control block to let us common up the JS_DefineElement calls when there | |||
11130 | // are different ways to succeed at wrapping the object. | |||
11131 | do { | |||
11132 | if (result[sequenceIdx0]) { | |||
11133 | JS::ExposeObjectToActiveJS(result[sequenceIdx0]); | |||
11134 | } | |||
11135 | tmp.setObjectOrNull(result[sequenceIdx0]); | |||
11136 | if (!MaybeWrapObjectOrNullValue(cx, &tmp)) { | |||
11137 | return false; | |||
11138 | } | |||
11139 | break; | |||
11140 | } while (false); | |||
11141 | if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp, | |||
11142 | JSPROP_ENUMERATE)) { | |||
11143 | return false; | |||
11144 | } | |||
11145 | } | |||
11146 | } | |||
11147 | args.rval().setObject(*returnArray); | |||
11148 | return true; | |||
11149 | } | |||
11150 | ||||
11151 | static const JSJitInfo receiveNullableObjectSequence_methodinfo = { | |||
11152 | { (JSJitGetterOp)receiveNullableObjectSequence }, | |||
11153 | { prototypes::id::TestExampleInterface }, | |||
11154 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11155 | JSJitInfo::Method, | |||
11156 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11157 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
11158 | false, /* isInfallible. False in setters. */ | |||
11159 | false, /* isMovable. Not relevant for setters. */ | |||
11160 | false, /* isEliminatable. Not relevant for setters. */ | |||
11161 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11162 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11163 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11164 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11165 | }; | |||
11166 | ||||
11167 | MOZ_CAN_RUN_SCRIPT static bool | |||
11168 | passSequenceOfSequences(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11169 | { | |||
11170 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfSequences"); | |||
11171 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11174( cx, "TestExampleInterface" , "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11172 | "TestExampleInterface", "passSequenceOfSequences", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11174( cx, "TestExampleInterface" , "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11173 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11174( cx, "TestExampleInterface" , "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11174 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11174( cx, "TestExampleInterface" , "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
11175 | ||||
11176 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11177 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfSequences", 1)) { | |||
11178 | return false; | |||
11179 | } | |||
11180 | binding_detail::AutoSequence<Sequence<int32_t>> arg0; | |||
11181 | if (args[0].isObject()) { | |||
11182 | JS::ForOfIterator iter(cx); | |||
11183 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
11184 | return false; | |||
11185 | } | |||
11186 | if (!iter.valueIsIterable()) { | |||
11187 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
11188 | return false; | |||
11189 | } | |||
11190 | binding_detail::AutoSequence<Sequence<int32_t>> &arr = arg0; | |||
11191 | JS::Rooted<JS::Value> temp(cx); | |||
11192 | while (true) { | |||
11193 | bool done; | |||
11194 | if (!iter.next(&temp, &done)) { | |||
11195 | return false; | |||
11196 | } | |||
11197 | if (done) { | |||
11198 | break; | |||
11199 | } | |||
11200 | Sequence<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
11201 | if (!slotPtr) { | |||
11202 | JS_ReportOutOfMemory(cx); | |||
11203 | return false; | |||
11204 | } | |||
11205 | Sequence<int32_t>& slot = *slotPtr; | |||
11206 | if (temp.isObject()) { | |||
11207 | JS::ForOfIterator iter1(cx); | |||
11208 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
11209 | return false; | |||
11210 | } | |||
11211 | if (!iter1.valueIsIterable()) { | |||
11212 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
11213 | return false; | |||
11214 | } | |||
11215 | Sequence<int32_t> &arr1 = slot; | |||
11216 | JS::Rooted<JS::Value> temp1(cx); | |||
11217 | while (true) { | |||
11218 | bool done1; | |||
11219 | if (!iter1.next(&temp1, &done1)) { | |||
11220 | return false; | |||
11221 | } | |||
11222 | if (done1) { | |||
11223 | break; | |||
11224 | } | |||
11225 | int32_t* slotPtr1 = arr1.AppendElement(mozilla::fallible); | |||
11226 | if (!slotPtr1) { | |||
11227 | JS_ReportOutOfMemory(cx); | |||
11228 | return false; | |||
11229 | } | |||
11230 | int32_t& slot1 = *slotPtr1; | |||
11231 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp1, "Element of element of argument 1", &slot1)) { | |||
11232 | return false; | |||
11233 | } | |||
11234 | } | |||
11235 | } else { | |||
11236 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
11237 | return false; | |||
11238 | } | |||
11239 | } | |||
11240 | } else { | |||
11241 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
11242 | return false; | |||
11243 | } | |||
11244 | // NOTE: This assert does NOT call the function. | |||
11245 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfSequences(Constify(arg0)))>, "Should be returning void here"); | |||
11246 | MOZ_KnownLive(self)(self)->PassSequenceOfSequences(Constify(arg0)); | |||
11247 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11247); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11247; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11248 | args.rval().setUndefined(); | |||
11249 | return true; | |||
11250 | } | |||
11251 | ||||
11252 | static const JSJitInfo passSequenceOfSequences_methodinfo = { | |||
11253 | { (JSJitGetterOp)passSequenceOfSequences }, | |||
11254 | { prototypes::id::TestExampleInterface }, | |||
11255 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11256 | JSJitInfo::Method, | |||
11257 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11258 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
11259 | false, /* isInfallible. False in setters. */ | |||
11260 | false, /* isMovable. Not relevant for setters. */ | |||
11261 | false, /* isEliminatable. Not relevant for setters. */ | |||
11262 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11263 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11264 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11265 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11266 | }; | |||
11267 | ||||
11268 | MOZ_CAN_RUN_SCRIPT static bool | |||
11269 | passSequenceOfSequencesOfSequences(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11270 | { | |||
11271 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfSequencesOfSequences"); | |||
11272 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11275( cx, "TestExampleInterface" , "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11273 | "TestExampleInterface", "passSequenceOfSequencesOfSequences", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11275( cx, "TestExampleInterface" , "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11274 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11275( cx, "TestExampleInterface" , "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11275 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11275( cx, "TestExampleInterface" , "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
11276 | ||||
11277 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11278 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfSequencesOfSequences", 1)) { | |||
11279 | return false; | |||
11280 | } | |||
11281 | binding_detail::AutoSequence<Sequence<Sequence<int32_t>>> arg0; | |||
11282 | if (args[0].isObject()) { | |||
11283 | JS::ForOfIterator iter(cx); | |||
11284 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
11285 | return false; | |||
11286 | } | |||
11287 | if (!iter.valueIsIterable()) { | |||
11288 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
11289 | return false; | |||
11290 | } | |||
11291 | binding_detail::AutoSequence<Sequence<Sequence<int32_t>>> &arr = arg0; | |||
11292 | JS::Rooted<JS::Value> temp(cx); | |||
11293 | while (true) { | |||
11294 | bool done; | |||
11295 | if (!iter.next(&temp, &done)) { | |||
11296 | return false; | |||
11297 | } | |||
11298 | if (done) { | |||
11299 | break; | |||
11300 | } | |||
11301 | Sequence<Sequence<int32_t>>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
11302 | if (!slotPtr) { | |||
11303 | JS_ReportOutOfMemory(cx); | |||
11304 | return false; | |||
11305 | } | |||
11306 | Sequence<Sequence<int32_t>>& slot = *slotPtr; | |||
11307 | if (temp.isObject()) { | |||
11308 | JS::ForOfIterator iter1(cx); | |||
11309 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
11310 | return false; | |||
11311 | } | |||
11312 | if (!iter1.valueIsIterable()) { | |||
11313 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
11314 | return false; | |||
11315 | } | |||
11316 | Sequence<Sequence<int32_t>> &arr1 = slot; | |||
11317 | JS::Rooted<JS::Value> temp1(cx); | |||
11318 | while (true) { | |||
11319 | bool done1; | |||
11320 | if (!iter1.next(&temp1, &done1)) { | |||
11321 | return false; | |||
11322 | } | |||
11323 | if (done1) { | |||
11324 | break; | |||
11325 | } | |||
11326 | Sequence<int32_t>* slotPtr1 = arr1.AppendElement(mozilla::fallible); | |||
11327 | if (!slotPtr1) { | |||
11328 | JS_ReportOutOfMemory(cx); | |||
11329 | return false; | |||
11330 | } | |||
11331 | Sequence<int32_t>& slot1 = *slotPtr1; | |||
11332 | if (temp1.isObject()) { | |||
11333 | JS::ForOfIterator iter2(cx); | |||
11334 | if (!iter2.init(temp1, JS::ForOfIterator::AllowNonIterable)) { | |||
11335 | return false; | |||
11336 | } | |||
11337 | if (!iter2.valueIsIterable()) { | |||
11338 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of element of argument 1", "sequence"); | |||
11339 | return false; | |||
11340 | } | |||
11341 | Sequence<int32_t> &arr2 = slot1; | |||
11342 | JS::Rooted<JS::Value> temp2(cx); | |||
11343 | while (true) { | |||
11344 | bool done2; | |||
11345 | if (!iter2.next(&temp2, &done2)) { | |||
11346 | return false; | |||
11347 | } | |||
11348 | if (done2) { | |||
11349 | break; | |||
11350 | } | |||
11351 | int32_t* slotPtr2 = arr2.AppendElement(mozilla::fallible); | |||
11352 | if (!slotPtr2) { | |||
11353 | JS_ReportOutOfMemory(cx); | |||
11354 | return false; | |||
11355 | } | |||
11356 | int32_t& slot2 = *slotPtr2; | |||
11357 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp2, "Element of element of element of argument 1", &slot2)) { | |||
11358 | return false; | |||
11359 | } | |||
11360 | } | |||
11361 | } else { | |||
11362 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of element of argument 1", "sequence"); | |||
11363 | return false; | |||
11364 | } | |||
11365 | } | |||
11366 | } else { | |||
11367 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
11368 | return false; | |||
11369 | } | |||
11370 | } | |||
11371 | } else { | |||
11372 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
11373 | return false; | |||
11374 | } | |||
11375 | // NOTE: This assert does NOT call the function. | |||
11376 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfSequencesOfSequences(Constify(arg0)))>, "Should be returning void here"); | |||
11377 | MOZ_KnownLive(self)(self)->PassSequenceOfSequencesOfSequences(Constify(arg0)); | |||
11378 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11378); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11378; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11379 | args.rval().setUndefined(); | |||
11380 | return true; | |||
11381 | } | |||
11382 | ||||
11383 | static const JSJitInfo passSequenceOfSequencesOfSequences_methodinfo = { | |||
11384 | { (JSJitGetterOp)passSequenceOfSequencesOfSequences }, | |||
11385 | { prototypes::id::TestExampleInterface }, | |||
11386 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11387 | JSJitInfo::Method, | |||
11388 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11389 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
11390 | false, /* isInfallible. False in setters. */ | |||
11391 | false, /* isMovable. Not relevant for setters. */ | |||
11392 | false, /* isEliminatable. Not relevant for setters. */ | |||
11393 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11394 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11395 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11396 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11397 | }; | |||
11398 | ||||
11399 | MOZ_CAN_RUN_SCRIPT static bool | |||
11400 | passRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11401 | { | |||
11402 | BindingCallContext cx(cx_, "TestExampleInterface.passRecord"); | |||
11403 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11406( cx, "TestExampleInterface" , "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11404 | "TestExampleInterface", "passRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11406( cx, "TestExampleInterface" , "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11405 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11406( cx, "TestExampleInterface" , "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11406 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11406( cx, "TestExampleInterface" , "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
11407 | ||||
11408 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11409 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecord", 1)) { | |||
11410 | return false; | |||
11411 | } | |||
11412 | Record<nsString, int32_t> arg0; | |||
11413 | if (args[0].isObject()) { | |||
11414 | auto& recordEntries = arg0.Entries(); | |||
11415 | ||||
11416 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
11417 | JS::RootedVector<jsid> ids(cx); | |||
11418 | if (!js::GetPropertyKeys(cx, recordObj, | |||
11419 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
11420 | return false; | |||
11421 | } | |||
11422 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
11423 | JS_ReportOutOfMemory(cx); | |||
11424 | return false; | |||
11425 | } | |||
11426 | JS::Rooted<JS::Value> propNameValue(cx); | |||
11427 | JS::Rooted<JS::Value> temp(cx); | |||
11428 | JS::Rooted<jsid> curId(cx); | |||
11429 | JS::Rooted<JS::Value> idVal(cx); | |||
11430 | // Use a hashset to keep track of ids seen, to avoid | |||
11431 | // introducing nasty O(N^2) behavior scanning for them all the | |||
11432 | // time. Ideally we'd use a data structure with O(1) lookup | |||
11433 | // _and_ ordering for the MozMap, but we don't have one lying | |||
11434 | // around. | |||
11435 | nsTHashtable<nsStringHashKey> idsSeen; | |||
11436 | for (size_t i = 0; i < ids.length(); ++i) { | |||
11437 | curId = ids[i]; | |||
11438 | ||||
11439 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
11440 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
11441 | &desc)) { | |||
11442 | return false; | |||
11443 | } | |||
11444 | ||||
11445 | if (desc.isNothing() || !desc->enumerable()) { | |||
11446 | continue; | |||
11447 | } | |||
11448 | ||||
11449 | idVal = js::IdToValue(curId); | |||
11450 | nsString propName; | |||
11451 | // This will just throw if idVal is a Symbol, like the spec says | |||
11452 | // to do. | |||
11453 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
11454 | return false; | |||
11455 | } | |||
11456 | ||||
11457 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
11458 | return false; | |||
11459 | } | |||
11460 | ||||
11461 | Record<nsString, int32_t>::EntryType* entry; | |||
11462 | if (!idsSeen.EnsureInserted(propName)) { | |||
11463 | // Find the existing entry. | |||
11464 | auto idx = recordEntries.IndexOf(propName); | |||
11465 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11466); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11466; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
11466 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11466); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11466; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
11467 | // Now blow it away to make it look like it was just added | |||
11468 | // to the array, because it's not obvious that it's | |||
11469 | // safe to write to its already-initialized mValue via our | |||
11470 | // normal codegen conversions. For example, the value | |||
11471 | // could be a union and this would change its type, but | |||
11472 | // codegen assumes we won't do that. | |||
11473 | entry = recordEntries.ReconstructElementAt(idx); | |||
11474 | } else { | |||
11475 | // Safe to do an infallible append here, because we did a | |||
11476 | // SetCapacity above to the right capacity. | |||
11477 | entry = recordEntries.AppendElement(); | |||
11478 | } | |||
11479 | entry->mKey = propName; | |||
11480 | int32_t& slot = entry->mValue; | |||
11481 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) { | |||
11482 | return false; | |||
11483 | } | |||
11484 | } | |||
11485 | } else { | |||
11486 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
11487 | return false; | |||
11488 | } | |||
11489 | // NOTE: This assert does NOT call the function. | |||
11490 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecord(Constify(arg0)))>, "Should be returning void here"); | |||
11491 | MOZ_KnownLive(self)(self)->PassRecord(Constify(arg0)); | |||
11492 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11492); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11492; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11493 | args.rval().setUndefined(); | |||
11494 | return true; | |||
11495 | } | |||
11496 | ||||
11497 | static const JSJitInfo passRecord_methodinfo = { | |||
11498 | { (JSJitGetterOp)passRecord }, | |||
11499 | { prototypes::id::TestExampleInterface }, | |||
11500 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11501 | JSJitInfo::Method, | |||
11502 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11503 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
11504 | false, /* isInfallible. False in setters. */ | |||
11505 | false, /* isMovable. Not relevant for setters. */ | |||
11506 | false, /* isEliminatable. Not relevant for setters. */ | |||
11507 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11508 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11509 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11510 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11511 | }; | |||
11512 | ||||
11513 | MOZ_CAN_RUN_SCRIPT static bool | |||
11514 | passNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11515 | { | |||
11516 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableRecord"); | |||
11517 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11520( cx, "TestExampleInterface" , "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11518 | "TestExampleInterface", "passNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11520( cx, "TestExampleInterface" , "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11519 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11520( cx, "TestExampleInterface" , "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
11520 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11520( cx, "TestExampleInterface" , "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
11521 | ||||
11522 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11523 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableRecord", 1)) { | |||
11524 | return false; | |||
11525 | } | |||
11526 | Nullable<Record<nsString, int32_t>> arg0; | |||
11527 | if (args[0].isObject()) { | |||
11528 | auto& recordEntries = arg0.SetValue().Entries(); | |||
11529 | ||||
11530 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
11531 | JS::RootedVector<jsid> ids(cx); | |||
11532 | if (!js::GetPropertyKeys(cx, recordObj, | |||
11533 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
11534 | return false; | |||
11535 | } | |||
11536 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
11537 | JS_ReportOutOfMemory(cx); | |||
11538 | return false; | |||
11539 | } | |||
11540 | JS::Rooted<JS::Value> propNameValue(cx); | |||
11541 | JS::Rooted<JS::Value> temp(cx); | |||
11542 | JS::Rooted<jsid> curId(cx); | |||
11543 | JS::Rooted<JS::Value> idVal(cx); | |||
11544 | // Use a hashset to keep track of ids seen, to avoid | |||
11545 | // introducing nasty O(N^2) behavior scanning for them all the | |||
11546 | // time. Ideally we'd use a data structure with O(1) lookup | |||
11547 | // _and_ ordering for the MozMap, but we don't have one lying | |||
11548 | // around. | |||
11549 | nsTHashtable<nsStringHashKey> idsSeen; | |||
11550 | for (size_t i = 0; i < ids.length(); ++i) { | |||
11551 | curId = ids[i]; | |||
11552 | ||||
11553 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
11554 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
11555 | &desc)) { | |||
11556 | return false; | |||
11557 | } | |||
11558 | ||||
11559 | if (desc.isNothing() || !desc->enumerable()) { | |||
11560 | continue; | |||
11561 | } | |||
11562 | ||||
11563 | idVal = js::IdToValue(curId); | |||
11564 | nsString propName; | |||
11565 | // This will just throw if idVal is a Symbol, like the spec says | |||
11566 | // to do. | |||
11567 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
11568 | return false; | |||
11569 | } | |||
11570 | ||||
11571 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
11572 | return false; | |||
11573 | } | |||
11574 | ||||
11575 | Record<nsString, int32_t>::EntryType* entry; | |||
11576 | if (!idsSeen.EnsureInserted(propName)) { | |||
11577 | // Find the existing entry. | |||
11578 | auto idx = recordEntries.IndexOf(propName); | |||
11579 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11580); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11580; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
11580 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11580); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11580; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
11581 | // Now blow it away to make it look like it was just added | |||
11582 | // to the array, because it's not obvious that it's | |||
11583 | // safe to write to its already-initialized mValue via our | |||
11584 | // normal codegen conversions. For example, the value | |||
11585 | // could be a union and this would change its type, but | |||
11586 | // codegen assumes we won't do that. | |||
11587 | entry = recordEntries.ReconstructElementAt(idx); | |||
11588 | } else { | |||
11589 | // Safe to do an infallible append here, because we did a | |||
11590 | // SetCapacity above to the right capacity. | |||
11591 | entry = recordEntries.AppendElement(); | |||
11592 | } | |||
11593 | entry->mKey = propName; | |||
11594 | int32_t& slot = entry->mValue; | |||
11595 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) { | |||
11596 | return false; | |||
11597 | } | |||
11598 | } | |||
11599 | } else if (args[0].isNullOrUndefined()) { | |||
11600 | arg0.SetNull(); | |||
11601 | } else { | |||
11602 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
11603 | return false; | |||
11604 | } | |||
11605 | // NOTE: This assert does NOT call the function. | |||
11606 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableRecord(Constify(arg0)))>, "Should be returning void here"); | |||
11607 | MOZ_KnownLive(self)(self)->PassNullableRecord(Constify(arg0)); | |||
11608 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11608); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11608; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11609 | args.rval().setUndefined(); | |||
11610 | return true; | |||
11611 | } | |||
11612 | ||||
11613 | static const JSJitInfo passNullableRecord_methodinfo = { | |||
11614 | { (JSJitGetterOp)passNullableRecord }, | |||
11615 | { prototypes::id::TestExampleInterface }, | |||
11616 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11617 | JSJitInfo::Method, | |||
11618 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11619 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
11620 | false, /* isInfallible. False in setters. */ | |||
11621 | false, /* isMovable. Not relevant for setters. */ | |||
11622 | false, /* isEliminatable. Not relevant for setters. */ | |||
11623 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11624 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11625 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11626 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11627 | }; | |||
11628 | ||||
11629 | MOZ_CAN_RUN_SCRIPT static bool | |||
11630 | passRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11631 | { | |||
11632 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfNullableInts"); | |||
11633 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11636( cx, "TestExampleInterface" , "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11634 | "TestExampleInterface", "passRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11636( cx, "TestExampleInterface" , "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11635 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11636( cx, "TestExampleInterface" , "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11636 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11636( cx, "TestExampleInterface" , "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
11637 | ||||
11638 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11639 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfNullableInts", 1)) { | |||
11640 | return false; | |||
11641 | } | |||
11642 | Record<nsString, Nullable<int32_t>> arg0; | |||
11643 | if (args[0].isObject()) { | |||
11644 | auto& recordEntries = arg0.Entries(); | |||
11645 | ||||
11646 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
11647 | JS::RootedVector<jsid> ids(cx); | |||
11648 | if (!js::GetPropertyKeys(cx, recordObj, | |||
11649 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
11650 | return false; | |||
11651 | } | |||
11652 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
11653 | JS_ReportOutOfMemory(cx); | |||
11654 | return false; | |||
11655 | } | |||
11656 | JS::Rooted<JS::Value> propNameValue(cx); | |||
11657 | JS::Rooted<JS::Value> temp(cx); | |||
11658 | JS::Rooted<jsid> curId(cx); | |||
11659 | JS::Rooted<JS::Value> idVal(cx); | |||
11660 | // Use a hashset to keep track of ids seen, to avoid | |||
11661 | // introducing nasty O(N^2) behavior scanning for them all the | |||
11662 | // time. Ideally we'd use a data structure with O(1) lookup | |||
11663 | // _and_ ordering for the MozMap, but we don't have one lying | |||
11664 | // around. | |||
11665 | nsTHashtable<nsStringHashKey> idsSeen; | |||
11666 | for (size_t i = 0; i < ids.length(); ++i) { | |||
11667 | curId = ids[i]; | |||
11668 | ||||
11669 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
11670 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
11671 | &desc)) { | |||
11672 | return false; | |||
11673 | } | |||
11674 | ||||
11675 | if (desc.isNothing() || !desc->enumerable()) { | |||
11676 | continue; | |||
11677 | } | |||
11678 | ||||
11679 | idVal = js::IdToValue(curId); | |||
11680 | nsString propName; | |||
11681 | // This will just throw if idVal is a Symbol, like the spec says | |||
11682 | // to do. | |||
11683 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
11684 | return false; | |||
11685 | } | |||
11686 | ||||
11687 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
11688 | return false; | |||
11689 | } | |||
11690 | ||||
11691 | Record<nsString, Nullable<int32_t>>::EntryType* entry; | |||
11692 | if (!idsSeen.EnsureInserted(propName)) { | |||
11693 | // Find the existing entry. | |||
11694 | auto idx = recordEntries.IndexOf(propName); | |||
11695 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11696); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11696; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
11696 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11696); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11696; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
11697 | // Now blow it away to make it look like it was just added | |||
11698 | // to the array, because it's not obvious that it's | |||
11699 | // safe to write to its already-initialized mValue via our | |||
11700 | // normal codegen conversions. For example, the value | |||
11701 | // could be a union and this would change its type, but | |||
11702 | // codegen assumes we won't do that. | |||
11703 | entry = recordEntries.ReconstructElementAt(idx); | |||
11704 | } else { | |||
11705 | // Safe to do an infallible append here, because we did a | |||
11706 | // SetCapacity above to the right capacity. | |||
11707 | entry = recordEntries.AppendElement(); | |||
11708 | } | |||
11709 | entry->mKey = propName; | |||
11710 | Nullable<int32_t>& slot = entry->mValue; | |||
11711 | if (temp.isNullOrUndefined()) { | |||
11712 | slot.SetNull(); | |||
11713 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) { | |||
11714 | return false; | |||
11715 | } | |||
11716 | } | |||
11717 | } else { | |||
11718 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
11719 | return false; | |||
11720 | } | |||
11721 | // NOTE: This assert does NOT call the function. | |||
11722 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfNullableInts(Constify(arg0)))>, "Should be returning void here"); | |||
11723 | MOZ_KnownLive(self)(self)->PassRecordOfNullableInts(Constify(arg0)); | |||
11724 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11724); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11724; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11725 | args.rval().setUndefined(); | |||
11726 | return true; | |||
11727 | } | |||
11728 | ||||
11729 | static const JSJitInfo passRecordOfNullableInts_methodinfo = { | |||
11730 | { (JSJitGetterOp)passRecordOfNullableInts }, | |||
11731 | { prototypes::id::TestExampleInterface }, | |||
11732 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11733 | JSJitInfo::Method, | |||
11734 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11735 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
11736 | false, /* isInfallible. False in setters. */ | |||
11737 | false, /* isMovable. Not relevant for setters. */ | |||
11738 | false, /* isEliminatable. Not relevant for setters. */ | |||
11739 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11740 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11741 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11742 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11743 | }; | |||
11744 | ||||
11745 | MOZ_CAN_RUN_SCRIPT static bool | |||
11746 | passOptionalRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11747 | { | |||
11748 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalRecordOfNullableInts"); | |||
11749 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11752( cx, "TestExampleInterface" , "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11750 | "TestExampleInterface", "passOptionalRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11752( cx, "TestExampleInterface" , "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11751 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11752( cx, "TestExampleInterface" , "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11752 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11752( cx, "TestExampleInterface" , "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
11753 | ||||
11754 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11755 | Optional<Record<nsString, Nullable<int32_t>>> arg0; | |||
11756 | if (args.hasDefined(0)) { | |||
11757 | arg0.Construct(); | |||
11758 | if (args[0].isObject()) { | |||
11759 | auto& recordEntries = arg0.Value().Entries(); | |||
11760 | ||||
11761 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
11762 | JS::RootedVector<jsid> ids(cx); | |||
11763 | if (!js::GetPropertyKeys(cx, recordObj, | |||
11764 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
11765 | return false; | |||
11766 | } | |||
11767 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
11768 | JS_ReportOutOfMemory(cx); | |||
11769 | return false; | |||
11770 | } | |||
11771 | JS::Rooted<JS::Value> propNameValue(cx); | |||
11772 | JS::Rooted<JS::Value> temp(cx); | |||
11773 | JS::Rooted<jsid> curId(cx); | |||
11774 | JS::Rooted<JS::Value> idVal(cx); | |||
11775 | // Use a hashset to keep track of ids seen, to avoid | |||
11776 | // introducing nasty O(N^2) behavior scanning for them all the | |||
11777 | // time. Ideally we'd use a data structure with O(1) lookup | |||
11778 | // _and_ ordering for the MozMap, but we don't have one lying | |||
11779 | // around. | |||
11780 | nsTHashtable<nsStringHashKey> idsSeen; | |||
11781 | for (size_t i = 0; i < ids.length(); ++i) { | |||
11782 | curId = ids[i]; | |||
11783 | ||||
11784 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
11785 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
11786 | &desc)) { | |||
11787 | return false; | |||
11788 | } | |||
11789 | ||||
11790 | if (desc.isNothing() || !desc->enumerable()) { | |||
11791 | continue; | |||
11792 | } | |||
11793 | ||||
11794 | idVal = js::IdToValue(curId); | |||
11795 | nsString propName; | |||
11796 | // This will just throw if idVal is a Symbol, like the spec says | |||
11797 | // to do. | |||
11798 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
11799 | return false; | |||
11800 | } | |||
11801 | ||||
11802 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
11803 | return false; | |||
11804 | } | |||
11805 | ||||
11806 | Record<nsString, Nullable<int32_t>>::EntryType* entry; | |||
11807 | if (!idsSeen.EnsureInserted(propName)) { | |||
11808 | // Find the existing entry. | |||
11809 | auto idx = recordEntries.IndexOf(propName); | |||
11810 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11811); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11811; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
11811 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11811); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11811; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
11812 | // Now blow it away to make it look like it was just added | |||
11813 | // to the array, because it's not obvious that it's | |||
11814 | // safe to write to its already-initialized mValue via our | |||
11815 | // normal codegen conversions. For example, the value | |||
11816 | // could be a union and this would change its type, but | |||
11817 | // codegen assumes we won't do that. | |||
11818 | entry = recordEntries.ReconstructElementAt(idx); | |||
11819 | } else { | |||
11820 | // Safe to do an infallible append here, because we did a | |||
11821 | // SetCapacity above to the right capacity. | |||
11822 | entry = recordEntries.AppendElement(); | |||
11823 | } | |||
11824 | entry->mKey = propName; | |||
11825 | Nullable<int32_t>& slot = entry->mValue; | |||
11826 | if (temp.isNullOrUndefined()) { | |||
11827 | slot.SetNull(); | |||
11828 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) { | |||
11829 | return false; | |||
11830 | } | |||
11831 | } | |||
11832 | } else { | |||
11833 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
11834 | return false; | |||
11835 | } | |||
11836 | } | |||
11837 | // NOTE: This assert does NOT call the function. | |||
11838 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecordOfNullableInts(Constify(arg0)))>, "Should be returning void here"); | |||
11839 | MOZ_KnownLive(self)(self)->PassOptionalRecordOfNullableInts(Constify(arg0)); | |||
11840 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11840); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11840; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11841 | args.rval().setUndefined(); | |||
11842 | return true; | |||
11843 | } | |||
11844 | ||||
11845 | static const JSJitInfo passOptionalRecordOfNullableInts_methodinfo = { | |||
11846 | { (JSJitGetterOp)passOptionalRecordOfNullableInts }, | |||
11847 | { prototypes::id::TestExampleInterface }, | |||
11848 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11849 | JSJitInfo::Method, | |||
11850 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11851 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
11852 | false, /* isInfallible. False in setters. */ | |||
11853 | false, /* isMovable. Not relevant for setters. */ | |||
11854 | false, /* isEliminatable. Not relevant for setters. */ | |||
11855 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11856 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11857 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11858 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11859 | }; | |||
11860 | ||||
11861 | MOZ_CAN_RUN_SCRIPT static bool | |||
11862 | passOptionalNullableRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11863 | { | |||
11864 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableRecordOfNullableInts"); | |||
11865 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11868( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11866 | "TestExampleInterface", "passOptionalNullableRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11868( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11867 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11868( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11868 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11868( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
11869 | ||||
11870 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11871 | Optional<Nullable<Record<nsString, Nullable<int32_t>>>> arg0; | |||
11872 | if (args.hasDefined(0)) { | |||
11873 | arg0.Construct(); | |||
11874 | if (args[0].isObject()) { | |||
11875 | auto& recordEntries = arg0.Value().SetValue().Entries(); | |||
11876 | ||||
11877 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
11878 | JS::RootedVector<jsid> ids(cx); | |||
11879 | if (!js::GetPropertyKeys(cx, recordObj, | |||
11880 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
11881 | return false; | |||
11882 | } | |||
11883 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
11884 | JS_ReportOutOfMemory(cx); | |||
11885 | return false; | |||
11886 | } | |||
11887 | JS::Rooted<JS::Value> propNameValue(cx); | |||
11888 | JS::Rooted<JS::Value> temp(cx); | |||
11889 | JS::Rooted<jsid> curId(cx); | |||
11890 | JS::Rooted<JS::Value> idVal(cx); | |||
11891 | // Use a hashset to keep track of ids seen, to avoid | |||
11892 | // introducing nasty O(N^2) behavior scanning for them all the | |||
11893 | // time. Ideally we'd use a data structure with O(1) lookup | |||
11894 | // _and_ ordering for the MozMap, but we don't have one lying | |||
11895 | // around. | |||
11896 | nsTHashtable<nsStringHashKey> idsSeen; | |||
11897 | for (size_t i = 0; i < ids.length(); ++i) { | |||
11898 | curId = ids[i]; | |||
11899 | ||||
11900 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
11901 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
11902 | &desc)) { | |||
11903 | return false; | |||
11904 | } | |||
11905 | ||||
11906 | if (desc.isNothing() || !desc->enumerable()) { | |||
11907 | continue; | |||
11908 | } | |||
11909 | ||||
11910 | idVal = js::IdToValue(curId); | |||
11911 | nsString propName; | |||
11912 | // This will just throw if idVal is a Symbol, like the spec says | |||
11913 | // to do. | |||
11914 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
11915 | return false; | |||
11916 | } | |||
11917 | ||||
11918 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
11919 | return false; | |||
11920 | } | |||
11921 | ||||
11922 | Record<nsString, Nullable<int32_t>>::EntryType* entry; | |||
11923 | if (!idsSeen.EnsureInserted(propName)) { | |||
11924 | // Find the existing entry. | |||
11925 | auto idx = recordEntries.IndexOf(propName); | |||
11926 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11927); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11927; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
11927 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 11927); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 11927; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
11928 | // Now blow it away to make it look like it was just added | |||
11929 | // to the array, because it's not obvious that it's | |||
11930 | // safe to write to its already-initialized mValue via our | |||
11931 | // normal codegen conversions. For example, the value | |||
11932 | // could be a union and this would change its type, but | |||
11933 | // codegen assumes we won't do that. | |||
11934 | entry = recordEntries.ReconstructElementAt(idx); | |||
11935 | } else { | |||
11936 | // Safe to do an infallible append here, because we did a | |||
11937 | // SetCapacity above to the right capacity. | |||
11938 | entry = recordEntries.AppendElement(); | |||
11939 | } | |||
11940 | entry->mKey = propName; | |||
11941 | Nullable<int32_t>& slot = entry->mValue; | |||
11942 | if (temp.isNullOrUndefined()) { | |||
11943 | slot.SetNull(); | |||
11944 | } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) { | |||
11945 | return false; | |||
11946 | } | |||
11947 | } | |||
11948 | } else if (args[0].isNullOrUndefined()) { | |||
11949 | arg0.Value().SetNull(); | |||
11950 | } else { | |||
11951 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
11952 | return false; | |||
11953 | } | |||
11954 | } | |||
11955 | // NOTE: This assert does NOT call the function. | |||
11956 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableInts(Constify(arg0)))>, "Should be returning void here"); | |||
11957 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableInts(Constify(arg0)); | |||
11958 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 11958); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 11958; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
11959 | args.rval().setUndefined(); | |||
11960 | return true; | |||
11961 | } | |||
11962 | ||||
11963 | static const JSJitInfo passOptionalNullableRecordOfNullableInts_methodinfo = { | |||
11964 | { (JSJitGetterOp)passOptionalNullableRecordOfNullableInts }, | |||
11965 | { prototypes::id::TestExampleInterface }, | |||
11966 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
11967 | JSJitInfo::Method, | |||
11968 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
11969 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
11970 | false, /* isInfallible. False in setters. */ | |||
11971 | false, /* isMovable. Not relevant for setters. */ | |||
11972 | false, /* isEliminatable. Not relevant for setters. */ | |||
11973 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
11974 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
11975 | false, /* isTypedMethod. Only relevant for methods. */ | |||
11976 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
11977 | }; | |||
11978 | ||||
11979 | MOZ_CAN_RUN_SCRIPT static bool | |||
11980 | passCastableObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
11981 | { | |||
11982 | BindingCallContext cx(cx_, "TestExampleInterface.passCastableObjectRecord"); | |||
11983 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11986( cx, "TestExampleInterface" , "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11984 | "TestExampleInterface", "passCastableObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11986( cx, "TestExampleInterface" , "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11985 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11986( cx, "TestExampleInterface" , "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
11986 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11986( cx, "TestExampleInterface" , "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
11987 | ||||
11988 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
11989 | if (!args.requireAtLeast(cx, "TestExampleInterface.passCastableObjectRecord", 1)) { | |||
11990 | return false; | |||
11991 | } | |||
11992 | Record<nsString, OwningNonNull<mozilla::dom::TestInterface>> arg0; | |||
11993 | if (args[0].isObject()) { | |||
11994 | auto& recordEntries = arg0.Entries(); | |||
11995 | ||||
11996 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
11997 | JS::RootedVector<jsid> ids(cx); | |||
11998 | if (!js::GetPropertyKeys(cx, recordObj, | |||
11999 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12000 | return false; | |||
12001 | } | |||
12002 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12003 | JS_ReportOutOfMemory(cx); | |||
12004 | return false; | |||
12005 | } | |||
12006 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12007 | JS::Rooted<JS::Value> temp(cx); | |||
12008 | JS::Rooted<jsid> curId(cx); | |||
12009 | JS::Rooted<JS::Value> idVal(cx); | |||
12010 | // Use a hashset to keep track of ids seen, to avoid | |||
12011 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12012 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12013 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12014 | // around. | |||
12015 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12016 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12017 | curId = ids[i]; | |||
12018 | ||||
12019 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12020 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12021 | &desc)) { | |||
12022 | return false; | |||
12023 | } | |||
12024 | ||||
12025 | if (desc.isNothing() || !desc->enumerable()) { | |||
12026 | continue; | |||
12027 | } | |||
12028 | ||||
12029 | idVal = js::IdToValue(curId); | |||
12030 | nsString propName; | |||
12031 | // This will just throw if idVal is a Symbol, like the spec says | |||
12032 | // to do. | |||
12033 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12034 | return false; | |||
12035 | } | |||
12036 | ||||
12037 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12038 | return false; | |||
12039 | } | |||
12040 | ||||
12041 | Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry; | |||
12042 | if (!idsSeen.EnsureInserted(propName)) { | |||
12043 | // Find the existing entry. | |||
12044 | auto idx = recordEntries.IndexOf(propName); | |||
12045 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12046); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12046; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12046 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12046); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12046; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12047 | // Now blow it away to make it look like it was just added | |||
12048 | // to the array, because it's not obvious that it's | |||
12049 | // safe to write to its already-initialized mValue via our | |||
12050 | // normal codegen conversions. For example, the value | |||
12051 | // could be a union and this would change its type, but | |||
12052 | // codegen assumes we won't do that. | |||
12053 | entry = recordEntries.ReconstructElementAt(idx); | |||
12054 | } else { | |||
12055 | // Safe to do an infallible append here, because we did a | |||
12056 | // SetCapacity above to the right capacity. | |||
12057 | entry = recordEntries.AppendElement(); | |||
12058 | } | |||
12059 | entry->mKey = propName; | |||
12060 | OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue; | |||
12061 | if (temp.isObject()) { | |||
12062 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
12063 | { | |||
12064 | // Our JSContext should be in the right global to do unwrapping in. | |||
12065 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
12066 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
12067 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface"); | |||
12068 | return false; | |||
12069 | } | |||
12070 | } | |||
12071 | } else { | |||
12072 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
12073 | return false; | |||
12074 | } | |||
12075 | } | |||
12076 | } else { | |||
12077 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12078 | return false; | |||
12079 | } | |||
12080 | // NOTE: This assert does NOT call the function. | |||
12081 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectRecord(Constify(arg0)))>, "Should be returning void here"); | |||
12082 | MOZ_KnownLive(self)(self)->PassCastableObjectRecord(Constify(arg0)); | |||
12083 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12083); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12083; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12084 | args.rval().setUndefined(); | |||
12085 | return true; | |||
12086 | } | |||
12087 | ||||
12088 | static const JSJitInfo passCastableObjectRecord_methodinfo = { | |||
12089 | { (JSJitGetterOp)passCastableObjectRecord }, | |||
12090 | { prototypes::id::TestExampleInterface }, | |||
12091 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12092 | JSJitInfo::Method, | |||
12093 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12094 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12095 | false, /* isInfallible. False in setters. */ | |||
12096 | false, /* isMovable. Not relevant for setters. */ | |||
12097 | false, /* isEliminatable. Not relevant for setters. */ | |||
12098 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12099 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12100 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12101 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12102 | }; | |||
12103 | ||||
12104 | MOZ_CAN_RUN_SCRIPT static bool | |||
12105 | passNullableCastableObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12106 | { | |||
12107 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableCastableObjectRecord"); | |||
12108 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12111( cx, "TestExampleInterface" , "passNullableCastableObjectRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12109 | "TestExampleInterface", "passNullableCastableObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12111( cx, "TestExampleInterface" , "passNullableCastableObjectRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12110 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12111( cx, "TestExampleInterface" , "passNullableCastableObjectRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12111 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12111( cx, "TestExampleInterface" , "passNullableCastableObjectRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
12112 | ||||
12113 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12114 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableCastableObjectRecord", 1)) { | |||
12115 | return false; | |||
12116 | } | |||
12117 | Record<nsString, RefPtr<mozilla::dom::TestInterface>> arg0; | |||
12118 | if (args[0].isObject()) { | |||
12119 | auto& recordEntries = arg0.Entries(); | |||
12120 | ||||
12121 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12122 | JS::RootedVector<jsid> ids(cx); | |||
12123 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12124 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12125 | return false; | |||
12126 | } | |||
12127 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12128 | JS_ReportOutOfMemory(cx); | |||
12129 | return false; | |||
12130 | } | |||
12131 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12132 | JS::Rooted<JS::Value> temp(cx); | |||
12133 | JS::Rooted<jsid> curId(cx); | |||
12134 | JS::Rooted<JS::Value> idVal(cx); | |||
12135 | // Use a hashset to keep track of ids seen, to avoid | |||
12136 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12137 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12138 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12139 | // around. | |||
12140 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12141 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12142 | curId = ids[i]; | |||
12143 | ||||
12144 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12145 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12146 | &desc)) { | |||
12147 | return false; | |||
12148 | } | |||
12149 | ||||
12150 | if (desc.isNothing() || !desc->enumerable()) { | |||
12151 | continue; | |||
12152 | } | |||
12153 | ||||
12154 | idVal = js::IdToValue(curId); | |||
12155 | nsString propName; | |||
12156 | // This will just throw if idVal is a Symbol, like the spec says | |||
12157 | // to do. | |||
12158 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12159 | return false; | |||
12160 | } | |||
12161 | ||||
12162 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12163 | return false; | |||
12164 | } | |||
12165 | ||||
12166 | Record<nsString, RefPtr<mozilla::dom::TestInterface>>::EntryType* entry; | |||
12167 | if (!idsSeen.EnsureInserted(propName)) { | |||
12168 | // Find the existing entry. | |||
12169 | auto idx = recordEntries.IndexOf(propName); | |||
12170 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12171); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12171; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12171 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12171); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12171; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12172 | // Now blow it away to make it look like it was just added | |||
12173 | // to the array, because it's not obvious that it's | |||
12174 | // safe to write to its already-initialized mValue via our | |||
12175 | // normal codegen conversions. For example, the value | |||
12176 | // could be a union and this would change its type, but | |||
12177 | // codegen assumes we won't do that. | |||
12178 | entry = recordEntries.ReconstructElementAt(idx); | |||
12179 | } else { | |||
12180 | // Safe to do an infallible append here, because we did a | |||
12181 | // SetCapacity above to the right capacity. | |||
12182 | entry = recordEntries.AppendElement(); | |||
12183 | } | |||
12184 | entry->mKey = propName; | |||
12185 | RefPtr<mozilla::dom::TestInterface>& slot = entry->mValue; | |||
12186 | if (temp.isObject()) { | |||
12187 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
12188 | { | |||
12189 | // Our JSContext should be in the right global to do unwrapping in. | |||
12190 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
12191 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
12192 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface"); | |||
12193 | return false; | |||
12194 | } | |||
12195 | } | |||
12196 | } else if (temp.isNullOrUndefined()) { | |||
12197 | slot = nullptr; | |||
12198 | } else { | |||
12199 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
12200 | return false; | |||
12201 | } | |||
12202 | } | |||
12203 | } else { | |||
12204 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12205 | return false; | |||
12206 | } | |||
12207 | // NOTE: This assert does NOT call the function. | |||
12208 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectRecord(Constify(arg0)))>, "Should be returning void here"); | |||
12209 | MOZ_KnownLive(self)(self)->PassNullableCastableObjectRecord(Constify(arg0)); | |||
12210 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12210); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12210; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12211 | args.rval().setUndefined(); | |||
12212 | return true; | |||
12213 | } | |||
12214 | ||||
12215 | static const JSJitInfo passNullableCastableObjectRecord_methodinfo = { | |||
12216 | { (JSJitGetterOp)passNullableCastableObjectRecord }, | |||
12217 | { prototypes::id::TestExampleInterface }, | |||
12218 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12219 | JSJitInfo::Method, | |||
12220 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12221 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12222 | false, /* isInfallible. False in setters. */ | |||
12223 | false, /* isMovable. Not relevant for setters. */ | |||
12224 | false, /* isEliminatable. Not relevant for setters. */ | |||
12225 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12226 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12227 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12228 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12229 | }; | |||
12230 | ||||
12231 | MOZ_CAN_RUN_SCRIPT static bool | |||
12232 | passCastableObjectNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12233 | { | |||
12234 | BindingCallContext cx(cx_, "TestExampleInterface.passCastableObjectNullableRecord"); | |||
12235 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12238( cx, "TestExampleInterface" , "passCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12236 | "TestExampleInterface", "passCastableObjectNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12238( cx, "TestExampleInterface" , "passCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12237 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12238( cx, "TestExampleInterface" , "passCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12238 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12238( cx, "TestExampleInterface" , "passCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
12239 | ||||
12240 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12241 | if (!args.requireAtLeast(cx, "TestExampleInterface.passCastableObjectNullableRecord", 1)) { | |||
12242 | return false; | |||
12243 | } | |||
12244 | Nullable<Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>> arg0; | |||
12245 | if (args[0].isObject()) { | |||
12246 | auto& recordEntries = arg0.SetValue().Entries(); | |||
12247 | ||||
12248 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12249 | JS::RootedVector<jsid> ids(cx); | |||
12250 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12251 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12252 | return false; | |||
12253 | } | |||
12254 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12255 | JS_ReportOutOfMemory(cx); | |||
12256 | return false; | |||
12257 | } | |||
12258 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12259 | JS::Rooted<JS::Value> temp(cx); | |||
12260 | JS::Rooted<jsid> curId(cx); | |||
12261 | JS::Rooted<JS::Value> idVal(cx); | |||
12262 | // Use a hashset to keep track of ids seen, to avoid | |||
12263 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12264 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12265 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12266 | // around. | |||
12267 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12268 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12269 | curId = ids[i]; | |||
12270 | ||||
12271 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12272 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12273 | &desc)) { | |||
12274 | return false; | |||
12275 | } | |||
12276 | ||||
12277 | if (desc.isNothing() || !desc->enumerable()) { | |||
12278 | continue; | |||
12279 | } | |||
12280 | ||||
12281 | idVal = js::IdToValue(curId); | |||
12282 | nsString propName; | |||
12283 | // This will just throw if idVal is a Symbol, like the spec says | |||
12284 | // to do. | |||
12285 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12286 | return false; | |||
12287 | } | |||
12288 | ||||
12289 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12290 | return false; | |||
12291 | } | |||
12292 | ||||
12293 | Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry; | |||
12294 | if (!idsSeen.EnsureInserted(propName)) { | |||
12295 | // Find the existing entry. | |||
12296 | auto idx = recordEntries.IndexOf(propName); | |||
12297 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12298); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12298; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12298 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12298); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12298; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12299 | // Now blow it away to make it look like it was just added | |||
12300 | // to the array, because it's not obvious that it's | |||
12301 | // safe to write to its already-initialized mValue via our | |||
12302 | // normal codegen conversions. For example, the value | |||
12303 | // could be a union and this would change its type, but | |||
12304 | // codegen assumes we won't do that. | |||
12305 | entry = recordEntries.ReconstructElementAt(idx); | |||
12306 | } else { | |||
12307 | // Safe to do an infallible append here, because we did a | |||
12308 | // SetCapacity above to the right capacity. | |||
12309 | entry = recordEntries.AppendElement(); | |||
12310 | } | |||
12311 | entry->mKey = propName; | |||
12312 | OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue; | |||
12313 | if (temp.isObject()) { | |||
12314 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
12315 | { | |||
12316 | // Our JSContext should be in the right global to do unwrapping in. | |||
12317 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
12318 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
12319 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface"); | |||
12320 | return false; | |||
12321 | } | |||
12322 | } | |||
12323 | } else { | |||
12324 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
12325 | return false; | |||
12326 | } | |||
12327 | } | |||
12328 | } else if (args[0].isNullOrUndefined()) { | |||
12329 | arg0.SetNull(); | |||
12330 | } else { | |||
12331 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12332 | return false; | |||
12333 | } | |||
12334 | // NOTE: This assert does NOT call the function. | |||
12335 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectNullableRecord(Constify(arg0)))>, "Should be returning void here"); | |||
12336 | MOZ_KnownLive(self)(self)->PassCastableObjectNullableRecord(Constify(arg0)); | |||
12337 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12337); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12337; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12338 | args.rval().setUndefined(); | |||
12339 | return true; | |||
12340 | } | |||
12341 | ||||
12342 | static const JSJitInfo passCastableObjectNullableRecord_methodinfo = { | |||
12343 | { (JSJitGetterOp)passCastableObjectNullableRecord }, | |||
12344 | { prototypes::id::TestExampleInterface }, | |||
12345 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12346 | JSJitInfo::Method, | |||
12347 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12348 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12349 | false, /* isInfallible. False in setters. */ | |||
12350 | false, /* isMovable. Not relevant for setters. */ | |||
12351 | false, /* isEliminatable. Not relevant for setters. */ | |||
12352 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12353 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12354 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12355 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12356 | }; | |||
12357 | ||||
12358 | MOZ_CAN_RUN_SCRIPT static bool | |||
12359 | passNullableCastableObjectNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12360 | { | |||
12361 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableCastableObjectNullableRecord"); | |||
12362 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12365( cx, "TestExampleInterface" , "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12363 | "TestExampleInterface", "passNullableCastableObjectNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12365( cx, "TestExampleInterface" , "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12364 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12365( cx, "TestExampleInterface" , "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12365 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12365( cx, "TestExampleInterface" , "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
12366 | ||||
12367 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12368 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableCastableObjectNullableRecord", 1)) { | |||
12369 | return false; | |||
12370 | } | |||
12371 | Nullable<Record<nsString, RefPtr<mozilla::dom::TestInterface>>> arg0; | |||
12372 | if (args[0].isObject()) { | |||
12373 | auto& recordEntries = arg0.SetValue().Entries(); | |||
12374 | ||||
12375 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12376 | JS::RootedVector<jsid> ids(cx); | |||
12377 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12378 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12379 | return false; | |||
12380 | } | |||
12381 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12382 | JS_ReportOutOfMemory(cx); | |||
12383 | return false; | |||
12384 | } | |||
12385 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12386 | JS::Rooted<JS::Value> temp(cx); | |||
12387 | JS::Rooted<jsid> curId(cx); | |||
12388 | JS::Rooted<JS::Value> idVal(cx); | |||
12389 | // Use a hashset to keep track of ids seen, to avoid | |||
12390 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12391 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12392 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12393 | // around. | |||
12394 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12395 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12396 | curId = ids[i]; | |||
12397 | ||||
12398 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12399 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12400 | &desc)) { | |||
12401 | return false; | |||
12402 | } | |||
12403 | ||||
12404 | if (desc.isNothing() || !desc->enumerable()) { | |||
12405 | continue; | |||
12406 | } | |||
12407 | ||||
12408 | idVal = js::IdToValue(curId); | |||
12409 | nsString propName; | |||
12410 | // This will just throw if idVal is a Symbol, like the spec says | |||
12411 | // to do. | |||
12412 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12413 | return false; | |||
12414 | } | |||
12415 | ||||
12416 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12417 | return false; | |||
12418 | } | |||
12419 | ||||
12420 | Record<nsString, RefPtr<mozilla::dom::TestInterface>>::EntryType* entry; | |||
12421 | if (!idsSeen.EnsureInserted(propName)) { | |||
12422 | // Find the existing entry. | |||
12423 | auto idx = recordEntries.IndexOf(propName); | |||
12424 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12425); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12425; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12425 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12425); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12425; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12426 | // Now blow it away to make it look like it was just added | |||
12427 | // to the array, because it's not obvious that it's | |||
12428 | // safe to write to its already-initialized mValue via our | |||
12429 | // normal codegen conversions. For example, the value | |||
12430 | // could be a union and this would change its type, but | |||
12431 | // codegen assumes we won't do that. | |||
12432 | entry = recordEntries.ReconstructElementAt(idx); | |||
12433 | } else { | |||
12434 | // Safe to do an infallible append here, because we did a | |||
12435 | // SetCapacity above to the right capacity. | |||
12436 | entry = recordEntries.AppendElement(); | |||
12437 | } | |||
12438 | entry->mKey = propName; | |||
12439 | RefPtr<mozilla::dom::TestInterface>& slot = entry->mValue; | |||
12440 | if (temp.isObject()) { | |||
12441 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
12442 | { | |||
12443 | // Our JSContext should be in the right global to do unwrapping in. | |||
12444 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
12445 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
12446 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface"); | |||
12447 | return false; | |||
12448 | } | |||
12449 | } | |||
12450 | } else if (temp.isNullOrUndefined()) { | |||
12451 | slot = nullptr; | |||
12452 | } else { | |||
12453 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
12454 | return false; | |||
12455 | } | |||
12456 | } | |||
12457 | } else if (args[0].isNullOrUndefined()) { | |||
12458 | arg0.SetNull(); | |||
12459 | } else { | |||
12460 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12461 | return false; | |||
12462 | } | |||
12463 | // NOTE: This assert does NOT call the function. | |||
12464 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableRecord(Constify(arg0)))>, "Should be returning void here"); | |||
12465 | MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableRecord(Constify(arg0)); | |||
12466 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12466); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12466; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12467 | args.rval().setUndefined(); | |||
12468 | return true; | |||
12469 | } | |||
12470 | ||||
12471 | static const JSJitInfo passNullableCastableObjectNullableRecord_methodinfo = { | |||
12472 | { (JSJitGetterOp)passNullableCastableObjectNullableRecord }, | |||
12473 | { prototypes::id::TestExampleInterface }, | |||
12474 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12475 | JSJitInfo::Method, | |||
12476 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12477 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12478 | false, /* isInfallible. False in setters. */ | |||
12479 | false, /* isMovable. Not relevant for setters. */ | |||
12480 | false, /* isEliminatable. Not relevant for setters. */ | |||
12481 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12482 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12483 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12484 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12485 | }; | |||
12486 | ||||
12487 | MOZ_CAN_RUN_SCRIPT static bool | |||
12488 | passOptionalRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12489 | { | |||
12490 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalRecord"); | |||
12491 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12494( cx, "TestExampleInterface" , "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
12492 | "TestExampleInterface", "passOptionalRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12494( cx, "TestExampleInterface" , "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
12493 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12494( cx, "TestExampleInterface" , "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
12494 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12494( cx, "TestExampleInterface" , "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
12495 | ||||
12496 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12497 | Optional<Record<nsString, int32_t>> arg0; | |||
12498 | if (args.hasDefined(0)) { | |||
12499 | arg0.Construct(); | |||
12500 | if (args[0].isObject()) { | |||
12501 | auto& recordEntries = arg0.Value().Entries(); | |||
12502 | ||||
12503 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12504 | JS::RootedVector<jsid> ids(cx); | |||
12505 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12506 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12507 | return false; | |||
12508 | } | |||
12509 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12510 | JS_ReportOutOfMemory(cx); | |||
12511 | return false; | |||
12512 | } | |||
12513 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12514 | JS::Rooted<JS::Value> temp(cx); | |||
12515 | JS::Rooted<jsid> curId(cx); | |||
12516 | JS::Rooted<JS::Value> idVal(cx); | |||
12517 | // Use a hashset to keep track of ids seen, to avoid | |||
12518 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12519 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12520 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12521 | // around. | |||
12522 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12523 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12524 | curId = ids[i]; | |||
12525 | ||||
12526 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12527 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12528 | &desc)) { | |||
12529 | return false; | |||
12530 | } | |||
12531 | ||||
12532 | if (desc.isNothing() || !desc->enumerable()) { | |||
12533 | continue; | |||
12534 | } | |||
12535 | ||||
12536 | idVal = js::IdToValue(curId); | |||
12537 | nsString propName; | |||
12538 | // This will just throw if idVal is a Symbol, like the spec says | |||
12539 | // to do. | |||
12540 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12541 | return false; | |||
12542 | } | |||
12543 | ||||
12544 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12545 | return false; | |||
12546 | } | |||
12547 | ||||
12548 | Record<nsString, int32_t>::EntryType* entry; | |||
12549 | if (!idsSeen.EnsureInserted(propName)) { | |||
12550 | // Find the existing entry. | |||
12551 | auto idx = recordEntries.IndexOf(propName); | |||
12552 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12553); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12553; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12553 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12553); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12553; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12554 | // Now blow it away to make it look like it was just added | |||
12555 | // to the array, because it's not obvious that it's | |||
12556 | // safe to write to its already-initialized mValue via our | |||
12557 | // normal codegen conversions. For example, the value | |||
12558 | // could be a union and this would change its type, but | |||
12559 | // codegen assumes we won't do that. | |||
12560 | entry = recordEntries.ReconstructElementAt(idx); | |||
12561 | } else { | |||
12562 | // Safe to do an infallible append here, because we did a | |||
12563 | // SetCapacity above to the right capacity. | |||
12564 | entry = recordEntries.AppendElement(); | |||
12565 | } | |||
12566 | entry->mKey = propName; | |||
12567 | int32_t& slot = entry->mValue; | |||
12568 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) { | |||
12569 | return false; | |||
12570 | } | |||
12571 | } | |||
12572 | } else { | |||
12573 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12574 | return false; | |||
12575 | } | |||
12576 | } | |||
12577 | // NOTE: This assert does NOT call the function. | |||
12578 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecord(Constify(arg0)))>, "Should be returning void here"); | |||
12579 | MOZ_KnownLive(self)(self)->PassOptionalRecord(Constify(arg0)); | |||
12580 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12580); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12580; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12581 | args.rval().setUndefined(); | |||
12582 | return true; | |||
12583 | } | |||
12584 | ||||
12585 | static const JSJitInfo passOptionalRecord_methodinfo = { | |||
12586 | { (JSJitGetterOp)passOptionalRecord }, | |||
12587 | { prototypes::id::TestExampleInterface }, | |||
12588 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12589 | JSJitInfo::Method, | |||
12590 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12591 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12592 | false, /* isInfallible. False in setters. */ | |||
12593 | false, /* isMovable. Not relevant for setters. */ | |||
12594 | false, /* isEliminatable. Not relevant for setters. */ | |||
12595 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12596 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12597 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12598 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12599 | }; | |||
12600 | ||||
12601 | MOZ_CAN_RUN_SCRIPT static bool | |||
12602 | passOptionalNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12603 | { | |||
12604 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableRecord"); | |||
12605 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12608( cx, "TestExampleInterface" , "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12606 | "TestExampleInterface", "passOptionalNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12608( cx, "TestExampleInterface" , "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12607 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12608( cx, "TestExampleInterface" , "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12608 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12608( cx, "TestExampleInterface" , "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
12609 | ||||
12610 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12611 | Optional<Nullable<Record<nsString, int32_t>>> arg0; | |||
12612 | if (args.hasDefined(0)) { | |||
12613 | arg0.Construct(); | |||
12614 | if (args[0].isObject()) { | |||
12615 | auto& recordEntries = arg0.Value().SetValue().Entries(); | |||
12616 | ||||
12617 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12618 | JS::RootedVector<jsid> ids(cx); | |||
12619 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12620 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12621 | return false; | |||
12622 | } | |||
12623 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12624 | JS_ReportOutOfMemory(cx); | |||
12625 | return false; | |||
12626 | } | |||
12627 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12628 | JS::Rooted<JS::Value> temp(cx); | |||
12629 | JS::Rooted<jsid> curId(cx); | |||
12630 | JS::Rooted<JS::Value> idVal(cx); | |||
12631 | // Use a hashset to keep track of ids seen, to avoid | |||
12632 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12633 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12634 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12635 | // around. | |||
12636 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12637 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12638 | curId = ids[i]; | |||
12639 | ||||
12640 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12641 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12642 | &desc)) { | |||
12643 | return false; | |||
12644 | } | |||
12645 | ||||
12646 | if (desc.isNothing() || !desc->enumerable()) { | |||
12647 | continue; | |||
12648 | } | |||
12649 | ||||
12650 | idVal = js::IdToValue(curId); | |||
12651 | nsString propName; | |||
12652 | // This will just throw if idVal is a Symbol, like the spec says | |||
12653 | // to do. | |||
12654 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12655 | return false; | |||
12656 | } | |||
12657 | ||||
12658 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12659 | return false; | |||
12660 | } | |||
12661 | ||||
12662 | Record<nsString, int32_t>::EntryType* entry; | |||
12663 | if (!idsSeen.EnsureInserted(propName)) { | |||
12664 | // Find the existing entry. | |||
12665 | auto idx = recordEntries.IndexOf(propName); | |||
12666 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12667); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12667; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12667 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12667); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12667; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12668 | // Now blow it away to make it look like it was just added | |||
12669 | // to the array, because it's not obvious that it's | |||
12670 | // safe to write to its already-initialized mValue via our | |||
12671 | // normal codegen conversions. For example, the value | |||
12672 | // could be a union and this would change its type, but | |||
12673 | // codegen assumes we won't do that. | |||
12674 | entry = recordEntries.ReconstructElementAt(idx); | |||
12675 | } else { | |||
12676 | // Safe to do an infallible append here, because we did a | |||
12677 | // SetCapacity above to the right capacity. | |||
12678 | entry = recordEntries.AppendElement(); | |||
12679 | } | |||
12680 | entry->mKey = propName; | |||
12681 | int32_t& slot = entry->mValue; | |||
12682 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) { | |||
12683 | return false; | |||
12684 | } | |||
12685 | } | |||
12686 | } else if (args[0].isNullOrUndefined()) { | |||
12687 | arg0.Value().SetNull(); | |||
12688 | } else { | |||
12689 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12690 | return false; | |||
12691 | } | |||
12692 | } | |||
12693 | // NOTE: This assert does NOT call the function. | |||
12694 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecord(Constify(arg0)))>, "Should be returning void here"); | |||
12695 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecord(Constify(arg0)); | |||
12696 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12696); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12696; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12697 | args.rval().setUndefined(); | |||
12698 | return true; | |||
12699 | } | |||
12700 | ||||
12701 | static const JSJitInfo passOptionalNullableRecord_methodinfo = { | |||
12702 | { (JSJitGetterOp)passOptionalNullableRecord }, | |||
12703 | { prototypes::id::TestExampleInterface }, | |||
12704 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12705 | JSJitInfo::Method, | |||
12706 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12707 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12708 | false, /* isInfallible. False in setters. */ | |||
12709 | false, /* isMovable. Not relevant for setters. */ | |||
12710 | false, /* isEliminatable. Not relevant for setters. */ | |||
12711 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12712 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12713 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12714 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12715 | }; | |||
12716 | ||||
12717 | MOZ_CAN_RUN_SCRIPT static bool | |||
12718 | passOptionalNullableRecordWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12719 | { | |||
12720 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableRecordWithDefaultValue"); | |||
12721 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12724( cx, "TestExampleInterface" , "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12722 | "TestExampleInterface", "passOptionalNullableRecordWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12724( cx, "TestExampleInterface" , "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12723 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12724( cx, "TestExampleInterface" , "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12724 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12724( cx, "TestExampleInterface" , "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
12725 | ||||
12726 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12727 | Nullable<Record<nsString, int32_t>> arg0; | |||
12728 | if (args.hasDefined(0)) { | |||
12729 | if (args[0].isObject()) { | |||
12730 | auto& recordEntries = arg0.SetValue().Entries(); | |||
12731 | ||||
12732 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12733 | JS::RootedVector<jsid> ids(cx); | |||
12734 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12735 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12736 | return false; | |||
12737 | } | |||
12738 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12739 | JS_ReportOutOfMemory(cx); | |||
12740 | return false; | |||
12741 | } | |||
12742 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12743 | JS::Rooted<JS::Value> temp(cx); | |||
12744 | JS::Rooted<jsid> curId(cx); | |||
12745 | JS::Rooted<JS::Value> idVal(cx); | |||
12746 | // Use a hashset to keep track of ids seen, to avoid | |||
12747 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12748 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12749 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12750 | // around. | |||
12751 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12752 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12753 | curId = ids[i]; | |||
12754 | ||||
12755 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12756 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12757 | &desc)) { | |||
12758 | return false; | |||
12759 | } | |||
12760 | ||||
12761 | if (desc.isNothing() || !desc->enumerable()) { | |||
12762 | continue; | |||
12763 | } | |||
12764 | ||||
12765 | idVal = js::IdToValue(curId); | |||
12766 | nsString propName; | |||
12767 | // This will just throw if idVal is a Symbol, like the spec says | |||
12768 | // to do. | |||
12769 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12770 | return false; | |||
12771 | } | |||
12772 | ||||
12773 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12774 | return false; | |||
12775 | } | |||
12776 | ||||
12777 | Record<nsString, int32_t>::EntryType* entry; | |||
12778 | if (!idsSeen.EnsureInserted(propName)) { | |||
12779 | // Find the existing entry. | |||
12780 | auto idx = recordEntries.IndexOf(propName); | |||
12781 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12782); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12782; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12782 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12782); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12782; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12783 | // Now blow it away to make it look like it was just added | |||
12784 | // to the array, because it's not obvious that it's | |||
12785 | // safe to write to its already-initialized mValue via our | |||
12786 | // normal codegen conversions. For example, the value | |||
12787 | // could be a union and this would change its type, but | |||
12788 | // codegen assumes we won't do that. | |||
12789 | entry = recordEntries.ReconstructElementAt(idx); | |||
12790 | } else { | |||
12791 | // Safe to do an infallible append here, because we did a | |||
12792 | // SetCapacity above to the right capacity. | |||
12793 | entry = recordEntries.AppendElement(); | |||
12794 | } | |||
12795 | entry->mKey = propName; | |||
12796 | int32_t& slot = entry->mValue; | |||
12797 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) { | |||
12798 | return false; | |||
12799 | } | |||
12800 | } | |||
12801 | } else if (args[0].isNullOrUndefined()) { | |||
12802 | arg0.SetNull(); | |||
12803 | } else { | |||
12804 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12805 | return false; | |||
12806 | } | |||
12807 | } else { | |||
12808 | arg0.SetNull(); | |||
12809 | } | |||
12810 | // NOTE: This assert does NOT call the function. | |||
12811 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
12812 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordWithDefaultValue(Constify(arg0)); | |||
12813 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12813); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12813; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12814 | args.rval().setUndefined(); | |||
12815 | return true; | |||
12816 | } | |||
12817 | ||||
12818 | static const JSJitInfo passOptionalNullableRecordWithDefaultValue_methodinfo = { | |||
12819 | { (JSJitGetterOp)passOptionalNullableRecordWithDefaultValue }, | |||
12820 | { prototypes::id::TestExampleInterface }, | |||
12821 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12822 | JSJitInfo::Method, | |||
12823 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12824 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12825 | false, /* isInfallible. False in setters. */ | |||
12826 | false, /* isMovable. Not relevant for setters. */ | |||
12827 | false, /* isEliminatable. Not relevant for setters. */ | |||
12828 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12829 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12830 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12831 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12832 | }; | |||
12833 | ||||
12834 | MOZ_CAN_RUN_SCRIPT static bool | |||
12835 | passOptionalObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12836 | { | |||
12837 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalObjectRecord"); | |||
12838 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12841( cx, "TestExampleInterface" , "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12839 | "TestExampleInterface", "passOptionalObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12841( cx, "TestExampleInterface" , "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12840 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12841( cx, "TestExampleInterface" , "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12841 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12841( cx, "TestExampleInterface" , "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
12842 | ||||
12843 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12844 | Optional<Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>> arg0; | |||
12845 | if (args.hasDefined(0)) { | |||
12846 | arg0.Construct(); | |||
12847 | if (args[0].isObject()) { | |||
12848 | auto& recordEntries = arg0.Value().Entries(); | |||
12849 | ||||
12850 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12851 | JS::RootedVector<jsid> ids(cx); | |||
12852 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12853 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12854 | return false; | |||
12855 | } | |||
12856 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12857 | JS_ReportOutOfMemory(cx); | |||
12858 | return false; | |||
12859 | } | |||
12860 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12861 | JS::Rooted<JS::Value> temp(cx); | |||
12862 | JS::Rooted<jsid> curId(cx); | |||
12863 | JS::Rooted<JS::Value> idVal(cx); | |||
12864 | // Use a hashset to keep track of ids seen, to avoid | |||
12865 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12866 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12867 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12868 | // around. | |||
12869 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12870 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12871 | curId = ids[i]; | |||
12872 | ||||
12873 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
12874 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
12875 | &desc)) { | |||
12876 | return false; | |||
12877 | } | |||
12878 | ||||
12879 | if (desc.isNothing() || !desc->enumerable()) { | |||
12880 | continue; | |||
12881 | } | |||
12882 | ||||
12883 | idVal = js::IdToValue(curId); | |||
12884 | nsString propName; | |||
12885 | // This will just throw if idVal is a Symbol, like the spec says | |||
12886 | // to do. | |||
12887 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
12888 | return false; | |||
12889 | } | |||
12890 | ||||
12891 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
12892 | return false; | |||
12893 | } | |||
12894 | ||||
12895 | Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry; | |||
12896 | if (!idsSeen.EnsureInserted(propName)) { | |||
12897 | // Find the existing entry. | |||
12898 | auto idx = recordEntries.IndexOf(propName); | |||
12899 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12900); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12900; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
12900 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 12900); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 12900; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
12901 | // Now blow it away to make it look like it was just added | |||
12902 | // to the array, because it's not obvious that it's | |||
12903 | // safe to write to its already-initialized mValue via our | |||
12904 | // normal codegen conversions. For example, the value | |||
12905 | // could be a union and this would change its type, but | |||
12906 | // codegen assumes we won't do that. | |||
12907 | entry = recordEntries.ReconstructElementAt(idx); | |||
12908 | } else { | |||
12909 | // Safe to do an infallible append here, because we did a | |||
12910 | // SetCapacity above to the right capacity. | |||
12911 | entry = recordEntries.AppendElement(); | |||
12912 | } | |||
12913 | entry->mKey = propName; | |||
12914 | OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue; | |||
12915 | if (temp.isObject()) { | |||
12916 | static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes."); | |||
12917 | { | |||
12918 | // Our JSContext should be in the right global to do unwrapping in. | |||
12919 | nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx); | |||
12920 | if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) { | |||
12921 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface"); | |||
12922 | return false; | |||
12923 | } | |||
12924 | } | |||
12925 | } else { | |||
12926 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
12927 | return false; | |||
12928 | } | |||
12929 | } | |||
12930 | } else { | |||
12931 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
12932 | return false; | |||
12933 | } | |||
12934 | } | |||
12935 | // NOTE: This assert does NOT call the function. | |||
12936 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalObjectRecord(Constify(arg0)))>, "Should be returning void here"); | |||
12937 | MOZ_KnownLive(self)(self)->PassOptionalObjectRecord(Constify(arg0)); | |||
12938 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 12938); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 12938; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
12939 | args.rval().setUndefined(); | |||
12940 | return true; | |||
12941 | } | |||
12942 | ||||
12943 | static const JSJitInfo passOptionalObjectRecord_methodinfo = { | |||
12944 | { (JSJitGetterOp)passOptionalObjectRecord }, | |||
12945 | { prototypes::id::TestExampleInterface }, | |||
12946 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
12947 | JSJitInfo::Method, | |||
12948 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
12949 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
12950 | false, /* isInfallible. False in setters. */ | |||
12951 | false, /* isMovable. Not relevant for setters. */ | |||
12952 | false, /* isEliminatable. Not relevant for setters. */ | |||
12953 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
12954 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
12955 | false, /* isTypedMethod. Only relevant for methods. */ | |||
12956 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
12957 | }; | |||
12958 | ||||
12959 | MOZ_CAN_RUN_SCRIPT static bool | |||
12960 | passExternalInterfaceRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
12961 | { | |||
12962 | BindingCallContext cx(cx_, "TestExampleInterface.passExternalInterfaceRecord"); | |||
12963 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12966( cx, "TestExampleInterface" , "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12964 | "TestExampleInterface", "passExternalInterfaceRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12966( cx, "TestExampleInterface" , "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12965 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12966( cx, "TestExampleInterface" , "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
12966 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12966( cx, "TestExampleInterface" , "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
12967 | ||||
12968 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
12969 | if (!args.requireAtLeast(cx, "TestExampleInterface.passExternalInterfaceRecord", 1)) { | |||
12970 | return false; | |||
12971 | } | |||
12972 | Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>> arg0; | |||
12973 | if (args[0].isObject()) { | |||
12974 | auto& recordEntries = arg0.Entries(); | |||
12975 | ||||
12976 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
12977 | JS::RootedVector<jsid> ids(cx); | |||
12978 | if (!js::GetPropertyKeys(cx, recordObj, | |||
12979 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
12980 | return false; | |||
12981 | } | |||
12982 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
12983 | JS_ReportOutOfMemory(cx); | |||
12984 | return false; | |||
12985 | } | |||
12986 | JS::Rooted<JS::Value> propNameValue(cx); | |||
12987 | JS::Rooted<JS::Value> temp(cx); | |||
12988 | JS::Rooted<jsid> curId(cx); | |||
12989 | JS::Rooted<JS::Value> idVal(cx); | |||
12990 | // Use a hashset to keep track of ids seen, to avoid | |||
12991 | // introducing nasty O(N^2) behavior scanning for them all the | |||
12992 | // time. Ideally we'd use a data structure with O(1) lookup | |||
12993 | // _and_ ordering for the MozMap, but we don't have one lying | |||
12994 | // around. | |||
12995 | nsTHashtable<nsStringHashKey> idsSeen; | |||
12996 | for (size_t i = 0; i < ids.length(); ++i) { | |||
12997 | curId = ids[i]; | |||
12998 | ||||
12999 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
13000 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
13001 | &desc)) { | |||
13002 | return false; | |||
13003 | } | |||
13004 | ||||
13005 | if (desc.isNothing() || !desc->enumerable()) { | |||
13006 | continue; | |||
13007 | } | |||
13008 | ||||
13009 | idVal = js::IdToValue(curId); | |||
13010 | nsString propName; | |||
13011 | // This will just throw if idVal is a Symbol, like the spec says | |||
13012 | // to do. | |||
13013 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
13014 | return false; | |||
13015 | } | |||
13016 | ||||
13017 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
13018 | return false; | |||
13019 | } | |||
13020 | ||||
13021 | Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>>::EntryType* entry; | |||
13022 | if (!idsSeen.EnsureInserted(propName)) { | |||
13023 | // Find the existing entry. | |||
13024 | auto idx = recordEntries.IndexOf(propName); | |||
13025 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13026); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13026; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
13026 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13026); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13026; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13027 | // Now blow it away to make it look like it was just added | |||
13028 | // to the array, because it's not obvious that it's | |||
13029 | // safe to write to its already-initialized mValue via our | |||
13030 | // normal codegen conversions. For example, the value | |||
13031 | // could be a union and this would change its type, but | |||
13032 | // codegen assumes we won't do that. | |||
13033 | entry = recordEntries.ReconstructElementAt(idx); | |||
13034 | } else { | |||
13035 | // Safe to do an infallible append here, because we did a | |||
13036 | // SetCapacity above to the right capacity. | |||
13037 | entry = recordEntries.AppendElement(); | |||
13038 | } | |||
13039 | entry->mKey = propName; | |||
13040 | RefPtr<mozilla::dom::TestExternalInterface>& slot = entry->mValue; | |||
13041 | if (temp.isObject()) { | |||
13042 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | |||
13043 | RefPtr<mozilla::dom::TestExternalInterface> tempHolder; | |||
13044 | JS::Rooted<JSObject*> source(cx, &temp.toObject()); | |||
13045 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder )))), 0)))) { | |||
13046 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestExternalInterface"); | |||
13047 | return false; | |||
13048 | } | |||
13049 | MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(tempHolder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestExampleGenBinding.cpp" , 13049); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder" ")"); do { *((volatile int*)__null) = 13049; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13050 | slot = tempHolder; | |||
13051 | } else { | |||
13052 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
13053 | return false; | |||
13054 | } | |||
13055 | } | |||
13056 | } else { | |||
13057 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
13058 | return false; | |||
13059 | } | |||
13060 | // NOTE: This assert does NOT call the function. | |||
13061 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassExternalInterfaceRecord(Constify(arg0)))>, "Should be returning void here"); | |||
13062 | MOZ_KnownLive(self)(self)->PassExternalInterfaceRecord(Constify(arg0)); | |||
13063 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13063); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13063; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13064 | args.rval().setUndefined(); | |||
13065 | return true; | |||
13066 | } | |||
13067 | ||||
13068 | static const JSJitInfo passExternalInterfaceRecord_methodinfo = { | |||
13069 | { (JSJitGetterOp)passExternalInterfaceRecord }, | |||
13070 | { prototypes::id::TestExampleInterface }, | |||
13071 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13072 | JSJitInfo::Method, | |||
13073 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13074 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
13075 | false, /* isInfallible. False in setters. */ | |||
13076 | false, /* isMovable. Not relevant for setters. */ | |||
13077 | false, /* isEliminatable. Not relevant for setters. */ | |||
13078 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13079 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13080 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13081 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13082 | }; | |||
13083 | ||||
13084 | MOZ_CAN_RUN_SCRIPT static bool | |||
13085 | passNullableExternalInterfaceRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13086 | { | |||
13087 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableExternalInterfaceRecord"); | |||
13088 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13091( cx, "TestExampleInterface" , "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13089 | "TestExampleInterface", "passNullableExternalInterfaceRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13091( cx, "TestExampleInterface" , "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13090 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13091( cx, "TestExampleInterface" , "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13091 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13091( cx, "TestExampleInterface" , "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
13092 | ||||
13093 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13094 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableExternalInterfaceRecord", 1)) { | |||
13095 | return false; | |||
13096 | } | |||
13097 | Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>> arg0; | |||
13098 | if (args[0].isObject()) { | |||
13099 | auto& recordEntries = arg0.Entries(); | |||
13100 | ||||
13101 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
13102 | JS::RootedVector<jsid> ids(cx); | |||
13103 | if (!js::GetPropertyKeys(cx, recordObj, | |||
13104 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
13105 | return false; | |||
13106 | } | |||
13107 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
13108 | JS_ReportOutOfMemory(cx); | |||
13109 | return false; | |||
13110 | } | |||
13111 | JS::Rooted<JS::Value> propNameValue(cx); | |||
13112 | JS::Rooted<JS::Value> temp(cx); | |||
13113 | JS::Rooted<jsid> curId(cx); | |||
13114 | JS::Rooted<JS::Value> idVal(cx); | |||
13115 | // Use a hashset to keep track of ids seen, to avoid | |||
13116 | // introducing nasty O(N^2) behavior scanning for them all the | |||
13117 | // time. Ideally we'd use a data structure with O(1) lookup | |||
13118 | // _and_ ordering for the MozMap, but we don't have one lying | |||
13119 | // around. | |||
13120 | nsTHashtable<nsStringHashKey> idsSeen; | |||
13121 | for (size_t i = 0; i < ids.length(); ++i) { | |||
13122 | curId = ids[i]; | |||
13123 | ||||
13124 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
13125 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
13126 | &desc)) { | |||
13127 | return false; | |||
13128 | } | |||
13129 | ||||
13130 | if (desc.isNothing() || !desc->enumerable()) { | |||
13131 | continue; | |||
13132 | } | |||
13133 | ||||
13134 | idVal = js::IdToValue(curId); | |||
13135 | nsString propName; | |||
13136 | // This will just throw if idVal is a Symbol, like the spec says | |||
13137 | // to do. | |||
13138 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
13139 | return false; | |||
13140 | } | |||
13141 | ||||
13142 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
13143 | return false; | |||
13144 | } | |||
13145 | ||||
13146 | Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>>::EntryType* entry; | |||
13147 | if (!idsSeen.EnsureInserted(propName)) { | |||
13148 | // Find the existing entry. | |||
13149 | auto idx = recordEntries.IndexOf(propName); | |||
13150 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13151); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13151; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
13151 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13151); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13151; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13152 | // Now blow it away to make it look like it was just added | |||
13153 | // to the array, because it's not obvious that it's | |||
13154 | // safe to write to its already-initialized mValue via our | |||
13155 | // normal codegen conversions. For example, the value | |||
13156 | // could be a union and this would change its type, but | |||
13157 | // codegen assumes we won't do that. | |||
13158 | entry = recordEntries.ReconstructElementAt(idx); | |||
13159 | } else { | |||
13160 | // Safe to do an infallible append here, because we did a | |||
13161 | // SetCapacity above to the right capacity. | |||
13162 | entry = recordEntries.AppendElement(); | |||
13163 | } | |||
13164 | entry->mKey = propName; | |||
13165 | RefPtr<mozilla::dom::TestExternalInterface>& slot = entry->mValue; | |||
13166 | if (temp.isObject()) { | |||
13167 | static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes."); | |||
13168 | RefPtr<mozilla::dom::TestExternalInterface> tempHolder; | |||
13169 | JS::Rooted<JSObject*> source(cx, &temp.toObject()); | |||
13170 | if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla ::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder )))), 0)))) { | |||
13171 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestExternalInterface"); | |||
13172 | return false; | |||
13173 | } | |||
13174 | MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType< decltype(tempHolder)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestExampleGenBinding.cpp" , 13174); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder" ")"); do { *((volatile int*)__null) = 13174; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13175 | slot = tempHolder; | |||
13176 | } else if (temp.isNullOrUndefined()) { | |||
13177 | slot = nullptr; | |||
13178 | } else { | |||
13179 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
13180 | return false; | |||
13181 | } | |||
13182 | } | |||
13183 | } else { | |||
13184 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
13185 | return false; | |||
13186 | } | |||
13187 | // NOTE: This assert does NOT call the function. | |||
13188 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceRecord(Constify(arg0)))>, "Should be returning void here"); | |||
13189 | MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceRecord(Constify(arg0)); | |||
13190 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13190); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13190; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13191 | args.rval().setUndefined(); | |||
13192 | return true; | |||
13193 | } | |||
13194 | ||||
13195 | static const JSJitInfo passNullableExternalInterfaceRecord_methodinfo = { | |||
13196 | { (JSJitGetterOp)passNullableExternalInterfaceRecord }, | |||
13197 | { prototypes::id::TestExampleInterface }, | |||
13198 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13199 | JSJitInfo::Method, | |||
13200 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13201 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
13202 | false, /* isInfallible. False in setters. */ | |||
13203 | false, /* isMovable. Not relevant for setters. */ | |||
13204 | false, /* isEliminatable. Not relevant for setters. */ | |||
13205 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13206 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13207 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13208 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13209 | }; | |||
13210 | ||||
13211 | MOZ_CAN_RUN_SCRIPT static bool | |||
13212 | passStringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13213 | { | |||
13214 | BindingCallContext cx(cx_, "TestExampleInterface.passStringRecord"); | |||
13215 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13218( cx, "TestExampleInterface" , "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13216 | "TestExampleInterface", "passStringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13218( cx, "TestExampleInterface" , "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13217 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13218( cx, "TestExampleInterface" , "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13218 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13218( cx, "TestExampleInterface" , "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
13219 | ||||
13220 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13221 | if (!args.requireAtLeast(cx, "TestExampleInterface.passStringRecord", 1)) { | |||
13222 | return false; | |||
13223 | } | |||
13224 | Record<nsString, nsString> arg0; | |||
13225 | if (args[0].isObject()) { | |||
13226 | auto& recordEntries = arg0.Entries(); | |||
13227 | ||||
13228 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
13229 | JS::RootedVector<jsid> ids(cx); | |||
13230 | if (!js::GetPropertyKeys(cx, recordObj, | |||
13231 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
13232 | return false; | |||
13233 | } | |||
13234 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
13235 | JS_ReportOutOfMemory(cx); | |||
13236 | return false; | |||
13237 | } | |||
13238 | JS::Rooted<JS::Value> propNameValue(cx); | |||
13239 | JS::Rooted<JS::Value> temp(cx); | |||
13240 | JS::Rooted<jsid> curId(cx); | |||
13241 | JS::Rooted<JS::Value> idVal(cx); | |||
13242 | // Use a hashset to keep track of ids seen, to avoid | |||
13243 | // introducing nasty O(N^2) behavior scanning for them all the | |||
13244 | // time. Ideally we'd use a data structure with O(1) lookup | |||
13245 | // _and_ ordering for the MozMap, but we don't have one lying | |||
13246 | // around. | |||
13247 | nsTHashtable<nsStringHashKey> idsSeen; | |||
13248 | for (size_t i = 0; i < ids.length(); ++i) { | |||
13249 | curId = ids[i]; | |||
13250 | ||||
13251 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
13252 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
13253 | &desc)) { | |||
13254 | return false; | |||
13255 | } | |||
13256 | ||||
13257 | if (desc.isNothing() || !desc->enumerable()) { | |||
13258 | continue; | |||
13259 | } | |||
13260 | ||||
13261 | idVal = js::IdToValue(curId); | |||
13262 | nsString propName; | |||
13263 | // This will just throw if idVal is a Symbol, like the spec says | |||
13264 | // to do. | |||
13265 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
13266 | return false; | |||
13267 | } | |||
13268 | ||||
13269 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
13270 | return false; | |||
13271 | } | |||
13272 | ||||
13273 | Record<nsString, nsString>::EntryType* entry; | |||
13274 | if (!idsSeen.EnsureInserted(propName)) { | |||
13275 | // Find the existing entry. | |||
13276 | auto idx = recordEntries.IndexOf(propName); | |||
13277 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13278); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13278; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
13278 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13278); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13278; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13279 | // Now blow it away to make it look like it was just added | |||
13280 | // to the array, because it's not obvious that it's | |||
13281 | // safe to write to its already-initialized mValue via our | |||
13282 | // normal codegen conversions. For example, the value | |||
13283 | // could be a union and this would change its type, but | |||
13284 | // codegen assumes we won't do that. | |||
13285 | entry = recordEntries.ReconstructElementAt(idx); | |||
13286 | } else { | |||
13287 | // Safe to do an infallible append here, because we did a | |||
13288 | // SetCapacity above to the right capacity. | |||
13289 | entry = recordEntries.AppendElement(); | |||
13290 | } | |||
13291 | entry->mKey = propName; | |||
13292 | nsString& slot = entry->mValue; | |||
13293 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | |||
13294 | return false; | |||
13295 | } | |||
13296 | } | |||
13297 | } else { | |||
13298 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
13299 | return false; | |||
13300 | } | |||
13301 | // NOTE: This assert does NOT call the function. | |||
13302 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassStringRecord(Constify(arg0)))>, "Should be returning void here"); | |||
13303 | MOZ_KnownLive(self)(self)->PassStringRecord(Constify(arg0)); | |||
13304 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13304); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13304; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13305 | args.rval().setUndefined(); | |||
13306 | return true; | |||
13307 | } | |||
13308 | ||||
13309 | static const JSJitInfo passStringRecord_methodinfo = { | |||
13310 | { (JSJitGetterOp)passStringRecord }, | |||
13311 | { prototypes::id::TestExampleInterface }, | |||
13312 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13313 | JSJitInfo::Method, | |||
13314 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13315 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
13316 | false, /* isInfallible. False in setters. */ | |||
13317 | false, /* isMovable. Not relevant for setters. */ | |||
13318 | false, /* isEliminatable. Not relevant for setters. */ | |||
13319 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13320 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13321 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13322 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13323 | }; | |||
13324 | ||||
13325 | MOZ_CAN_RUN_SCRIPT static bool | |||
13326 | passByteStringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13327 | { | |||
13328 | BindingCallContext cx(cx_, "TestExampleInterface.passByteStringRecord"); | |||
13329 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestExampleInterface" , "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13330 | "TestExampleInterface", "passByteStringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestExampleInterface" , "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13331 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestExampleInterface" , "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13332 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestExampleInterface" , "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
13333 | ||||
13334 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13335 | if (!args.requireAtLeast(cx, "TestExampleInterface.passByteStringRecord", 1)) { | |||
13336 | return false; | |||
13337 | } | |||
13338 | Record<nsString, nsCString> arg0; | |||
13339 | if (args[0].isObject()) { | |||
13340 | auto& recordEntries = arg0.Entries(); | |||
13341 | ||||
13342 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
13343 | JS::RootedVector<jsid> ids(cx); | |||
13344 | if (!js::GetPropertyKeys(cx, recordObj, | |||
13345 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
13346 | return false; | |||
13347 | } | |||
13348 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
13349 | JS_ReportOutOfMemory(cx); | |||
13350 | return false; | |||
13351 | } | |||
13352 | JS::Rooted<JS::Value> propNameValue(cx); | |||
13353 | JS::Rooted<JS::Value> temp(cx); | |||
13354 | JS::Rooted<jsid> curId(cx); | |||
13355 | JS::Rooted<JS::Value> idVal(cx); | |||
13356 | // Use a hashset to keep track of ids seen, to avoid | |||
13357 | // introducing nasty O(N^2) behavior scanning for them all the | |||
13358 | // time. Ideally we'd use a data structure with O(1) lookup | |||
13359 | // _and_ ordering for the MozMap, but we don't have one lying | |||
13360 | // around. | |||
13361 | nsTHashtable<nsStringHashKey> idsSeen; | |||
13362 | for (size_t i = 0; i < ids.length(); ++i) { | |||
13363 | curId = ids[i]; | |||
13364 | ||||
13365 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
13366 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
13367 | &desc)) { | |||
13368 | return false; | |||
13369 | } | |||
13370 | ||||
13371 | if (desc.isNothing() || !desc->enumerable()) { | |||
13372 | continue; | |||
13373 | } | |||
13374 | ||||
13375 | idVal = js::IdToValue(curId); | |||
13376 | nsString propName; | |||
13377 | // This will just throw if idVal is a Symbol, like the spec says | |||
13378 | // to do. | |||
13379 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
13380 | return false; | |||
13381 | } | |||
13382 | ||||
13383 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
13384 | return false; | |||
13385 | } | |||
13386 | ||||
13387 | Record<nsString, nsCString>::EntryType* entry; | |||
13388 | if (!idsSeen.EnsureInserted(propName)) { | |||
13389 | // Find the existing entry. | |||
13390 | auto idx = recordEntries.IndexOf(propName); | |||
13391 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13392); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13392; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
13392 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13392); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13392; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13393 | // Now blow it away to make it look like it was just added | |||
13394 | // to the array, because it's not obvious that it's | |||
13395 | // safe to write to its already-initialized mValue via our | |||
13396 | // normal codegen conversions. For example, the value | |||
13397 | // could be a union and this would change its type, but | |||
13398 | // codegen assumes we won't do that. | |||
13399 | entry = recordEntries.ReconstructElementAt(idx); | |||
13400 | } else { | |||
13401 | // Safe to do an infallible append here, because we did a | |||
13402 | // SetCapacity above to the right capacity. | |||
13403 | entry = recordEntries.AppendElement(); | |||
13404 | } | |||
13405 | entry->mKey = propName; | |||
13406 | nsCString& slot = entry->mValue; | |||
13407 | if (!ConvertJSValueToByteString(cx, temp, false, "value in argument 1", slot)) { | |||
13408 | return false; | |||
13409 | } | |||
13410 | } | |||
13411 | } else { | |||
13412 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
13413 | return false; | |||
13414 | } | |||
13415 | // NOTE: This assert does NOT call the function. | |||
13416 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByteStringRecord(Constify(arg0)))>, "Should be returning void here"); | |||
13417 | MOZ_KnownLive(self)(self)->PassByteStringRecord(Constify(arg0)); | |||
13418 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13418); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13418; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13419 | args.rval().setUndefined(); | |||
13420 | return true; | |||
13421 | } | |||
13422 | ||||
13423 | static const JSJitInfo passByteStringRecord_methodinfo = { | |||
13424 | { (JSJitGetterOp)passByteStringRecord }, | |||
13425 | { prototypes::id::TestExampleInterface }, | |||
13426 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13427 | JSJitInfo::Method, | |||
13428 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13429 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
13430 | false, /* isInfallible. False in setters. */ | |||
13431 | false, /* isMovable. Not relevant for setters. */ | |||
13432 | false, /* isEliminatable. Not relevant for setters. */ | |||
13433 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13434 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13435 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13436 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13437 | }; | |||
13438 | ||||
13439 | MOZ_CAN_RUN_SCRIPT static bool | |||
13440 | passUTF8StringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13441 | { | |||
13442 | BindingCallContext cx(cx_, "TestExampleInterface.passUTF8StringRecord"); | |||
13443 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13446( cx, "TestExampleInterface" , "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13444 | "TestExampleInterface", "passUTF8StringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13446( cx, "TestExampleInterface" , "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13445 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13446( cx, "TestExampleInterface" , "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13446 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13446( cx, "TestExampleInterface" , "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
13447 | ||||
13448 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13449 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUTF8StringRecord", 1)) { | |||
13450 | return false; | |||
13451 | } | |||
13452 | Record<nsString, nsCString> arg0; | |||
13453 | if (args[0].isObject()) { | |||
13454 | auto& recordEntries = arg0.Entries(); | |||
13455 | ||||
13456 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
13457 | JS::RootedVector<jsid> ids(cx); | |||
13458 | if (!js::GetPropertyKeys(cx, recordObj, | |||
13459 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
13460 | return false; | |||
13461 | } | |||
13462 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
13463 | JS_ReportOutOfMemory(cx); | |||
13464 | return false; | |||
13465 | } | |||
13466 | JS::Rooted<JS::Value> propNameValue(cx); | |||
13467 | JS::Rooted<JS::Value> temp(cx); | |||
13468 | JS::Rooted<jsid> curId(cx); | |||
13469 | JS::Rooted<JS::Value> idVal(cx); | |||
13470 | // Use a hashset to keep track of ids seen, to avoid | |||
13471 | // introducing nasty O(N^2) behavior scanning for them all the | |||
13472 | // time. Ideally we'd use a data structure with O(1) lookup | |||
13473 | // _and_ ordering for the MozMap, but we don't have one lying | |||
13474 | // around. | |||
13475 | nsTHashtable<nsStringHashKey> idsSeen; | |||
13476 | for (size_t i = 0; i < ids.length(); ++i) { | |||
13477 | curId = ids[i]; | |||
13478 | ||||
13479 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
13480 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
13481 | &desc)) { | |||
13482 | return false; | |||
13483 | } | |||
13484 | ||||
13485 | if (desc.isNothing() || !desc->enumerable()) { | |||
13486 | continue; | |||
13487 | } | |||
13488 | ||||
13489 | idVal = js::IdToValue(curId); | |||
13490 | nsString propName; | |||
13491 | // This will just throw if idVal is a Symbol, like the spec says | |||
13492 | // to do. | |||
13493 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
13494 | return false; | |||
13495 | } | |||
13496 | ||||
13497 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
13498 | return false; | |||
13499 | } | |||
13500 | ||||
13501 | Record<nsString, nsCString>::EntryType* entry; | |||
13502 | if (!idsSeen.EnsureInserted(propName)) { | |||
13503 | // Find the existing entry. | |||
13504 | auto idx = recordEntries.IndexOf(propName); | |||
13505 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13506); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13506; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
13506 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13506); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13506; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13507 | // Now blow it away to make it look like it was just added | |||
13508 | // to the array, because it's not obvious that it's | |||
13509 | // safe to write to its already-initialized mValue via our | |||
13510 | // normal codegen conversions. For example, the value | |||
13511 | // could be a union and this would change its type, but | |||
13512 | // codegen assumes we won't do that. | |||
13513 | entry = recordEntries.ReconstructElementAt(idx); | |||
13514 | } else { | |||
13515 | // Safe to do an infallible append here, because we did a | |||
13516 | // SetCapacity above to the right capacity. | |||
13517 | entry = recordEntries.AppendElement(); | |||
13518 | } | |||
13519 | entry->mKey = propName; | |||
13520 | nsCString& slot = entry->mValue; | |||
13521 | if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) { | |||
13522 | return false; | |||
13523 | } | |||
13524 | } | |||
13525 | } else { | |||
13526 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
13527 | return false; | |||
13528 | } | |||
13529 | // NOTE: This assert does NOT call the function. | |||
13530 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUTF8StringRecord(Constify(arg0)))>, "Should be returning void here"); | |||
13531 | MOZ_KnownLive(self)(self)->PassUTF8StringRecord(Constify(arg0)); | |||
13532 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13532); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13532; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13533 | args.rval().setUndefined(); | |||
13534 | return true; | |||
13535 | } | |||
13536 | ||||
13537 | static const JSJitInfo passUTF8StringRecord_methodinfo = { | |||
13538 | { (JSJitGetterOp)passUTF8StringRecord }, | |||
13539 | { prototypes::id::TestExampleInterface }, | |||
13540 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13541 | JSJitInfo::Method, | |||
13542 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13543 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
13544 | false, /* isInfallible. False in setters. */ | |||
13545 | false, /* isMovable. Not relevant for setters. */ | |||
13546 | false, /* isEliminatable. Not relevant for setters. */ | |||
13547 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13548 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13549 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13550 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13551 | }; | |||
13552 | ||||
13553 | MOZ_CAN_RUN_SCRIPT static bool | |||
13554 | passRecordOfRecords(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13555 | { | |||
13556 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfRecords"); | |||
13557 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13560( cx, "TestExampleInterface" , "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13558 | "TestExampleInterface", "passRecordOfRecords", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13560( cx, "TestExampleInterface" , "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13559 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13560( cx, "TestExampleInterface" , "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13560 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13560( cx, "TestExampleInterface" , "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
13561 | ||||
13562 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13563 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfRecords", 1)) { | |||
13564 | return false; | |||
13565 | } | |||
13566 | Record<nsString, Record<nsString, int32_t>> arg0; | |||
13567 | if (args[0].isObject()) { | |||
13568 | auto& recordEntries = arg0.Entries(); | |||
13569 | ||||
13570 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
13571 | JS::RootedVector<jsid> ids(cx); | |||
13572 | if (!js::GetPropertyKeys(cx, recordObj, | |||
13573 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
13574 | return false; | |||
13575 | } | |||
13576 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
13577 | JS_ReportOutOfMemory(cx); | |||
13578 | return false; | |||
13579 | } | |||
13580 | JS::Rooted<JS::Value> propNameValue(cx); | |||
13581 | JS::Rooted<JS::Value> temp(cx); | |||
13582 | JS::Rooted<jsid> curId(cx); | |||
13583 | JS::Rooted<JS::Value> idVal(cx); | |||
13584 | // Use a hashset to keep track of ids seen, to avoid | |||
13585 | // introducing nasty O(N^2) behavior scanning for them all the | |||
13586 | // time. Ideally we'd use a data structure with O(1) lookup | |||
13587 | // _and_ ordering for the MozMap, but we don't have one lying | |||
13588 | // around. | |||
13589 | nsTHashtable<nsStringHashKey> idsSeen; | |||
13590 | for (size_t i = 0; i < ids.length(); ++i) { | |||
13591 | curId = ids[i]; | |||
13592 | ||||
13593 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
13594 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
13595 | &desc)) { | |||
13596 | return false; | |||
13597 | } | |||
13598 | ||||
13599 | if (desc.isNothing() || !desc->enumerable()) { | |||
13600 | continue; | |||
13601 | } | |||
13602 | ||||
13603 | idVal = js::IdToValue(curId); | |||
13604 | nsString propName; | |||
13605 | // This will just throw if idVal is a Symbol, like the spec says | |||
13606 | // to do. | |||
13607 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
13608 | return false; | |||
13609 | } | |||
13610 | ||||
13611 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
13612 | return false; | |||
13613 | } | |||
13614 | ||||
13615 | Record<nsString, Record<nsString, int32_t>>::EntryType* entry; | |||
13616 | if (!idsSeen.EnsureInserted(propName)) { | |||
13617 | // Find the existing entry. | |||
13618 | auto idx = recordEntries.IndexOf(propName); | |||
13619 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13620); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13620; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
13620 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13620); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13620; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13621 | // Now blow it away to make it look like it was just added | |||
13622 | // to the array, because it's not obvious that it's | |||
13623 | // safe to write to its already-initialized mValue via our | |||
13624 | // normal codegen conversions. For example, the value | |||
13625 | // could be a union and this would change its type, but | |||
13626 | // codegen assumes we won't do that. | |||
13627 | entry = recordEntries.ReconstructElementAt(idx); | |||
13628 | } else { | |||
13629 | // Safe to do an infallible append here, because we did a | |||
13630 | // SetCapacity above to the right capacity. | |||
13631 | entry = recordEntries.AppendElement(); | |||
13632 | } | |||
13633 | entry->mKey = propName; | |||
13634 | Record<nsString, int32_t>& slot = entry->mValue; | |||
13635 | if (temp.isObject()) { | |||
13636 | auto& recordEntries = slot.Entries(); | |||
13637 | ||||
13638 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | |||
13639 | JS::RootedVector<jsid> ids(cx); | |||
13640 | if (!js::GetPropertyKeys(cx, recordObj, | |||
13641 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
13642 | return false; | |||
13643 | } | |||
13644 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
13645 | JS_ReportOutOfMemory(cx); | |||
13646 | return false; | |||
13647 | } | |||
13648 | JS::Rooted<JS::Value> propNameValue(cx); | |||
13649 | JS::Rooted<JS::Value> temp(cx); | |||
13650 | JS::Rooted<jsid> curId(cx); | |||
13651 | JS::Rooted<JS::Value> idVal(cx); | |||
13652 | // Use a hashset to keep track of ids seen, to avoid | |||
13653 | // introducing nasty O(N^2) behavior scanning for them all the | |||
13654 | // time. Ideally we'd use a data structure with O(1) lookup | |||
13655 | // _and_ ordering for the MozMap, but we don't have one lying | |||
13656 | // around. | |||
13657 | nsTHashtable<nsStringHashKey> idsSeen; | |||
13658 | for (size_t i = 0; i < ids.length(); ++i) { | |||
13659 | curId = ids[i]; | |||
13660 | ||||
13661 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
13662 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
13663 | &desc)) { | |||
13664 | return false; | |||
13665 | } | |||
13666 | ||||
13667 | if (desc.isNothing() || !desc->enumerable()) { | |||
13668 | continue; | |||
13669 | } | |||
13670 | ||||
13671 | idVal = js::IdToValue(curId); | |||
13672 | nsString propName; | |||
13673 | // This will just throw if idVal is a Symbol, like the spec says | |||
13674 | // to do. | |||
13675 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | |||
13676 | return false; | |||
13677 | } | |||
13678 | ||||
13679 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
13680 | return false; | |||
13681 | } | |||
13682 | ||||
13683 | Record<nsString, int32_t>::EntryType* entry; | |||
13684 | if (!idsSeen.EnsureInserted(propName)) { | |||
13685 | // Find the existing entry. | |||
13686 | auto idx = recordEntries.IndexOf(propName); | |||
13687 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13688); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13688; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
13688 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 13688); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 13688; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
13689 | // Now blow it away to make it look like it was just added | |||
13690 | // to the array, because it's not obvious that it's | |||
13691 | // safe to write to its already-initialized mValue via our | |||
13692 | // normal codegen conversions. For example, the value | |||
13693 | // could be a union and this would change its type, but | |||
13694 | // codegen assumes we won't do that. | |||
13695 | entry = recordEntries.ReconstructElementAt(idx); | |||
13696 | } else { | |||
13697 | // Safe to do an infallible append here, because we did a | |||
13698 | // SetCapacity above to the right capacity. | |||
13699 | entry = recordEntries.AppendElement(); | |||
13700 | } | |||
13701 | entry->mKey = propName; | |||
13702 | int32_t& slot = entry->mValue; | |||
13703 | if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in value in argument 1", &slot)) { | |||
13704 | return false; | |||
13705 | } | |||
13706 | } | |||
13707 | } else { | |||
13708 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
13709 | return false; | |||
13710 | } | |||
13711 | } | |||
13712 | } else { | |||
13713 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
13714 | return false; | |||
13715 | } | |||
13716 | // NOTE: This assert does NOT call the function. | |||
13717 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfRecords(Constify(arg0)))>, "Should be returning void here"); | |||
13718 | MOZ_KnownLive(self)(self)->PassRecordOfRecords(Constify(arg0)); | |||
13719 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13719); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13719; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13720 | args.rval().setUndefined(); | |||
13721 | return true; | |||
13722 | } | |||
13723 | ||||
13724 | static const JSJitInfo passRecordOfRecords_methodinfo = { | |||
13725 | { (JSJitGetterOp)passRecordOfRecords }, | |||
13726 | { prototypes::id::TestExampleInterface }, | |||
13727 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13728 | JSJitInfo::Method, | |||
13729 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13730 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
13731 | false, /* isInfallible. False in setters. */ | |||
13732 | false, /* isMovable. Not relevant for setters. */ | |||
13733 | false, /* isEliminatable. Not relevant for setters. */ | |||
13734 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13735 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13736 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13737 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13738 | }; | |||
13739 | ||||
13740 | MOZ_CAN_RUN_SCRIPT static bool | |||
13741 | receiveRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13742 | { | |||
13743 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13746( cx, "TestExampleInterface" , "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13744 | "TestExampleInterface", "receiveRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13746( cx, "TestExampleInterface" , "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13745 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13746( cx, "TestExampleInterface" , "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13746 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13746( cx, "TestExampleInterface" , "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
13747 | ||||
13748 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13749 | Record<nsString, int32_t> result; | |||
13750 | // NOTE: This assert does NOT call the function. | |||
13751 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveRecord(result))>, "Should be returning void here"); | |||
13752 | MOZ_KnownLive(self)(self)->ReceiveRecord(result); | |||
13753 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13753); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13753; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13754 | ||||
13755 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | |||
13756 | if (!returnObj) { | |||
13757 | return false; | |||
13758 | } | |||
13759 | // Scope for 'tmp' | |||
13760 | { | |||
13761 | JS::Rooted<JS::Value> tmp(cx); | |||
13762 | for (auto& entry : result.Entries()) { | |||
13763 | auto& recordValue0 = entry.mValue; | |||
13764 | // Control block to let us common up the JS_DefineUCProperty calls when there | |||
13765 | // are different ways to succeed at wrapping the value. | |||
13766 | do { | |||
13767 | tmp.setInt32(int32_t(recordValue0)); | |||
13768 | break; | |||
13769 | } while (false); | |||
13770 | if (!JS_DefineUCProperty(cx, returnObj, | |||
13771 | entry.mKey.BeginReading(), | |||
13772 | entry.mKey.Length(), tmp, | |||
13773 | JSPROP_ENUMERATE)) { | |||
13774 | return false; | |||
13775 | } | |||
13776 | } | |||
13777 | } | |||
13778 | args.rval().setObject(*returnObj); | |||
13779 | return true; | |||
13780 | } | |||
13781 | ||||
13782 | static const JSJitInfo receiveRecord_methodinfo = { | |||
13783 | { (JSJitGetterOp)receiveRecord }, | |||
13784 | { prototypes::id::TestExampleInterface }, | |||
13785 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13786 | JSJitInfo::Method, | |||
13787 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13788 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
13789 | false, /* isInfallible. False in setters. */ | |||
13790 | false, /* isMovable. Not relevant for setters. */ | |||
13791 | false, /* isEliminatable. Not relevant for setters. */ | |||
13792 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13793 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13794 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13795 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13796 | }; | |||
13797 | ||||
13798 | MOZ_CAN_RUN_SCRIPT static bool | |||
13799 | receiveNullableRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13800 | { | |||
13801 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13804( cx, "TestExampleInterface" , "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13802 | "TestExampleInterface", "receiveNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13804( cx, "TestExampleInterface" , "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13803 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13804( cx, "TestExampleInterface" , "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13804 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13804( cx, "TestExampleInterface" , "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
13805 | ||||
13806 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13807 | Nullable<Record<nsString, int32_t>> result; | |||
13808 | // NOTE: This assert does NOT call the function. | |||
13809 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableRecord(result))>, "Should be returning void here"); | |||
13810 | MOZ_KnownLive(self)(self)->ReceiveNullableRecord(result); | |||
13811 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13811); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13811; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13812 | ||||
13813 | if (result.IsNull()) { | |||
13814 | args.rval().setNull(); | |||
13815 | return true; | |||
13816 | } | |||
13817 | ||||
13818 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | |||
13819 | if (!returnObj) { | |||
13820 | return false; | |||
13821 | } | |||
13822 | // Scope for 'tmp' | |||
13823 | { | |||
13824 | JS::Rooted<JS::Value> tmp(cx); | |||
13825 | for (auto& entry : result.Value().Entries()) { | |||
13826 | auto& recordValue0 = entry.mValue; | |||
13827 | // Control block to let us common up the JS_DefineUCProperty calls when there | |||
13828 | // are different ways to succeed at wrapping the value. | |||
13829 | do { | |||
13830 | tmp.setInt32(int32_t(recordValue0)); | |||
13831 | break; | |||
13832 | } while (false); | |||
13833 | if (!JS_DefineUCProperty(cx, returnObj, | |||
13834 | entry.mKey.BeginReading(), | |||
13835 | entry.mKey.Length(), tmp, | |||
13836 | JSPROP_ENUMERATE)) { | |||
13837 | return false; | |||
13838 | } | |||
13839 | } | |||
13840 | } | |||
13841 | args.rval().setObject(*returnObj); | |||
13842 | return true; | |||
13843 | } | |||
13844 | ||||
13845 | static const JSJitInfo receiveNullableRecord_methodinfo = { | |||
13846 | { (JSJitGetterOp)receiveNullableRecord }, | |||
13847 | { prototypes::id::TestExampleInterface }, | |||
13848 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13849 | JSJitInfo::Method, | |||
13850 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13851 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
13852 | false, /* isInfallible. False in setters. */ | |||
13853 | false, /* isMovable. Not relevant for setters. */ | |||
13854 | false, /* isEliminatable. Not relevant for setters. */ | |||
13855 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13856 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13857 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13858 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13859 | }; | |||
13860 | ||||
13861 | MOZ_CAN_RUN_SCRIPT static bool | |||
13862 | receiveRecordOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13863 | { | |||
13864 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13867( cx, "TestExampleInterface" , "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13865 | "TestExampleInterface", "receiveRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13867( cx, "TestExampleInterface" , "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13866 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13867( cx, "TestExampleInterface" , "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13867 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13867( cx, "TestExampleInterface" , "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
13868 | ||||
13869 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13870 | Record<nsString, Nullable<int32_t>> result; | |||
13871 | // NOTE: This assert does NOT call the function. | |||
13872 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveRecordOfNullableInts(result))>, "Should be returning void here"); | |||
13873 | MOZ_KnownLive(self)(self)->ReceiveRecordOfNullableInts(result); | |||
13874 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13874); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13874; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13875 | ||||
13876 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | |||
13877 | if (!returnObj) { | |||
13878 | return false; | |||
13879 | } | |||
13880 | // Scope for 'tmp' | |||
13881 | { | |||
13882 | JS::Rooted<JS::Value> tmp(cx); | |||
13883 | for (auto& entry : result.Entries()) { | |||
13884 | auto& recordValue0 = entry.mValue; | |||
13885 | // Control block to let us common up the JS_DefineUCProperty calls when there | |||
13886 | // are different ways to succeed at wrapping the value. | |||
13887 | do { | |||
13888 | if (recordValue0.IsNull()) { | |||
13889 | tmp.setNull(); | |||
13890 | break; | |||
13891 | } | |||
13892 | tmp.setInt32(int32_t(recordValue0.Value())); | |||
13893 | break; | |||
13894 | } while (false); | |||
13895 | if (!JS_DefineUCProperty(cx, returnObj, | |||
13896 | entry.mKey.BeginReading(), | |||
13897 | entry.mKey.Length(), tmp, | |||
13898 | JSPROP_ENUMERATE)) { | |||
13899 | return false; | |||
13900 | } | |||
13901 | } | |||
13902 | } | |||
13903 | args.rval().setObject(*returnObj); | |||
13904 | return true; | |||
13905 | } | |||
13906 | ||||
13907 | static const JSJitInfo receiveRecordOfNullableInts_methodinfo = { | |||
13908 | { (JSJitGetterOp)receiveRecordOfNullableInts }, | |||
13909 | { prototypes::id::TestExampleInterface }, | |||
13910 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13911 | JSJitInfo::Method, | |||
13912 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13913 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
13914 | false, /* isInfallible. False in setters. */ | |||
13915 | false, /* isMovable. Not relevant for setters. */ | |||
13916 | false, /* isEliminatable. Not relevant for setters. */ | |||
13917 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13918 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13919 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13920 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13921 | }; | |||
13922 | ||||
13923 | MOZ_CAN_RUN_SCRIPT static bool | |||
13924 | receiveNullableRecordOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13925 | { | |||
13926 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13929( cx, "TestExampleInterface" , "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13927 | "TestExampleInterface", "receiveNullableRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13929( cx, "TestExampleInterface" , "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13928 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13929( cx, "TestExampleInterface" , "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
13929 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13929( cx, "TestExampleInterface" , "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
13930 | ||||
13931 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13932 | Nullable<Record<nsString, Nullable<int32_t>>> result; | |||
13933 | // NOTE: This assert does NOT call the function. | |||
13934 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableRecordOfNullableInts(result))>, "Should be returning void here"); | |||
13935 | MOZ_KnownLive(self)(self)->ReceiveNullableRecordOfNullableInts(result); | |||
13936 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 13936); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 13936; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
13937 | ||||
13938 | if (result.IsNull()) { | |||
13939 | args.rval().setNull(); | |||
13940 | return true; | |||
13941 | } | |||
13942 | ||||
13943 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | |||
13944 | if (!returnObj) { | |||
13945 | return false; | |||
13946 | } | |||
13947 | // Scope for 'tmp' | |||
13948 | { | |||
13949 | JS::Rooted<JS::Value> tmp(cx); | |||
13950 | for (auto& entry : result.Value().Entries()) { | |||
13951 | auto& recordValue0 = entry.mValue; | |||
13952 | // Control block to let us common up the JS_DefineUCProperty calls when there | |||
13953 | // are different ways to succeed at wrapping the value. | |||
13954 | do { | |||
13955 | if (recordValue0.IsNull()) { | |||
13956 | tmp.setNull(); | |||
13957 | break; | |||
13958 | } | |||
13959 | tmp.setInt32(int32_t(recordValue0.Value())); | |||
13960 | break; | |||
13961 | } while (false); | |||
13962 | if (!JS_DefineUCProperty(cx, returnObj, | |||
13963 | entry.mKey.BeginReading(), | |||
13964 | entry.mKey.Length(), tmp, | |||
13965 | JSPROP_ENUMERATE)) { | |||
13966 | return false; | |||
13967 | } | |||
13968 | } | |||
13969 | } | |||
13970 | args.rval().setObject(*returnObj); | |||
13971 | return true; | |||
13972 | } | |||
13973 | ||||
13974 | static const JSJitInfo receiveNullableRecordOfNullableInts_methodinfo = { | |||
13975 | { (JSJitGetterOp)receiveNullableRecordOfNullableInts }, | |||
13976 | { prototypes::id::TestExampleInterface }, | |||
13977 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
13978 | JSJitInfo::Method, | |||
13979 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
13980 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
13981 | false, /* isInfallible. False in setters. */ | |||
13982 | false, /* isMovable. Not relevant for setters. */ | |||
13983 | false, /* isEliminatable. Not relevant for setters. */ | |||
13984 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
13985 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
13986 | false, /* isTypedMethod. Only relevant for methods. */ | |||
13987 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
13988 | }; | |||
13989 | ||||
13990 | MOZ_CAN_RUN_SCRIPT static bool | |||
13991 | receiveAnyRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
13992 | { | |||
13993 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13996( cx, "TestExampleInterface" , "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13994 | "TestExampleInterface", "receiveAnyRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13996( cx, "TestExampleInterface" , "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13995 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13996( cx, "TestExampleInterface" , "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
13996 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13996( cx, "TestExampleInterface" , "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
13997 | ||||
13998 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
13999 | Record<nsString, JS::Value> result; | |||
14000 | RecordRooter<nsString, JS::Value> resultRooter(cx, &result); | |||
14001 | // NOTE: This assert does NOT call the function. | |||
14002 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveAnyRecord(cx, result))>, "Should be returning void here"); | |||
14003 | MOZ_KnownLive(self)(self)->ReceiveAnyRecord(cx, result); | |||
14004 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14004); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14004; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14005 | ||||
14006 | JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx)); | |||
14007 | if (!returnObj) { | |||
14008 | return false; | |||
14009 | } | |||
14010 | // Scope for 'tmp' | |||
14011 | { | |||
14012 | JS::Rooted<JS::Value> tmp(cx); | |||
14013 | for (auto& entry : result.Entries()) { | |||
14014 | auto& recordValue0 = entry.mValue; | |||
14015 | // Control block to let us common up the JS_DefineUCProperty calls when there | |||
14016 | // are different ways to succeed at wrapping the value. | |||
14017 | do { | |||
14018 | JS::ExposeValueToActiveJS(recordValue0); | |||
14019 | tmp.set(recordValue0); | |||
14020 | if (!MaybeWrapValue(cx, &tmp)) { | |||
14021 | return false; | |||
14022 | } | |||
14023 | break; | |||
14024 | } while (false); | |||
14025 | if (!JS_DefineUCProperty(cx, returnObj, | |||
14026 | entry.mKey.BeginReading(), | |||
14027 | entry.mKey.Length(), tmp, | |||
14028 | JSPROP_ENUMERATE)) { | |||
14029 | return false; | |||
14030 | } | |||
14031 | } | |||
14032 | } | |||
14033 | args.rval().setObject(*returnObj); | |||
14034 | return true; | |||
14035 | } | |||
14036 | ||||
14037 | static const JSJitInfo receiveAnyRecord_methodinfo = { | |||
14038 | { (JSJitGetterOp)receiveAnyRecord }, | |||
14039 | { prototypes::id::TestExampleInterface }, | |||
14040 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14041 | JSJitInfo::Method, | |||
14042 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14043 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
14044 | false, /* isInfallible. False in setters. */ | |||
14045 | false, /* isMovable. Not relevant for setters. */ | |||
14046 | false, /* isEliminatable. Not relevant for setters. */ | |||
14047 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14048 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14049 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14050 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14051 | }; | |||
14052 | ||||
14053 | MOZ_CAN_RUN_SCRIPT static bool | |||
14054 | passArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14055 | { | |||
14056 | BindingCallContext cx(cx_, "TestExampleInterface.passArrayBuffer"); | |||
14057 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14060( cx, "TestExampleInterface" , "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14058 | "TestExampleInterface", "passArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14060( cx, "TestExampleInterface" , "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14059 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14060( cx, "TestExampleInterface" , "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14060 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14060( cx, "TestExampleInterface" , "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14061 | ||||
14062 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14063 | if (!args.requireAtLeast(cx, "TestExampleInterface.passArrayBuffer", 1)) { | |||
14064 | return false; | |||
14065 | } | |||
14066 | RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx); | |||
14067 | if (args[0].isObject()) { | |||
14068 | if (!arg0.Init(&args[0].toObject())) { | |||
14069 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer"); | |||
14070 | return false; | |||
14071 | } | |||
14072 | if (JS::IsSharedArrayBufferObject(arg0.Obj())) { | |||
14073 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14074 | return false; | |||
14075 | } | |||
14076 | if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) { | |||
14077 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14078 | return false; | |||
14079 | } | |||
14080 | if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) { | |||
14081 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14082 | return false; | |||
14083 | } | |||
14084 | } else { | |||
14085 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14086 | return false; | |||
14087 | } | |||
14088 | // NOTE: This assert does NOT call the function. | |||
14089 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassArrayBuffer(Constify(arg0)))>, "Should be returning void here"); | |||
14090 | MOZ_KnownLive(self)(self)->PassArrayBuffer(Constify(arg0)); | |||
14091 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14091); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14091; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14092 | args.rval().setUndefined(); | |||
14093 | return true; | |||
14094 | } | |||
14095 | ||||
14096 | static const JSJitInfo passArrayBuffer_methodinfo = { | |||
14097 | { (JSJitGetterOp)passArrayBuffer }, | |||
14098 | { prototypes::id::TestExampleInterface }, | |||
14099 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14100 | JSJitInfo::Method, | |||
14101 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14102 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14103 | false, /* isInfallible. False in setters. */ | |||
14104 | false, /* isMovable. Not relevant for setters. */ | |||
14105 | false, /* isEliminatable. Not relevant for setters. */ | |||
14106 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14107 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14108 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14109 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14110 | }; | |||
14111 | ||||
14112 | MOZ_CAN_RUN_SCRIPT static bool | |||
14113 | passNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14114 | { | |||
14115 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableArrayBuffer"); | |||
14116 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14119( cx, "TestExampleInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14117 | "TestExampleInterface", "passNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14119( cx, "TestExampleInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14118 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14119( cx, "TestExampleInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14119 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14119( cx, "TestExampleInterface" , "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14120 | ||||
14121 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14122 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableArrayBuffer", 1)) { | |||
14123 | return false; | |||
14124 | } | |||
14125 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx); | |||
14126 | if (args[0].isObject()) { | |||
14127 | if (!arg0.SetValue().Init(&args[0].toObject())) { | |||
14128 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull"); | |||
14129 | return false; | |||
14130 | } | |||
14131 | if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) { | |||
14132 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14133 | return false; | |||
14134 | } | |||
14135 | if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) { | |||
14136 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14137 | return false; | |||
14138 | } | |||
14139 | if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) { | |||
14140 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14141 | return false; | |||
14142 | } | |||
14143 | } else if (args[0].isNullOrUndefined()) { | |||
14144 | arg0.SetNull(); | |||
14145 | } else { | |||
14146 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14147 | return false; | |||
14148 | } | |||
14149 | // NOTE: This assert does NOT call the function. | |||
14150 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableArrayBuffer(Constify(arg0)))>, "Should be returning void here"); | |||
14151 | MOZ_KnownLive(self)(self)->PassNullableArrayBuffer(Constify(arg0)); | |||
14152 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14152); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14152; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14153 | args.rval().setUndefined(); | |||
14154 | return true; | |||
14155 | } | |||
14156 | ||||
14157 | static const JSJitInfo passNullableArrayBuffer_methodinfo = { | |||
14158 | { (JSJitGetterOp)passNullableArrayBuffer }, | |||
14159 | { prototypes::id::TestExampleInterface }, | |||
14160 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14161 | JSJitInfo::Method, | |||
14162 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14163 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14164 | false, /* isInfallible. False in setters. */ | |||
14165 | false, /* isMovable. Not relevant for setters. */ | |||
14166 | false, /* isEliminatable. Not relevant for setters. */ | |||
14167 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14168 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14169 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14170 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14171 | }; | |||
14172 | ||||
14173 | MOZ_CAN_RUN_SCRIPT static bool | |||
14174 | passOptionalArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14175 | { | |||
14176 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalArrayBuffer"); | |||
14177 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14180( cx, "TestExampleInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14178 | "TestExampleInterface", "passOptionalArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14180( cx, "TestExampleInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14179 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14180( cx, "TestExampleInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14180 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14180( cx, "TestExampleInterface" , "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14181 | ||||
14182 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14183 | Optional<ArrayBuffer> arg0; | |||
14184 | Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder; | |||
14185 | if (args.hasDefined(0)) { | |||
14186 | arg0.Construct(); | |||
14187 | arg0_holder.emplace(cx, &arg0.Value()); | |||
14188 | if (args[0].isObject()) { | |||
14189 | if (!arg0.Value().Init(&args[0].toObject())) { | |||
14190 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer"); | |||
14191 | return false; | |||
14192 | } | |||
14193 | if (JS::IsSharedArrayBufferObject(arg0.Value().Obj())) { | |||
14194 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14195 | return false; | |||
14196 | } | |||
14197 | if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().Obj())) { | |||
14198 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14199 | return false; | |||
14200 | } | |||
14201 | if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().Obj())) { | |||
14202 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14203 | return false; | |||
14204 | } | |||
14205 | } else { | |||
14206 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14207 | return false; | |||
14208 | } | |||
14209 | } | |||
14210 | // NOTE: This assert does NOT call the function. | |||
14211 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalArrayBuffer(Constify(arg0)))>, "Should be returning void here"); | |||
14212 | MOZ_KnownLive(self)(self)->PassOptionalArrayBuffer(Constify(arg0)); | |||
14213 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14213); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14213; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14214 | args.rval().setUndefined(); | |||
14215 | return true; | |||
14216 | } | |||
14217 | ||||
14218 | static const JSJitInfo passOptionalArrayBuffer_methodinfo = { | |||
14219 | { (JSJitGetterOp)passOptionalArrayBuffer }, | |||
14220 | { prototypes::id::TestExampleInterface }, | |||
14221 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14222 | JSJitInfo::Method, | |||
14223 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14224 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14225 | false, /* isInfallible. False in setters. */ | |||
14226 | false, /* isMovable. Not relevant for setters. */ | |||
14227 | false, /* isEliminatable. Not relevant for setters. */ | |||
14228 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14229 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14230 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14231 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14232 | }; | |||
14233 | ||||
14234 | MOZ_CAN_RUN_SCRIPT static bool | |||
14235 | passOptionalNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14236 | { | |||
14237 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableArrayBuffer"); | |||
14238 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14241( cx, "TestExampleInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14239 | "TestExampleInterface", "passOptionalNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14241( cx, "TestExampleInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14240 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14241( cx, "TestExampleInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14241 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14241( cx, "TestExampleInterface" , "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
14242 | ||||
14243 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14244 | Optional<Nullable<ArrayBuffer>> arg0; | |||
14245 | Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder; | |||
14246 | if (args.hasDefined(0)) { | |||
14247 | arg0.Construct(); | |||
14248 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
14249 | if (args[0].isObject()) { | |||
14250 | if (!arg0.Value().SetValue().Init(&args[0].toObject())) { | |||
14251 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull"); | |||
14252 | return false; | |||
14253 | } | |||
14254 | if (JS::IsSharedArrayBufferObject(arg0.Value().SetValue().Obj())) { | |||
14255 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14256 | return false; | |||
14257 | } | |||
14258 | if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) { | |||
14259 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14260 | return false; | |||
14261 | } | |||
14262 | if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) { | |||
14263 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14264 | return false; | |||
14265 | } | |||
14266 | } else if (args[0].isNullOrUndefined()) { | |||
14267 | arg0.Value().SetNull(); | |||
14268 | } else { | |||
14269 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14270 | return false; | |||
14271 | } | |||
14272 | } | |||
14273 | // NOTE: This assert does NOT call the function. | |||
14274 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBuffer(Constify(arg0)))>, "Should be returning void here"); | |||
14275 | MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBuffer(Constify(arg0)); | |||
14276 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14276); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14276; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14277 | args.rval().setUndefined(); | |||
14278 | return true; | |||
14279 | } | |||
14280 | ||||
14281 | static const JSJitInfo passOptionalNullableArrayBuffer_methodinfo = { | |||
14282 | { (JSJitGetterOp)passOptionalNullableArrayBuffer }, | |||
14283 | { prototypes::id::TestExampleInterface }, | |||
14284 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14285 | JSJitInfo::Method, | |||
14286 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14287 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14288 | false, /* isInfallible. False in setters. */ | |||
14289 | false, /* isMovable. Not relevant for setters. */ | |||
14290 | false, /* isEliminatable. Not relevant for setters. */ | |||
14291 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14292 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14293 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14294 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14295 | }; | |||
14296 | ||||
14297 | MOZ_CAN_RUN_SCRIPT static bool | |||
14298 | passOptionalNullableArrayBufferWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14299 | { | |||
14300 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableArrayBufferWithDefaultValue"); | |||
14301 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestExampleInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14302 | "TestExampleInterface", "passOptionalNullableArrayBufferWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestExampleInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14303 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestExampleInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14304 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestExampleInterface" , "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
14305 | ||||
14306 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14307 | RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx); | |||
14308 | if (args.hasDefined(0)) { | |||
14309 | if (args[0].isObject()) { | |||
14310 | if (!arg0.SetValue().Init(&args[0].toObject())) { | |||
14311 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull"); | |||
14312 | return false; | |||
14313 | } | |||
14314 | if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) { | |||
14315 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14316 | return false; | |||
14317 | } | |||
14318 | if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) { | |||
14319 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14320 | return false; | |||
14321 | } | |||
14322 | if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) { | |||
14323 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14324 | return false; | |||
14325 | } | |||
14326 | } else if (args[0].isNullOrUndefined()) { | |||
14327 | arg0.SetNull(); | |||
14328 | } else { | |||
14329 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14330 | return false; | |||
14331 | } | |||
14332 | } else { | |||
14333 | arg0.SetNull(); | |||
14334 | } | |||
14335 | // NOTE: This assert does NOT call the function. | |||
14336 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBufferWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
14337 | MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBufferWithDefaultValue(Constify(arg0)); | |||
14338 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14338); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14338; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14339 | args.rval().setUndefined(); | |||
14340 | return true; | |||
14341 | } | |||
14342 | ||||
14343 | static const JSJitInfo passOptionalNullableArrayBufferWithDefaultValue_methodinfo = { | |||
14344 | { (JSJitGetterOp)passOptionalNullableArrayBufferWithDefaultValue }, | |||
14345 | { prototypes::id::TestExampleInterface }, | |||
14346 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14347 | JSJitInfo::Method, | |||
14348 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14349 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14350 | false, /* isInfallible. False in setters. */ | |||
14351 | false, /* isMovable. Not relevant for setters. */ | |||
14352 | false, /* isEliminatable. Not relevant for setters. */ | |||
14353 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14354 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14355 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14356 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14357 | }; | |||
14358 | ||||
14359 | MOZ_CAN_RUN_SCRIPT static bool | |||
14360 | passArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14361 | { | |||
14362 | BindingCallContext cx(cx_, "TestExampleInterface.passArrayBufferView"); | |||
14363 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14366( cx, "TestExampleInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14364 | "TestExampleInterface", "passArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14366( cx, "TestExampleInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14365 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14366( cx, "TestExampleInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14366 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14366( cx, "TestExampleInterface" , "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14367 | ||||
14368 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14369 | if (!args.requireAtLeast(cx, "TestExampleInterface.passArrayBufferView", 1)) { | |||
14370 | return false; | |||
14371 | } | |||
14372 | RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx); | |||
14373 | if (args[0].isObject()) { | |||
14374 | if (!arg0.Init(&args[0].toObject())) { | |||
14375 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView"); | |||
14376 | return false; | |||
14377 | } | |||
14378 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14379 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14380 | return false; | |||
14381 | } | |||
14382 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14383 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14384 | return false; | |||
14385 | } | |||
14386 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14387 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14388 | return false; | |||
14389 | } | |||
14390 | } else { | |||
14391 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14392 | return false; | |||
14393 | } | |||
14394 | // NOTE: This assert does NOT call the function. | |||
14395 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassArrayBufferView(Constify(arg0)))>, "Should be returning void here"); | |||
14396 | MOZ_KnownLive(self)(self)->PassArrayBufferView(Constify(arg0)); | |||
14397 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14397); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14397; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14398 | args.rval().setUndefined(); | |||
14399 | return true; | |||
14400 | } | |||
14401 | ||||
14402 | static const JSJitInfo passArrayBufferView_methodinfo = { | |||
14403 | { (JSJitGetterOp)passArrayBufferView }, | |||
14404 | { prototypes::id::TestExampleInterface }, | |||
14405 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14406 | JSJitInfo::Method, | |||
14407 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14408 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14409 | false, /* isInfallible. False in setters. */ | |||
14410 | false, /* isMovable. Not relevant for setters. */ | |||
14411 | false, /* isEliminatable. Not relevant for setters. */ | |||
14412 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14413 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14414 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14415 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14416 | }; | |||
14417 | ||||
14418 | MOZ_CAN_RUN_SCRIPT static bool | |||
14419 | passInt8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14420 | { | |||
14421 | BindingCallContext cx(cx_, "TestExampleInterface.passInt8Array"); | |||
14422 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14425( cx, "TestExampleInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14423 | "TestExampleInterface", "passInt8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14425( cx, "TestExampleInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14424 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14425( cx, "TestExampleInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14425 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14425( cx, "TestExampleInterface" , "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14426 | ||||
14427 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14428 | if (!args.requireAtLeast(cx, "TestExampleInterface.passInt8Array", 1)) { | |||
14429 | return false; | |||
14430 | } | |||
14431 | RootedSpiderMonkeyInterface<Int8Array> arg0(cx); | |||
14432 | if (args[0].isObject()) { | |||
14433 | if (!arg0.Init(&args[0].toObject())) { | |||
14434 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int8Array"); | |||
14435 | return false; | |||
14436 | } | |||
14437 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14438 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14439 | return false; | |||
14440 | } | |||
14441 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14442 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14443 | return false; | |||
14444 | } | |||
14445 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14446 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14447 | return false; | |||
14448 | } | |||
14449 | } else { | |||
14450 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14451 | return false; | |||
14452 | } | |||
14453 | // NOTE: This assert does NOT call the function. | |||
14454 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassInt8Array(Constify(arg0)))>, "Should be returning void here"); | |||
14455 | MOZ_KnownLive(self)(self)->PassInt8Array(Constify(arg0)); | |||
14456 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14456); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14456; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14457 | args.rval().setUndefined(); | |||
14458 | return true; | |||
14459 | } | |||
14460 | ||||
14461 | static const JSJitInfo passInt8Array_methodinfo = { | |||
14462 | { (JSJitGetterOp)passInt8Array }, | |||
14463 | { prototypes::id::TestExampleInterface }, | |||
14464 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14465 | JSJitInfo::Method, | |||
14466 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14467 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14468 | false, /* isInfallible. False in setters. */ | |||
14469 | false, /* isMovable. Not relevant for setters. */ | |||
14470 | false, /* isEliminatable. Not relevant for setters. */ | |||
14471 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14472 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14473 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14474 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14475 | }; | |||
14476 | ||||
14477 | MOZ_CAN_RUN_SCRIPT static bool | |||
14478 | passInt16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14479 | { | |||
14480 | BindingCallContext cx(cx_, "TestExampleInterface.passInt16Array"); | |||
14481 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14484( cx, "TestExampleInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14482 | "TestExampleInterface", "passInt16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14484( cx, "TestExampleInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14483 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14484( cx, "TestExampleInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14484 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14484( cx, "TestExampleInterface" , "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14485 | ||||
14486 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14487 | if (!args.requireAtLeast(cx, "TestExampleInterface.passInt16Array", 1)) { | |||
14488 | return false; | |||
14489 | } | |||
14490 | RootedSpiderMonkeyInterface<Int16Array> arg0(cx); | |||
14491 | if (args[0].isObject()) { | |||
14492 | if (!arg0.Init(&args[0].toObject())) { | |||
14493 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int16Array"); | |||
14494 | return false; | |||
14495 | } | |||
14496 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14497 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14498 | return false; | |||
14499 | } | |||
14500 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14501 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14502 | return false; | |||
14503 | } | |||
14504 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14505 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14506 | return false; | |||
14507 | } | |||
14508 | } else { | |||
14509 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14510 | return false; | |||
14511 | } | |||
14512 | // NOTE: This assert does NOT call the function. | |||
14513 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassInt16Array(Constify(arg0)))>, "Should be returning void here"); | |||
14514 | MOZ_KnownLive(self)(self)->PassInt16Array(Constify(arg0)); | |||
14515 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14515); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14515; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14516 | args.rval().setUndefined(); | |||
14517 | return true; | |||
14518 | } | |||
14519 | ||||
14520 | static const JSJitInfo passInt16Array_methodinfo = { | |||
14521 | { (JSJitGetterOp)passInt16Array }, | |||
14522 | { prototypes::id::TestExampleInterface }, | |||
14523 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14524 | JSJitInfo::Method, | |||
14525 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14526 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14527 | false, /* isInfallible. False in setters. */ | |||
14528 | false, /* isMovable. Not relevant for setters. */ | |||
14529 | false, /* isEliminatable. Not relevant for setters. */ | |||
14530 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14531 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14532 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14533 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14534 | }; | |||
14535 | ||||
14536 | MOZ_CAN_RUN_SCRIPT static bool | |||
14537 | passInt32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14538 | { | |||
14539 | BindingCallContext cx(cx_, "TestExampleInterface.passInt32Array"); | |||
14540 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14543( cx, "TestExampleInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14541 | "TestExampleInterface", "passInt32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14543( cx, "TestExampleInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14542 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14543( cx, "TestExampleInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14543 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14543( cx, "TestExampleInterface" , "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14544 | ||||
14545 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14546 | if (!args.requireAtLeast(cx, "TestExampleInterface.passInt32Array", 1)) { | |||
14547 | return false; | |||
14548 | } | |||
14549 | RootedSpiderMonkeyInterface<Int32Array> arg0(cx); | |||
14550 | if (args[0].isObject()) { | |||
14551 | if (!arg0.Init(&args[0].toObject())) { | |||
14552 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int32Array"); | |||
14553 | return false; | |||
14554 | } | |||
14555 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14556 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14557 | return false; | |||
14558 | } | |||
14559 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14560 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14561 | return false; | |||
14562 | } | |||
14563 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14564 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14565 | return false; | |||
14566 | } | |||
14567 | } else { | |||
14568 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14569 | return false; | |||
14570 | } | |||
14571 | // NOTE: This assert does NOT call the function. | |||
14572 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassInt32Array(Constify(arg0)))>, "Should be returning void here"); | |||
14573 | MOZ_KnownLive(self)(self)->PassInt32Array(Constify(arg0)); | |||
14574 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14574); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14574; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14575 | args.rval().setUndefined(); | |||
14576 | return true; | |||
14577 | } | |||
14578 | ||||
14579 | static const JSJitInfo passInt32Array_methodinfo = { | |||
14580 | { (JSJitGetterOp)passInt32Array }, | |||
14581 | { prototypes::id::TestExampleInterface }, | |||
14582 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14583 | JSJitInfo::Method, | |||
14584 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14585 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14586 | false, /* isInfallible. False in setters. */ | |||
14587 | false, /* isMovable. Not relevant for setters. */ | |||
14588 | false, /* isEliminatable. Not relevant for setters. */ | |||
14589 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14590 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14591 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14592 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14593 | }; | |||
14594 | ||||
14595 | MOZ_CAN_RUN_SCRIPT static bool | |||
14596 | passUint8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14597 | { | |||
14598 | BindingCallContext cx(cx_, "TestExampleInterface.passUint8Array"); | |||
14599 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14602( cx, "TestExampleInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14600 | "TestExampleInterface", "passUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14602( cx, "TestExampleInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14601 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14602( cx, "TestExampleInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14602 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14602( cx, "TestExampleInterface" , "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14603 | ||||
14604 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14605 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUint8Array", 1)) { | |||
14606 | return false; | |||
14607 | } | |||
14608 | RootedSpiderMonkeyInterface<Uint8Array> arg0(cx); | |||
14609 | if (args[0].isObject()) { | |||
14610 | if (!arg0.Init(&args[0].toObject())) { | |||
14611 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8Array"); | |||
14612 | return false; | |||
14613 | } | |||
14614 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14615 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14616 | return false; | |||
14617 | } | |||
14618 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14619 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14620 | return false; | |||
14621 | } | |||
14622 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14623 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14624 | return false; | |||
14625 | } | |||
14626 | } else { | |||
14627 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14628 | return false; | |||
14629 | } | |||
14630 | // NOTE: This assert does NOT call the function. | |||
14631 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint8Array(Constify(arg0)))>, "Should be returning void here"); | |||
14632 | MOZ_KnownLive(self)(self)->PassUint8Array(Constify(arg0)); | |||
14633 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14633); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14633; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14634 | args.rval().setUndefined(); | |||
14635 | return true; | |||
14636 | } | |||
14637 | ||||
14638 | static const JSJitInfo passUint8Array_methodinfo = { | |||
14639 | { (JSJitGetterOp)passUint8Array }, | |||
14640 | { prototypes::id::TestExampleInterface }, | |||
14641 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14642 | JSJitInfo::Method, | |||
14643 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14644 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14645 | false, /* isInfallible. False in setters. */ | |||
14646 | false, /* isMovable. Not relevant for setters. */ | |||
14647 | false, /* isEliminatable. Not relevant for setters. */ | |||
14648 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14649 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14650 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14651 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14652 | }; | |||
14653 | ||||
14654 | MOZ_CAN_RUN_SCRIPT static bool | |||
14655 | passUint16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14656 | { | |||
14657 | BindingCallContext cx(cx_, "TestExampleInterface.passUint16Array"); | |||
14658 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14661( cx, "TestExampleInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14659 | "TestExampleInterface", "passUint16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14661( cx, "TestExampleInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14660 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14661( cx, "TestExampleInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14661 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14661( cx, "TestExampleInterface" , "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14662 | ||||
14663 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14664 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUint16Array", 1)) { | |||
14665 | return false; | |||
14666 | } | |||
14667 | RootedSpiderMonkeyInterface<Uint16Array> arg0(cx); | |||
14668 | if (args[0].isObject()) { | |||
14669 | if (!arg0.Init(&args[0].toObject())) { | |||
14670 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint16Array"); | |||
14671 | return false; | |||
14672 | } | |||
14673 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14674 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14675 | return false; | |||
14676 | } | |||
14677 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14678 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14679 | return false; | |||
14680 | } | |||
14681 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14682 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14683 | return false; | |||
14684 | } | |||
14685 | } else { | |||
14686 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14687 | return false; | |||
14688 | } | |||
14689 | // NOTE: This assert does NOT call the function. | |||
14690 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint16Array(Constify(arg0)))>, "Should be returning void here"); | |||
14691 | MOZ_KnownLive(self)(self)->PassUint16Array(Constify(arg0)); | |||
14692 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14692); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14692; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14693 | args.rval().setUndefined(); | |||
14694 | return true; | |||
14695 | } | |||
14696 | ||||
14697 | static const JSJitInfo passUint16Array_methodinfo = { | |||
14698 | { (JSJitGetterOp)passUint16Array }, | |||
14699 | { prototypes::id::TestExampleInterface }, | |||
14700 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14701 | JSJitInfo::Method, | |||
14702 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14703 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14704 | false, /* isInfallible. False in setters. */ | |||
14705 | false, /* isMovable. Not relevant for setters. */ | |||
14706 | false, /* isEliminatable. Not relevant for setters. */ | |||
14707 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14708 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14709 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14710 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14711 | }; | |||
14712 | ||||
14713 | MOZ_CAN_RUN_SCRIPT static bool | |||
14714 | passUint32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14715 | { | |||
14716 | BindingCallContext cx(cx_, "TestExampleInterface.passUint32Array"); | |||
14717 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14720( cx, "TestExampleInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14718 | "TestExampleInterface", "passUint32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14720( cx, "TestExampleInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14719 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14720( cx, "TestExampleInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14720 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14720( cx, "TestExampleInterface" , "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14721 | ||||
14722 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14723 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUint32Array", 1)) { | |||
14724 | return false; | |||
14725 | } | |||
14726 | RootedSpiderMonkeyInterface<Uint32Array> arg0(cx); | |||
14727 | if (args[0].isObject()) { | |||
14728 | if (!arg0.Init(&args[0].toObject())) { | |||
14729 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint32Array"); | |||
14730 | return false; | |||
14731 | } | |||
14732 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14733 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14734 | return false; | |||
14735 | } | |||
14736 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14737 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14738 | return false; | |||
14739 | } | |||
14740 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14741 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14742 | return false; | |||
14743 | } | |||
14744 | } else { | |||
14745 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14746 | return false; | |||
14747 | } | |||
14748 | // NOTE: This assert does NOT call the function. | |||
14749 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint32Array(Constify(arg0)))>, "Should be returning void here"); | |||
14750 | MOZ_KnownLive(self)(self)->PassUint32Array(Constify(arg0)); | |||
14751 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14751); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14751; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14752 | args.rval().setUndefined(); | |||
14753 | return true; | |||
14754 | } | |||
14755 | ||||
14756 | static const JSJitInfo passUint32Array_methodinfo = { | |||
14757 | { (JSJitGetterOp)passUint32Array }, | |||
14758 | { prototypes::id::TestExampleInterface }, | |||
14759 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14760 | JSJitInfo::Method, | |||
14761 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14762 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14763 | false, /* isInfallible. False in setters. */ | |||
14764 | false, /* isMovable. Not relevant for setters. */ | |||
14765 | false, /* isEliminatable. Not relevant for setters. */ | |||
14766 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14767 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14768 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14769 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14770 | }; | |||
14771 | ||||
14772 | MOZ_CAN_RUN_SCRIPT static bool | |||
14773 | passUint8ClampedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14774 | { | |||
14775 | BindingCallContext cx(cx_, "TestExampleInterface.passUint8ClampedArray"); | |||
14776 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14779( cx, "TestExampleInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14777 | "TestExampleInterface", "passUint8ClampedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14779( cx, "TestExampleInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14778 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14779( cx, "TestExampleInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14779 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14779( cx, "TestExampleInterface" , "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14780 | ||||
14781 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14782 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUint8ClampedArray", 1)) { | |||
14783 | return false; | |||
14784 | } | |||
14785 | RootedSpiderMonkeyInterface<Uint8ClampedArray> arg0(cx); | |||
14786 | if (args[0].isObject()) { | |||
14787 | if (!arg0.Init(&args[0].toObject())) { | |||
14788 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8ClampedArray"); | |||
14789 | return false; | |||
14790 | } | |||
14791 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14792 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14793 | return false; | |||
14794 | } | |||
14795 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14796 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14797 | return false; | |||
14798 | } | |||
14799 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14800 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14801 | return false; | |||
14802 | } | |||
14803 | } else { | |||
14804 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14805 | return false; | |||
14806 | } | |||
14807 | // NOTE: This assert does NOT call the function. | |||
14808 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint8ClampedArray(Constify(arg0)))>, "Should be returning void here"); | |||
14809 | MOZ_KnownLive(self)(self)->PassUint8ClampedArray(Constify(arg0)); | |||
14810 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14810); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14810; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14811 | args.rval().setUndefined(); | |||
14812 | return true; | |||
14813 | } | |||
14814 | ||||
14815 | static const JSJitInfo passUint8ClampedArray_methodinfo = { | |||
14816 | { (JSJitGetterOp)passUint8ClampedArray }, | |||
14817 | { prototypes::id::TestExampleInterface }, | |||
14818 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14819 | JSJitInfo::Method, | |||
14820 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14821 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14822 | false, /* isInfallible. False in setters. */ | |||
14823 | false, /* isMovable. Not relevant for setters. */ | |||
14824 | false, /* isEliminatable. Not relevant for setters. */ | |||
14825 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14826 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14827 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14828 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14829 | }; | |||
14830 | ||||
14831 | MOZ_CAN_RUN_SCRIPT static bool | |||
14832 | passFloat32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14833 | { | |||
14834 | BindingCallContext cx(cx_, "TestExampleInterface.passFloat32Array"); | |||
14835 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14838( cx, "TestExampleInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14836 | "TestExampleInterface", "passFloat32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14838( cx, "TestExampleInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14837 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14838( cx, "TestExampleInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14838 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14838( cx, "TestExampleInterface" , "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14839 | ||||
14840 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14841 | if (!args.requireAtLeast(cx, "TestExampleInterface.passFloat32Array", 1)) { | |||
14842 | return false; | |||
14843 | } | |||
14844 | RootedSpiderMonkeyInterface<Float32Array> arg0(cx); | |||
14845 | if (args[0].isObject()) { | |||
14846 | if (!arg0.Init(&args[0].toObject())) { | |||
14847 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array"); | |||
14848 | return false; | |||
14849 | } | |||
14850 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14851 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14852 | return false; | |||
14853 | } | |||
14854 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14855 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14856 | return false; | |||
14857 | } | |||
14858 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14859 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14860 | return false; | |||
14861 | } | |||
14862 | } else { | |||
14863 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14864 | return false; | |||
14865 | } | |||
14866 | // NOTE: This assert does NOT call the function. | |||
14867 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassFloat32Array(Constify(arg0)))>, "Should be returning void here"); | |||
14868 | MOZ_KnownLive(self)(self)->PassFloat32Array(Constify(arg0)); | |||
14869 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14869); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14869; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14870 | args.rval().setUndefined(); | |||
14871 | return true; | |||
14872 | } | |||
14873 | ||||
14874 | static const JSJitInfo passFloat32Array_methodinfo = { | |||
14875 | { (JSJitGetterOp)passFloat32Array }, | |||
14876 | { prototypes::id::TestExampleInterface }, | |||
14877 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14878 | JSJitInfo::Method, | |||
14879 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14880 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14881 | false, /* isInfallible. False in setters. */ | |||
14882 | false, /* isMovable. Not relevant for setters. */ | |||
14883 | false, /* isEliminatable. Not relevant for setters. */ | |||
14884 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14885 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14886 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14887 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14888 | }; | |||
14889 | ||||
14890 | MOZ_CAN_RUN_SCRIPT static bool | |||
14891 | passFloat64Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14892 | { | |||
14893 | BindingCallContext cx(cx_, "TestExampleInterface.passFloat64Array"); | |||
14894 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14897( cx, "TestExampleInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14895 | "TestExampleInterface", "passFloat64Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14897( cx, "TestExampleInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14896 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14897( cx, "TestExampleInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
14897 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14897( cx, "TestExampleInterface" , "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
14898 | ||||
14899 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14900 | if (!args.requireAtLeast(cx, "TestExampleInterface.passFloat64Array", 1)) { | |||
14901 | return false; | |||
14902 | } | |||
14903 | RootedSpiderMonkeyInterface<Float64Array> arg0(cx); | |||
14904 | if (args[0].isObject()) { | |||
14905 | if (!arg0.Init(&args[0].toObject())) { | |||
14906 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float64Array"); | |||
14907 | return false; | |||
14908 | } | |||
14909 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
14910 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
14911 | return false; | |||
14912 | } | |||
14913 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
14914 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
14915 | return false; | |||
14916 | } | |||
14917 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
14918 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
14919 | return false; | |||
14920 | } | |||
14921 | } else { | |||
14922 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
14923 | return false; | |||
14924 | } | |||
14925 | // NOTE: This assert does NOT call the function. | |||
14926 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassFloat64Array(Constify(arg0)))>, "Should be returning void here"); | |||
14927 | MOZ_KnownLive(self)(self)->PassFloat64Array(Constify(arg0)); | |||
14928 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 14928); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 14928; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
14929 | args.rval().setUndefined(); | |||
14930 | return true; | |||
14931 | } | |||
14932 | ||||
14933 | static const JSJitInfo passFloat64Array_methodinfo = { | |||
14934 | { (JSJitGetterOp)passFloat64Array }, | |||
14935 | { prototypes::id::TestExampleInterface }, | |||
14936 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
14937 | JSJitInfo::Method, | |||
14938 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
14939 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
14940 | false, /* isInfallible. False in setters. */ | |||
14941 | false, /* isMovable. Not relevant for setters. */ | |||
14942 | false, /* isEliminatable. Not relevant for setters. */ | |||
14943 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
14944 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
14945 | false, /* isTypedMethod. Only relevant for methods. */ | |||
14946 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
14947 | }; | |||
14948 | ||||
14949 | MOZ_CAN_RUN_SCRIPT static bool | |||
14950 | passSequenceOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
14951 | { | |||
14952 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfArrayBuffers"); | |||
14953 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14956( cx, "TestExampleInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14954 | "TestExampleInterface", "passSequenceOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14956( cx, "TestExampleInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14955 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14956( cx, "TestExampleInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
14956 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14956( cx, "TestExampleInterface" , "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
14957 | ||||
14958 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
14959 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfArrayBuffers", 1)) { | |||
14960 | return false; | |||
14961 | } | |||
14962 | binding_detail::AutoSequence<ArrayBuffer> arg0; | |||
14963 | SequenceRooter<ArrayBuffer> arg0_holder(cx, &arg0); | |||
14964 | if (args[0].isObject()) { | |||
14965 | JS::ForOfIterator iter(cx); | |||
14966 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
14967 | return false; | |||
14968 | } | |||
14969 | if (!iter.valueIsIterable()) { | |||
14970 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
14971 | return false; | |||
14972 | } | |||
14973 | binding_detail::AutoSequence<ArrayBuffer> &arr = arg0; | |||
14974 | JS::Rooted<JS::Value> temp(cx); | |||
14975 | while (true) { | |||
14976 | bool done; | |||
14977 | if (!iter.next(&temp, &done)) { | |||
14978 | return false; | |||
14979 | } | |||
14980 | if (done) { | |||
14981 | break; | |||
14982 | } | |||
14983 | ArrayBuffer* slotPtr = arr.AppendElement(mozilla::fallible); | |||
14984 | if (!slotPtr) { | |||
14985 | JS_ReportOutOfMemory(cx); | |||
14986 | return false; | |||
14987 | } | |||
14988 | ArrayBuffer& slot = *slotPtr; | |||
14989 | if (temp.isObject()) { | |||
14990 | if (!slot.Init(&temp.toObject())) { | |||
14991 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBuffer"); | |||
14992 | return false; | |||
14993 | } | |||
14994 | if (JS::IsSharedArrayBufferObject(slot.Obj())) { | |||
14995 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1"); | |||
14996 | return false; | |||
14997 | } | |||
14998 | if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) { | |||
14999 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1"); | |||
15000 | return false; | |||
15001 | } | |||
15002 | if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) { | |||
15003 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1"); | |||
15004 | return false; | |||
15005 | } | |||
15006 | } else { | |||
15007 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
15008 | return false; | |||
15009 | } | |||
15010 | } | |||
15011 | } else { | |||
15012 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
15013 | return false; | |||
15014 | } | |||
15015 | // NOTE: This assert does NOT call the function. | |||
15016 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfArrayBuffers(Constify(arg0)))>, "Should be returning void here"); | |||
15017 | MOZ_KnownLive(self)(self)->PassSequenceOfArrayBuffers(Constify(arg0)); | |||
15018 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15018); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15018; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15019 | args.rval().setUndefined(); | |||
15020 | return true; | |||
15021 | } | |||
15022 | ||||
15023 | static const JSJitInfo passSequenceOfArrayBuffers_methodinfo = { | |||
15024 | { (JSJitGetterOp)passSequenceOfArrayBuffers }, | |||
15025 | { prototypes::id::TestExampleInterface }, | |||
15026 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15027 | JSJitInfo::Method, | |||
15028 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15029 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15030 | false, /* isInfallible. False in setters. */ | |||
15031 | false, /* isMovable. Not relevant for setters. */ | |||
15032 | false, /* isEliminatable. Not relevant for setters. */ | |||
15033 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15034 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15035 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15036 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15037 | }; | |||
15038 | ||||
15039 | MOZ_CAN_RUN_SCRIPT static bool | |||
15040 | passSequenceOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15041 | { | |||
15042 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfNullableArrayBuffers"); | |||
15043 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15046( cx, "TestExampleInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15044 | "TestExampleInterface", "passSequenceOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15046( cx, "TestExampleInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15045 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15046( cx, "TestExampleInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15046 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15046( cx, "TestExampleInterface" , "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
15047 | ||||
15048 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15049 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfNullableArrayBuffers", 1)) { | |||
15050 | return false; | |||
15051 | } | |||
15052 | binding_detail::AutoSequence<Nullable<ArrayBuffer>> arg0; | |||
15053 | SequenceRooter<Nullable<ArrayBuffer>> arg0_holder(cx, &arg0); | |||
15054 | if (args[0].isObject()) { | |||
15055 | JS::ForOfIterator iter(cx); | |||
15056 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
15057 | return false; | |||
15058 | } | |||
15059 | if (!iter.valueIsIterable()) { | |||
15060 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
15061 | return false; | |||
15062 | } | |||
15063 | binding_detail::AutoSequence<Nullable<ArrayBuffer>> &arr = arg0; | |||
15064 | JS::Rooted<JS::Value> temp(cx); | |||
15065 | while (true) { | |||
15066 | bool done; | |||
15067 | if (!iter.next(&temp, &done)) { | |||
15068 | return false; | |||
15069 | } | |||
15070 | if (done) { | |||
15071 | break; | |||
15072 | } | |||
15073 | Nullable<ArrayBuffer>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
15074 | if (!slotPtr) { | |||
15075 | JS_ReportOutOfMemory(cx); | |||
15076 | return false; | |||
15077 | } | |||
15078 | Nullable<ArrayBuffer>& slot = *slotPtr; | |||
15079 | if (temp.isObject()) { | |||
15080 | if (!slot.SetValue().Init(&temp.toObject())) { | |||
15081 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBufferOrNull"); | |||
15082 | return false; | |||
15083 | } | |||
15084 | if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) { | |||
15085 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1"); | |||
15086 | return false; | |||
15087 | } | |||
15088 | if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) { | |||
15089 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1"); | |||
15090 | return false; | |||
15091 | } | |||
15092 | if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) { | |||
15093 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1"); | |||
15094 | return false; | |||
15095 | } | |||
15096 | } else if (temp.isNullOrUndefined()) { | |||
15097 | slot.SetNull(); | |||
15098 | } else { | |||
15099 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
15100 | return false; | |||
15101 | } | |||
15102 | } | |||
15103 | } else { | |||
15104 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
15105 | return false; | |||
15106 | } | |||
15107 | // NOTE: This assert does NOT call the function. | |||
15108 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableArrayBuffers(Constify(arg0)))>, "Should be returning void here"); | |||
15109 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableArrayBuffers(Constify(arg0)); | |||
15110 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15110); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15110; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15111 | args.rval().setUndefined(); | |||
15112 | return true; | |||
15113 | } | |||
15114 | ||||
15115 | static const JSJitInfo passSequenceOfNullableArrayBuffers_methodinfo = { | |||
15116 | { (JSJitGetterOp)passSequenceOfNullableArrayBuffers }, | |||
15117 | { prototypes::id::TestExampleInterface }, | |||
15118 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15119 | JSJitInfo::Method, | |||
15120 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15121 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15122 | false, /* isInfallible. False in setters. */ | |||
15123 | false, /* isMovable. Not relevant for setters. */ | |||
15124 | false, /* isEliminatable. Not relevant for setters. */ | |||
15125 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15126 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15127 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15128 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15129 | }; | |||
15130 | ||||
15131 | MOZ_CAN_RUN_SCRIPT static bool | |||
15132 | passRecordOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15133 | { | |||
15134 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfArrayBuffers"); | |||
15135 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15138( cx, "TestExampleInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15136 | "TestExampleInterface", "passRecordOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15138( cx, "TestExampleInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15137 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15138( cx, "TestExampleInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15138 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15138( cx, "TestExampleInterface" , "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
15139 | ||||
15140 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15141 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfArrayBuffers", 1)) { | |||
15142 | return false; | |||
15143 | } | |||
15144 | Record<nsString, ArrayBuffer> arg0; | |||
15145 | RecordRooter<nsString, ArrayBuffer> arg0_holder(cx, &arg0); | |||
15146 | if (args[0].isObject()) { | |||
15147 | auto& recordEntries = arg0.Entries(); | |||
15148 | ||||
15149 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
15150 | JS::RootedVector<jsid> ids(cx); | |||
15151 | if (!js::GetPropertyKeys(cx, recordObj, | |||
15152 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
15153 | return false; | |||
15154 | } | |||
15155 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
15156 | JS_ReportOutOfMemory(cx); | |||
15157 | return false; | |||
15158 | } | |||
15159 | JS::Rooted<JS::Value> propNameValue(cx); | |||
15160 | JS::Rooted<JS::Value> temp(cx); | |||
15161 | JS::Rooted<jsid> curId(cx); | |||
15162 | JS::Rooted<JS::Value> idVal(cx); | |||
15163 | // Use a hashset to keep track of ids seen, to avoid | |||
15164 | // introducing nasty O(N^2) behavior scanning for them all the | |||
15165 | // time. Ideally we'd use a data structure with O(1) lookup | |||
15166 | // _and_ ordering for the MozMap, but we don't have one lying | |||
15167 | // around. | |||
15168 | nsTHashtable<nsStringHashKey> idsSeen; | |||
15169 | for (size_t i = 0; i < ids.length(); ++i) { | |||
15170 | curId = ids[i]; | |||
15171 | ||||
15172 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
15173 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
15174 | &desc)) { | |||
15175 | return false; | |||
15176 | } | |||
15177 | ||||
15178 | if (desc.isNothing() || !desc->enumerable()) { | |||
15179 | continue; | |||
15180 | } | |||
15181 | ||||
15182 | idVal = js::IdToValue(curId); | |||
15183 | nsString propName; | |||
15184 | // This will just throw if idVal is a Symbol, like the spec says | |||
15185 | // to do. | |||
15186 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
15187 | return false; | |||
15188 | } | |||
15189 | ||||
15190 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
15191 | return false; | |||
15192 | } | |||
15193 | ||||
15194 | Record<nsString, ArrayBuffer>::EntryType* entry; | |||
15195 | if (!idsSeen.EnsureInserted(propName)) { | |||
15196 | // Find the existing entry. | |||
15197 | auto idx = recordEntries.IndexOf(propName); | |||
15198 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 15199); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 15199; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
15199 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 15199); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 15199; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
15200 | // Now blow it away to make it look like it was just added | |||
15201 | // to the array, because it's not obvious that it's | |||
15202 | // safe to write to its already-initialized mValue via our | |||
15203 | // normal codegen conversions. For example, the value | |||
15204 | // could be a union and this would change its type, but | |||
15205 | // codegen assumes we won't do that. | |||
15206 | entry = recordEntries.ReconstructElementAt(idx); | |||
15207 | } else { | |||
15208 | // Safe to do an infallible append here, because we did a | |||
15209 | // SetCapacity above to the right capacity. | |||
15210 | entry = recordEntries.AppendElement(); | |||
15211 | } | |||
15212 | entry->mKey = propName; | |||
15213 | ArrayBuffer& slot = entry->mValue; | |||
15214 | if (temp.isObject()) { | |||
15215 | if (!slot.Init(&temp.toObject())) { | |||
15216 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBuffer"); | |||
15217 | return false; | |||
15218 | } | |||
15219 | if (JS::IsSharedArrayBufferObject(slot.Obj())) { | |||
15220 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1"); | |||
15221 | return false; | |||
15222 | } | |||
15223 | if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) { | |||
15224 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1"); | |||
15225 | return false; | |||
15226 | } | |||
15227 | if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) { | |||
15228 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1"); | |||
15229 | return false; | |||
15230 | } | |||
15231 | } else { | |||
15232 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
15233 | return false; | |||
15234 | } | |||
15235 | } | |||
15236 | } else { | |||
15237 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
15238 | return false; | |||
15239 | } | |||
15240 | // NOTE: This assert does NOT call the function. | |||
15241 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfArrayBuffers(Constify(arg0)))>, "Should be returning void here"); | |||
15242 | MOZ_KnownLive(self)(self)->PassRecordOfArrayBuffers(Constify(arg0)); | |||
15243 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15243); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15243; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15244 | args.rval().setUndefined(); | |||
15245 | return true; | |||
15246 | } | |||
15247 | ||||
15248 | static const JSJitInfo passRecordOfArrayBuffers_methodinfo = { | |||
15249 | { (JSJitGetterOp)passRecordOfArrayBuffers }, | |||
15250 | { prototypes::id::TestExampleInterface }, | |||
15251 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15252 | JSJitInfo::Method, | |||
15253 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15254 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15255 | false, /* isInfallible. False in setters. */ | |||
15256 | false, /* isMovable. Not relevant for setters. */ | |||
15257 | false, /* isEliminatable. Not relevant for setters. */ | |||
15258 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15259 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15260 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15261 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15262 | }; | |||
15263 | ||||
15264 | MOZ_CAN_RUN_SCRIPT static bool | |||
15265 | passRecordOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15266 | { | |||
15267 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfNullableArrayBuffers"); | |||
15268 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15271( cx, "TestExampleInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15269 | "TestExampleInterface", "passRecordOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15271( cx, "TestExampleInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15270 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15271( cx, "TestExampleInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15271 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15271( cx, "TestExampleInterface" , "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
15272 | ||||
15273 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15274 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfNullableArrayBuffers", 1)) { | |||
15275 | return false; | |||
15276 | } | |||
15277 | Record<nsString, Nullable<ArrayBuffer>> arg0; | |||
15278 | RecordRooter<nsString, Nullable<ArrayBuffer>> arg0_holder(cx, &arg0); | |||
15279 | if (args[0].isObject()) { | |||
15280 | auto& recordEntries = arg0.Entries(); | |||
15281 | ||||
15282 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
15283 | JS::RootedVector<jsid> ids(cx); | |||
15284 | if (!js::GetPropertyKeys(cx, recordObj, | |||
15285 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
15286 | return false; | |||
15287 | } | |||
15288 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
15289 | JS_ReportOutOfMemory(cx); | |||
15290 | return false; | |||
15291 | } | |||
15292 | JS::Rooted<JS::Value> propNameValue(cx); | |||
15293 | JS::Rooted<JS::Value> temp(cx); | |||
15294 | JS::Rooted<jsid> curId(cx); | |||
15295 | JS::Rooted<JS::Value> idVal(cx); | |||
15296 | // Use a hashset to keep track of ids seen, to avoid | |||
15297 | // introducing nasty O(N^2) behavior scanning for them all the | |||
15298 | // time. Ideally we'd use a data structure with O(1) lookup | |||
15299 | // _and_ ordering for the MozMap, but we don't have one lying | |||
15300 | // around. | |||
15301 | nsTHashtable<nsStringHashKey> idsSeen; | |||
15302 | for (size_t i = 0; i < ids.length(); ++i) { | |||
15303 | curId = ids[i]; | |||
15304 | ||||
15305 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
15306 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
15307 | &desc)) { | |||
15308 | return false; | |||
15309 | } | |||
15310 | ||||
15311 | if (desc.isNothing() || !desc->enumerable()) { | |||
15312 | continue; | |||
15313 | } | |||
15314 | ||||
15315 | idVal = js::IdToValue(curId); | |||
15316 | nsString propName; | |||
15317 | // This will just throw if idVal is a Symbol, like the spec says | |||
15318 | // to do. | |||
15319 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
15320 | return false; | |||
15321 | } | |||
15322 | ||||
15323 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
15324 | return false; | |||
15325 | } | |||
15326 | ||||
15327 | Record<nsString, Nullable<ArrayBuffer>>::EntryType* entry; | |||
15328 | if (!idsSeen.EnsureInserted(propName)) { | |||
15329 | // Find the existing entry. | |||
15330 | auto idx = recordEntries.IndexOf(propName); | |||
15331 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 15332); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 15332; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
15332 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 15332); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 15332; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
15333 | // Now blow it away to make it look like it was just added | |||
15334 | // to the array, because it's not obvious that it's | |||
15335 | // safe to write to its already-initialized mValue via our | |||
15336 | // normal codegen conversions. For example, the value | |||
15337 | // could be a union and this would change its type, but | |||
15338 | // codegen assumes we won't do that. | |||
15339 | entry = recordEntries.ReconstructElementAt(idx); | |||
15340 | } else { | |||
15341 | // Safe to do an infallible append here, because we did a | |||
15342 | // SetCapacity above to the right capacity. | |||
15343 | entry = recordEntries.AppendElement(); | |||
15344 | } | |||
15345 | entry->mKey = propName; | |||
15346 | Nullable<ArrayBuffer>& slot = entry->mValue; | |||
15347 | if (temp.isObject()) { | |||
15348 | if (!slot.SetValue().Init(&temp.toObject())) { | |||
15349 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBufferOrNull"); | |||
15350 | return false; | |||
15351 | } | |||
15352 | if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) { | |||
15353 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1"); | |||
15354 | return false; | |||
15355 | } | |||
15356 | if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) { | |||
15357 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1"); | |||
15358 | return false; | |||
15359 | } | |||
15360 | if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) { | |||
15361 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1"); | |||
15362 | return false; | |||
15363 | } | |||
15364 | } else if (temp.isNullOrUndefined()) { | |||
15365 | slot.SetNull(); | |||
15366 | } else { | |||
15367 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
15368 | return false; | |||
15369 | } | |||
15370 | } | |||
15371 | } else { | |||
15372 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
15373 | return false; | |||
15374 | } | |||
15375 | // NOTE: This assert does NOT call the function. | |||
15376 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfNullableArrayBuffers(Constify(arg0)))>, "Should be returning void here"); | |||
15377 | MOZ_KnownLive(self)(self)->PassRecordOfNullableArrayBuffers(Constify(arg0)); | |||
15378 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15378); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15378; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15379 | args.rval().setUndefined(); | |||
15380 | return true; | |||
15381 | } | |||
15382 | ||||
15383 | static const JSJitInfo passRecordOfNullableArrayBuffers_methodinfo = { | |||
15384 | { (JSJitGetterOp)passRecordOfNullableArrayBuffers }, | |||
15385 | { prototypes::id::TestExampleInterface }, | |||
15386 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15387 | JSJitInfo::Method, | |||
15388 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15389 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15390 | false, /* isInfallible. False in setters. */ | |||
15391 | false, /* isMovable. Not relevant for setters. */ | |||
15392 | false, /* isEliminatable. Not relevant for setters. */ | |||
15393 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15394 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15395 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15396 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15397 | }; | |||
15398 | ||||
15399 | MOZ_CAN_RUN_SCRIPT static bool | |||
15400 | passVariadicTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15401 | { | |||
15402 | BindingCallContext cx(cx_, "TestExampleInterface.passVariadicTypedArray"); | |||
15403 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15406( cx, "TestExampleInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15404 | "TestExampleInterface", "passVariadicTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15406( cx, "TestExampleInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15405 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15406( cx, "TestExampleInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15406 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15406( cx, "TestExampleInterface" , "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15407 | ||||
15408 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15409 | AutoSequence<Float32Array> arg0; | |||
15410 | SequenceRooter<Float32Array> arg0_holder(cx, &arg0); | |||
15411 | if (args.length() > 0) { | |||
15412 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
15413 | JS_ReportOutOfMemory(cx); | |||
15414 | return false; | |||
15415 | } | |||
15416 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
15417 | // OK to do infallible append here, since we ensured capacity already. | |||
15418 | Float32Array& slot = *arg0.AppendElement(); | |||
15419 | if (args[variadicArg].isObject()) { | |||
15420 | if (!slot.Init(&args[variadicArg].toObject())) { | |||
15421 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array"); | |||
15422 | return false; | |||
15423 | } | |||
15424 | if (JS::IsArrayBufferViewShared(slot.Obj())) { | |||
15425 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
15426 | return false; | |||
15427 | } | |||
15428 | if (JS::IsLargeArrayBufferView(slot.Obj())) { | |||
15429 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
15430 | return false; | |||
15431 | } | |||
15432 | if (JS::IsResizableArrayBufferView(slot.Obj())) { | |||
15433 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
15434 | return false; | |||
15435 | } | |||
15436 | } else { | |||
15437 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
15438 | return false; | |||
15439 | } | |||
15440 | } | |||
15441 | } | |||
15442 | // NOTE: This assert does NOT call the function. | |||
15443 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicTypedArray(Constify(arg0)))>, "Should be returning void here"); | |||
15444 | MOZ_KnownLive(self)(self)->PassVariadicTypedArray(Constify(arg0)); | |||
15445 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15445); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15445; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15446 | args.rval().setUndefined(); | |||
15447 | return true; | |||
15448 | } | |||
15449 | ||||
15450 | static const JSJitInfo passVariadicTypedArray_methodinfo = { | |||
15451 | { (JSJitGetterOp)passVariadicTypedArray }, | |||
15452 | { prototypes::id::TestExampleInterface }, | |||
15453 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15454 | JSJitInfo::Method, | |||
15455 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15456 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15457 | false, /* isInfallible. False in setters. */ | |||
15458 | false, /* isMovable. Not relevant for setters. */ | |||
15459 | false, /* isEliminatable. Not relevant for setters. */ | |||
15460 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15461 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15462 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15463 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15464 | }; | |||
15465 | ||||
15466 | MOZ_CAN_RUN_SCRIPT static bool | |||
15467 | passVariadicNullableTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15468 | { | |||
15469 | BindingCallContext cx(cx_, "TestExampleInterface.passVariadicNullableTypedArray"); | |||
15470 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15473( cx, "TestExampleInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15471 | "TestExampleInterface", "passVariadicNullableTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15473( cx, "TestExampleInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15472 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15473( cx, "TestExampleInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15473 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15473( cx, "TestExampleInterface" , "passVariadicNullableTypedArray", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
15474 | ||||
15475 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15476 | AutoSequence<Nullable<Float32Array>> arg0; | |||
15477 | SequenceRooter<Nullable<Float32Array>> arg0_holder(cx, &arg0); | |||
15478 | if (args.length() > 0) { | |||
15479 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
15480 | JS_ReportOutOfMemory(cx); | |||
15481 | return false; | |||
15482 | } | |||
15483 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
15484 | // OK to do infallible append here, since we ensured capacity already. | |||
15485 | Nullable<Float32Array>& slot = *arg0.AppendElement(); | |||
15486 | if (args[variadicArg].isObject()) { | |||
15487 | if (!slot.SetValue().Init(&args[variadicArg].toObject())) { | |||
15488 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32ArrayOrNull"); | |||
15489 | return false; | |||
15490 | } | |||
15491 | if (JS::IsArrayBufferViewShared(slot.SetValue().Obj())) { | |||
15492 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1"); | |||
15493 | return false; | |||
15494 | } | |||
15495 | if (JS::IsLargeArrayBufferView(slot.SetValue().Obj())) { | |||
15496 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1"); | |||
15497 | return false; | |||
15498 | } | |||
15499 | if (JS::IsResizableArrayBufferView(slot.SetValue().Obj())) { | |||
15500 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1"); | |||
15501 | return false; | |||
15502 | } | |||
15503 | } else if (args[variadicArg].isNullOrUndefined()) { | |||
15504 | slot.SetNull(); | |||
15505 | } else { | |||
15506 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
15507 | return false; | |||
15508 | } | |||
15509 | } | |||
15510 | } | |||
15511 | // NOTE: This assert does NOT call the function. | |||
15512 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicNullableTypedArray(Constify(arg0)))>, "Should be returning void here"); | |||
15513 | MOZ_KnownLive(self)(self)->PassVariadicNullableTypedArray(Constify(arg0)); | |||
15514 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15514); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15514; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15515 | args.rval().setUndefined(); | |||
15516 | return true; | |||
15517 | } | |||
15518 | ||||
15519 | static const JSJitInfo passVariadicNullableTypedArray_methodinfo = { | |||
15520 | { (JSJitGetterOp)passVariadicNullableTypedArray }, | |||
15521 | { prototypes::id::TestExampleInterface }, | |||
15522 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15523 | JSJitInfo::Method, | |||
15524 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15525 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15526 | false, /* isInfallible. False in setters. */ | |||
15527 | false, /* isMovable. Not relevant for setters. */ | |||
15528 | false, /* isEliminatable. Not relevant for setters. */ | |||
15529 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15530 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15531 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15532 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15533 | }; | |||
15534 | ||||
15535 | MOZ_CAN_RUN_SCRIPT static bool | |||
15536 | receiveUint8Array(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15537 | { | |||
15538 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15541( cx, "TestExampleInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15539 | "TestExampleInterface", "receiveUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15541( cx, "TestExampleInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15540 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15541( cx, "TestExampleInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15541 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15541( cx, "TestExampleInterface" , "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15542 | ||||
15543 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15544 | JS::Rooted<JSObject*> result(cx); | |||
15545 | // NOTE: This assert does NOT call the function. | |||
15546 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveUint8Array(cx, &result))>, "Should be returning void here"); | |||
15547 | MOZ_KnownLive(self)(self)->ReceiveUint8Array(cx, &result); | |||
15548 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15548); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15548; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15549 | JS::ExposeObjectToActiveJS(result); | |||
15550 | args.rval().setObject(*result); | |||
15551 | if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) { | |||
15552 | return false; | |||
15553 | } | |||
15554 | return true; | |||
15555 | } | |||
15556 | ||||
15557 | static const JSJitInfo receiveUint8Array_methodinfo = { | |||
15558 | { (JSJitGetterOp)receiveUint8Array }, | |||
15559 | { prototypes::id::TestExampleInterface }, | |||
15560 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15561 | JSJitInfo::Method, | |||
15562 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15563 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
15564 | false, /* isInfallible. False in setters. */ | |||
15565 | false, /* isMovable. Not relevant for setters. */ | |||
15566 | false, /* isEliminatable. Not relevant for setters. */ | |||
15567 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15568 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15569 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15570 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15571 | }; | |||
15572 | ||||
15573 | MOZ_CAN_RUN_SCRIPT static bool | |||
15574 | get_uint8ArrayAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
15575 | { | |||
15576 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15579( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15577 | "TestExampleInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15579( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15578 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject15579( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15579 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15579( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15580 | ||||
15581 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15582 | JS::Rooted<JSObject*> result(cx); | |||
15583 | // NOTE: This assert does NOT call the function. | |||
15584 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetUint8ArrayAttr(cx, &result))>, "Should be returning void here"); | |||
15585 | MOZ_KnownLive(self)(self)->GetUint8ArrayAttr(cx, &result); | |||
15586 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15586); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15586; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15587 | JS::ExposeObjectToActiveJS(result); | |||
15588 | args.rval().setObject(*result); | |||
15589 | if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) { | |||
15590 | return false; | |||
15591 | } | |||
15592 | return true; | |||
15593 | } | |||
15594 | ||||
15595 | MOZ_CAN_RUN_SCRIPT static bool | |||
15596 | set_uint8ArrayAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
15597 | { | |||
15598 | BindingCallContext cx(cx_, "TestExampleInterface.uint8ArrayAttr setter"); | |||
15599 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15602( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15600 | "TestExampleInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15602( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15601 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject15602( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15602 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15602( cx, "TestExampleInterface" , "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15603 | ||||
15604 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15605 | RootedSpiderMonkeyInterface<Uint8Array> arg0(cx); | |||
15606 | if (args[0].isObject()) { | |||
15607 | if (!arg0.Init(&args[0].toObject())) { | |||
15608 | cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "Uint8Array"); | |||
15609 | return false; | |||
15610 | } | |||
15611 | if (JS::IsArrayBufferViewShared(arg0.Obj())) { | |||
15612 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value being assigned"); | |||
15613 | return false; | |||
15614 | } | |||
15615 | if (JS::IsLargeArrayBufferView(arg0.Obj())) { | |||
15616 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned"); | |||
15617 | return false; | |||
15618 | } | |||
15619 | if (JS::IsResizableArrayBufferView(arg0.Obj())) { | |||
15620 | cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned"); | |||
15621 | return false; | |||
15622 | } | |||
15623 | } else { | |||
15624 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned"); | |||
15625 | return false; | |||
15626 | } | |||
15627 | // NOTE: This assert does NOT call the function. | |||
15628 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetUint8ArrayAttr(Constify(arg0)))>, "Should be returning void here"); | |||
15629 | MOZ_KnownLive(self)(self)->SetUint8ArrayAttr(Constify(arg0)); | |||
15630 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15630); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15630; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15631 | ||||
15632 | return true; | |||
15633 | } | |||
15634 | ||||
15635 | static const JSJitInfo uint8ArrayAttr_getterinfo = { | |||
15636 | { get_uint8ArrayAttr }, | |||
15637 | { prototypes::id::TestExampleInterface }, | |||
15638 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15639 | JSJitInfo::Getter, | |||
15640 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15641 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
15642 | false, /* isInfallible. False in setters. */ | |||
15643 | false, /* isMovable. Not relevant for setters. */ | |||
15644 | false, /* isEliminatable. Not relevant for setters. */ | |||
15645 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15646 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15647 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15648 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15649 | }; | |||
15650 | static const JSJitInfo uint8ArrayAttr_setterinfo = { | |||
15651 | { (JSJitGetterOp)set_uint8ArrayAttr }, | |||
15652 | { prototypes::id::TestExampleInterface }, | |||
15653 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15654 | JSJitInfo::Setter, | |||
15655 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15656 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15657 | false, /* isInfallible. False in setters. */ | |||
15658 | false, /* isMovable. Not relevant for setters. */ | |||
15659 | false, /* isEliminatable. Not relevant for setters. */ | |||
15660 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15661 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15662 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15663 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15664 | }; | |||
15665 | ||||
15666 | MOZ_CAN_RUN_SCRIPT static bool | |||
15667 | passString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15668 | { | |||
15669 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15672( cx, "TestExampleInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15670 | "TestExampleInterface", "passString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15672( cx, "TestExampleInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15671 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15672( cx, "TestExampleInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15672 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15672( cx, "TestExampleInterface" , "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15673 | ||||
15674 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15675 | if (!args.requireAtLeast(cx, "TestExampleInterface.passString", 1)) { | |||
15676 | return false; | |||
15677 | } | |||
15678 | binding_detail::FakeString<char16_t> arg0; | |||
15679 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | |||
15680 | return false; | |||
15681 | } | |||
15682 | // NOTE: This assert does NOT call the function. | |||
15683 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassString(NonNullHelper(Constify(arg0))))>, "Should be returning void here"); | |||
15684 | MOZ_KnownLive(self)(self)->PassString(NonNullHelper(Constify(arg0))); | |||
15685 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15685); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15685; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15686 | args.rval().setUndefined(); | |||
15687 | return true; | |||
15688 | } | |||
15689 | ||||
15690 | static const JSJitInfo passString_methodinfo = { | |||
15691 | { (JSJitGetterOp)passString }, | |||
15692 | { prototypes::id::TestExampleInterface }, | |||
15693 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15694 | JSJitInfo::Method, | |||
15695 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15696 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15697 | false, /* isInfallible. False in setters. */ | |||
15698 | false, /* isMovable. Not relevant for setters. */ | |||
15699 | false, /* isEliminatable. Not relevant for setters. */ | |||
15700 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15701 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15702 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15703 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15704 | }; | |||
15705 | ||||
15706 | MOZ_CAN_RUN_SCRIPT static bool | |||
15707 | passNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15708 | { | |||
15709 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15712( cx, "TestExampleInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15710 | "TestExampleInterface", "passNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15712( cx, "TestExampleInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15711 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15712( cx, "TestExampleInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15712 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15712( cx, "TestExampleInterface" , "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15713 | ||||
15714 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15715 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableString", 1)) { | |||
15716 | return false; | |||
15717 | } | |||
15718 | binding_detail::FakeString<char16_t> arg0; | |||
15719 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | |||
15720 | return false; | |||
15721 | } | |||
15722 | // NOTE: This assert does NOT call the function. | |||
15723 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableString(NonNullHelper(Constify(arg0))))>, "Should be returning void here"); | |||
15724 | MOZ_KnownLive(self)(self)->PassNullableString(NonNullHelper(Constify(arg0))); | |||
15725 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15725); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15725; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15726 | args.rval().setUndefined(); | |||
15727 | return true; | |||
15728 | } | |||
15729 | ||||
15730 | static const JSJitInfo passNullableString_methodinfo = { | |||
15731 | { (JSJitGetterOp)passNullableString }, | |||
15732 | { prototypes::id::TestExampleInterface }, | |||
15733 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15734 | JSJitInfo::Method, | |||
15735 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15736 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15737 | false, /* isInfallible. False in setters. */ | |||
15738 | false, /* isMovable. Not relevant for setters. */ | |||
15739 | false, /* isEliminatable. Not relevant for setters. */ | |||
15740 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15741 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15742 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15743 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15744 | }; | |||
15745 | ||||
15746 | MOZ_CAN_RUN_SCRIPT static bool | |||
15747 | passOptionalString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15748 | { | |||
15749 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15752( cx, "TestExampleInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15750 | "TestExampleInterface", "passOptionalString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15752( cx, "TestExampleInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15751 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15752( cx, "TestExampleInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15752 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15752( cx, "TestExampleInterface" , "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15753 | ||||
15754 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15755 | Optional<nsAString> arg0; | |||
15756 | binding_detail::FakeString<char16_t> arg0_holder; | |||
15757 | if (args.hasDefined(0)) { | |||
15758 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) { | |||
15759 | return false; | |||
15760 | } | |||
15761 | arg0 = &arg0_holder; | |||
15762 | } | |||
15763 | // NOTE: This assert does NOT call the function. | |||
15764 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalString(NonNullHelper(Constify(arg0))))>, "Should be returning void here"); | |||
15765 | MOZ_KnownLive(self)(self)->PassOptionalString(NonNullHelper(Constify(arg0))); | |||
15766 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15766); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15766; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15767 | args.rval().setUndefined(); | |||
15768 | return true; | |||
15769 | } | |||
15770 | ||||
15771 | static const JSJitInfo passOptionalString_methodinfo = { | |||
15772 | { (JSJitGetterOp)passOptionalString }, | |||
15773 | { prototypes::id::TestExampleInterface }, | |||
15774 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15775 | JSJitInfo::Method, | |||
15776 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15777 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15778 | false, /* isInfallible. False in setters. */ | |||
15779 | false, /* isMovable. Not relevant for setters. */ | |||
15780 | false, /* isEliminatable. Not relevant for setters. */ | |||
15781 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15782 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15783 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15784 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15785 | }; | |||
15786 | ||||
15787 | MOZ_CAN_RUN_SCRIPT static bool | |||
15788 | passOptionalStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15789 | { | |||
15790 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15793( cx, "TestExampleInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15791 | "TestExampleInterface", "passOptionalStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15793( cx, "TestExampleInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15792 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15793( cx, "TestExampleInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15793 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15793( cx, "TestExampleInterface" , "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
15794 | ||||
15795 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15796 | binding_detail::FakeString<char16_t> arg0; | |||
15797 | if (args.hasDefined(0)) { | |||
15798 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | |||
15799 | return false; | |||
15800 | } | |||
15801 | } else { | |||
15802 | arg0.AssignLiteral(u"abc"); | |||
15803 | } | |||
15804 | // NOTE: This assert does NOT call the function. | |||
15805 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalStringWithDefaultValue(NonNullHelper(Constify(arg0))))>, "Should be returning void here"); | |||
15806 | MOZ_KnownLive(self)(self)->PassOptionalStringWithDefaultValue(NonNullHelper(Constify(arg0))); | |||
15807 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15807); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15807; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15808 | args.rval().setUndefined(); | |||
15809 | return true; | |||
15810 | } | |||
15811 | ||||
15812 | static const JSJitInfo passOptionalStringWithDefaultValue_methodinfo = { | |||
15813 | { (JSJitGetterOp)passOptionalStringWithDefaultValue }, | |||
15814 | { prototypes::id::TestExampleInterface }, | |||
15815 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15816 | JSJitInfo::Method, | |||
15817 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15818 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15819 | false, /* isInfallible. False in setters. */ | |||
15820 | false, /* isMovable. Not relevant for setters. */ | |||
15821 | false, /* isEliminatable. Not relevant for setters. */ | |||
15822 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15823 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15824 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15825 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15826 | }; | |||
15827 | ||||
15828 | MOZ_CAN_RUN_SCRIPT static bool | |||
15829 | passOptionalNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15830 | { | |||
15831 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15834( cx, "TestExampleInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15832 | "TestExampleInterface", "passOptionalNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15834( cx, "TestExampleInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15833 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15834( cx, "TestExampleInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15834 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15834( cx, "TestExampleInterface" , "passOptionalNullableString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
15835 | ||||
15836 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15837 | Optional<nsAString> arg0; | |||
15838 | binding_detail::FakeString<char16_t> arg0_holder; | |||
15839 | if (args.hasDefined(0)) { | |||
15840 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) { | |||
15841 | return false; | |||
15842 | } | |||
15843 | arg0 = &arg0_holder; | |||
15844 | } | |||
15845 | // NOTE: This assert does NOT call the function. | |||
15846 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableString(NonNullHelper(Constify(arg0))))>, "Should be returning void here"); | |||
15847 | MOZ_KnownLive(self)(self)->PassOptionalNullableString(NonNullHelper(Constify(arg0))); | |||
15848 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15848); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15848; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15849 | args.rval().setUndefined(); | |||
15850 | return true; | |||
15851 | } | |||
15852 | ||||
15853 | static const JSJitInfo passOptionalNullableString_methodinfo = { | |||
15854 | { (JSJitGetterOp)passOptionalNullableString }, | |||
15855 | { prototypes::id::TestExampleInterface }, | |||
15856 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15857 | JSJitInfo::Method, | |||
15858 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15859 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15860 | false, /* isInfallible. False in setters. */ | |||
15861 | false, /* isMovable. Not relevant for setters. */ | |||
15862 | false, /* isEliminatable. Not relevant for setters. */ | |||
15863 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15864 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15865 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15866 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15867 | }; | |||
15868 | ||||
15869 | MOZ_CAN_RUN_SCRIPT static bool | |||
15870 | passOptionalNullableStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15871 | { | |||
15872 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15875( cx, "TestExampleInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15873 | "TestExampleInterface", "passOptionalNullableStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15875( cx, "TestExampleInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15874 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15875( cx, "TestExampleInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
15875 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15875( cx, "TestExampleInterface" , "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
15876 | ||||
15877 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15878 | binding_detail::FakeString<char16_t> arg0; | |||
15879 | if (args.hasDefined(0)) { | |||
15880 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | |||
15881 | return false; | |||
15882 | } | |||
15883 | } else { | |||
15884 | arg0.SetIsVoid(true); | |||
15885 | } | |||
15886 | // NOTE: This assert does NOT call the function. | |||
15887 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableStringWithDefaultValue(NonNullHelper(Constify(arg0))))>, "Should be returning void here"); | |||
15888 | MOZ_KnownLive(self)(self)->PassOptionalNullableStringWithDefaultValue(NonNullHelper(Constify(arg0))); | |||
15889 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15889); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15889; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15890 | args.rval().setUndefined(); | |||
15891 | return true; | |||
15892 | } | |||
15893 | ||||
15894 | static const JSJitInfo passOptionalNullableStringWithDefaultValue_methodinfo = { | |||
15895 | { (JSJitGetterOp)passOptionalNullableStringWithDefaultValue }, | |||
15896 | { prototypes::id::TestExampleInterface }, | |||
15897 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15898 | JSJitInfo::Method, | |||
15899 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15900 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15901 | false, /* isInfallible. False in setters. */ | |||
15902 | false, /* isMovable. Not relevant for setters. */ | |||
15903 | false, /* isEliminatable. Not relevant for setters. */ | |||
15904 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15905 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15906 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15907 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15908 | }; | |||
15909 | ||||
15910 | MOZ_CAN_RUN_SCRIPT static bool | |||
15911 | passVariadicString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15912 | { | |||
15913 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15916( cx, "TestExampleInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15914 | "TestExampleInterface", "passVariadicString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15916( cx, "TestExampleInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15915 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15916( cx, "TestExampleInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15916 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15916( cx, "TestExampleInterface" , "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15917 | ||||
15918 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15919 | AutoSequence<nsString> arg0; | |||
15920 | if (args.length() > 0) { | |||
15921 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
15922 | JS_ReportOutOfMemory(cx); | |||
15923 | return false; | |||
15924 | } | |||
15925 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
15926 | // OK to do infallible append here, since we ensured capacity already. | |||
15927 | nsString& slot = *arg0.AppendElement(); | |||
15928 | if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) { | |||
15929 | return false; | |||
15930 | } | |||
15931 | } | |||
15932 | } | |||
15933 | // NOTE: This assert does NOT call the function. | |||
15934 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicString(NonNullHelper(Constify(arg0))))>, "Should be returning void here"); | |||
15935 | MOZ_KnownLive(self)(self)->PassVariadicString(NonNullHelper(Constify(arg0))); | |||
15936 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15936); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15936; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15937 | args.rval().setUndefined(); | |||
15938 | return true; | |||
15939 | } | |||
15940 | ||||
15941 | static const JSJitInfo passVariadicString_methodinfo = { | |||
15942 | { (JSJitGetterOp)passVariadicString }, | |||
15943 | { prototypes::id::TestExampleInterface }, | |||
15944 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15945 | JSJitInfo::Method, | |||
15946 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15947 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15948 | false, /* isInfallible. False in setters. */ | |||
15949 | false, /* isMovable. Not relevant for setters. */ | |||
15950 | false, /* isEliminatable. Not relevant for setters. */ | |||
15951 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15952 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15953 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15954 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15955 | }; | |||
15956 | ||||
15957 | MOZ_CAN_RUN_SCRIPT static bool | |||
15958 | passByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
15959 | { | |||
15960 | BindingCallContext cx(cx_, "TestExampleInterface.passByteString"); | |||
15961 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15964( cx, "TestExampleInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15962 | "TestExampleInterface", "passByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15964( cx, "TestExampleInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15963 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15964( cx, "TestExampleInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
15964 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15964( cx, "TestExampleInterface" , "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
15965 | ||||
15966 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
15967 | if (!args.requireAtLeast(cx, "TestExampleInterface.passByteString", 1)) { | |||
15968 | return false; | |||
15969 | } | |||
15970 | nsCString arg0; | |||
15971 | if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) { | |||
15972 | return false; | |||
15973 | } | |||
15974 | // NOTE: This assert does NOT call the function. | |||
15975 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByteString(Constify(arg0)))>, "Should be returning void here"); | |||
15976 | MOZ_KnownLive(self)(self)->PassByteString(Constify(arg0)); | |||
15977 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 15977); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 15977; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
15978 | args.rval().setUndefined(); | |||
15979 | return true; | |||
15980 | } | |||
15981 | ||||
15982 | static const JSJitInfo passByteString_methodinfo = { | |||
15983 | { (JSJitGetterOp)passByteString }, | |||
15984 | { prototypes::id::TestExampleInterface }, | |||
15985 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
15986 | JSJitInfo::Method, | |||
15987 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
15988 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
15989 | false, /* isInfallible. False in setters. */ | |||
15990 | false, /* isMovable. Not relevant for setters. */ | |||
15991 | false, /* isEliminatable. Not relevant for setters. */ | |||
15992 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
15993 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
15994 | false, /* isTypedMethod. Only relevant for methods. */ | |||
15995 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
15996 | }; | |||
15997 | ||||
15998 | MOZ_CAN_RUN_SCRIPT static bool | |||
15999 | passNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16000 | { | |||
16001 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableByteString"); | |||
16002 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16005( cx, "TestExampleInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16003 | "TestExampleInterface", "passNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16005( cx, "TestExampleInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16004 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16005( cx, "TestExampleInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16005 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16005( cx, "TestExampleInterface" , "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16006 | ||||
16007 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16008 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableByteString", 1)) { | |||
16009 | return false; | |||
16010 | } | |||
16011 | nsCString arg0; | |||
16012 | if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) { | |||
16013 | return false; | |||
16014 | } | |||
16015 | // NOTE: This assert does NOT call the function. | |||
16016 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableByteString(Constify(arg0)))>, "Should be returning void here"); | |||
16017 | MOZ_KnownLive(self)(self)->PassNullableByteString(Constify(arg0)); | |||
16018 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16018); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16018; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16019 | args.rval().setUndefined(); | |||
16020 | return true; | |||
16021 | } | |||
16022 | ||||
16023 | static const JSJitInfo passNullableByteString_methodinfo = { | |||
16024 | { (JSJitGetterOp)passNullableByteString }, | |||
16025 | { prototypes::id::TestExampleInterface }, | |||
16026 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16027 | JSJitInfo::Method, | |||
16028 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16029 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16030 | false, /* isInfallible. False in setters. */ | |||
16031 | false, /* isMovable. Not relevant for setters. */ | |||
16032 | false, /* isEliminatable. Not relevant for setters. */ | |||
16033 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16034 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16035 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16036 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16037 | }; | |||
16038 | ||||
16039 | MOZ_CAN_RUN_SCRIPT static bool | |||
16040 | passOptionalByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16041 | { | |||
16042 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalByteString"); | |||
16043 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16046( cx, "TestExampleInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16044 | "TestExampleInterface", "passOptionalByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16046( cx, "TestExampleInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16045 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16046( cx, "TestExampleInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16046 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16046( cx, "TestExampleInterface" , "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16047 | ||||
16048 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16049 | Optional<nsCString> arg0; | |||
16050 | if (args.hasDefined(0)) { | |||
16051 | arg0.Construct(); | |||
16052 | if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0.Value())) { | |||
16053 | return false; | |||
16054 | } | |||
16055 | } | |||
16056 | // NOTE: This assert does NOT call the function. | |||
16057 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteString(Constify(arg0)))>, "Should be returning void here"); | |||
16058 | MOZ_KnownLive(self)(self)->PassOptionalByteString(Constify(arg0)); | |||
16059 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16059); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16059; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16060 | args.rval().setUndefined(); | |||
16061 | return true; | |||
16062 | } | |||
16063 | ||||
16064 | static const JSJitInfo passOptionalByteString_methodinfo = { | |||
16065 | { (JSJitGetterOp)passOptionalByteString }, | |||
16066 | { prototypes::id::TestExampleInterface }, | |||
16067 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16068 | JSJitInfo::Method, | |||
16069 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16070 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16071 | false, /* isInfallible. False in setters. */ | |||
16072 | false, /* isMovable. Not relevant for setters. */ | |||
16073 | false, /* isEliminatable. Not relevant for setters. */ | |||
16074 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16075 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16076 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16077 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16078 | }; | |||
16079 | ||||
16080 | MOZ_CAN_RUN_SCRIPT static bool | |||
16081 | passOptionalByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16082 | { | |||
16083 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalByteStringWithDefaultValue"); | |||
16084 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16087( cx, "TestExampleInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16085 | "TestExampleInterface", "passOptionalByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16087( cx, "TestExampleInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16086 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16087( cx, "TestExampleInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16087 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16087( cx, "TestExampleInterface" , "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16088 | ||||
16089 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16090 | nsCString arg0; | |||
16091 | if (args.hasDefined(0)) { | |||
16092 | if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) { | |||
16093 | return false; | |||
16094 | } | |||
16095 | } else { | |||
16096 | arg0.AssignLiteral("abc"); | |||
16097 | } | |||
16098 | // NOTE: This assert does NOT call the function. | |||
16099 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteStringWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
16100 | MOZ_KnownLive(self)(self)->PassOptionalByteStringWithDefaultValue(Constify(arg0)); | |||
16101 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16101); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16101; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16102 | args.rval().setUndefined(); | |||
16103 | return true; | |||
16104 | } | |||
16105 | ||||
16106 | static const JSJitInfo passOptionalByteStringWithDefaultValue_methodinfo = { | |||
16107 | { (JSJitGetterOp)passOptionalByteStringWithDefaultValue }, | |||
16108 | { prototypes::id::TestExampleInterface }, | |||
16109 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16110 | JSJitInfo::Method, | |||
16111 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16112 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16113 | false, /* isInfallible. False in setters. */ | |||
16114 | false, /* isMovable. Not relevant for setters. */ | |||
16115 | false, /* isEliminatable. Not relevant for setters. */ | |||
16116 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16117 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16118 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16119 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16120 | }; | |||
16121 | ||||
16122 | MOZ_CAN_RUN_SCRIPT static bool | |||
16123 | passOptionalNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16124 | { | |||
16125 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableByteString"); | |||
16126 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16129( cx, "TestExampleInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16127 | "TestExampleInterface", "passOptionalNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16129( cx, "TestExampleInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16128 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16129( cx, "TestExampleInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16129 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16129( cx, "TestExampleInterface" , "passOptionalNullableByteString", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16130 | ||||
16131 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16132 | Optional<nsCString> arg0; | |||
16133 | if (args.hasDefined(0)) { | |||
16134 | arg0.Construct(); | |||
16135 | if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0.Value())) { | |||
16136 | return false; | |||
16137 | } | |||
16138 | } | |||
16139 | // NOTE: This assert does NOT call the function. | |||
16140 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableByteString(Constify(arg0)))>, "Should be returning void here"); | |||
16141 | MOZ_KnownLive(self)(self)->PassOptionalNullableByteString(Constify(arg0)); | |||
16142 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16142); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16142; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16143 | args.rval().setUndefined(); | |||
16144 | return true; | |||
16145 | } | |||
16146 | ||||
16147 | static const JSJitInfo passOptionalNullableByteString_methodinfo = { | |||
16148 | { (JSJitGetterOp)passOptionalNullableByteString }, | |||
16149 | { prototypes::id::TestExampleInterface }, | |||
16150 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16151 | JSJitInfo::Method, | |||
16152 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16153 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16154 | false, /* isInfallible. False in setters. */ | |||
16155 | false, /* isMovable. Not relevant for setters. */ | |||
16156 | false, /* isEliminatable. Not relevant for setters. */ | |||
16157 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16158 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16159 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16160 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16161 | }; | |||
16162 | ||||
16163 | MOZ_CAN_RUN_SCRIPT static bool | |||
16164 | passOptionalNullableByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16165 | { | |||
16166 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableByteStringWithDefaultValue"); | |||
16167 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16170( cx, "TestExampleInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16168 | "TestExampleInterface", "passOptionalNullableByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16170( cx, "TestExampleInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16169 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16170( cx, "TestExampleInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16170 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16170( cx, "TestExampleInterface" , "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16171 | ||||
16172 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16173 | nsCString arg0; | |||
16174 | if (args.hasDefined(0)) { | |||
16175 | if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) { | |||
16176 | return false; | |||
16177 | } | |||
16178 | } else { | |||
16179 | arg0.SetIsVoid(true); | |||
16180 | } | |||
16181 | // NOTE: This assert does NOT call the function. | |||
16182 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableByteStringWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
16183 | MOZ_KnownLive(self)(self)->PassOptionalNullableByteStringWithDefaultValue(Constify(arg0)); | |||
16184 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16184); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16184; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16185 | args.rval().setUndefined(); | |||
16186 | return true; | |||
16187 | } | |||
16188 | ||||
16189 | static const JSJitInfo passOptionalNullableByteStringWithDefaultValue_methodinfo = { | |||
16190 | { (JSJitGetterOp)passOptionalNullableByteStringWithDefaultValue }, | |||
16191 | { prototypes::id::TestExampleInterface }, | |||
16192 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16193 | JSJitInfo::Method, | |||
16194 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16195 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16196 | false, /* isInfallible. False in setters. */ | |||
16197 | false, /* isMovable. Not relevant for setters. */ | |||
16198 | false, /* isEliminatable. Not relevant for setters. */ | |||
16199 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16200 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16201 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16202 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16203 | }; | |||
16204 | ||||
16205 | MOZ_CAN_RUN_SCRIPT static bool | |||
16206 | passVariadicByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16207 | { | |||
16208 | BindingCallContext cx(cx_, "TestExampleInterface.passVariadicByteString"); | |||
16209 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16212( cx, "TestExampleInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16210 | "TestExampleInterface", "passVariadicByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16212( cx, "TestExampleInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16211 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16212( cx, "TestExampleInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16212 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16212( cx, "TestExampleInterface" , "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16213 | ||||
16214 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16215 | AutoSequence<nsCString> arg0; | |||
16216 | if (args.length() > 0) { | |||
16217 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
16218 | JS_ReportOutOfMemory(cx); | |||
16219 | return false; | |||
16220 | } | |||
16221 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
16222 | // OK to do infallible append here, since we ensured capacity already. | |||
16223 | nsCString& slot = *arg0.AppendElement(); | |||
16224 | if (!ConvertJSValueToByteString(cx, args[variadicArg], false, "argument 1", slot)) { | |||
16225 | return false; | |||
16226 | } | |||
16227 | } | |||
16228 | } | |||
16229 | // NOTE: This assert does NOT call the function. | |||
16230 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicByteString(Constify(arg0)))>, "Should be returning void here"); | |||
16231 | MOZ_KnownLive(self)(self)->PassVariadicByteString(Constify(arg0)); | |||
16232 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16232); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16232; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16233 | args.rval().setUndefined(); | |||
16234 | return true; | |||
16235 | } | |||
16236 | ||||
16237 | static const JSJitInfo passVariadicByteString_methodinfo = { | |||
16238 | { (JSJitGetterOp)passVariadicByteString }, | |||
16239 | { prototypes::id::TestExampleInterface }, | |||
16240 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16241 | JSJitInfo::Method, | |||
16242 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16243 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16244 | false, /* isInfallible. False in setters. */ | |||
16245 | false, /* isMovable. Not relevant for setters. */ | |||
16246 | false, /* isEliminatable. Not relevant for setters. */ | |||
16247 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16248 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16249 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16250 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16251 | }; | |||
16252 | ||||
16253 | MOZ_CAN_RUN_SCRIPT static bool | |||
16254 | passUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16255 | { | |||
16256 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionByteString"); | |||
16257 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16260( cx, "TestExampleInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16258 | "TestExampleInterface", "passUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16260( cx, "TestExampleInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16259 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16260( cx, "TestExampleInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16260 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16260( cx, "TestExampleInterface" , "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16261 | ||||
16262 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16263 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionByteString", 1)) { | |||
16264 | return false; | |||
16265 | } | |||
16266 | ByteStringOrLong arg0; | |||
16267 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
16268 | return false; | |||
16269 | } | |||
16270 | // NOTE: This assert does NOT call the function. | |||
16271 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionByteString(Constify(arg0)))>, "Should be returning void here"); | |||
16272 | MOZ_KnownLive(self)(self)->PassUnionByteString(Constify(arg0)); | |||
16273 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16273); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16273; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16274 | args.rval().setUndefined(); | |||
16275 | return true; | |||
16276 | } | |||
16277 | ||||
16278 | static const JSJitInfo passUnionByteString_methodinfo = { | |||
16279 | { (JSJitGetterOp)passUnionByteString }, | |||
16280 | { prototypes::id::TestExampleInterface }, | |||
16281 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16282 | JSJitInfo::Method, | |||
16283 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16284 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16285 | false, /* isInfallible. False in setters. */ | |||
16286 | false, /* isMovable. Not relevant for setters. */ | |||
16287 | false, /* isEliminatable. Not relevant for setters. */ | |||
16288 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16289 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16290 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16291 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16292 | }; | |||
16293 | ||||
16294 | MOZ_CAN_RUN_SCRIPT static bool | |||
16295 | passOptionalUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16296 | { | |||
16297 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalUnionByteString"); | |||
16298 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16301( cx, "TestExampleInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16299 | "TestExampleInterface", "passOptionalUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16301( cx, "TestExampleInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16300 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16301( cx, "TestExampleInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16301 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16301( cx, "TestExampleInterface" , "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16302 | ||||
16303 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16304 | Optional<ByteStringOrLong> arg0; | |||
16305 | if (args.hasDefined(0)) { | |||
16306 | arg0.Construct(); | |||
16307 | if (!arg0.Value().Init(cx, args[0], "Argument 1", false)) { | |||
16308 | return false; | |||
16309 | } | |||
16310 | } | |||
16311 | // NOTE: This assert does NOT call the function. | |||
16312 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionByteString(Constify(arg0)))>, "Should be returning void here"); | |||
16313 | MOZ_KnownLive(self)(self)->PassOptionalUnionByteString(Constify(arg0)); | |||
16314 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16314); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16314; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16315 | args.rval().setUndefined(); | |||
16316 | return true; | |||
16317 | } | |||
16318 | ||||
16319 | static const JSJitInfo passOptionalUnionByteString_methodinfo = { | |||
16320 | { (JSJitGetterOp)passOptionalUnionByteString }, | |||
16321 | { prototypes::id::TestExampleInterface }, | |||
16322 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16323 | JSJitInfo::Method, | |||
16324 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16325 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16326 | false, /* isInfallible. False in setters. */ | |||
16327 | false, /* isMovable. Not relevant for setters. */ | |||
16328 | false, /* isEliminatable. Not relevant for setters. */ | |||
16329 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16330 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16331 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16332 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16333 | }; | |||
16334 | ||||
16335 | MOZ_CAN_RUN_SCRIPT static bool | |||
16336 | passOptionalUnionByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16337 | { | |||
16338 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalUnionByteStringWithDefaultValue"); | |||
16339 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16342( cx, "TestExampleInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16340 | "TestExampleInterface", "passOptionalUnionByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16342( cx, "TestExampleInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16341 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16342( cx, "TestExampleInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16342 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16342( cx, "TestExampleInterface" , "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16343 | ||||
16344 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16345 | ByteStringOrLong arg0; | |||
16346 | if (!(args.hasDefined(0))) { | |||
16347 | arg0.SetStringLiteral("abc"); | |||
16348 | } else { | |||
16349 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
16350 | return false; | |||
16351 | } | |||
16352 | } | |||
16353 | // NOTE: This assert does NOT call the function. | |||
16354 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionByteStringWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
16355 | MOZ_KnownLive(self)(self)->PassOptionalUnionByteStringWithDefaultValue(Constify(arg0)); | |||
16356 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16356); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16356; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16357 | args.rval().setUndefined(); | |||
16358 | return true; | |||
16359 | } | |||
16360 | ||||
16361 | static const JSJitInfo passOptionalUnionByteStringWithDefaultValue_methodinfo = { | |||
16362 | { (JSJitGetterOp)passOptionalUnionByteStringWithDefaultValue }, | |||
16363 | { prototypes::id::TestExampleInterface }, | |||
16364 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16365 | JSJitInfo::Method, | |||
16366 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16367 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16368 | false, /* isInfallible. False in setters. */ | |||
16369 | false, /* isMovable. Not relevant for setters. */ | |||
16370 | false, /* isEliminatable. Not relevant for setters. */ | |||
16371 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16372 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16373 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16374 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16375 | }; | |||
16376 | ||||
16377 | MOZ_CAN_RUN_SCRIPT static bool | |||
16378 | passUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16379 | { | |||
16380 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16383( cx, "TestExampleInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16381 | "TestExampleInterface", "passUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16383( cx, "TestExampleInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16382 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16383( cx, "TestExampleInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16383 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16383( cx, "TestExampleInterface" , "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t( js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16384 | ||||
16385 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16386 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUTF8String", 1)) { | |||
16387 | return false; | |||
16388 | } | |||
16389 | binding_detail::FakeString<char> arg0; | |||
16390 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | |||
16391 | return false; | |||
16392 | } | |||
16393 | // NOTE: This assert does NOT call the function. | |||
16394 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
16395 | MOZ_KnownLive(self)(self)->PassUTF8String(Constify(arg0)); | |||
16396 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16396); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16396; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16397 | args.rval().setUndefined(); | |||
16398 | return true; | |||
16399 | } | |||
16400 | ||||
16401 | static const JSJitInfo passUTF8String_methodinfo = { | |||
16402 | { (JSJitGetterOp)passUTF8String }, | |||
16403 | { prototypes::id::TestExampleInterface }, | |||
16404 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16405 | JSJitInfo::Method, | |||
16406 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16407 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16408 | false, /* isInfallible. False in setters. */ | |||
16409 | false, /* isMovable. Not relevant for setters. */ | |||
16410 | false, /* isEliminatable. Not relevant for setters. */ | |||
16411 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16412 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16413 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16414 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16415 | }; | |||
16416 | ||||
16417 | MOZ_CAN_RUN_SCRIPT static bool | |||
16418 | passNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16419 | { | |||
16420 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16423( cx, "TestExampleInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16421 | "TestExampleInterface", "passNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16423( cx, "TestExampleInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16422 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16423( cx, "TestExampleInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16423 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16423( cx, "TestExampleInterface" , "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16424 | ||||
16425 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16426 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableUTF8String", 1)) { | |||
16427 | return false; | |||
16428 | } | |||
16429 | binding_detail::FakeString<char> arg0; | |||
16430 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | |||
16431 | return false; | |||
16432 | } | |||
16433 | // NOTE: This assert does NOT call the function. | |||
16434 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
16435 | MOZ_KnownLive(self)(self)->PassNullableUTF8String(Constify(arg0)); | |||
16436 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16436); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16436; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16437 | args.rval().setUndefined(); | |||
16438 | return true; | |||
16439 | } | |||
16440 | ||||
16441 | static const JSJitInfo passNullableUTF8String_methodinfo = { | |||
16442 | { (JSJitGetterOp)passNullableUTF8String }, | |||
16443 | { prototypes::id::TestExampleInterface }, | |||
16444 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16445 | JSJitInfo::Method, | |||
16446 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16447 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16448 | false, /* isInfallible. False in setters. */ | |||
16449 | false, /* isMovable. Not relevant for setters. */ | |||
16450 | false, /* isEliminatable. Not relevant for setters. */ | |||
16451 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16452 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16453 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16454 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16455 | }; | |||
16456 | ||||
16457 | MOZ_CAN_RUN_SCRIPT static bool | |||
16458 | passOptionalUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16459 | { | |||
16460 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16463( cx, "TestExampleInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16461 | "TestExampleInterface", "passOptionalUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16463( cx, "TestExampleInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16462 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16463( cx, "TestExampleInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16463 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16463( cx, "TestExampleInterface" , "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16464 | ||||
16465 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16466 | Optional<nsACString> arg0; | |||
16467 | binding_detail::FakeString<char> arg0_holder; | |||
16468 | if (args.hasDefined(0)) { | |||
16469 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) { | |||
16470 | return false; | |||
16471 | } | |||
16472 | arg0 = &arg0_holder; | |||
16473 | } | |||
16474 | // NOTE: This assert does NOT call the function. | |||
16475 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
16476 | MOZ_KnownLive(self)(self)->PassOptionalUTF8String(Constify(arg0)); | |||
16477 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16477); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16477; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16478 | args.rval().setUndefined(); | |||
16479 | return true; | |||
16480 | } | |||
16481 | ||||
16482 | static const JSJitInfo passOptionalUTF8String_methodinfo = { | |||
16483 | { (JSJitGetterOp)passOptionalUTF8String }, | |||
16484 | { prototypes::id::TestExampleInterface }, | |||
16485 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16486 | JSJitInfo::Method, | |||
16487 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16488 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16489 | false, /* isInfallible. False in setters. */ | |||
16490 | false, /* isMovable. Not relevant for setters. */ | |||
16491 | false, /* isEliminatable. Not relevant for setters. */ | |||
16492 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16493 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16494 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16495 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16496 | }; | |||
16497 | ||||
16498 | MOZ_CAN_RUN_SCRIPT static bool | |||
16499 | passOptionalUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16500 | { | |||
16501 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16504( cx, "TestExampleInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16502 | "TestExampleInterface", "passOptionalUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16504( cx, "TestExampleInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16503 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16504( cx, "TestExampleInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16504 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16504( cx, "TestExampleInterface" , "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16505 | ||||
16506 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16507 | binding_detail::FakeString<char> arg0; | |||
16508 | if (args.hasDefined(0)) { | |||
16509 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | |||
16510 | return false; | |||
16511 | } | |||
16512 | } else { | |||
16513 | arg0.AssignLiteral("abc"); | |||
16514 | } | |||
16515 | // NOTE: This assert does NOT call the function. | |||
16516 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUTF8StringWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
16517 | MOZ_KnownLive(self)(self)->PassOptionalUTF8StringWithDefaultValue(Constify(arg0)); | |||
16518 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16518); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16518; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16519 | args.rval().setUndefined(); | |||
16520 | return true; | |||
16521 | } | |||
16522 | ||||
16523 | static const JSJitInfo passOptionalUTF8StringWithDefaultValue_methodinfo = { | |||
16524 | { (JSJitGetterOp)passOptionalUTF8StringWithDefaultValue }, | |||
16525 | { prototypes::id::TestExampleInterface }, | |||
16526 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16527 | JSJitInfo::Method, | |||
16528 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16529 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16530 | false, /* isInfallible. False in setters. */ | |||
16531 | false, /* isMovable. Not relevant for setters. */ | |||
16532 | false, /* isEliminatable. Not relevant for setters. */ | |||
16533 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16534 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16535 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16536 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16537 | }; | |||
16538 | ||||
16539 | MOZ_CAN_RUN_SCRIPT static bool | |||
16540 | passOptionalNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16541 | { | |||
16542 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16545( cx, "TestExampleInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16543 | "TestExampleInterface", "passOptionalNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16545( cx, "TestExampleInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16544 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16545( cx, "TestExampleInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16545 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16545( cx, "TestExampleInterface" , "passOptionalNullableUTF8String", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16546 | ||||
16547 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16548 | Optional<nsACString> arg0; | |||
16549 | binding_detail::FakeString<char> arg0_holder; | |||
16550 | if (args.hasDefined(0)) { | |||
16551 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) { | |||
16552 | return false; | |||
16553 | } | |||
16554 | arg0 = &arg0_holder; | |||
16555 | } | |||
16556 | // NOTE: This assert does NOT call the function. | |||
16557 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
16558 | MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8String(Constify(arg0)); | |||
16559 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16559); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16559; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16560 | args.rval().setUndefined(); | |||
16561 | return true; | |||
16562 | } | |||
16563 | ||||
16564 | static const JSJitInfo passOptionalNullableUTF8String_methodinfo = { | |||
16565 | { (JSJitGetterOp)passOptionalNullableUTF8String }, | |||
16566 | { prototypes::id::TestExampleInterface }, | |||
16567 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16568 | JSJitInfo::Method, | |||
16569 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16570 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16571 | false, /* isInfallible. False in setters. */ | |||
16572 | false, /* isMovable. Not relevant for setters. */ | |||
16573 | false, /* isEliminatable. Not relevant for setters. */ | |||
16574 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16575 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16576 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16577 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16578 | }; | |||
16579 | ||||
16580 | MOZ_CAN_RUN_SCRIPT static bool | |||
16581 | passOptionalNullableUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16582 | { | |||
16583 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16586( cx, "TestExampleInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16584 | "TestExampleInterface", "passOptionalNullableUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16586( cx, "TestExampleInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16585 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16586( cx, "TestExampleInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16586 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16586( cx, "TestExampleInterface" , "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16587 | ||||
16588 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16589 | binding_detail::FakeString<char> arg0; | |||
16590 | if (args.hasDefined(0)) { | |||
16591 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | |||
16592 | return false; | |||
16593 | } | |||
16594 | } else { | |||
16595 | arg0.SetIsVoid(true); | |||
16596 | } | |||
16597 | // NOTE: This assert does NOT call the function. | |||
16598 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8StringWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
16599 | MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8StringWithDefaultValue(Constify(arg0)); | |||
16600 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16600); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16600; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16601 | args.rval().setUndefined(); | |||
16602 | return true; | |||
16603 | } | |||
16604 | ||||
16605 | static const JSJitInfo passOptionalNullableUTF8StringWithDefaultValue_methodinfo = { | |||
16606 | { (JSJitGetterOp)passOptionalNullableUTF8StringWithDefaultValue }, | |||
16607 | { prototypes::id::TestExampleInterface }, | |||
16608 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16609 | JSJitInfo::Method, | |||
16610 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16611 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16612 | false, /* isInfallible. False in setters. */ | |||
16613 | false, /* isMovable. Not relevant for setters. */ | |||
16614 | false, /* isEliminatable. Not relevant for setters. */ | |||
16615 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16616 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16617 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16618 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16619 | }; | |||
16620 | ||||
16621 | MOZ_CAN_RUN_SCRIPT static bool | |||
16622 | passVariadicUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16623 | { | |||
16624 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16627( cx, "TestExampleInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16625 | "TestExampleInterface", "passVariadicUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16627( cx, "TestExampleInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16626 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16627( cx, "TestExampleInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16627 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16627( cx, "TestExampleInterface" , "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16628 | ||||
16629 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16630 | AutoSequence<nsCString> arg0; | |||
16631 | if (args.length() > 0) { | |||
16632 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
16633 | JS_ReportOutOfMemory(cx); | |||
16634 | return false; | |||
16635 | } | |||
16636 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
16637 | // OK to do infallible append here, since we ensured capacity already. | |||
16638 | nsCString& slot = *arg0.AppendElement(); | |||
16639 | if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) { | |||
16640 | return false; | |||
16641 | } | |||
16642 | } | |||
16643 | } | |||
16644 | // NOTE: This assert does NOT call the function. | |||
16645 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
16646 | MOZ_KnownLive(self)(self)->PassVariadicUTF8String(Constify(arg0)); | |||
16647 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16647); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16647; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16648 | args.rval().setUndefined(); | |||
16649 | return true; | |||
16650 | } | |||
16651 | ||||
16652 | static const JSJitInfo passVariadicUTF8String_methodinfo = { | |||
16653 | { (JSJitGetterOp)passVariadicUTF8String }, | |||
16654 | { prototypes::id::TestExampleInterface }, | |||
16655 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16656 | JSJitInfo::Method, | |||
16657 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16658 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16659 | false, /* isInfallible. False in setters. */ | |||
16660 | false, /* isMovable. Not relevant for setters. */ | |||
16661 | false, /* isEliminatable. Not relevant for setters. */ | |||
16662 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16663 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16664 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16665 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16666 | }; | |||
16667 | ||||
16668 | MOZ_CAN_RUN_SCRIPT static bool | |||
16669 | passUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16670 | { | |||
16671 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionUTF8String"); | |||
16672 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16675( cx, "TestExampleInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16673 | "TestExampleInterface", "passUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16675( cx, "TestExampleInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16674 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16675( cx, "TestExampleInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16675 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16675( cx, "TestExampleInterface" , "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16676 | ||||
16677 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16678 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionUTF8String", 1)) { | |||
16679 | return false; | |||
16680 | } | |||
16681 | UTF8StringOrLong arg0; | |||
16682 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
16683 | return false; | |||
16684 | } | |||
16685 | // NOTE: This assert does NOT call the function. | |||
16686 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
16687 | MOZ_KnownLive(self)(self)->PassUnionUTF8String(Constify(arg0)); | |||
16688 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16688); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16688; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16689 | args.rval().setUndefined(); | |||
16690 | return true; | |||
16691 | } | |||
16692 | ||||
16693 | static const JSJitInfo passUnionUTF8String_methodinfo = { | |||
16694 | { (JSJitGetterOp)passUnionUTF8String }, | |||
16695 | { prototypes::id::TestExampleInterface }, | |||
16696 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16697 | JSJitInfo::Method, | |||
16698 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16699 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16700 | false, /* isInfallible. False in setters. */ | |||
16701 | false, /* isMovable. Not relevant for setters. */ | |||
16702 | false, /* isEliminatable. Not relevant for setters. */ | |||
16703 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16704 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16705 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16706 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16707 | }; | |||
16708 | ||||
16709 | MOZ_CAN_RUN_SCRIPT static bool | |||
16710 | passOptionalUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16711 | { | |||
16712 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalUnionUTF8String"); | |||
16713 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16716( cx, "TestExampleInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16714 | "TestExampleInterface", "passOptionalUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16716( cx, "TestExampleInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16715 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16716( cx, "TestExampleInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16716 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16716( cx, "TestExampleInterface" , "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16717 | ||||
16718 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16719 | Optional<UTF8StringOrLong> arg0; | |||
16720 | if (args.hasDefined(0)) { | |||
16721 | arg0.Construct(); | |||
16722 | if (!arg0.Value().Init(cx, args[0], "Argument 1", false)) { | |||
16723 | return false; | |||
16724 | } | |||
16725 | } | |||
16726 | // NOTE: This assert does NOT call the function. | |||
16727 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
16728 | MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8String(Constify(arg0)); | |||
16729 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16729); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16729; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16730 | args.rval().setUndefined(); | |||
16731 | return true; | |||
16732 | } | |||
16733 | ||||
16734 | static const JSJitInfo passOptionalUnionUTF8String_methodinfo = { | |||
16735 | { (JSJitGetterOp)passOptionalUnionUTF8String }, | |||
16736 | { prototypes::id::TestExampleInterface }, | |||
16737 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16738 | JSJitInfo::Method, | |||
16739 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16740 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16741 | false, /* isInfallible. False in setters. */ | |||
16742 | false, /* isMovable. Not relevant for setters. */ | |||
16743 | false, /* isEliminatable. Not relevant for setters. */ | |||
16744 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16745 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16746 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16747 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16748 | }; | |||
16749 | ||||
16750 | MOZ_CAN_RUN_SCRIPT static bool | |||
16751 | passOptionalUnionUTF8StringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16752 | { | |||
16753 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalUnionUTF8StringWithDefaultValue"); | |||
16754 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16757( cx, "TestExampleInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16755 | "TestExampleInterface", "passOptionalUnionUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16757( cx, "TestExampleInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16756 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16757( cx, "TestExampleInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16757 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16757( cx, "TestExampleInterface" , "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16758 | ||||
16759 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16760 | UTF8StringOrLong arg0; | |||
16761 | if (!(args.hasDefined(0))) { | |||
16762 | arg0.SetStringLiteral("abc"); | |||
16763 | } else { | |||
16764 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
16765 | return false; | |||
16766 | } | |||
16767 | } | |||
16768 | // NOTE: This assert does NOT call the function. | |||
16769 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8StringWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
16770 | MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8StringWithDefaultValue(Constify(arg0)); | |||
16771 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16771); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16771; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16772 | args.rval().setUndefined(); | |||
16773 | return true; | |||
16774 | } | |||
16775 | ||||
16776 | static const JSJitInfo passOptionalUnionUTF8StringWithDefaultValue_methodinfo = { | |||
16777 | { (JSJitGetterOp)passOptionalUnionUTF8StringWithDefaultValue }, | |||
16778 | { prototypes::id::TestExampleInterface }, | |||
16779 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16780 | JSJitInfo::Method, | |||
16781 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16782 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16783 | false, /* isInfallible. False in setters. */ | |||
16784 | false, /* isMovable. Not relevant for setters. */ | |||
16785 | false, /* isEliminatable. Not relevant for setters. */ | |||
16786 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16787 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16788 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16789 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16790 | }; | |||
16791 | ||||
16792 | MOZ_CAN_RUN_SCRIPT static bool | |||
16793 | passSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16794 | { | |||
16795 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16798( cx, "TestExampleInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
16796 | "TestExampleInterface", "passSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16798( cx, "TestExampleInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
16797 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16798( cx, "TestExampleInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
16798 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16798( cx, "TestExampleInterface" , "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
16799 | ||||
16800 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16801 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSVS", 1)) { | |||
16802 | return false; | |||
16803 | } | |||
16804 | binding_detail::FakeString<char16_t> arg0; | |||
16805 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | |||
16806 | return false; | |||
16807 | } | |||
16808 | if (!NormalizeUSVString(arg0)) { | |||
16809 | JS_ReportOutOfMemory(cx); | |||
16810 | return false; | |||
16811 | } | |||
16812 | // NOTE: This assert does NOT call the function. | |||
16813 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSVS(Constify(arg0)))>, "Should be returning void here"); | |||
16814 | MOZ_KnownLive(self)(self)->PassSVS(Constify(arg0)); | |||
16815 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16815); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16815; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16816 | args.rval().setUndefined(); | |||
16817 | return true; | |||
16818 | } | |||
16819 | ||||
16820 | static const JSJitInfo passSVS_methodinfo = { | |||
16821 | { (JSJitGetterOp)passSVS }, | |||
16822 | { prototypes::id::TestExampleInterface }, | |||
16823 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16824 | JSJitInfo::Method, | |||
16825 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16826 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16827 | false, /* isInfallible. False in setters. */ | |||
16828 | false, /* isMovable. Not relevant for setters. */ | |||
16829 | false, /* isEliminatable. Not relevant for setters. */ | |||
16830 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16831 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16832 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16833 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16834 | }; | |||
16835 | ||||
16836 | MOZ_CAN_RUN_SCRIPT static bool | |||
16837 | passNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16838 | { | |||
16839 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16842( cx, "TestExampleInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16840 | "TestExampleInterface", "passNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16842( cx, "TestExampleInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16841 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16842( cx, "TestExampleInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16842 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16842( cx, "TestExampleInterface" , "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16843 | ||||
16844 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16845 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableSVS", 1)) { | |||
16846 | return false; | |||
16847 | } | |||
16848 | binding_detail::FakeString<char16_t> arg0; | |||
16849 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | |||
16850 | return false; | |||
16851 | } | |||
16852 | if (!NormalizeUSVString(arg0)) { | |||
16853 | JS_ReportOutOfMemory(cx); | |||
16854 | return false; | |||
16855 | } | |||
16856 | // NOTE: This assert does NOT call the function. | |||
16857 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSVS(Constify(arg0)))>, "Should be returning void here"); | |||
16858 | MOZ_KnownLive(self)(self)->PassNullableSVS(Constify(arg0)); | |||
16859 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16859); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16859; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16860 | args.rval().setUndefined(); | |||
16861 | return true; | |||
16862 | } | |||
16863 | ||||
16864 | static const JSJitInfo passNullableSVS_methodinfo = { | |||
16865 | { (JSJitGetterOp)passNullableSVS }, | |||
16866 | { prototypes::id::TestExampleInterface }, | |||
16867 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16868 | JSJitInfo::Method, | |||
16869 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16870 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16871 | false, /* isInfallible. False in setters. */ | |||
16872 | false, /* isMovable. Not relevant for setters. */ | |||
16873 | false, /* isEliminatable. Not relevant for setters. */ | |||
16874 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16875 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16876 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16877 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16878 | }; | |||
16879 | ||||
16880 | MOZ_CAN_RUN_SCRIPT static bool | |||
16881 | passOptionalSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16882 | { | |||
16883 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16886( cx, "TestExampleInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16884 | "TestExampleInterface", "passOptionalSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16886( cx, "TestExampleInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16885 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16886( cx, "TestExampleInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16886 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16886( cx, "TestExampleInterface" , "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16887 | ||||
16888 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16889 | Optional<nsAString> arg0; | |||
16890 | binding_detail::FakeString<char16_t> arg0_holder; | |||
16891 | if (args.hasDefined(0)) { | |||
16892 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) { | |||
16893 | return false; | |||
16894 | } | |||
16895 | if (!NormalizeUSVString(arg0_holder)) { | |||
16896 | JS_ReportOutOfMemory(cx); | |||
16897 | return false; | |||
16898 | } | |||
16899 | arg0 = &arg0_holder; | |||
16900 | } | |||
16901 | // NOTE: This assert does NOT call the function. | |||
16902 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSVS(Constify(arg0)))>, "Should be returning void here"); | |||
16903 | MOZ_KnownLive(self)(self)->PassOptionalSVS(Constify(arg0)); | |||
16904 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16904); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16904; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16905 | args.rval().setUndefined(); | |||
16906 | return true; | |||
16907 | } | |||
16908 | ||||
16909 | static const JSJitInfo passOptionalSVS_methodinfo = { | |||
16910 | { (JSJitGetterOp)passOptionalSVS }, | |||
16911 | { prototypes::id::TestExampleInterface }, | |||
16912 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16913 | JSJitInfo::Method, | |||
16914 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16915 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16916 | false, /* isInfallible. False in setters. */ | |||
16917 | false, /* isMovable. Not relevant for setters. */ | |||
16918 | false, /* isEliminatable. Not relevant for setters. */ | |||
16919 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16920 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16921 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16922 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16923 | }; | |||
16924 | ||||
16925 | MOZ_CAN_RUN_SCRIPT static bool | |||
16926 | passOptionalSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16927 | { | |||
16928 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16931( cx, "TestExampleInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16929 | "TestExampleInterface", "passOptionalSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16931( cx, "TestExampleInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16930 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16931( cx, "TestExampleInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
16931 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16931( cx, "TestExampleInterface" , "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
16932 | ||||
16933 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16934 | binding_detail::FakeString<char16_t> arg0; | |||
16935 | if (args.hasDefined(0)) { | |||
16936 | if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) { | |||
16937 | return false; | |||
16938 | } | |||
16939 | if (!NormalizeUSVString(arg0)) { | |||
16940 | JS_ReportOutOfMemory(cx); | |||
16941 | return false; | |||
16942 | } | |||
16943 | } else { | |||
16944 | arg0.AssignLiteral(u"abc"); | |||
16945 | } | |||
16946 | // NOTE: This assert does NOT call the function. | |||
16947 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSVSWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
16948 | MOZ_KnownLive(self)(self)->PassOptionalSVSWithDefaultValue(Constify(arg0)); | |||
16949 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16949); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16949; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16950 | args.rval().setUndefined(); | |||
16951 | return true; | |||
16952 | } | |||
16953 | ||||
16954 | static const JSJitInfo passOptionalSVSWithDefaultValue_methodinfo = { | |||
16955 | { (JSJitGetterOp)passOptionalSVSWithDefaultValue }, | |||
16956 | { prototypes::id::TestExampleInterface }, | |||
16957 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
16958 | JSJitInfo::Method, | |||
16959 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
16960 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
16961 | false, /* isInfallible. False in setters. */ | |||
16962 | false, /* isMovable. Not relevant for setters. */ | |||
16963 | false, /* isEliminatable. Not relevant for setters. */ | |||
16964 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
16965 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
16966 | false, /* isTypedMethod. Only relevant for methods. */ | |||
16967 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
16968 | }; | |||
16969 | ||||
16970 | MOZ_CAN_RUN_SCRIPT static bool | |||
16971 | passOptionalNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
16972 | { | |||
16973 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16976( cx, "TestExampleInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16974 | "TestExampleInterface", "passOptionalNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16976( cx, "TestExampleInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16975 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16976( cx, "TestExampleInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
16976 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16976( cx, "TestExampleInterface" , "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
16977 | ||||
16978 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
16979 | Optional<nsAString> arg0; | |||
16980 | binding_detail::FakeString<char16_t> arg0_holder; | |||
16981 | if (args.hasDefined(0)) { | |||
16982 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) { | |||
16983 | return false; | |||
16984 | } | |||
16985 | if (!NormalizeUSVString(arg0_holder)) { | |||
16986 | JS_ReportOutOfMemory(cx); | |||
16987 | return false; | |||
16988 | } | |||
16989 | arg0 = &arg0_holder; | |||
16990 | } | |||
16991 | // NOTE: This assert does NOT call the function. | |||
16992 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSVS(Constify(arg0)))>, "Should be returning void here"); | |||
16993 | MOZ_KnownLive(self)(self)->PassOptionalNullableSVS(Constify(arg0)); | |||
16994 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 16994); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 16994; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
16995 | args.rval().setUndefined(); | |||
16996 | return true; | |||
16997 | } | |||
16998 | ||||
16999 | static const JSJitInfo passOptionalNullableSVS_methodinfo = { | |||
17000 | { (JSJitGetterOp)passOptionalNullableSVS }, | |||
17001 | { prototypes::id::TestExampleInterface }, | |||
17002 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17003 | JSJitInfo::Method, | |||
17004 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17005 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17006 | false, /* isInfallible. False in setters. */ | |||
17007 | false, /* isMovable. Not relevant for setters. */ | |||
17008 | false, /* isEliminatable. Not relevant for setters. */ | |||
17009 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17010 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17011 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17012 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17013 | }; | |||
17014 | ||||
17015 | MOZ_CAN_RUN_SCRIPT static bool | |||
17016 | passOptionalNullableSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17017 | { | |||
17018 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17021( cx, "TestExampleInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17019 | "TestExampleInterface", "passOptionalNullableSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17021( cx, "TestExampleInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17020 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17021( cx, "TestExampleInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17021 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17021( cx, "TestExampleInterface" , "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
17022 | ||||
17023 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17024 | binding_detail::FakeString<char16_t> arg0; | |||
17025 | if (args.hasDefined(0)) { | |||
17026 | if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) { | |||
17027 | return false; | |||
17028 | } | |||
17029 | if (!NormalizeUSVString(arg0)) { | |||
17030 | JS_ReportOutOfMemory(cx); | |||
17031 | return false; | |||
17032 | } | |||
17033 | } else { | |||
17034 | arg0.SetIsVoid(true); | |||
17035 | } | |||
17036 | // NOTE: This assert does NOT call the function. | |||
17037 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSVSWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
17038 | MOZ_KnownLive(self)(self)->PassOptionalNullableSVSWithDefaultValue(Constify(arg0)); | |||
17039 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17039); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17039; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17040 | args.rval().setUndefined(); | |||
17041 | return true; | |||
17042 | } | |||
17043 | ||||
17044 | static const JSJitInfo passOptionalNullableSVSWithDefaultValue_methodinfo = { | |||
17045 | { (JSJitGetterOp)passOptionalNullableSVSWithDefaultValue }, | |||
17046 | { prototypes::id::TestExampleInterface }, | |||
17047 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17048 | JSJitInfo::Method, | |||
17049 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17050 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17051 | false, /* isInfallible. False in setters. */ | |||
17052 | false, /* isMovable. Not relevant for setters. */ | |||
17053 | false, /* isEliminatable. Not relevant for setters. */ | |||
17054 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17055 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17056 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17057 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17058 | }; | |||
17059 | ||||
17060 | MOZ_CAN_RUN_SCRIPT static bool | |||
17061 | passVariadicSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17062 | { | |||
17063 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17066( cx, "TestExampleInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17064 | "TestExampleInterface", "passVariadicSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17066( cx, "TestExampleInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17065 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17066( cx, "TestExampleInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17066 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17066( cx, "TestExampleInterface" , "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17067 | ||||
17068 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17069 | AutoSequence<nsString> arg0; | |||
17070 | if (args.length() > 0) { | |||
17071 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
17072 | JS_ReportOutOfMemory(cx); | |||
17073 | return false; | |||
17074 | } | |||
17075 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
17076 | // OK to do infallible append here, since we ensured capacity already. | |||
17077 | nsString& slot = *arg0.AppendElement(); | |||
17078 | if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) { | |||
17079 | return false; | |||
17080 | } | |||
17081 | if (!NormalizeUSVString(slot)) { | |||
17082 | JS_ReportOutOfMemory(cx); | |||
17083 | return false; | |||
17084 | } | |||
17085 | } | |||
17086 | } | |||
17087 | // NOTE: This assert does NOT call the function. | |||
17088 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicSVS(Constify(arg0)))>, "Should be returning void here"); | |||
17089 | MOZ_KnownLive(self)(self)->PassVariadicSVS(Constify(arg0)); | |||
17090 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17090); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17090; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17091 | args.rval().setUndefined(); | |||
17092 | return true; | |||
17093 | } | |||
17094 | ||||
17095 | static const JSJitInfo passVariadicSVS_methodinfo = { | |||
17096 | { (JSJitGetterOp)passVariadicSVS }, | |||
17097 | { prototypes::id::TestExampleInterface }, | |||
17098 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17099 | JSJitInfo::Method, | |||
17100 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17101 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17102 | false, /* isInfallible. False in setters. */ | |||
17103 | false, /* isMovable. Not relevant for setters. */ | |||
17104 | false, /* isEliminatable. Not relevant for setters. */ | |||
17105 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17106 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17107 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17108 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17109 | }; | |||
17110 | ||||
17111 | MOZ_CAN_RUN_SCRIPT static bool | |||
17112 | receiveSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17113 | { | |||
17114 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17117( cx, "TestExampleInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17115 | "TestExampleInterface", "receiveSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17117( cx, "TestExampleInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17116 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17117( cx, "TestExampleInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17117 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17117( cx, "TestExampleInterface" , "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17118 | ||||
17119 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17120 | DOMString result; | |||
17121 | // NOTE: This assert does NOT call the function. | |||
17122 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveSVS(result))>, "Should be returning void here"); | |||
17123 | MOZ_KnownLive(self)(self)->ReceiveSVS(result); | |||
17124 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17124); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17124; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17125 | if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) { | |||
17126 | return false; | |||
17127 | } | |||
17128 | return true; | |||
17129 | } | |||
17130 | ||||
17131 | static const JSJitInfo receiveSVS_methodinfo = { | |||
17132 | { (JSJitGetterOp)receiveSVS }, | |||
17133 | { prototypes::id::TestExampleInterface }, | |||
17134 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17135 | JSJitInfo::Method, | |||
17136 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17137 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | |||
17138 | false, /* isInfallible. False in setters. */ | |||
17139 | false, /* isMovable. Not relevant for setters. */ | |||
17140 | false, /* isEliminatable. Not relevant for setters. */ | |||
17141 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17142 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17143 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17144 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17145 | }; | |||
17146 | ||||
17147 | MOZ_CAN_RUN_SCRIPT static bool | |||
17148 | passJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17149 | { | |||
17150 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17153( cx, "TestExampleInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17151 | "TestExampleInterface", "passJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17153( cx, "TestExampleInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17152 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17153( cx, "TestExampleInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17153 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17153( cx, "TestExampleInterface" , "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17154 | ||||
17155 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17156 | if (!args.requireAtLeast(cx, "TestExampleInterface.passJSString", 1)) { | |||
17157 | return false; | |||
17158 | } | |||
17159 | JS::Rooted<JSString*> arg0(cx); | |||
17160 | if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) { | |||
17161 | return false; | |||
17162 | } | |||
17163 | // NOTE: This assert does NOT call the function. | |||
17164 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassJSString(cx, Constify(arg0)))>, "Should be returning void here"); | |||
17165 | MOZ_KnownLive(self)(self)->PassJSString(cx, Constify(arg0)); | |||
17166 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17166); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17166; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17167 | args.rval().setUndefined(); | |||
17168 | return true; | |||
17169 | } | |||
17170 | ||||
17171 | static const JSJitInfo passJSString_methodinfo = { | |||
17172 | { (JSJitGetterOp)passJSString }, | |||
17173 | { prototypes::id::TestExampleInterface }, | |||
17174 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17175 | JSJitInfo::Method, | |||
17176 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17177 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17178 | false, /* isInfallible. False in setters. */ | |||
17179 | false, /* isMovable. Not relevant for setters. */ | |||
17180 | false, /* isEliminatable. Not relevant for setters. */ | |||
17181 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17182 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17183 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17184 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17185 | }; | |||
17186 | ||||
17187 | MOZ_CAN_RUN_SCRIPT static bool | |||
17188 | passOptionalJSStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17189 | { | |||
17190 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17193( cx, "TestExampleInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17191 | "TestExampleInterface", "passOptionalJSStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17193( cx, "TestExampleInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17192 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17193( cx, "TestExampleInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17193 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17193( cx, "TestExampleInterface" , "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
17194 | ||||
17195 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17196 | JS::Rooted<JSString*> arg0(cx); | |||
17197 | if (args.hasDefined(0)) { | |||
17198 | if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) { | |||
17199 | return false; | |||
17200 | } | |||
17201 | } else { | |||
17202 | static const char data[] = { 'a', 'b', 'c', 0 }; | |||
17203 | arg0 = JS_NewStringCopyN(cx, data, std::size(data) - 1); | |||
17204 | if (!arg0) { | |||
17205 | return false; | |||
17206 | } | |||
17207 | } | |||
17208 | // NOTE: This assert does NOT call the function. | |||
17209 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalJSStringWithDefaultValue(cx, Constify(arg0)))>, "Should be returning void here"); | |||
17210 | MOZ_KnownLive(self)(self)->PassOptionalJSStringWithDefaultValue(cx, Constify(arg0)); | |||
17211 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17211); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17211; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17212 | args.rval().setUndefined(); | |||
17213 | return true; | |||
17214 | } | |||
17215 | ||||
17216 | static const JSJitInfo passOptionalJSStringWithDefaultValue_methodinfo = { | |||
17217 | { (JSJitGetterOp)passOptionalJSStringWithDefaultValue }, | |||
17218 | { prototypes::id::TestExampleInterface }, | |||
17219 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17220 | JSJitInfo::Method, | |||
17221 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17222 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17223 | false, /* isInfallible. False in setters. */ | |||
17224 | false, /* isMovable. Not relevant for setters. */ | |||
17225 | false, /* isEliminatable. Not relevant for setters. */ | |||
17226 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17227 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17228 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17229 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17230 | }; | |||
17231 | ||||
17232 | MOZ_CAN_RUN_SCRIPT static bool | |||
17233 | receiveJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17234 | { | |||
17235 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17238( cx, "TestExampleInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17236 | "TestExampleInterface", "receiveJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17238( cx, "TestExampleInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17237 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17238( cx, "TestExampleInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17238 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17238( cx, "TestExampleInterface" , "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17239 | ||||
17240 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17241 | JS::Rooted<JSString*> result(cx); | |||
17242 | // NOTE: This assert does NOT call the function. | |||
17243 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveJSString(cx, &result))>, "Should be returning void here"); | |||
17244 | MOZ_KnownLive(self)(self)->ReceiveJSString(cx, &result); | |||
17245 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17245); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17245; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17246 | args.rval().setString(result); | |||
17247 | if (!MaybeWrapStringValue(cx, args.rval())) { | |||
17248 | return false; | |||
17249 | } | |||
17250 | return true; | |||
17251 | } | |||
17252 | ||||
17253 | static const JSJitInfo receiveJSString_methodinfo = { | |||
17254 | { (JSJitGetterOp)receiveJSString }, | |||
17255 | { prototypes::id::TestExampleInterface }, | |||
17256 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17257 | JSJitInfo::Method, | |||
17258 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17259 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | |||
17260 | false, /* isInfallible. False in setters. */ | |||
17261 | false, /* isMovable. Not relevant for setters. */ | |||
17262 | false, /* isEliminatable. Not relevant for setters. */ | |||
17263 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17264 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17265 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17266 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17267 | }; | |||
17268 | ||||
17269 | MOZ_CAN_RUN_SCRIPT static bool | |||
17270 | get_readonlyJSStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
17271 | { | |||
17272 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17275( cx, "TestExampleInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17273 | "TestExampleInterface", "readonlyJSStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17275( cx, "TestExampleInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17274 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject17275( cx, "TestExampleInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17275 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17275( cx, "TestExampleInterface" , "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17276 | ||||
17277 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17278 | JS::Rooted<JSString*> result(cx); | |||
17279 | // NOTE: This assert does NOT call the function. | |||
17280 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetReadonlyJSStringAttr(cx, &result))>, "Should be returning void here"); | |||
17281 | MOZ_KnownLive(self)(self)->GetReadonlyJSStringAttr(cx, &result); | |||
17282 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17282); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17282; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17283 | args.rval().setString(result); | |||
17284 | if (!MaybeWrapStringValue(cx, args.rval())) { | |||
17285 | return false; | |||
17286 | } | |||
17287 | return true; | |||
17288 | } | |||
17289 | ||||
17290 | static const JSJitInfo readonlyJSStringAttr_getterinfo = { | |||
17291 | { get_readonlyJSStringAttr }, | |||
17292 | { prototypes::id::TestExampleInterface }, | |||
17293 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17294 | JSJitInfo::Getter, | |||
17295 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17296 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | |||
17297 | false, /* isInfallible. False in setters. */ | |||
17298 | false, /* isMovable. Not relevant for setters. */ | |||
17299 | false, /* isEliminatable. Not relevant for setters. */ | |||
17300 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17301 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17302 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17303 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17304 | }; | |||
17305 | ||||
17306 | MOZ_CAN_RUN_SCRIPT static bool | |||
17307 | get_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
17308 | { | |||
17309 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17312( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17310 | "TestExampleInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17312( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17311 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject17312( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17312 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17312( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17313 | ||||
17314 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17315 | JS::Rooted<JSString*> result(cx); | |||
17316 | // NOTE: This assert does NOT call the function. | |||
17317 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetJsStringAttr(cx, &result))>, "Should be returning void here"); | |||
17318 | MOZ_KnownLive(self)(self)->GetJsStringAttr(cx, &result); | |||
17319 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17319); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17319; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17320 | args.rval().setString(result); | |||
17321 | if (!MaybeWrapStringValue(cx, args.rval())) { | |||
17322 | return false; | |||
17323 | } | |||
17324 | return true; | |||
17325 | } | |||
17326 | ||||
17327 | MOZ_CAN_RUN_SCRIPT static bool | |||
17328 | set_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
17329 | { | |||
17330 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17333( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17331 | "TestExampleInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17333( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17332 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject17333( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17333 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17333( cx, "TestExampleInterface" , "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17334 | ||||
17335 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17336 | JS::Rooted<JSString*> arg0(cx); | |||
17337 | if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) { | |||
17338 | return false; | |||
17339 | } | |||
17340 | // NOTE: This assert does NOT call the function. | |||
17341 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetJsStringAttr(cx, Constify(arg0)))>, "Should be returning void here"); | |||
17342 | MOZ_KnownLive(self)(self)->SetJsStringAttr(cx, Constify(arg0)); | |||
17343 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17343); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17343; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17344 | ||||
17345 | return true; | |||
17346 | } | |||
17347 | ||||
17348 | static const JSJitInfo jsStringAttr_getterinfo = { | |||
17349 | { get_jsStringAttr }, | |||
17350 | { prototypes::id::TestExampleInterface }, | |||
17351 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17352 | JSJitInfo::Getter, | |||
17353 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17354 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | |||
17355 | false, /* isInfallible. False in setters. */ | |||
17356 | false, /* isMovable. Not relevant for setters. */ | |||
17357 | false, /* isEliminatable. Not relevant for setters. */ | |||
17358 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17359 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17360 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17361 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17362 | }; | |||
17363 | static const JSJitInfo jsStringAttr_setterinfo = { | |||
17364 | { (JSJitGetterOp)set_jsStringAttr }, | |||
17365 | { prototypes::id::TestExampleInterface }, | |||
17366 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17367 | JSJitInfo::Setter, | |||
17368 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17369 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17370 | false, /* isInfallible. False in setters. */ | |||
17371 | false, /* isMovable. Not relevant for setters. */ | |||
17372 | false, /* isEliminatable. Not relevant for setters. */ | |||
17373 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17374 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17375 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17376 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17377 | }; | |||
17378 | ||||
17379 | MOZ_CAN_RUN_SCRIPT static bool | |||
17380 | passEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17381 | { | |||
17382 | BindingCallContext cx(cx_, "TestExampleInterface.passEnum"); | |||
17383 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17386( cx, "TestExampleInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
17384 | "TestExampleInterface", "passEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17386( cx, "TestExampleInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
17385 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17386( cx, "TestExampleInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
17386 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17386( cx, "TestExampleInterface" , "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
17387 | ||||
17388 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17389 | if (!args.requireAtLeast(cx, "TestExampleInterface.passEnum", 1)) { | |||
17390 | return false; | |||
17391 | } | |||
17392 | TestEnum arg0; | |||
17393 | { | |||
17394 | int index; | |||
17395 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | |||
17396 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17397 | "TestEnum", "argument 1", | |||
17398 | &index)) { | |||
17399 | return false; | |||
17400 | } | |||
17401 | MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index >= 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("index >= 0", "../TestExampleGenBinding.cpp", 17401); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 17401; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
17402 | arg0 = static_cast<TestEnum>(index); | |||
17403 | } | |||
17404 | // NOTE: This assert does NOT call the function. | |||
17405 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassEnum(arg0))>, "Should be returning void here"); | |||
17406 | MOZ_KnownLive(self)(self)->PassEnum(arg0); | |||
17407 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17407); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17407; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17408 | args.rval().setUndefined(); | |||
17409 | return true; | |||
17410 | } | |||
17411 | ||||
17412 | static const JSJitInfo passEnum_methodinfo = { | |||
17413 | { (JSJitGetterOp)passEnum }, | |||
17414 | { prototypes::id::TestExampleInterface }, | |||
17415 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17416 | JSJitInfo::Method, | |||
17417 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17418 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17419 | false, /* isInfallible. False in setters. */ | |||
17420 | false, /* isMovable. Not relevant for setters. */ | |||
17421 | false, /* isEliminatable. Not relevant for setters. */ | |||
17422 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17423 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17424 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17425 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17426 | }; | |||
17427 | ||||
17428 | MOZ_CAN_RUN_SCRIPT static bool | |||
17429 | passNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17430 | { | |||
17431 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableEnum"); | |||
17432 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17435( cx, "TestExampleInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17433 | "TestExampleInterface", "passNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17435( cx, "TestExampleInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17434 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17435( cx, "TestExampleInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17435 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17435( cx, "TestExampleInterface" , "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17436 | ||||
17437 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17438 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableEnum", 1)) { | |||
17439 | return false; | |||
17440 | } | |||
17441 | Nullable<TestEnum> arg0; | |||
17442 | if (args[0].isNullOrUndefined()) { | |||
17443 | arg0.SetNull(); | |||
17444 | } else { | |||
17445 | { | |||
17446 | int index; | |||
17447 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | |||
17448 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17449 | "TestEnum", "argument 1", | |||
17450 | &index)) { | |||
17451 | return false; | |||
17452 | } | |||
17453 | MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index >= 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("index >= 0", "../TestExampleGenBinding.cpp", 17453); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 17453; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
17454 | arg0.SetValue() = static_cast<TestEnum>(index); | |||
17455 | } | |||
17456 | } | |||
17457 | // NOTE: This assert does NOT call the function. | |||
17458 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableEnum(Constify(arg0)))>, "Should be returning void here"); | |||
17459 | MOZ_KnownLive(self)(self)->PassNullableEnum(Constify(arg0)); | |||
17460 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17460); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17460; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17461 | args.rval().setUndefined(); | |||
17462 | return true; | |||
17463 | } | |||
17464 | ||||
17465 | static const JSJitInfo passNullableEnum_methodinfo = { | |||
17466 | { (JSJitGetterOp)passNullableEnum }, | |||
17467 | { prototypes::id::TestExampleInterface }, | |||
17468 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17469 | JSJitInfo::Method, | |||
17470 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17471 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17472 | false, /* isInfallible. False in setters. */ | |||
17473 | false, /* isMovable. Not relevant for setters. */ | |||
17474 | false, /* isEliminatable. Not relevant for setters. */ | |||
17475 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17476 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17477 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17478 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17479 | }; | |||
17480 | ||||
17481 | MOZ_CAN_RUN_SCRIPT static bool | |||
17482 | passOptionalEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17483 | { | |||
17484 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalEnum"); | |||
17485 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17488( cx, "TestExampleInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17486 | "TestExampleInterface", "passOptionalEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17488( cx, "TestExampleInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17487 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17488( cx, "TestExampleInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17488 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17488( cx, "TestExampleInterface" , "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17489 | ||||
17490 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17491 | Optional<TestEnum> arg0; | |||
17492 | if (args.hasDefined(0)) { | |||
17493 | arg0.Construct(); | |||
17494 | { | |||
17495 | int index; | |||
17496 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | |||
17497 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17498 | "TestEnum", "argument 1", | |||
17499 | &index)) { | |||
17500 | return false; | |||
17501 | } | |||
17502 | MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index >= 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("index >= 0", "../TestExampleGenBinding.cpp", 17502); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 17502; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
17503 | arg0.Value() = static_cast<TestEnum>(index); | |||
17504 | } | |||
17505 | } | |||
17506 | // NOTE: This assert does NOT call the function. | |||
17507 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalEnum(Constify(arg0)))>, "Should be returning void here"); | |||
17508 | MOZ_KnownLive(self)(self)->PassOptionalEnum(Constify(arg0)); | |||
17509 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17509); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17509; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17510 | args.rval().setUndefined(); | |||
17511 | return true; | |||
17512 | } | |||
17513 | ||||
17514 | static const JSJitInfo passOptionalEnum_methodinfo = { | |||
17515 | { (JSJitGetterOp)passOptionalEnum }, | |||
17516 | { prototypes::id::TestExampleInterface }, | |||
17517 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17518 | JSJitInfo::Method, | |||
17519 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17520 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17521 | false, /* isInfallible. False in setters. */ | |||
17522 | false, /* isMovable. Not relevant for setters. */ | |||
17523 | false, /* isEliminatable. Not relevant for setters. */ | |||
17524 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17525 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17526 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17527 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17528 | }; | |||
17529 | ||||
17530 | MOZ_CAN_RUN_SCRIPT static bool | |||
17531 | passEnumWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17532 | { | |||
17533 | BindingCallContext cx(cx_, "TestExampleInterface.passEnumWithDefault"); | |||
17534 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17537( cx, "TestExampleInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17535 | "TestExampleInterface", "passEnumWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17537( cx, "TestExampleInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17536 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17537( cx, "TestExampleInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17537 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17537( cx, "TestExampleInterface" , "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17538 | ||||
17539 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17540 | TestEnum arg0; | |||
17541 | if (args.hasDefined(0)) { | |||
17542 | { | |||
17543 | int index; | |||
17544 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | |||
17545 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17546 | "TestEnum", "argument 1", | |||
17547 | &index)) { | |||
17548 | return false; | |||
17549 | } | |||
17550 | MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index >= 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("index >= 0", "../TestExampleGenBinding.cpp", 17550); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 17550; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
17551 | arg0 = static_cast<TestEnum>(index); | |||
17552 | } | |||
17553 | } else { | |||
17554 | arg0 = TestEnum::A; | |||
17555 | } | |||
17556 | // NOTE: This assert does NOT call the function. | |||
17557 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassEnumWithDefault(arg0))>, "Should be returning void here"); | |||
17558 | MOZ_KnownLive(self)(self)->PassEnumWithDefault(arg0); | |||
17559 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17559); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17559; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17560 | args.rval().setUndefined(); | |||
17561 | return true; | |||
17562 | } | |||
17563 | ||||
17564 | static const JSJitInfo passEnumWithDefault_methodinfo = { | |||
17565 | { (JSJitGetterOp)passEnumWithDefault }, | |||
17566 | { prototypes::id::TestExampleInterface }, | |||
17567 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17568 | JSJitInfo::Method, | |||
17569 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17570 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17571 | false, /* isInfallible. False in setters. */ | |||
17572 | false, /* isMovable. Not relevant for setters. */ | |||
17573 | false, /* isEliminatable. Not relevant for setters. */ | |||
17574 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17575 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17576 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17577 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17578 | }; | |||
17579 | ||||
17580 | MOZ_CAN_RUN_SCRIPT static bool | |||
17581 | passOptionalNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17582 | { | |||
17583 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableEnum"); | |||
17584 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17587( cx, "TestExampleInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17585 | "TestExampleInterface", "passOptionalNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17587( cx, "TestExampleInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17586 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17587( cx, "TestExampleInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17587 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17587( cx, "TestExampleInterface" , "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
17588 | ||||
17589 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17590 | Optional<Nullable<TestEnum>> arg0; | |||
17591 | if (args.hasDefined(0)) { | |||
17592 | arg0.Construct(); | |||
17593 | if (args[0].isNullOrUndefined()) { | |||
17594 | arg0.Value().SetNull(); | |||
17595 | } else { | |||
17596 | { | |||
17597 | int index; | |||
17598 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | |||
17599 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17600 | "TestEnum", "argument 1", | |||
17601 | &index)) { | |||
17602 | return false; | |||
17603 | } | |||
17604 | MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index >= 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("index >= 0", "../TestExampleGenBinding.cpp", 17604); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 17604; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
17605 | arg0.Value().SetValue() = static_cast<TestEnum>(index); | |||
17606 | } | |||
17607 | } | |||
17608 | } | |||
17609 | // NOTE: This assert does NOT call the function. | |||
17610 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableEnum(Constify(arg0)))>, "Should be returning void here"); | |||
17611 | MOZ_KnownLive(self)(self)->PassOptionalNullableEnum(Constify(arg0)); | |||
17612 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17612); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17612; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17613 | args.rval().setUndefined(); | |||
17614 | return true; | |||
17615 | } | |||
17616 | ||||
17617 | static const JSJitInfo passOptionalNullableEnum_methodinfo = { | |||
17618 | { (JSJitGetterOp)passOptionalNullableEnum }, | |||
17619 | { prototypes::id::TestExampleInterface }, | |||
17620 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17621 | JSJitInfo::Method, | |||
17622 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17623 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17624 | false, /* isInfallible. False in setters. */ | |||
17625 | false, /* isMovable. Not relevant for setters. */ | |||
17626 | false, /* isEliminatable. Not relevant for setters. */ | |||
17627 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17628 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17629 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17630 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17631 | }; | |||
17632 | ||||
17633 | MOZ_CAN_RUN_SCRIPT static bool | |||
17634 | passOptionalNullableEnumWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17635 | { | |||
17636 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableEnumWithDefaultValue"); | |||
17637 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17640( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17638 | "TestExampleInterface", "passOptionalNullableEnumWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17640( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17639 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17640( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17640 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17640( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
17641 | ||||
17642 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17643 | Nullable<TestEnum> arg0; | |||
17644 | if (args.hasDefined(0)) { | |||
17645 | if (args[0].isNullOrUndefined()) { | |||
17646 | arg0.SetNull(); | |||
17647 | } else { | |||
17648 | { | |||
17649 | int index; | |||
17650 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | |||
17651 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17652 | "TestEnum", "argument 1", | |||
17653 | &index)) { | |||
17654 | return false; | |||
17655 | } | |||
17656 | MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index >= 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("index >= 0", "../TestExampleGenBinding.cpp", 17656); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 17656; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
17657 | arg0.SetValue() = static_cast<TestEnum>(index); | |||
17658 | } | |||
17659 | } | |||
17660 | } else { | |||
17661 | arg0.SetNull(); | |||
17662 | } | |||
17663 | // NOTE: This assert does NOT call the function. | |||
17664 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue(Constify(arg0)))>, "Should be returning void here"); | |||
17665 | MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue(Constify(arg0)); | |||
17666 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17666); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17666; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17667 | args.rval().setUndefined(); | |||
17668 | return true; | |||
17669 | } | |||
17670 | ||||
17671 | static const JSJitInfo passOptionalNullableEnumWithDefaultValue_methodinfo = { | |||
17672 | { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue }, | |||
17673 | { prototypes::id::TestExampleInterface }, | |||
17674 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17675 | JSJitInfo::Method, | |||
17676 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17677 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17678 | false, /* isInfallible. False in setters. */ | |||
17679 | false, /* isMovable. Not relevant for setters. */ | |||
17680 | false, /* isEliminatable. Not relevant for setters. */ | |||
17681 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17682 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17683 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17684 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17685 | }; | |||
17686 | ||||
17687 | MOZ_CAN_RUN_SCRIPT static bool | |||
17688 | passOptionalNullableEnumWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17689 | { | |||
17690 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableEnumWithDefaultValue2"); | |||
17691 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17694( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17692 | "TestExampleInterface", "passOptionalNullableEnumWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17694( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17693 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17694( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
17694 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17694( cx, "TestExampleInterface" , "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
17695 | ||||
17696 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17697 | Nullable<TestEnum> arg0; | |||
17698 | if (args.hasDefined(0)) { | |||
17699 | if (args[0].isNullOrUndefined()) { | |||
17700 | arg0.SetNull(); | |||
17701 | } else { | |||
17702 | { | |||
17703 | int index; | |||
17704 | if (!binding_detail::FindEnumStringIndex<true>(cx, args[0], | |||
17705 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17706 | "TestEnum", "argument 1", | |||
17707 | &index)) { | |||
17708 | return false; | |||
17709 | } | |||
17710 | MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index >= 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("index >= 0", "../TestExampleGenBinding.cpp", 17710); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int* )__null) = 17710; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
17711 | arg0.SetValue() = static_cast<TestEnum>(index); | |||
17712 | } | |||
17713 | } | |||
17714 | } else { | |||
17715 | arg0.SetValue() = TestEnum::A; | |||
17716 | } | |||
17717 | // NOTE: This assert does NOT call the function. | |||
17718 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue2(Constify(arg0)))>, "Should be returning void here"); | |||
17719 | MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue2(Constify(arg0)); | |||
17720 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17720); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17720; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17721 | args.rval().setUndefined(); | |||
17722 | return true; | |||
17723 | } | |||
17724 | ||||
17725 | static const JSJitInfo passOptionalNullableEnumWithDefaultValue2_methodinfo = { | |||
17726 | { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue2 }, | |||
17727 | { prototypes::id::TestExampleInterface }, | |||
17728 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17729 | JSJitInfo::Method, | |||
17730 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17731 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17732 | false, /* isInfallible. False in setters. */ | |||
17733 | false, /* isMovable. Not relevant for setters. */ | |||
17734 | false, /* isEliminatable. Not relevant for setters. */ | |||
17735 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17736 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17737 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17738 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17739 | }; | |||
17740 | ||||
17741 | MOZ_CAN_RUN_SCRIPT static bool | |||
17742 | receiveEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17743 | { | |||
17744 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17747( cx, "TestExampleInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17745 | "TestExampleInterface", "receiveEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17747( cx, "TestExampleInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17746 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17747( cx, "TestExampleInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17747 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17747( cx, "TestExampleInterface" , "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17748 | ||||
17749 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17750 | TestEnum result(MOZ_KnownLive(self)(self)->ReceiveEnum()); | |||
17751 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17751); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17751; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17752 | if (!ToJSValue(cx, result, args.rval())) { | |||
17753 | return false; | |||
17754 | } | |||
17755 | return true; | |||
17756 | } | |||
17757 | ||||
17758 | static const JSJitInfo receiveEnum_methodinfo = { | |||
17759 | { (JSJitGetterOp)receiveEnum }, | |||
17760 | { prototypes::id::TestExampleInterface }, | |||
17761 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17762 | JSJitInfo::Method, | |||
17763 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17764 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | |||
17765 | false, /* isInfallible. False in setters. */ | |||
17766 | false, /* isMovable. Not relevant for setters. */ | |||
17767 | false, /* isEliminatable. Not relevant for setters. */ | |||
17768 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17769 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17770 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17771 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17772 | }; | |||
17773 | ||||
17774 | MOZ_CAN_RUN_SCRIPT static bool | |||
17775 | receiveNullableEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17776 | { | |||
17777 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17780( cx, "TestExampleInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17778 | "TestExampleInterface", "receiveNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17780( cx, "TestExampleInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17779 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17780( cx, "TestExampleInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17780 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17780( cx, "TestExampleInterface" , "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17781 | ||||
17782 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17783 | Nullable<TestEnum> result(MOZ_KnownLive(self)(self)->ReceiveNullableEnum()); | |||
17784 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17784); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17784; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17785 | if (result.IsNull()) { | |||
17786 | args.rval().setNull(); | |||
17787 | return true; | |||
17788 | } else { | |||
17789 | if (!ToJSValue(cx, result.Value(), args.rval())) { | |||
17790 | return false; | |||
17791 | } | |||
17792 | return true; | |||
17793 | } | |||
17794 | } | |||
17795 | ||||
17796 | static const JSJitInfo receiveNullableEnum_methodinfo = { | |||
17797 | { (JSJitGetterOp)receiveNullableEnum }, | |||
17798 | { prototypes::id::TestExampleInterface }, | |||
17799 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17800 | JSJitInfo::Method, | |||
17801 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17802 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
17803 | false, /* isInfallible. False in setters. */ | |||
17804 | false, /* isMovable. Not relevant for setters. */ | |||
17805 | false, /* isEliminatable. Not relevant for setters. */ | |||
17806 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17807 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17808 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17809 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17810 | }; | |||
17811 | ||||
17812 | MOZ_CAN_RUN_SCRIPT static bool | |||
17813 | get_enumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
17814 | { | |||
17815 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17816 | "TestExampleInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17817 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17818 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17819 | ||||
17820 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17821 | TestEnum result(MOZ_KnownLive(self)(self)->EnumAttribute()); | |||
17822 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17822); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17822; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17823 | if (!ToJSValue(cx, result, args.rval())) { | |||
17824 | return false; | |||
17825 | } | |||
17826 | return true; | |||
17827 | } | |||
17828 | ||||
17829 | MOZ_CAN_RUN_SCRIPT static bool | |||
17830 | set_enumAttribute(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args) | |||
17831 | { | |||
17832 | BindingCallContext cx(cx_, "TestExampleInterface.enumAttribute setter"); | |||
17833 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17836( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17834 | "TestExampleInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17836( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17835 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject17836( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17836 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17836( cx, "TestExampleInterface" , "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17837 | ||||
17838 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17839 | TestEnum arg0; | |||
17840 | { | |||
17841 | int index; | |||
17842 | if (!binding_detail::FindEnumStringIndex<false>(cx, args[0], | |||
17843 | binding_detail::EnumStrings<TestEnum>::Values, | |||
17844 | "TestEnum", "value being assigned", | |||
17845 | &index)) { | |||
17846 | return false; | |||
17847 | } | |||
17848 | if (index < 0) { | |||
17849 | return true; | |||
17850 | } | |||
17851 | arg0 = static_cast<TestEnum>(index); | |||
17852 | } | |||
17853 | // NOTE: This assert does NOT call the function. | |||
17854 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetEnumAttribute(arg0))>, "Should be returning void here"); | |||
17855 | MOZ_KnownLive(self)(self)->SetEnumAttribute(arg0); | |||
17856 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17856); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17856; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17857 | ||||
17858 | return true; | |||
17859 | } | |||
17860 | ||||
17861 | static const JSJitInfo enumAttribute_getterinfo = { | |||
17862 | { get_enumAttribute }, | |||
17863 | { prototypes::id::TestExampleInterface }, | |||
17864 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17865 | JSJitInfo::Getter, | |||
17866 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17867 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | |||
17868 | false, /* isInfallible. False in setters. */ | |||
17869 | false, /* isMovable. Not relevant for setters. */ | |||
17870 | false, /* isEliminatable. Not relevant for setters. */ | |||
17871 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17872 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17873 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17874 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17875 | }; | |||
17876 | static const JSJitInfo enumAttribute_setterinfo = { | |||
17877 | { (JSJitGetterOp)set_enumAttribute }, | |||
17878 | { prototypes::id::TestExampleInterface }, | |||
17879 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17880 | JSJitInfo::Setter, | |||
17881 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17882 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17883 | false, /* isInfallible. False in setters. */ | |||
17884 | false, /* isMovable. Not relevant for setters. */ | |||
17885 | false, /* isEliminatable. Not relevant for setters. */ | |||
17886 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17887 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17888 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17889 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17890 | }; | |||
17891 | ||||
17892 | MOZ_CAN_RUN_SCRIPT static bool | |||
17893 | get_readonlyEnumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args) | |||
17894 | { | |||
17895 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17898( cx, "TestExampleInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17896 | "TestExampleInterface", "readonlyEnumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17898( cx, "TestExampleInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17897 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject17898( cx, "TestExampleInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17898 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17898( cx, "TestExampleInterface" , "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17899 | ||||
17900 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17901 | TestEnum result(MOZ_KnownLive(self)(self)->ReadonlyEnumAttribute()); | |||
17902 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17902); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17902; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17903 | if (!ToJSValue(cx, result, args.rval())) { | |||
17904 | return false; | |||
17905 | } | |||
17906 | return true; | |||
17907 | } | |||
17908 | ||||
17909 | static const JSJitInfo readonlyEnumAttribute_getterinfo = { | |||
17910 | { get_readonlyEnumAttribute }, | |||
17911 | { prototypes::id::TestExampleInterface }, | |||
17912 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17913 | JSJitInfo::Getter, | |||
17914 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17915 | JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */ | |||
17916 | false, /* isInfallible. False in setters. */ | |||
17917 | false, /* isMovable. Not relevant for setters. */ | |||
17918 | false, /* isEliminatable. Not relevant for setters. */ | |||
17919 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17920 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17921 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17922 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17923 | }; | |||
17924 | ||||
17925 | MOZ_CAN_RUN_SCRIPT static bool | |||
17926 | passCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17927 | { | |||
17928 | BindingCallContext cx(cx_, "TestExampleInterface.passCallback"); | |||
17929 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17932( cx, "TestExampleInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17930 | "TestExampleInterface", "passCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17932( cx, "TestExampleInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17931 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17932( cx, "TestExampleInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17932 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17932( cx, "TestExampleInterface" , "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17933 | ||||
17934 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17935 | if (!args.requireAtLeast(cx, "TestExampleInterface.passCallback", 1)) { | |||
17936 | return false; | |||
17937 | } | |||
17938 | RootedCallback<OwningNonNull<binding_detail::FastTestCallback>> arg0(cx); | |||
17939 | if (args[0].isObject()) { | |||
17940 | if (JS::IsCallable(&args[0].toObject())) { | |||
17941 | { // scope for tempRoot and tempGlobalRoot if needed | |||
17942 | arg0 = new binding_detail::FastTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
17943 | } | |||
17944 | } else { | |||
17945 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
17946 | return false; | |||
17947 | } | |||
17948 | } else { | |||
17949 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
17950 | return false; | |||
17951 | } | |||
17952 | // NOTE: This assert does NOT call the function. | |||
17953 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCallback(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))))>, "Should be returning void here"); | |||
17954 | MOZ_KnownLive(self)(self)->PassCallback(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0))); | |||
17955 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 17955); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 17955; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
17956 | args.rval().setUndefined(); | |||
17957 | return true; | |||
17958 | } | |||
17959 | ||||
17960 | static const JSJitInfo passCallback_methodinfo = { | |||
17961 | { (JSJitGetterOp)passCallback }, | |||
17962 | { prototypes::id::TestExampleInterface }, | |||
17963 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
17964 | JSJitInfo::Method, | |||
17965 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
17966 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
17967 | false, /* isInfallible. False in setters. */ | |||
17968 | false, /* isMovable. Not relevant for setters. */ | |||
17969 | false, /* isEliminatable. Not relevant for setters. */ | |||
17970 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
17971 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
17972 | false, /* isTypedMethod. Only relevant for methods. */ | |||
17973 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
17974 | }; | |||
17975 | ||||
17976 | MOZ_CAN_RUN_SCRIPT static bool | |||
17977 | passNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
17978 | { | |||
17979 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableCallback"); | |||
17980 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17983( cx, "TestExampleInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17981 | "TestExampleInterface", "passNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17983( cx, "TestExampleInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17982 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17983( cx, "TestExampleInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
17983 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17983( cx, "TestExampleInterface" , "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
17984 | ||||
17985 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
17986 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableCallback", 1)) { | |||
17987 | return false; | |||
17988 | } | |||
17989 | RootedCallback<RefPtr<binding_detail::FastTestCallback>> arg0(cx); | |||
17990 | if (args[0].isObject()) { | |||
17991 | if (JS::IsCallable(&args[0].toObject())) { | |||
17992 | { // scope for tempRoot and tempGlobalRoot if needed | |||
17993 | arg0 = new binding_detail::FastTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
17994 | } | |||
17995 | } else { | |||
17996 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
17997 | return false; | |||
17998 | } | |||
17999 | } else if (args[0].isNullOrUndefined()) { | |||
18000 | arg0 = nullptr; | |||
18001 | } else { | |||
18002 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
18003 | return false; | |||
18004 | } | |||
18005 | // NOTE: This assert does NOT call the function. | |||
18006 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
18007 | MOZ_KnownLive(self)(self)->PassNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
18008 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18008); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18008; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18009 | args.rval().setUndefined(); | |||
18010 | return true; | |||
18011 | } | |||
18012 | ||||
18013 | static const JSJitInfo passNullableCallback_methodinfo = { | |||
18014 | { (JSJitGetterOp)passNullableCallback }, | |||
18015 | { prototypes::id::TestExampleInterface }, | |||
18016 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18017 | JSJitInfo::Method, | |||
18018 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18019 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18020 | false, /* isInfallible. False in setters. */ | |||
18021 | false, /* isMovable. Not relevant for setters. */ | |||
18022 | false, /* isEliminatable. Not relevant for setters. */ | |||
18023 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18024 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18025 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18026 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18027 | }; | |||
18028 | ||||
18029 | MOZ_CAN_RUN_SCRIPT static bool | |||
18030 | passOptionalCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18031 | { | |||
18032 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalCallback"); | |||
18033 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18036( cx, "TestExampleInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18034 | "TestExampleInterface", "passOptionalCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18036( cx, "TestExampleInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18035 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18036( cx, "TestExampleInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18036 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18036( cx, "TestExampleInterface" , "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
18037 | ||||
18038 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18039 | Optional<OwningNonNull<TestCallback>> arg0; | |||
18040 | if (args.hasDefined(0)) { | |||
18041 | arg0.Construct(); | |||
18042 | if (args[0].isObject()) { | |||
18043 | if (JS::IsCallable(&args[0].toObject())) { | |||
18044 | { // scope for tempRoot and tempGlobalRoot if needed | |||
18045 | JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject()); | |||
18046 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | |||
18047 | arg0.Value() = new TestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | |||
18048 | } | |||
18049 | } else { | |||
18050 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
18051 | return false; | |||
18052 | } | |||
18053 | } else { | |||
18054 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
18055 | return false; | |||
18056 | } | |||
18057 | } | |||
18058 | // NOTE: This assert does NOT call the function. | |||
18059 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalCallback(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))))>, "Should be returning void here"); | |||
18060 | MOZ_KnownLive(self)(self)->PassOptionalCallback(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0)))); | |||
18061 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18061); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18061; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18062 | args.rval().setUndefined(); | |||
18063 | return true; | |||
18064 | } | |||
18065 | ||||
18066 | static const JSJitInfo passOptionalCallback_methodinfo = { | |||
18067 | { (JSJitGetterOp)passOptionalCallback }, | |||
18068 | { prototypes::id::TestExampleInterface }, | |||
18069 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18070 | JSJitInfo::Method, | |||
18071 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18072 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18073 | false, /* isInfallible. False in setters. */ | |||
18074 | false, /* isMovable. Not relevant for setters. */ | |||
18075 | false, /* isEliminatable. Not relevant for setters. */ | |||
18076 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18077 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18078 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18079 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18080 | }; | |||
18081 | ||||
18082 | MOZ_CAN_RUN_SCRIPT static bool | |||
18083 | passOptionalNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18084 | { | |||
18085 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableCallback"); | |||
18086 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18089( cx, "TestExampleInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18087 | "TestExampleInterface", "passOptionalNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18089( cx, "TestExampleInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18088 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18089( cx, "TestExampleInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18089 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18089( cx, "TestExampleInterface" , "passOptionalNullableCallback", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18090 | ||||
18091 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18092 | Optional<RefPtr<TestCallback>> arg0; | |||
18093 | if (args.hasDefined(0)) { | |||
18094 | arg0.Construct(); | |||
18095 | if (args[0].isObject()) { | |||
18096 | if (JS::IsCallable(&args[0].toObject())) { | |||
18097 | { // scope for tempRoot and tempGlobalRoot if needed | |||
18098 | JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject()); | |||
18099 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | |||
18100 | arg0.Value() = new TestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | |||
18101 | } | |||
18102 | } else { | |||
18103 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
18104 | return false; | |||
18105 | } | |||
18106 | } else if (args[0].isNullOrUndefined()) { | |||
18107 | arg0.Value() = nullptr; | |||
18108 | } else { | |||
18109 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
18110 | return false; | |||
18111 | } | |||
18112 | } | |||
18113 | // NOTE: This assert does NOT call the function. | |||
18114 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
18115 | MOZ_KnownLive(self)(self)->PassOptionalNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
18116 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18116); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18116; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18117 | args.rval().setUndefined(); | |||
18118 | return true; | |||
18119 | } | |||
18120 | ||||
18121 | static const JSJitInfo passOptionalNullableCallback_methodinfo = { | |||
18122 | { (JSJitGetterOp)passOptionalNullableCallback }, | |||
18123 | { prototypes::id::TestExampleInterface }, | |||
18124 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18125 | JSJitInfo::Method, | |||
18126 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18127 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18128 | false, /* isInfallible. False in setters. */ | |||
18129 | false, /* isMovable. Not relevant for setters. */ | |||
18130 | false, /* isEliminatable. Not relevant for setters. */ | |||
18131 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18132 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18133 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18134 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18135 | }; | |||
18136 | ||||
18137 | MOZ_CAN_RUN_SCRIPT static bool | |||
18138 | passOptionalNullableCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18139 | { | |||
18140 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableCallbackWithDefaultValue"); | |||
18141 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18144( cx, "TestExampleInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18142 | "TestExampleInterface", "passOptionalNullableCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18144( cx, "TestExampleInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18143 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18144( cx, "TestExampleInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18144 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18144( cx, "TestExampleInterface" , "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18145 | ||||
18146 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18147 | RootedCallback<RefPtr<binding_detail::FastTestCallback>> arg0(cx); | |||
18148 | if (args.hasDefined(0)) { | |||
18149 | if (args[0].isObject()) { | |||
18150 | if (JS::IsCallable(&args[0].toObject())) { | |||
18151 | { // scope for tempRoot and tempGlobalRoot if needed | |||
18152 | arg0 = new binding_detail::FastTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
18153 | } | |||
18154 | } else { | |||
18155 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
18156 | return false; | |||
18157 | } | |||
18158 | } else if (args[0].isNullOrUndefined()) { | |||
18159 | arg0 = nullptr; | |||
18160 | } else { | |||
18161 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
18162 | return false; | |||
18163 | } | |||
18164 | } else { | |||
18165 | arg0 = nullptr; | |||
18166 | } | |||
18167 | // NOTE: This assert does NOT call the function. | |||
18168 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
18169 | MOZ_KnownLive(self)(self)->PassOptionalNullableCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
18170 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18170); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18170; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18171 | args.rval().setUndefined(); | |||
18172 | return true; | |||
18173 | } | |||
18174 | ||||
18175 | static const JSJitInfo passOptionalNullableCallbackWithDefaultValue_methodinfo = { | |||
18176 | { (JSJitGetterOp)passOptionalNullableCallbackWithDefaultValue }, | |||
18177 | { prototypes::id::TestExampleInterface }, | |||
18178 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18179 | JSJitInfo::Method, | |||
18180 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18181 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18182 | false, /* isInfallible. False in setters. */ | |||
18183 | false, /* isMovable. Not relevant for setters. */ | |||
18184 | false, /* isEliminatable. Not relevant for setters. */ | |||
18185 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18186 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18187 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18188 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18189 | }; | |||
18190 | ||||
18191 | MOZ_CAN_RUN_SCRIPT static bool | |||
18192 | receiveCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18193 | { | |||
18194 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18197( cx, "TestExampleInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18195 | "TestExampleInterface", "receiveCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18197( cx, "TestExampleInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18196 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18197( cx, "TestExampleInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18197 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18197( cx, "TestExampleInterface" , "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
18198 | ||||
18199 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18200 | RefPtr<TestCallback> result(MOZ_KnownLive(self)(self)->ReceiveCallback()); | |||
18201 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18201); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18201; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18202 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
18203 | if (!MaybeWrapObjectValue(cx, args.rval())) { | |||
18204 | return false; | |||
18205 | } | |||
18206 | return true; | |||
18207 | } | |||
18208 | ||||
18209 | static const JSJitInfo receiveCallback_methodinfo = { | |||
18210 | { (JSJitGetterOp)receiveCallback }, | |||
18211 | { prototypes::id::TestExampleInterface }, | |||
18212 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18213 | JSJitInfo::Method, | |||
18214 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18215 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
18216 | false, /* isInfallible. False in setters. */ | |||
18217 | false, /* isMovable. Not relevant for setters. */ | |||
18218 | false, /* isEliminatable. Not relevant for setters. */ | |||
18219 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18220 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18221 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18222 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18223 | }; | |||
18224 | ||||
18225 | MOZ_CAN_RUN_SCRIPT static bool | |||
18226 | receiveNullableCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18227 | { | |||
18228 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18231( cx, "TestExampleInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18229 | "TestExampleInterface", "receiveNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18231( cx, "TestExampleInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18230 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18231( cx, "TestExampleInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18231 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18231( cx, "TestExampleInterface" , "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
18232 | ||||
18233 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18234 | RefPtr<TestCallback> result(MOZ_KnownLive(self)(self)->ReceiveNullableCallback()); | |||
18235 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18235); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18235; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18236 | if (result) { | |||
18237 | args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result)); | |||
18238 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { | |||
18239 | return false; | |||
18240 | } | |||
18241 | return true; | |||
18242 | } else { | |||
18243 | args.rval().setNull(); | |||
18244 | return true; | |||
18245 | } | |||
18246 | } | |||
18247 | ||||
18248 | static const JSJitInfo receiveNullableCallback_methodinfo = { | |||
18249 | { (JSJitGetterOp)receiveNullableCallback }, | |||
18250 | { prototypes::id::TestExampleInterface }, | |||
18251 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18252 | JSJitInfo::Method, | |||
18253 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18254 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
18255 | false, /* isInfallible. False in setters. */ | |||
18256 | false, /* isMovable. Not relevant for setters. */ | |||
18257 | false, /* isEliminatable. Not relevant for setters. */ | |||
18258 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18259 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18260 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18261 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18262 | }; | |||
18263 | ||||
18264 | MOZ_CAN_RUN_SCRIPT static bool | |||
18265 | passNullableTreatAsNullCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18266 | { | |||
18267 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableTreatAsNullCallback"); | |||
18268 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18271( cx, "TestExampleInterface" , "passNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18269 | "TestExampleInterface", "passNullableTreatAsNullCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18271( cx, "TestExampleInterface" , "passNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18270 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18271( cx, "TestExampleInterface" , "passNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18271 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18271( cx, "TestExampleInterface" , "passNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18272 | ||||
18273 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18274 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableTreatAsNullCallback", 1)) { | |||
18275 | return false; | |||
18276 | } | |||
18277 | RootedCallback<RefPtr<binding_detail::FastTestTreatAsNullCallback>> arg0(cx); | |||
18278 | if (args[0].isObject()) { | |||
18279 | if (JS::IsCallable(&args[0].toObject())) { | |||
18280 | { // scope for tempRoot and tempGlobalRoot if needed | |||
18281 | arg0 = new binding_detail::FastTestTreatAsNullCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
18282 | } | |||
18283 | } else { | |||
18284 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
18285 | return false; | |||
18286 | } | |||
18287 | } else if (args[0].isNullOrUndefined()) { | |||
18288 | arg0 = nullptr; | |||
18289 | } else { | |||
18290 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
18291 | return false; | |||
18292 | } | |||
18293 | // NOTE: This assert does NOT call the function. | |||
18294 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableTreatAsNullCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
18295 | MOZ_KnownLive(self)(self)->PassNullableTreatAsNullCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
18296 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18296); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18296; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18297 | args.rval().setUndefined(); | |||
18298 | return true; | |||
18299 | } | |||
18300 | ||||
18301 | static const JSJitInfo passNullableTreatAsNullCallback_methodinfo = { | |||
18302 | { (JSJitGetterOp)passNullableTreatAsNullCallback }, | |||
18303 | { prototypes::id::TestExampleInterface }, | |||
18304 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18305 | JSJitInfo::Method, | |||
18306 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18307 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18308 | false, /* isInfallible. False in setters. */ | |||
18309 | false, /* isMovable. Not relevant for setters. */ | |||
18310 | false, /* isEliminatable. Not relevant for setters. */ | |||
18311 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18312 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18313 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18314 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18315 | }; | |||
18316 | ||||
18317 | MOZ_CAN_RUN_SCRIPT static bool | |||
18318 | passOptionalNullableTreatAsNullCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18319 | { | |||
18320 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableTreatAsNullCallback"); | |||
18321 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18324( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18322 | "TestExampleInterface", "passOptionalNullableTreatAsNullCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18324( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18323 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18324( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18324 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18324( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallback", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18325 | ||||
18326 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18327 | Optional<RefPtr<TestTreatAsNullCallback>> arg0; | |||
18328 | if (args.hasDefined(0)) { | |||
18329 | arg0.Construct(); | |||
18330 | if (args[0].isObject()) { | |||
18331 | if (JS::IsCallable(&args[0].toObject())) { | |||
18332 | { // scope for tempRoot and tempGlobalRoot if needed | |||
18333 | JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject()); | |||
18334 | JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx)); | |||
18335 | arg0.Value() = new TestTreatAsNullCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal()); | |||
18336 | } | |||
18337 | } else { | |||
18338 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
18339 | return false; | |||
18340 | } | |||
18341 | } else if (args[0].isNullOrUndefined()) { | |||
18342 | arg0.Value() = nullptr; | |||
18343 | } else { | |||
18344 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
18345 | return false; | |||
18346 | } | |||
18347 | } | |||
18348 | // NOTE: This assert does NOT call the function. | |||
18349 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
18350 | MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
18351 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18351); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18351; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18352 | args.rval().setUndefined(); | |||
18353 | return true; | |||
18354 | } | |||
18355 | ||||
18356 | static const JSJitInfo passOptionalNullableTreatAsNullCallback_methodinfo = { | |||
18357 | { (JSJitGetterOp)passOptionalNullableTreatAsNullCallback }, | |||
18358 | { prototypes::id::TestExampleInterface }, | |||
18359 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18360 | JSJitInfo::Method, | |||
18361 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18362 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18363 | false, /* isInfallible. False in setters. */ | |||
18364 | false, /* isMovable. Not relevant for setters. */ | |||
18365 | false, /* isEliminatable. Not relevant for setters. */ | |||
18366 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18367 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18368 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18369 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18370 | }; | |||
18371 | ||||
18372 | MOZ_CAN_RUN_SCRIPT static bool | |||
18373 | passOptionalNullableTreatAsNullCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18374 | { | |||
18375 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue"); | |||
18376 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18379( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
18377 | "TestExampleInterface", "passOptionalNullableTreatAsNullCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18379( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
18378 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18379( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
18379 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18379( cx, "TestExampleInterface" , "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
18380 | ||||
18381 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18382 | RootedCallback<RefPtr<binding_detail::FastTestTreatAsNullCallback>> arg0(cx); | |||
18383 | if (args.hasDefined(0)) { | |||
18384 | if (args[0].isObject()) { | |||
18385 | if (JS::IsCallable(&args[0].toObject())) { | |||
18386 | { // scope for tempRoot and tempGlobalRoot if needed | |||
18387 | arg0 = new binding_detail::FastTestTreatAsNullCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx)); | |||
18388 | } | |||
18389 | } else { | |||
18390 | cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1"); | |||
18391 | return false; | |||
18392 | } | |||
18393 | } else if (args[0].isNullOrUndefined()) { | |||
18394 | arg0 = nullptr; | |||
18395 | } else { | |||
18396 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
18397 | return false; | |||
18398 | } | |||
18399 | } else { | |||
18400 | arg0 = nullptr; | |||
18401 | } | |||
18402 | // NOTE: This assert does NOT call the function. | |||
18403 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0))))>, "Should be returning void here"); | |||
18404 | MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0))); | |||
18405 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18405); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18405; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18406 | args.rval().setUndefined(); | |||
18407 | return true; | |||
18408 | } | |||
18409 | ||||
18410 | static const JSJitInfo passOptionalNullableTreatAsNullCallbackWithDefaultValue_methodinfo = { | |||
18411 | { (JSJitGetterOp)passOptionalNullableTreatAsNullCallbackWithDefaultValue }, | |||
18412 | { prototypes::id::TestExampleInterface }, | |||
18413 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18414 | JSJitInfo::Method, | |||
18415 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18416 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18417 | false, /* isInfallible. False in setters. */ | |||
18418 | false, /* isMovable. Not relevant for setters. */ | |||
18419 | false, /* isEliminatable. Not relevant for setters. */ | |||
18420 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18421 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18422 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18423 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18424 | }; | |||
18425 | ||||
18426 | MOZ_CAN_RUN_SCRIPT static bool | |||
18427 | passAny(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18428 | { | |||
18429 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18432( cx, "TestExampleInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
18430 | "TestExampleInterface", "passAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18432( cx, "TestExampleInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
18431 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18432( cx, "TestExampleInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
18432 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18432( cx, "TestExampleInterface" , "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
18433 | ||||
18434 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18435 | if (!args.requireAtLeast(cx, "TestExampleInterface.passAny", 1)) { | |||
18436 | return false; | |||
18437 | } | |||
18438 | JS::Rooted<JS::Value> arg0(cx); | |||
18439 | arg0 = args[0]; | |||
18440 | // NOTE: This assert does NOT call the function. | |||
18441 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAny(cx, arg0))>, "Should be returning void here"); | |||
18442 | MOZ_KnownLive(self)(self)->PassAny(cx, arg0); | |||
18443 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18443); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18443; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18444 | args.rval().setUndefined(); | |||
18445 | return true; | |||
18446 | } | |||
18447 | ||||
18448 | static const JSJitInfo passAny_methodinfo = { | |||
18449 | { (JSJitGetterOp)passAny }, | |||
18450 | { prototypes::id::TestExampleInterface }, | |||
18451 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18452 | JSJitInfo::Method, | |||
18453 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18454 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18455 | false, /* isInfallible. False in setters. */ | |||
18456 | false, /* isMovable. Not relevant for setters. */ | |||
18457 | false, /* isEliminatable. Not relevant for setters. */ | |||
18458 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18459 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18460 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18461 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18462 | }; | |||
18463 | ||||
18464 | MOZ_CAN_RUN_SCRIPT static bool | |||
18465 | passVariadicAny(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18466 | { | |||
18467 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18470( cx, "TestExampleInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18468 | "TestExampleInterface", "passVariadicAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18470( cx, "TestExampleInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18469 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18470( cx, "TestExampleInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18470 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18470( cx, "TestExampleInterface" , "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
18471 | ||||
18472 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18473 | AutoSequence<JS::Value> arg0; | |||
18474 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0); | |||
18475 | if (args.length() > 0) { | |||
18476 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
18477 | JS_ReportOutOfMemory(cx); | |||
18478 | return false; | |||
18479 | } | |||
18480 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
18481 | // OK to do infallible append here, since we ensured capacity already. | |||
18482 | JS::Value& slot = *arg0.AppendElement(); | |||
18483 | slot = args[variadicArg]; | |||
18484 | } | |||
18485 | } | |||
18486 | // NOTE: This assert does NOT call the function. | |||
18487 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
18488 | MOZ_KnownLive(self)(self)->PassVariadicAny(cx, Constify(arg0)); | |||
18489 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18489); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18489; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18490 | args.rval().setUndefined(); | |||
18491 | return true; | |||
18492 | } | |||
18493 | ||||
18494 | static const JSJitInfo passVariadicAny_methodinfo = { | |||
18495 | { (JSJitGetterOp)passVariadicAny }, | |||
18496 | { prototypes::id::TestExampleInterface }, | |||
18497 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18498 | JSJitInfo::Method, | |||
18499 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18500 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18501 | false, /* isInfallible. False in setters. */ | |||
18502 | false, /* isMovable. Not relevant for setters. */ | |||
18503 | false, /* isEliminatable. Not relevant for setters. */ | |||
18504 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18505 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18506 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18507 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18508 | }; | |||
18509 | ||||
18510 | MOZ_CAN_RUN_SCRIPT static bool | |||
18511 | passOptionalAny(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18512 | { | |||
18513 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18516( cx, "TestExampleInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18514 | "TestExampleInterface", "passOptionalAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18516( cx, "TestExampleInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18515 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18516( cx, "TestExampleInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18516 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18516( cx, "TestExampleInterface" , "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
18517 | ||||
18518 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18519 | JS::Rooted<JS::Value> arg0(cx); | |||
18520 | if (args.hasDefined(0)) { | |||
18521 | arg0 = args[0]; | |||
18522 | } else { | |||
18523 | arg0 = JS::UndefinedValue(); | |||
18524 | } | |||
18525 | // NOTE: This assert does NOT call the function. | |||
18526 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalAny(cx, arg0))>, "Should be returning void here"); | |||
18527 | MOZ_KnownLive(self)(self)->PassOptionalAny(cx, arg0); | |||
18528 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18528); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18528; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18529 | args.rval().setUndefined(); | |||
18530 | return true; | |||
18531 | } | |||
18532 | ||||
18533 | static const JSJitInfo passOptionalAny_methodinfo = { | |||
18534 | { (JSJitGetterOp)passOptionalAny }, | |||
18535 | { prototypes::id::TestExampleInterface }, | |||
18536 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18537 | JSJitInfo::Method, | |||
18538 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18539 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18540 | false, /* isInfallible. False in setters. */ | |||
18541 | false, /* isMovable. Not relevant for setters. */ | |||
18542 | false, /* isEliminatable. Not relevant for setters. */ | |||
18543 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18544 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18545 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18546 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18547 | }; | |||
18548 | ||||
18549 | MOZ_CAN_RUN_SCRIPT static bool | |||
18550 | passAnyDefaultNull(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18551 | { | |||
18552 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18555( cx, "TestExampleInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18553 | "TestExampleInterface", "passAnyDefaultNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18555( cx, "TestExampleInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18554 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18555( cx, "TestExampleInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18555 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18555( cx, "TestExampleInterface" , "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
18556 | ||||
18557 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18558 | JS::Rooted<JS::Value> arg0(cx); | |||
18559 | if (args.hasDefined(0)) { | |||
18560 | arg0 = args[0]; | |||
18561 | } else { | |||
18562 | arg0 = JS::NullValue(); | |||
18563 | } | |||
18564 | // NOTE: This assert does NOT call the function. | |||
18565 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAnyDefaultNull(cx, arg0))>, "Should be returning void here"); | |||
18566 | MOZ_KnownLive(self)(self)->PassAnyDefaultNull(cx, arg0); | |||
18567 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18567); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18567; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18568 | args.rval().setUndefined(); | |||
18569 | return true; | |||
18570 | } | |||
18571 | ||||
18572 | static const JSJitInfo passAnyDefaultNull_methodinfo = { | |||
18573 | { (JSJitGetterOp)passAnyDefaultNull }, | |||
18574 | { prototypes::id::TestExampleInterface }, | |||
18575 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18576 | JSJitInfo::Method, | |||
18577 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18578 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18579 | false, /* isInfallible. False in setters. */ | |||
18580 | false, /* isMovable. Not relevant for setters. */ | |||
18581 | false, /* isEliminatable. Not relevant for setters. */ | |||
18582 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18583 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18584 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18585 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18586 | }; | |||
18587 | ||||
18588 | MOZ_CAN_RUN_SCRIPT static bool | |||
18589 | passSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18590 | { | |||
18591 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfAny"); | |||
18592 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18595( cx, "TestExampleInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18593 | "TestExampleInterface", "passSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18595( cx, "TestExampleInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18594 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18595( cx, "TestExampleInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
18595 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18595( cx, "TestExampleInterface" , "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
18596 | ||||
18597 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18598 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfAny", 1)) { | |||
18599 | return false; | |||
18600 | } | |||
18601 | binding_detail::AutoSequence<JS::Value> arg0; | |||
18602 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0); | |||
18603 | if (args[0].isObject()) { | |||
18604 | JS::ForOfIterator iter(cx); | |||
18605 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
18606 | return false; | |||
18607 | } | |||
18608 | if (!iter.valueIsIterable()) { | |||
18609 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18610 | return false; | |||
18611 | } | |||
18612 | binding_detail::AutoSequence<JS::Value> &arr = arg0; | |||
18613 | JS::Rooted<JS::Value> temp(cx); | |||
18614 | while (true) { | |||
18615 | bool done; | |||
18616 | if (!iter.next(&temp, &done)) { | |||
18617 | return false; | |||
18618 | } | |||
18619 | if (done) { | |||
18620 | break; | |||
18621 | } | |||
18622 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | |||
18623 | if (!slotPtr) { | |||
18624 | JS_ReportOutOfMemory(cx); | |||
18625 | return false; | |||
18626 | } | |||
18627 | JS::Value& slot = *slotPtr; | |||
18628 | slot = temp; | |||
18629 | } | |||
18630 | } else { | |||
18631 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18632 | return false; | |||
18633 | } | |||
18634 | // NOTE: This assert does NOT call the function. | |||
18635 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
18636 | MOZ_KnownLive(self)(self)->PassSequenceOfAny(cx, Constify(arg0)); | |||
18637 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18637); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18637; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18638 | args.rval().setUndefined(); | |||
18639 | return true; | |||
18640 | } | |||
18641 | ||||
18642 | static const JSJitInfo passSequenceOfAny_methodinfo = { | |||
18643 | { (JSJitGetterOp)passSequenceOfAny }, | |||
18644 | { prototypes::id::TestExampleInterface }, | |||
18645 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18646 | JSJitInfo::Method, | |||
18647 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18648 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18649 | false, /* isInfallible. False in setters. */ | |||
18650 | false, /* isMovable. Not relevant for setters. */ | |||
18651 | false, /* isEliminatable. Not relevant for setters. */ | |||
18652 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18653 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18654 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18655 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18656 | }; | |||
18657 | ||||
18658 | MOZ_CAN_RUN_SCRIPT static bool | |||
18659 | passNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18660 | { | |||
18661 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableSequenceOfAny"); | |||
18662 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestExampleInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18663 | "TestExampleInterface", "passNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestExampleInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18664 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestExampleInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18665 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18665( cx, "TestExampleInterface" , "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18666 | ||||
18667 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18668 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableSequenceOfAny", 1)) { | |||
18669 | return false; | |||
18670 | } | |||
18671 | Nullable<Sequence<JS::Value>> arg0; | |||
18672 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue()); | |||
18673 | if (args[0].isObject()) { | |||
18674 | JS::ForOfIterator iter(cx); | |||
18675 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
18676 | return false; | |||
18677 | } | |||
18678 | if (!iter.valueIsIterable()) { | |||
18679 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18680 | return false; | |||
18681 | } | |||
18682 | Sequence<JS::Value> &arr = arg0.SetValue(); | |||
18683 | JS::Rooted<JS::Value> temp(cx); | |||
18684 | while (true) { | |||
18685 | bool done; | |||
18686 | if (!iter.next(&temp, &done)) { | |||
18687 | return false; | |||
18688 | } | |||
18689 | if (done) { | |||
18690 | break; | |||
18691 | } | |||
18692 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | |||
18693 | if (!slotPtr) { | |||
18694 | JS_ReportOutOfMemory(cx); | |||
18695 | return false; | |||
18696 | } | |||
18697 | JS::Value& slot = *slotPtr; | |||
18698 | slot = temp; | |||
18699 | } | |||
18700 | } else if (args[0].isNullOrUndefined()) { | |||
18701 | arg0.SetNull(); | |||
18702 | } else { | |||
18703 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18704 | return false; | |||
18705 | } | |||
18706 | // NOTE: This assert does NOT call the function. | |||
18707 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
18708 | MOZ_KnownLive(self)(self)->PassNullableSequenceOfAny(cx, Constify(arg0)); | |||
18709 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18709); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18709; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18710 | args.rval().setUndefined(); | |||
18711 | return true; | |||
18712 | } | |||
18713 | ||||
18714 | static const JSJitInfo passNullableSequenceOfAny_methodinfo = { | |||
18715 | { (JSJitGetterOp)passNullableSequenceOfAny }, | |||
18716 | { prototypes::id::TestExampleInterface }, | |||
18717 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18718 | JSJitInfo::Method, | |||
18719 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18720 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18721 | false, /* isInfallible. False in setters. */ | |||
18722 | false, /* isMovable. Not relevant for setters. */ | |||
18723 | false, /* isEliminatable. Not relevant for setters. */ | |||
18724 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18725 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18726 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18727 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18728 | }; | |||
18729 | ||||
18730 | MOZ_CAN_RUN_SCRIPT static bool | |||
18731 | passOptionalSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18732 | { | |||
18733 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalSequenceOfAny"); | |||
18734 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18737( cx, "TestExampleInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18735 | "TestExampleInterface", "passOptionalSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18737( cx, "TestExampleInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18736 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18737( cx, "TestExampleInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18737 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18737( cx, "TestExampleInterface" , "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18738 | ||||
18739 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18740 | Optional<Sequence<JS::Value>> arg0; | |||
18741 | Maybe<SequenceRooter<JS::Value>> arg0_holder; | |||
18742 | if (args.hasDefined(0)) { | |||
18743 | arg0.Construct(); | |||
18744 | arg0_holder.emplace(cx, &arg0.Value()); | |||
18745 | if (args[0].isObject()) { | |||
18746 | JS::ForOfIterator iter(cx); | |||
18747 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
18748 | return false; | |||
18749 | } | |||
18750 | if (!iter.valueIsIterable()) { | |||
18751 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18752 | return false; | |||
18753 | } | |||
18754 | Sequence<JS::Value> &arr = arg0.Value(); | |||
18755 | JS::Rooted<JS::Value> temp(cx); | |||
18756 | while (true) { | |||
18757 | bool done; | |||
18758 | if (!iter.next(&temp, &done)) { | |||
18759 | return false; | |||
18760 | } | |||
18761 | if (done) { | |||
18762 | break; | |||
18763 | } | |||
18764 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | |||
18765 | if (!slotPtr) { | |||
18766 | JS_ReportOutOfMemory(cx); | |||
18767 | return false; | |||
18768 | } | |||
18769 | JS::Value& slot = *slotPtr; | |||
18770 | slot = temp; | |||
18771 | } | |||
18772 | } else { | |||
18773 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18774 | return false; | |||
18775 | } | |||
18776 | } | |||
18777 | // NOTE: This assert does NOT call the function. | |||
18778 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
18779 | MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAny(cx, Constify(arg0)); | |||
18780 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18780); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18780; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18781 | args.rval().setUndefined(); | |||
18782 | return true; | |||
18783 | } | |||
18784 | ||||
18785 | static const JSJitInfo passOptionalSequenceOfAny_methodinfo = { | |||
18786 | { (JSJitGetterOp)passOptionalSequenceOfAny }, | |||
18787 | { prototypes::id::TestExampleInterface }, | |||
18788 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18789 | JSJitInfo::Method, | |||
18790 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18791 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18792 | false, /* isInfallible. False in setters. */ | |||
18793 | false, /* isMovable. Not relevant for setters. */ | |||
18794 | false, /* isEliminatable. Not relevant for setters. */ | |||
18795 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18796 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18797 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18798 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18799 | }; | |||
18800 | ||||
18801 | MOZ_CAN_RUN_SCRIPT static bool | |||
18802 | passOptionalNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18803 | { | |||
18804 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceOfAny"); | |||
18805 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18808( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18806 | "TestExampleInterface", "passOptionalNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18808( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18807 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18808( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18808 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18808( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18809 | ||||
18810 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18811 | Optional<Nullable<Sequence<JS::Value>>> arg0; | |||
18812 | Maybe<SequenceRooter<JS::Value>> arg0_holder; | |||
18813 | if (args.hasDefined(0)) { | |||
18814 | arg0.Construct(); | |||
18815 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
18816 | if (args[0].isObject()) { | |||
18817 | JS::ForOfIterator iter(cx); | |||
18818 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
18819 | return false; | |||
18820 | } | |||
18821 | if (!iter.valueIsIterable()) { | |||
18822 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18823 | return false; | |||
18824 | } | |||
18825 | Sequence<JS::Value> &arr = arg0.Value().SetValue(); | |||
18826 | JS::Rooted<JS::Value> temp(cx); | |||
18827 | while (true) { | |||
18828 | bool done; | |||
18829 | if (!iter.next(&temp, &done)) { | |||
18830 | return false; | |||
18831 | } | |||
18832 | if (done) { | |||
18833 | break; | |||
18834 | } | |||
18835 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | |||
18836 | if (!slotPtr) { | |||
18837 | JS_ReportOutOfMemory(cx); | |||
18838 | return false; | |||
18839 | } | |||
18840 | JS::Value& slot = *slotPtr; | |||
18841 | slot = temp; | |||
18842 | } | |||
18843 | } else if (args[0].isNullOrUndefined()) { | |||
18844 | arg0.Value().SetNull(); | |||
18845 | } else { | |||
18846 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18847 | return false; | |||
18848 | } | |||
18849 | } | |||
18850 | // NOTE: This assert does NOT call the function. | |||
18851 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
18852 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfAny(cx, Constify(arg0)); | |||
18853 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18853); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18853; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18854 | args.rval().setUndefined(); | |||
18855 | return true; | |||
18856 | } | |||
18857 | ||||
18858 | static const JSJitInfo passOptionalNullableSequenceOfAny_methodinfo = { | |||
18859 | { (JSJitGetterOp)passOptionalNullableSequenceOfAny }, | |||
18860 | { prototypes::id::TestExampleInterface }, | |||
18861 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18862 | JSJitInfo::Method, | |||
18863 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18864 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18865 | false, /* isInfallible. False in setters. */ | |||
18866 | false, /* isMovable. Not relevant for setters. */ | |||
18867 | false, /* isEliminatable. Not relevant for setters. */ | |||
18868 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18869 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18870 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18871 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18872 | }; | |||
18873 | ||||
18874 | MOZ_CAN_RUN_SCRIPT static bool | |||
18875 | passOptionalSequenceOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18876 | { | |||
18877 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalSequenceOfAnyWithDefaultValue"); | |||
18878 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18881( cx, "TestExampleInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18879 | "TestExampleInterface", "passOptionalSequenceOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18881( cx, "TestExampleInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18880 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18881( cx, "TestExampleInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18881 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18881( cx, "TestExampleInterface" , "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18882 | ||||
18883 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18884 | Nullable<Sequence<JS::Value>> arg0; | |||
18885 | SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue()); | |||
18886 | if (args.hasDefined(0)) { | |||
18887 | if (args[0].isObject()) { | |||
18888 | JS::ForOfIterator iter(cx); | |||
18889 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
18890 | return false; | |||
18891 | } | |||
18892 | if (!iter.valueIsIterable()) { | |||
18893 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18894 | return false; | |||
18895 | } | |||
18896 | Sequence<JS::Value> &arr = arg0.SetValue(); | |||
18897 | JS::Rooted<JS::Value> temp(cx); | |||
18898 | while (true) { | |||
18899 | bool done; | |||
18900 | if (!iter.next(&temp, &done)) { | |||
18901 | return false; | |||
18902 | } | |||
18903 | if (done) { | |||
18904 | break; | |||
18905 | } | |||
18906 | JS::Value* slotPtr = arr.AppendElement(mozilla::fallible); | |||
18907 | if (!slotPtr) { | |||
18908 | JS_ReportOutOfMemory(cx); | |||
18909 | return false; | |||
18910 | } | |||
18911 | JS::Value& slot = *slotPtr; | |||
18912 | slot = temp; | |||
18913 | } | |||
18914 | } else if (args[0].isNullOrUndefined()) { | |||
18915 | arg0.SetNull(); | |||
18916 | } else { | |||
18917 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18918 | return false; | |||
18919 | } | |||
18920 | } else { | |||
18921 | arg0.SetNull(); | |||
18922 | } | |||
18923 | // NOTE: This assert does NOT call the function. | |||
18924 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAnyWithDefaultValue(cx, Constify(arg0)))>, "Should be returning void here"); | |||
18925 | MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAnyWithDefaultValue(cx, Constify(arg0)); | |||
18926 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 18926); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 18926; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
18927 | args.rval().setUndefined(); | |||
18928 | return true; | |||
18929 | } | |||
18930 | ||||
18931 | static const JSJitInfo passOptionalSequenceOfAnyWithDefaultValue_methodinfo = { | |||
18932 | { (JSJitGetterOp)passOptionalSequenceOfAnyWithDefaultValue }, | |||
18933 | { prototypes::id::TestExampleInterface }, | |||
18934 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
18935 | JSJitInfo::Method, | |||
18936 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
18937 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
18938 | false, /* isInfallible. False in setters. */ | |||
18939 | false, /* isMovable. Not relevant for setters. */ | |||
18940 | false, /* isEliminatable. Not relevant for setters. */ | |||
18941 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
18942 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
18943 | false, /* isTypedMethod. Only relevant for methods. */ | |||
18944 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
18945 | }; | |||
18946 | ||||
18947 | MOZ_CAN_RUN_SCRIPT static bool | |||
18948 | passSequenceOfSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
18949 | { | |||
18950 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfSequenceOfAny"); | |||
18951 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18954( cx, "TestExampleInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18952 | "TestExampleInterface", "passSequenceOfSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18954( cx, "TestExampleInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18953 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18954( cx, "TestExampleInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
18954 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18954( cx, "TestExampleInterface" , "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
18955 | ||||
18956 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
18957 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfSequenceOfAny", 1)) { | |||
18958 | return false; | |||
18959 | } | |||
18960 | binding_detail::AutoSequence<Sequence<JS::Value>> arg0; | |||
18961 | SequenceRooter<Sequence<JS::Value>> arg0_holder(cx, &arg0); | |||
18962 | if (args[0].isObject()) { | |||
18963 | JS::ForOfIterator iter(cx); | |||
18964 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
18965 | return false; | |||
18966 | } | |||
18967 | if (!iter.valueIsIterable()) { | |||
18968 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
18969 | return false; | |||
18970 | } | |||
18971 | binding_detail::AutoSequence<Sequence<JS::Value>> &arr = arg0; | |||
18972 | JS::Rooted<JS::Value> temp(cx); | |||
18973 | while (true) { | |||
18974 | bool done; | |||
18975 | if (!iter.next(&temp, &done)) { | |||
18976 | return false; | |||
18977 | } | |||
18978 | if (done) { | |||
18979 | break; | |||
18980 | } | |||
18981 | Sequence<JS::Value>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
18982 | if (!slotPtr) { | |||
18983 | JS_ReportOutOfMemory(cx); | |||
18984 | return false; | |||
18985 | } | |||
18986 | Sequence<JS::Value>& slot = *slotPtr; | |||
18987 | if (temp.isObject()) { | |||
18988 | JS::ForOfIterator iter1(cx); | |||
18989 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
18990 | return false; | |||
18991 | } | |||
18992 | if (!iter1.valueIsIterable()) { | |||
18993 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
18994 | return false; | |||
18995 | } | |||
18996 | Sequence<JS::Value> &arr1 = slot; | |||
18997 | JS::Rooted<JS::Value> temp1(cx); | |||
18998 | while (true) { | |||
18999 | bool done1; | |||
19000 | if (!iter1.next(&temp1, &done1)) { | |||
19001 | return false; | |||
19002 | } | |||
19003 | if (done1) { | |||
19004 | break; | |||
19005 | } | |||
19006 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | |||
19007 | if (!slotPtr1) { | |||
19008 | JS_ReportOutOfMemory(cx); | |||
19009 | return false; | |||
19010 | } | |||
19011 | JS::Value& slot1 = *slotPtr1; | |||
19012 | slot1 = temp1; | |||
19013 | } | |||
19014 | } else { | |||
19015 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
19016 | return false; | |||
19017 | } | |||
19018 | } | |||
19019 | } else { | |||
19020 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
19021 | return false; | |||
19022 | } | |||
19023 | // NOTE: This assert does NOT call the function. | |||
19024 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19025 | MOZ_KnownLive(self)(self)->PassSequenceOfSequenceOfAny(cx, Constify(arg0)); | |||
19026 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19026); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19026; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19027 | args.rval().setUndefined(); | |||
19028 | return true; | |||
19029 | } | |||
19030 | ||||
19031 | static const JSJitInfo passSequenceOfSequenceOfAny_methodinfo = { | |||
19032 | { (JSJitGetterOp)passSequenceOfSequenceOfAny }, | |||
19033 | { prototypes::id::TestExampleInterface }, | |||
19034 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19035 | JSJitInfo::Method, | |||
19036 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19037 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19038 | false, /* isInfallible. False in setters. */ | |||
19039 | false, /* isMovable. Not relevant for setters. */ | |||
19040 | false, /* isEliminatable. Not relevant for setters. */ | |||
19041 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19042 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19043 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19044 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19045 | }; | |||
19046 | ||||
19047 | MOZ_CAN_RUN_SCRIPT static bool | |||
19048 | passSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19049 | { | |||
19050 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfNullableSequenceOfAny"); | |||
19051 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19054( cx, "TestExampleInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19052 | "TestExampleInterface", "passSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19054( cx, "TestExampleInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19053 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19054( cx, "TestExampleInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19054 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19054( cx, "TestExampleInterface" , "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
19055 | ||||
19056 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19057 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfNullableSequenceOfAny", 1)) { | |||
19058 | return false; | |||
19059 | } | |||
19060 | binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> arg0; | |||
19061 | SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0); | |||
19062 | if (args[0].isObject()) { | |||
19063 | JS::ForOfIterator iter(cx); | |||
19064 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
19065 | return false; | |||
19066 | } | |||
19067 | if (!iter.valueIsIterable()) { | |||
19068 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
19069 | return false; | |||
19070 | } | |||
19071 | binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> &arr = arg0; | |||
19072 | JS::Rooted<JS::Value> temp(cx); | |||
19073 | while (true) { | |||
19074 | bool done; | |||
19075 | if (!iter.next(&temp, &done)) { | |||
19076 | return false; | |||
19077 | } | |||
19078 | if (done) { | |||
19079 | break; | |||
19080 | } | |||
19081 | Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
19082 | if (!slotPtr) { | |||
19083 | JS_ReportOutOfMemory(cx); | |||
19084 | return false; | |||
19085 | } | |||
19086 | Nullable<Sequence<JS::Value>>& slot = *slotPtr; | |||
19087 | if (temp.isObject()) { | |||
19088 | JS::ForOfIterator iter1(cx); | |||
19089 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
19090 | return false; | |||
19091 | } | |||
19092 | if (!iter1.valueIsIterable()) { | |||
19093 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
19094 | return false; | |||
19095 | } | |||
19096 | Sequence<JS::Value> &arr1 = slot.SetValue(); | |||
19097 | JS::Rooted<JS::Value> temp1(cx); | |||
19098 | while (true) { | |||
19099 | bool done1; | |||
19100 | if (!iter1.next(&temp1, &done1)) { | |||
19101 | return false; | |||
19102 | } | |||
19103 | if (done1) { | |||
19104 | break; | |||
19105 | } | |||
19106 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | |||
19107 | if (!slotPtr1) { | |||
19108 | JS_ReportOutOfMemory(cx); | |||
19109 | return false; | |||
19110 | } | |||
19111 | JS::Value& slot1 = *slotPtr1; | |||
19112 | slot1 = temp1; | |||
19113 | } | |||
19114 | } else if (temp.isNullOrUndefined()) { | |||
19115 | slot.SetNull(); | |||
19116 | } else { | |||
19117 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
19118 | return false; | |||
19119 | } | |||
19120 | } | |||
19121 | } else { | |||
19122 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
19123 | return false; | |||
19124 | } | |||
19125 | // NOTE: This assert does NOT call the function. | |||
19126 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19127 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableSequenceOfAny(cx, Constify(arg0)); | |||
19128 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19128); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19128; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19129 | args.rval().setUndefined(); | |||
19130 | return true; | |||
19131 | } | |||
19132 | ||||
19133 | static const JSJitInfo passSequenceOfNullableSequenceOfAny_methodinfo = { | |||
19134 | { (JSJitGetterOp)passSequenceOfNullableSequenceOfAny }, | |||
19135 | { prototypes::id::TestExampleInterface }, | |||
19136 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19137 | JSJitInfo::Method, | |||
19138 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19139 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19140 | false, /* isInfallible. False in setters. */ | |||
19141 | false, /* isMovable. Not relevant for setters. */ | |||
19142 | false, /* isEliminatable. Not relevant for setters. */ | |||
19143 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19144 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19145 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19146 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19147 | }; | |||
19148 | ||||
19149 | MOZ_CAN_RUN_SCRIPT static bool | |||
19150 | passNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19151 | { | |||
19152 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableSequenceOfNullableSequenceOfAny"); | |||
19153 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19156( cx, "TestExampleInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19154 | "TestExampleInterface", "passNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19156( cx, "TestExampleInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19155 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19156( cx, "TestExampleInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19156 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19156( cx, "TestExampleInterface" , "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
19157 | ||||
19158 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19159 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableSequenceOfNullableSequenceOfAny", 1)) { | |||
19160 | return false; | |||
19161 | } | |||
19162 | Nullable<Sequence<Nullable<Sequence<JS::Value>>>> arg0; | |||
19163 | SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0.SetValue()); | |||
19164 | if (args[0].isObject()) { | |||
19165 | JS::ForOfIterator iter(cx); | |||
19166 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
19167 | return false; | |||
19168 | } | |||
19169 | if (!iter.valueIsIterable()) { | |||
19170 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
19171 | return false; | |||
19172 | } | |||
19173 | Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.SetValue(); | |||
19174 | JS::Rooted<JS::Value> temp(cx); | |||
19175 | while (true) { | |||
19176 | bool done; | |||
19177 | if (!iter.next(&temp, &done)) { | |||
19178 | return false; | |||
19179 | } | |||
19180 | if (done) { | |||
19181 | break; | |||
19182 | } | |||
19183 | Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
19184 | if (!slotPtr) { | |||
19185 | JS_ReportOutOfMemory(cx); | |||
19186 | return false; | |||
19187 | } | |||
19188 | Nullable<Sequence<JS::Value>>& slot = *slotPtr; | |||
19189 | if (temp.isObject()) { | |||
19190 | JS::ForOfIterator iter1(cx); | |||
19191 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
19192 | return false; | |||
19193 | } | |||
19194 | if (!iter1.valueIsIterable()) { | |||
19195 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
19196 | return false; | |||
19197 | } | |||
19198 | Sequence<JS::Value> &arr1 = slot.SetValue(); | |||
19199 | JS::Rooted<JS::Value> temp1(cx); | |||
19200 | while (true) { | |||
19201 | bool done1; | |||
19202 | if (!iter1.next(&temp1, &done1)) { | |||
19203 | return false; | |||
19204 | } | |||
19205 | if (done1) { | |||
19206 | break; | |||
19207 | } | |||
19208 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | |||
19209 | if (!slotPtr1) { | |||
19210 | JS_ReportOutOfMemory(cx); | |||
19211 | return false; | |||
19212 | } | |||
19213 | JS::Value& slot1 = *slotPtr1; | |||
19214 | slot1 = temp1; | |||
19215 | } | |||
19216 | } else if (temp.isNullOrUndefined()) { | |||
19217 | slot.SetNull(); | |||
19218 | } else { | |||
19219 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
19220 | return false; | |||
19221 | } | |||
19222 | } | |||
19223 | } else if (args[0].isNullOrUndefined()) { | |||
19224 | arg0.SetNull(); | |||
19225 | } else { | |||
19226 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
19227 | return false; | |||
19228 | } | |||
19229 | // NOTE: This assert does NOT call the function. | |||
19230 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequenceOfNullableSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19231 | MOZ_KnownLive(self)(self)->PassNullableSequenceOfNullableSequenceOfAny(cx, Constify(arg0)); | |||
19232 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19232); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19232; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19233 | args.rval().setUndefined(); | |||
19234 | return true; | |||
19235 | } | |||
19236 | ||||
19237 | static const JSJitInfo passNullableSequenceOfNullableSequenceOfAny_methodinfo = { | |||
19238 | { (JSJitGetterOp)passNullableSequenceOfNullableSequenceOfAny }, | |||
19239 | { prototypes::id::TestExampleInterface }, | |||
19240 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19241 | JSJitInfo::Method, | |||
19242 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19243 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19244 | false, /* isInfallible. False in setters. */ | |||
19245 | false, /* isMovable. Not relevant for setters. */ | |||
19246 | false, /* isEliminatable. Not relevant for setters. */ | |||
19247 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19248 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19249 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19250 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19251 | }; | |||
19252 | ||||
19253 | MOZ_CAN_RUN_SCRIPT static bool | |||
19254 | passOptionalNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19255 | { | |||
19256 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceOfNullableSequenceOfAny"); | |||
19257 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19260( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
19258 | "TestExampleInterface", "passOptionalNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19260( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
19259 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19260( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
19260 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19260( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfAny", JS:: ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame:: Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
19261 | ||||
19262 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19263 | Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>> arg0; | |||
19264 | Maybe<SequenceRooter<Nullable<Sequence<JS::Value>>>> arg0_holder; | |||
19265 | if (args.hasDefined(0)) { | |||
19266 | arg0.Construct(); | |||
19267 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
19268 | if (args[0].isObject()) { | |||
19269 | JS::ForOfIterator iter(cx); | |||
19270 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
19271 | return false; | |||
19272 | } | |||
19273 | if (!iter.valueIsIterable()) { | |||
19274 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
19275 | return false; | |||
19276 | } | |||
19277 | Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.Value().SetValue(); | |||
19278 | JS::Rooted<JS::Value> temp(cx); | |||
19279 | while (true) { | |||
19280 | bool done; | |||
19281 | if (!iter.next(&temp, &done)) { | |||
19282 | return false; | |||
19283 | } | |||
19284 | if (done) { | |||
19285 | break; | |||
19286 | } | |||
19287 | Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
19288 | if (!slotPtr) { | |||
19289 | JS_ReportOutOfMemory(cx); | |||
19290 | return false; | |||
19291 | } | |||
19292 | Nullable<Sequence<JS::Value>>& slot = *slotPtr; | |||
19293 | if (temp.isObject()) { | |||
19294 | JS::ForOfIterator iter1(cx); | |||
19295 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
19296 | return false; | |||
19297 | } | |||
19298 | if (!iter1.valueIsIterable()) { | |||
19299 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
19300 | return false; | |||
19301 | } | |||
19302 | Sequence<JS::Value> &arr1 = slot.SetValue(); | |||
19303 | JS::Rooted<JS::Value> temp1(cx); | |||
19304 | while (true) { | |||
19305 | bool done1; | |||
19306 | if (!iter1.next(&temp1, &done1)) { | |||
19307 | return false; | |||
19308 | } | |||
19309 | if (done1) { | |||
19310 | break; | |||
19311 | } | |||
19312 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | |||
19313 | if (!slotPtr1) { | |||
19314 | JS_ReportOutOfMemory(cx); | |||
19315 | return false; | |||
19316 | } | |||
19317 | JS::Value& slot1 = *slotPtr1; | |||
19318 | slot1 = temp1; | |||
19319 | } | |||
19320 | } else if (temp.isNullOrUndefined()) { | |||
19321 | slot.SetNull(); | |||
19322 | } else { | |||
19323 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
19324 | return false; | |||
19325 | } | |||
19326 | } | |||
19327 | } else if (args[0].isNullOrUndefined()) { | |||
19328 | arg0.Value().SetNull(); | |||
19329 | } else { | |||
19330 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
19331 | return false; | |||
19332 | } | |||
19333 | } | |||
19334 | // NOTE: This assert does NOT call the function. | |||
19335 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19336 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfAny(cx, Constify(arg0)); | |||
19337 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19337); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19337; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19338 | args.rval().setUndefined(); | |||
19339 | return true; | |||
19340 | } | |||
19341 | ||||
19342 | static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfAny_methodinfo = { | |||
19343 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfAny }, | |||
19344 | { prototypes::id::TestExampleInterface }, | |||
19345 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19346 | JSJitInfo::Method, | |||
19347 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19348 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19349 | false, /* isInfallible. False in setters. */ | |||
19350 | false, /* isMovable. Not relevant for setters. */ | |||
19351 | false, /* isEliminatable. Not relevant for setters. */ | |||
19352 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19353 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19354 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19355 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19356 | }; | |||
19357 | ||||
19358 | MOZ_CAN_RUN_SCRIPT static bool | |||
19359 | passRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19360 | { | |||
19361 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfAny"); | |||
19362 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19365( cx, "TestExampleInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19363 | "TestExampleInterface", "passRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19365( cx, "TestExampleInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19364 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19365( cx, "TestExampleInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19365 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19365( cx, "TestExampleInterface" , "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
19366 | ||||
19367 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19368 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfAny", 1)) { | |||
19369 | return false; | |||
19370 | } | |||
19371 | Record<nsString, JS::Value> arg0; | |||
19372 | RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0); | |||
19373 | if (args[0].isObject()) { | |||
19374 | auto& recordEntries = arg0.Entries(); | |||
19375 | ||||
19376 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
19377 | JS::RootedVector<jsid> ids(cx); | |||
19378 | if (!js::GetPropertyKeys(cx, recordObj, | |||
19379 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
19380 | return false; | |||
19381 | } | |||
19382 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
19383 | JS_ReportOutOfMemory(cx); | |||
19384 | return false; | |||
19385 | } | |||
19386 | JS::Rooted<JS::Value> propNameValue(cx); | |||
19387 | JS::Rooted<JS::Value> temp(cx); | |||
19388 | JS::Rooted<jsid> curId(cx); | |||
19389 | JS::Rooted<JS::Value> idVal(cx); | |||
19390 | // Use a hashset to keep track of ids seen, to avoid | |||
19391 | // introducing nasty O(N^2) behavior scanning for them all the | |||
19392 | // time. Ideally we'd use a data structure with O(1) lookup | |||
19393 | // _and_ ordering for the MozMap, but we don't have one lying | |||
19394 | // around. | |||
19395 | nsTHashtable<nsStringHashKey> idsSeen; | |||
19396 | for (size_t i = 0; i < ids.length(); ++i) { | |||
19397 | curId = ids[i]; | |||
19398 | ||||
19399 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
19400 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
19401 | &desc)) { | |||
19402 | return false; | |||
19403 | } | |||
19404 | ||||
19405 | if (desc.isNothing() || !desc->enumerable()) { | |||
19406 | continue; | |||
19407 | } | |||
19408 | ||||
19409 | idVal = js::IdToValue(curId); | |||
19410 | nsString propName; | |||
19411 | // This will just throw if idVal is a Symbol, like the spec says | |||
19412 | // to do. | |||
19413 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
19414 | return false; | |||
19415 | } | |||
19416 | ||||
19417 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
19418 | return false; | |||
19419 | } | |||
19420 | ||||
19421 | Record<nsString, JS::Value>::EntryType* entry; | |||
19422 | if (!idsSeen.EnsureInserted(propName)) { | |||
19423 | // Find the existing entry. | |||
19424 | auto idx = recordEntries.IndexOf(propName); | |||
19425 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19426); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19426; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
19426 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19426); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19426; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
19427 | // Now blow it away to make it look like it was just added | |||
19428 | // to the array, because it's not obvious that it's | |||
19429 | // safe to write to its already-initialized mValue via our | |||
19430 | // normal codegen conversions. For example, the value | |||
19431 | // could be a union and this would change its type, but | |||
19432 | // codegen assumes we won't do that. | |||
19433 | entry = recordEntries.ReconstructElementAt(idx); | |||
19434 | } else { | |||
19435 | // Safe to do an infallible append here, because we did a | |||
19436 | // SetCapacity above to the right capacity. | |||
19437 | entry = recordEntries.AppendElement(); | |||
19438 | } | |||
19439 | entry->mKey = propName; | |||
19440 | JS::Value& slot = entry->mValue; | |||
19441 | slot = temp; | |||
19442 | } | |||
19443 | } else { | |||
19444 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
19445 | return false; | |||
19446 | } | |||
19447 | // NOTE: This assert does NOT call the function. | |||
19448 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19449 | MOZ_KnownLive(self)(self)->PassRecordOfAny(cx, Constify(arg0)); | |||
19450 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19450); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19450; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19451 | args.rval().setUndefined(); | |||
19452 | return true; | |||
19453 | } | |||
19454 | ||||
19455 | static const JSJitInfo passRecordOfAny_methodinfo = { | |||
19456 | { (JSJitGetterOp)passRecordOfAny }, | |||
19457 | { prototypes::id::TestExampleInterface }, | |||
19458 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19459 | JSJitInfo::Method, | |||
19460 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19461 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19462 | false, /* isInfallible. False in setters. */ | |||
19463 | false, /* isMovable. Not relevant for setters. */ | |||
19464 | false, /* isEliminatable. Not relevant for setters. */ | |||
19465 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19466 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19467 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19468 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19469 | }; | |||
19470 | ||||
19471 | MOZ_CAN_RUN_SCRIPT static bool | |||
19472 | passNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19473 | { | |||
19474 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableRecordOfAny"); | |||
19475 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19478( cx, "TestExampleInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19476 | "TestExampleInterface", "passNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19478( cx, "TestExampleInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19477 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19478( cx, "TestExampleInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19478 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19478( cx, "TestExampleInterface" , "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
19479 | ||||
19480 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19481 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableRecordOfAny", 1)) { | |||
19482 | return false; | |||
19483 | } | |||
19484 | Nullable<Record<nsString, JS::Value>> arg0; | |||
19485 | RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue()); | |||
19486 | if (args[0].isObject()) { | |||
19487 | auto& recordEntries = arg0.SetValue().Entries(); | |||
19488 | ||||
19489 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
19490 | JS::RootedVector<jsid> ids(cx); | |||
19491 | if (!js::GetPropertyKeys(cx, recordObj, | |||
19492 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
19493 | return false; | |||
19494 | } | |||
19495 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
19496 | JS_ReportOutOfMemory(cx); | |||
19497 | return false; | |||
19498 | } | |||
19499 | JS::Rooted<JS::Value> propNameValue(cx); | |||
19500 | JS::Rooted<JS::Value> temp(cx); | |||
19501 | JS::Rooted<jsid> curId(cx); | |||
19502 | JS::Rooted<JS::Value> idVal(cx); | |||
19503 | // Use a hashset to keep track of ids seen, to avoid | |||
19504 | // introducing nasty O(N^2) behavior scanning for them all the | |||
19505 | // time. Ideally we'd use a data structure with O(1) lookup | |||
19506 | // _and_ ordering for the MozMap, but we don't have one lying | |||
19507 | // around. | |||
19508 | nsTHashtable<nsStringHashKey> idsSeen; | |||
19509 | for (size_t i = 0; i < ids.length(); ++i) { | |||
19510 | curId = ids[i]; | |||
19511 | ||||
19512 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
19513 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
19514 | &desc)) { | |||
19515 | return false; | |||
19516 | } | |||
19517 | ||||
19518 | if (desc.isNothing() || !desc->enumerable()) { | |||
19519 | continue; | |||
19520 | } | |||
19521 | ||||
19522 | idVal = js::IdToValue(curId); | |||
19523 | nsString propName; | |||
19524 | // This will just throw if idVal is a Symbol, like the spec says | |||
19525 | // to do. | |||
19526 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
19527 | return false; | |||
19528 | } | |||
19529 | ||||
19530 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
19531 | return false; | |||
19532 | } | |||
19533 | ||||
19534 | Record<nsString, JS::Value>::EntryType* entry; | |||
19535 | if (!idsSeen.EnsureInserted(propName)) { | |||
19536 | // Find the existing entry. | |||
19537 | auto idx = recordEntries.IndexOf(propName); | |||
19538 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19539); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19539; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
19539 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19539); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19539; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
19540 | // Now blow it away to make it look like it was just added | |||
19541 | // to the array, because it's not obvious that it's | |||
19542 | // safe to write to its already-initialized mValue via our | |||
19543 | // normal codegen conversions. For example, the value | |||
19544 | // could be a union and this would change its type, but | |||
19545 | // codegen assumes we won't do that. | |||
19546 | entry = recordEntries.ReconstructElementAt(idx); | |||
19547 | } else { | |||
19548 | // Safe to do an infallible append here, because we did a | |||
19549 | // SetCapacity above to the right capacity. | |||
19550 | entry = recordEntries.AppendElement(); | |||
19551 | } | |||
19552 | entry->mKey = propName; | |||
19553 | JS::Value& slot = entry->mValue; | |||
19554 | slot = temp; | |||
19555 | } | |||
19556 | } else if (args[0].isNullOrUndefined()) { | |||
19557 | arg0.SetNull(); | |||
19558 | } else { | |||
19559 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
19560 | return false; | |||
19561 | } | |||
19562 | // NOTE: This assert does NOT call the function. | |||
19563 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19564 | MOZ_KnownLive(self)(self)->PassNullableRecordOfAny(cx, Constify(arg0)); | |||
19565 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19565); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19565; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19566 | args.rval().setUndefined(); | |||
19567 | return true; | |||
19568 | } | |||
19569 | ||||
19570 | static const JSJitInfo passNullableRecordOfAny_methodinfo = { | |||
19571 | { (JSJitGetterOp)passNullableRecordOfAny }, | |||
19572 | { prototypes::id::TestExampleInterface }, | |||
19573 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19574 | JSJitInfo::Method, | |||
19575 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19576 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19577 | false, /* isInfallible. False in setters. */ | |||
19578 | false, /* isMovable. Not relevant for setters. */ | |||
19579 | false, /* isEliminatable. Not relevant for setters. */ | |||
19580 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19581 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19582 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19583 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19584 | }; | |||
19585 | ||||
19586 | MOZ_CAN_RUN_SCRIPT static bool | |||
19587 | passOptionalRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19588 | { | |||
19589 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalRecordOfAny"); | |||
19590 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19593( cx, "TestExampleInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19591 | "TestExampleInterface", "passOptionalRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19593( cx, "TestExampleInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19592 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19593( cx, "TestExampleInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19593 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19593( cx, "TestExampleInterface" , "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
19594 | ||||
19595 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19596 | Optional<Record<nsString, JS::Value>> arg0; | |||
19597 | Maybe<RecordRooter<nsString, JS::Value>> arg0_holder; | |||
19598 | if (args.hasDefined(0)) { | |||
19599 | arg0.Construct(); | |||
19600 | arg0_holder.emplace(cx, &arg0.Value()); | |||
19601 | if (args[0].isObject()) { | |||
19602 | auto& recordEntries = arg0.Value().Entries(); | |||
19603 | ||||
19604 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
19605 | JS::RootedVector<jsid> ids(cx); | |||
19606 | if (!js::GetPropertyKeys(cx, recordObj, | |||
19607 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
19608 | return false; | |||
19609 | } | |||
19610 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
19611 | JS_ReportOutOfMemory(cx); | |||
19612 | return false; | |||
19613 | } | |||
19614 | JS::Rooted<JS::Value> propNameValue(cx); | |||
19615 | JS::Rooted<JS::Value> temp(cx); | |||
19616 | JS::Rooted<jsid> curId(cx); | |||
19617 | JS::Rooted<JS::Value> idVal(cx); | |||
19618 | // Use a hashset to keep track of ids seen, to avoid | |||
19619 | // introducing nasty O(N^2) behavior scanning for them all the | |||
19620 | // time. Ideally we'd use a data structure with O(1) lookup | |||
19621 | // _and_ ordering for the MozMap, but we don't have one lying | |||
19622 | // around. | |||
19623 | nsTHashtable<nsStringHashKey> idsSeen; | |||
19624 | for (size_t i = 0; i < ids.length(); ++i) { | |||
19625 | curId = ids[i]; | |||
19626 | ||||
19627 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
19628 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
19629 | &desc)) { | |||
19630 | return false; | |||
19631 | } | |||
19632 | ||||
19633 | if (desc.isNothing() || !desc->enumerable()) { | |||
19634 | continue; | |||
19635 | } | |||
19636 | ||||
19637 | idVal = js::IdToValue(curId); | |||
19638 | nsString propName; | |||
19639 | // This will just throw if idVal is a Symbol, like the spec says | |||
19640 | // to do. | |||
19641 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
19642 | return false; | |||
19643 | } | |||
19644 | ||||
19645 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
19646 | return false; | |||
19647 | } | |||
19648 | ||||
19649 | Record<nsString, JS::Value>::EntryType* entry; | |||
19650 | if (!idsSeen.EnsureInserted(propName)) { | |||
19651 | // Find the existing entry. | |||
19652 | auto idx = recordEntries.IndexOf(propName); | |||
19653 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19654); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19654; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
19654 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19654); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19654; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
19655 | // Now blow it away to make it look like it was just added | |||
19656 | // to the array, because it's not obvious that it's | |||
19657 | // safe to write to its already-initialized mValue via our | |||
19658 | // normal codegen conversions. For example, the value | |||
19659 | // could be a union and this would change its type, but | |||
19660 | // codegen assumes we won't do that. | |||
19661 | entry = recordEntries.ReconstructElementAt(idx); | |||
19662 | } else { | |||
19663 | // Safe to do an infallible append here, because we did a | |||
19664 | // SetCapacity above to the right capacity. | |||
19665 | entry = recordEntries.AppendElement(); | |||
19666 | } | |||
19667 | entry->mKey = propName; | |||
19668 | JS::Value& slot = entry->mValue; | |||
19669 | slot = temp; | |||
19670 | } | |||
19671 | } else { | |||
19672 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
19673 | return false; | |||
19674 | } | |||
19675 | } | |||
19676 | // NOTE: This assert does NOT call the function. | |||
19677 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19678 | MOZ_KnownLive(self)(self)->PassOptionalRecordOfAny(cx, Constify(arg0)); | |||
19679 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19679); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19679; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19680 | args.rval().setUndefined(); | |||
19681 | return true; | |||
19682 | } | |||
19683 | ||||
19684 | static const JSJitInfo passOptionalRecordOfAny_methodinfo = { | |||
19685 | { (JSJitGetterOp)passOptionalRecordOfAny }, | |||
19686 | { prototypes::id::TestExampleInterface }, | |||
19687 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19688 | JSJitInfo::Method, | |||
19689 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19690 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19691 | false, /* isInfallible. False in setters. */ | |||
19692 | false, /* isMovable. Not relevant for setters. */ | |||
19693 | false, /* isEliminatable. Not relevant for setters. */ | |||
19694 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19695 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19696 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19697 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19698 | }; | |||
19699 | ||||
19700 | MOZ_CAN_RUN_SCRIPT static bool | |||
19701 | passOptionalNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19702 | { | |||
19703 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableRecordOfAny"); | |||
19704 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19707( cx, "TestExampleInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19705 | "TestExampleInterface", "passOptionalNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19707( cx, "TestExampleInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19706 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19707( cx, "TestExampleInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19707 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19707( cx, "TestExampleInterface" , "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
19708 | ||||
19709 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19710 | Optional<Nullable<Record<nsString, JS::Value>>> arg0; | |||
19711 | Maybe<RecordRooter<nsString, JS::Value>> arg0_holder; | |||
19712 | if (args.hasDefined(0)) { | |||
19713 | arg0.Construct(); | |||
19714 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
19715 | if (args[0].isObject()) { | |||
19716 | auto& recordEntries = arg0.Value().SetValue().Entries(); | |||
19717 | ||||
19718 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
19719 | JS::RootedVector<jsid> ids(cx); | |||
19720 | if (!js::GetPropertyKeys(cx, recordObj, | |||
19721 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
19722 | return false; | |||
19723 | } | |||
19724 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
19725 | JS_ReportOutOfMemory(cx); | |||
19726 | return false; | |||
19727 | } | |||
19728 | JS::Rooted<JS::Value> propNameValue(cx); | |||
19729 | JS::Rooted<JS::Value> temp(cx); | |||
19730 | JS::Rooted<jsid> curId(cx); | |||
19731 | JS::Rooted<JS::Value> idVal(cx); | |||
19732 | // Use a hashset to keep track of ids seen, to avoid | |||
19733 | // introducing nasty O(N^2) behavior scanning for them all the | |||
19734 | // time. Ideally we'd use a data structure with O(1) lookup | |||
19735 | // _and_ ordering for the MozMap, but we don't have one lying | |||
19736 | // around. | |||
19737 | nsTHashtable<nsStringHashKey> idsSeen; | |||
19738 | for (size_t i = 0; i < ids.length(); ++i) { | |||
19739 | curId = ids[i]; | |||
19740 | ||||
19741 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
19742 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
19743 | &desc)) { | |||
19744 | return false; | |||
19745 | } | |||
19746 | ||||
19747 | if (desc.isNothing() || !desc->enumerable()) { | |||
19748 | continue; | |||
19749 | } | |||
19750 | ||||
19751 | idVal = js::IdToValue(curId); | |||
19752 | nsString propName; | |||
19753 | // This will just throw if idVal is a Symbol, like the spec says | |||
19754 | // to do. | |||
19755 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
19756 | return false; | |||
19757 | } | |||
19758 | ||||
19759 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
19760 | return false; | |||
19761 | } | |||
19762 | ||||
19763 | Record<nsString, JS::Value>::EntryType* entry; | |||
19764 | if (!idsSeen.EnsureInserted(propName)) { | |||
19765 | // Find the existing entry. | |||
19766 | auto idx = recordEntries.IndexOf(propName); | |||
19767 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19768); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19768; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
19768 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19768); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19768; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
19769 | // Now blow it away to make it look like it was just added | |||
19770 | // to the array, because it's not obvious that it's | |||
19771 | // safe to write to its already-initialized mValue via our | |||
19772 | // normal codegen conversions. For example, the value | |||
19773 | // could be a union and this would change its type, but | |||
19774 | // codegen assumes we won't do that. | |||
19775 | entry = recordEntries.ReconstructElementAt(idx); | |||
19776 | } else { | |||
19777 | // Safe to do an infallible append here, because we did a | |||
19778 | // SetCapacity above to the right capacity. | |||
19779 | entry = recordEntries.AppendElement(); | |||
19780 | } | |||
19781 | entry->mKey = propName; | |||
19782 | JS::Value& slot = entry->mValue; | |||
19783 | slot = temp; | |||
19784 | } | |||
19785 | } else if (args[0].isNullOrUndefined()) { | |||
19786 | arg0.Value().SetNull(); | |||
19787 | } else { | |||
19788 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
19789 | return false; | |||
19790 | } | |||
19791 | } | |||
19792 | // NOTE: This assert does NOT call the function. | |||
19793 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19794 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfAny(cx, Constify(arg0)); | |||
19795 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19795); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19795; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19796 | args.rval().setUndefined(); | |||
19797 | return true; | |||
19798 | } | |||
19799 | ||||
19800 | static const JSJitInfo passOptionalNullableRecordOfAny_methodinfo = { | |||
19801 | { (JSJitGetterOp)passOptionalNullableRecordOfAny }, | |||
19802 | { prototypes::id::TestExampleInterface }, | |||
19803 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19804 | JSJitInfo::Method, | |||
19805 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19806 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19807 | false, /* isInfallible. False in setters. */ | |||
19808 | false, /* isMovable. Not relevant for setters. */ | |||
19809 | false, /* isEliminatable. Not relevant for setters. */ | |||
19810 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19811 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19812 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19813 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19814 | }; | |||
19815 | ||||
19816 | MOZ_CAN_RUN_SCRIPT static bool | |||
19817 | passOptionalRecordOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19818 | { | |||
19819 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalRecordOfAnyWithDefaultValue"); | |||
19820 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19823( cx, "TestExampleInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19821 | "TestExampleInterface", "passOptionalRecordOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19823( cx, "TestExampleInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19822 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19823( cx, "TestExampleInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
19823 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19823( cx, "TestExampleInterface" , "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
19824 | ||||
19825 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19826 | Nullable<Record<nsString, JS::Value>> arg0; | |||
19827 | RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue()); | |||
19828 | if (args.hasDefined(0)) { | |||
19829 | if (args[0].isObject()) { | |||
19830 | auto& recordEntries = arg0.SetValue().Entries(); | |||
19831 | ||||
19832 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
19833 | JS::RootedVector<jsid> ids(cx); | |||
19834 | if (!js::GetPropertyKeys(cx, recordObj, | |||
19835 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
19836 | return false; | |||
19837 | } | |||
19838 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
19839 | JS_ReportOutOfMemory(cx); | |||
19840 | return false; | |||
19841 | } | |||
19842 | JS::Rooted<JS::Value> propNameValue(cx); | |||
19843 | JS::Rooted<JS::Value> temp(cx); | |||
19844 | JS::Rooted<jsid> curId(cx); | |||
19845 | JS::Rooted<JS::Value> idVal(cx); | |||
19846 | // Use a hashset to keep track of ids seen, to avoid | |||
19847 | // introducing nasty O(N^2) behavior scanning for them all the | |||
19848 | // time. Ideally we'd use a data structure with O(1) lookup | |||
19849 | // _and_ ordering for the MozMap, but we don't have one lying | |||
19850 | // around. | |||
19851 | nsTHashtable<nsStringHashKey> idsSeen; | |||
19852 | for (size_t i = 0; i < ids.length(); ++i) { | |||
19853 | curId = ids[i]; | |||
19854 | ||||
19855 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
19856 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
19857 | &desc)) { | |||
19858 | return false; | |||
19859 | } | |||
19860 | ||||
19861 | if (desc.isNothing() || !desc->enumerable()) { | |||
19862 | continue; | |||
19863 | } | |||
19864 | ||||
19865 | idVal = js::IdToValue(curId); | |||
19866 | nsString propName; | |||
19867 | // This will just throw if idVal is a Symbol, like the spec says | |||
19868 | // to do. | |||
19869 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
19870 | return false; | |||
19871 | } | |||
19872 | ||||
19873 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
19874 | return false; | |||
19875 | } | |||
19876 | ||||
19877 | Record<nsString, JS::Value>::EntryType* entry; | |||
19878 | if (!idsSeen.EnsureInserted(propName)) { | |||
19879 | // Find the existing entry. | |||
19880 | auto idx = recordEntries.IndexOf(propName); | |||
19881 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19882); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19882; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
19882 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 19882); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 19882; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
19883 | // Now blow it away to make it look like it was just added | |||
19884 | // to the array, because it's not obvious that it's | |||
19885 | // safe to write to its already-initialized mValue via our | |||
19886 | // normal codegen conversions. For example, the value | |||
19887 | // could be a union and this would change its type, but | |||
19888 | // codegen assumes we won't do that. | |||
19889 | entry = recordEntries.ReconstructElementAt(idx); | |||
19890 | } else { | |||
19891 | // Safe to do an infallible append here, because we did a | |||
19892 | // SetCapacity above to the right capacity. | |||
19893 | entry = recordEntries.AppendElement(); | |||
19894 | } | |||
19895 | entry->mKey = propName; | |||
19896 | JS::Value& slot = entry->mValue; | |||
19897 | slot = temp; | |||
19898 | } | |||
19899 | } else if (args[0].isNullOrUndefined()) { | |||
19900 | arg0.SetNull(); | |||
19901 | } else { | |||
19902 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
19903 | return false; | |||
19904 | } | |||
19905 | } else { | |||
19906 | arg0.SetNull(); | |||
19907 | } | |||
19908 | // NOTE: This assert does NOT call the function. | |||
19909 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecordOfAnyWithDefaultValue(cx, Constify(arg0)))>, "Should be returning void here"); | |||
19910 | MOZ_KnownLive(self)(self)->PassOptionalRecordOfAnyWithDefaultValue(cx, Constify(arg0)); | |||
19911 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 19911); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 19911; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
19912 | args.rval().setUndefined(); | |||
19913 | return true; | |||
19914 | } | |||
19915 | ||||
19916 | static const JSJitInfo passOptionalRecordOfAnyWithDefaultValue_methodinfo = { | |||
19917 | { (JSJitGetterOp)passOptionalRecordOfAnyWithDefaultValue }, | |||
19918 | { prototypes::id::TestExampleInterface }, | |||
19919 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
19920 | JSJitInfo::Method, | |||
19921 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
19922 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
19923 | false, /* isInfallible. False in setters. */ | |||
19924 | false, /* isMovable. Not relevant for setters. */ | |||
19925 | false, /* isEliminatable. Not relevant for setters. */ | |||
19926 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
19927 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
19928 | false, /* isTypedMethod. Only relevant for methods. */ | |||
19929 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
19930 | }; | |||
19931 | ||||
19932 | MOZ_CAN_RUN_SCRIPT static bool | |||
19933 | passRecordOfRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
19934 | { | |||
19935 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfRecordOfAny"); | |||
19936 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19939( cx, "TestExampleInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19937 | "TestExampleInterface", "passRecordOfRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19939( cx, "TestExampleInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19938 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19939( cx, "TestExampleInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
19939 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19939( cx, "TestExampleInterface" , "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
19940 | ||||
19941 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
19942 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfRecordOfAny", 1)) { | |||
19943 | return false; | |||
19944 | } | |||
19945 | Record<nsString, Record<nsString, JS::Value>> arg0; | |||
19946 | RecordRooter<nsString, Record<nsString, JS::Value>> arg0_holder(cx, &arg0); | |||
19947 | if (args[0].isObject()) { | |||
19948 | auto& recordEntries = arg0.Entries(); | |||
19949 | ||||
19950 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
19951 | JS::RootedVector<jsid> ids(cx); | |||
19952 | if (!js::GetPropertyKeys(cx, recordObj, | |||
19953 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
19954 | return false; | |||
19955 | } | |||
19956 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
19957 | JS_ReportOutOfMemory(cx); | |||
19958 | return false; | |||
19959 | } | |||
19960 | JS::Rooted<JS::Value> propNameValue(cx); | |||
19961 | JS::Rooted<JS::Value> temp(cx); | |||
19962 | JS::Rooted<jsid> curId(cx); | |||
19963 | JS::Rooted<JS::Value> idVal(cx); | |||
19964 | // Use a hashset to keep track of ids seen, to avoid | |||
19965 | // introducing nasty O(N^2) behavior scanning for them all the | |||
19966 | // time. Ideally we'd use a data structure with O(1) lookup | |||
19967 | // _and_ ordering for the MozMap, but we don't have one lying | |||
19968 | // around. | |||
19969 | nsTHashtable<nsStringHashKey> idsSeen; | |||
19970 | for (size_t i = 0; i < ids.length(); ++i) { | |||
19971 | curId = ids[i]; | |||
19972 | ||||
19973 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
19974 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
19975 | &desc)) { | |||
19976 | return false; | |||
19977 | } | |||
19978 | ||||
19979 | if (desc.isNothing() || !desc->enumerable()) { | |||
19980 | continue; | |||
19981 | } | |||
19982 | ||||
19983 | idVal = js::IdToValue(curId); | |||
19984 | nsString propName; | |||
19985 | // This will just throw if idVal is a Symbol, like the spec says | |||
19986 | // to do. | |||
19987 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
19988 | return false; | |||
19989 | } | |||
19990 | ||||
19991 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
19992 | return false; | |||
19993 | } | |||
19994 | ||||
19995 | Record<nsString, Record<nsString, JS::Value>>::EntryType* entry; | |||
19996 | if (!idsSeen.EnsureInserted(propName)) { | |||
19997 | // Find the existing entry. | |||
19998 | auto idx = recordEntries.IndexOf(propName); | |||
19999 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20000); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20000; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20000 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20000); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20000; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20001 | // Now blow it away to make it look like it was just added | |||
20002 | // to the array, because it's not obvious that it's | |||
20003 | // safe to write to its already-initialized mValue via our | |||
20004 | // normal codegen conversions. For example, the value | |||
20005 | // could be a union and this would change its type, but | |||
20006 | // codegen assumes we won't do that. | |||
20007 | entry = recordEntries.ReconstructElementAt(idx); | |||
20008 | } else { | |||
20009 | // Safe to do an infallible append here, because we did a | |||
20010 | // SetCapacity above to the right capacity. | |||
20011 | entry = recordEntries.AppendElement(); | |||
20012 | } | |||
20013 | entry->mKey = propName; | |||
20014 | Record<nsString, JS::Value>& slot = entry->mValue; | |||
20015 | if (temp.isObject()) { | |||
20016 | auto& recordEntries = slot.Entries(); | |||
20017 | ||||
20018 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | |||
20019 | JS::RootedVector<jsid> ids(cx); | |||
20020 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20021 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20022 | return false; | |||
20023 | } | |||
20024 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20025 | JS_ReportOutOfMemory(cx); | |||
20026 | return false; | |||
20027 | } | |||
20028 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20029 | JS::Rooted<JS::Value> temp(cx); | |||
20030 | JS::Rooted<jsid> curId(cx); | |||
20031 | JS::Rooted<JS::Value> idVal(cx); | |||
20032 | // Use a hashset to keep track of ids seen, to avoid | |||
20033 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20034 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20035 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20036 | // around. | |||
20037 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20038 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20039 | curId = ids[i]; | |||
20040 | ||||
20041 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20042 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20043 | &desc)) { | |||
20044 | return false; | |||
20045 | } | |||
20046 | ||||
20047 | if (desc.isNothing() || !desc->enumerable()) { | |||
20048 | continue; | |||
20049 | } | |||
20050 | ||||
20051 | idVal = js::IdToValue(curId); | |||
20052 | nsString propName; | |||
20053 | // This will just throw if idVal is a Symbol, like the spec says | |||
20054 | // to do. | |||
20055 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | |||
20056 | return false; | |||
20057 | } | |||
20058 | ||||
20059 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20060 | return false; | |||
20061 | } | |||
20062 | ||||
20063 | Record<nsString, JS::Value>::EntryType* entry; | |||
20064 | if (!idsSeen.EnsureInserted(propName)) { | |||
20065 | // Find the existing entry. | |||
20066 | auto idx = recordEntries.IndexOf(propName); | |||
20067 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20068); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20068; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20068 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20068); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20068; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20069 | // Now blow it away to make it look like it was just added | |||
20070 | // to the array, because it's not obvious that it's | |||
20071 | // safe to write to its already-initialized mValue via our | |||
20072 | // normal codegen conversions. For example, the value | |||
20073 | // could be a union and this would change its type, but | |||
20074 | // codegen assumes we won't do that. | |||
20075 | entry = recordEntries.ReconstructElementAt(idx); | |||
20076 | } else { | |||
20077 | // Safe to do an infallible append here, because we did a | |||
20078 | // SetCapacity above to the right capacity. | |||
20079 | entry = recordEntries.AppendElement(); | |||
20080 | } | |||
20081 | entry->mKey = propName; | |||
20082 | JS::Value& slot = entry->mValue; | |||
20083 | slot = temp; | |||
20084 | } | |||
20085 | } else { | |||
20086 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
20087 | return false; | |||
20088 | } | |||
20089 | } | |||
20090 | } else { | |||
20091 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
20092 | return false; | |||
20093 | } | |||
20094 | // NOTE: This assert does NOT call the function. | |||
20095 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
20096 | MOZ_KnownLive(self)(self)->PassRecordOfRecordOfAny(cx, Constify(arg0)); | |||
20097 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 20097); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20097; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
20098 | args.rval().setUndefined(); | |||
20099 | return true; | |||
20100 | } | |||
20101 | ||||
20102 | static const JSJitInfo passRecordOfRecordOfAny_methodinfo = { | |||
20103 | { (JSJitGetterOp)passRecordOfRecordOfAny }, | |||
20104 | { prototypes::id::TestExampleInterface }, | |||
20105 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
20106 | JSJitInfo::Method, | |||
20107 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
20108 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
20109 | false, /* isInfallible. False in setters. */ | |||
20110 | false, /* isMovable. Not relevant for setters. */ | |||
20111 | false, /* isEliminatable. Not relevant for setters. */ | |||
20112 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
20113 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
20114 | false, /* isTypedMethod. Only relevant for methods. */ | |||
20115 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
20116 | }; | |||
20117 | ||||
20118 | MOZ_CAN_RUN_SCRIPT static bool | |||
20119 | passRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
20120 | { | |||
20121 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfNullableRecordOfAny"); | |||
20122 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20125( cx, "TestExampleInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20123 | "TestExampleInterface", "passRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20125( cx, "TestExampleInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20124 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20125( cx, "TestExampleInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20125 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20125( cx, "TestExampleInterface" , "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
20126 | ||||
20127 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
20128 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfNullableRecordOfAny", 1)) { | |||
20129 | return false; | |||
20130 | } | |||
20131 | Record<nsString, Nullable<Record<nsString, JS::Value>>> arg0; | |||
20132 | RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0); | |||
20133 | if (args[0].isObject()) { | |||
20134 | auto& recordEntries = arg0.Entries(); | |||
20135 | ||||
20136 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
20137 | JS::RootedVector<jsid> ids(cx); | |||
20138 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20139 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20140 | return false; | |||
20141 | } | |||
20142 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20143 | JS_ReportOutOfMemory(cx); | |||
20144 | return false; | |||
20145 | } | |||
20146 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20147 | JS::Rooted<JS::Value> temp(cx); | |||
20148 | JS::Rooted<jsid> curId(cx); | |||
20149 | JS::Rooted<JS::Value> idVal(cx); | |||
20150 | // Use a hashset to keep track of ids seen, to avoid | |||
20151 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20152 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20153 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20154 | // around. | |||
20155 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20156 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20157 | curId = ids[i]; | |||
20158 | ||||
20159 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20160 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20161 | &desc)) { | |||
20162 | return false; | |||
20163 | } | |||
20164 | ||||
20165 | if (desc.isNothing() || !desc->enumerable()) { | |||
20166 | continue; | |||
20167 | } | |||
20168 | ||||
20169 | idVal = js::IdToValue(curId); | |||
20170 | nsString propName; | |||
20171 | // This will just throw if idVal is a Symbol, like the spec says | |||
20172 | // to do. | |||
20173 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
20174 | return false; | |||
20175 | } | |||
20176 | ||||
20177 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20178 | return false; | |||
20179 | } | |||
20180 | ||||
20181 | Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry; | |||
20182 | if (!idsSeen.EnsureInserted(propName)) { | |||
20183 | // Find the existing entry. | |||
20184 | auto idx = recordEntries.IndexOf(propName); | |||
20185 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20186); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20186; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20186 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20186); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20186; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20187 | // Now blow it away to make it look like it was just added | |||
20188 | // to the array, because it's not obvious that it's | |||
20189 | // safe to write to its already-initialized mValue via our | |||
20190 | // normal codegen conversions. For example, the value | |||
20191 | // could be a union and this would change its type, but | |||
20192 | // codegen assumes we won't do that. | |||
20193 | entry = recordEntries.ReconstructElementAt(idx); | |||
20194 | } else { | |||
20195 | // Safe to do an infallible append here, because we did a | |||
20196 | // SetCapacity above to the right capacity. | |||
20197 | entry = recordEntries.AppendElement(); | |||
20198 | } | |||
20199 | entry->mKey = propName; | |||
20200 | Nullable<Record<nsString, JS::Value>>& slot = entry->mValue; | |||
20201 | if (temp.isObject()) { | |||
20202 | auto& recordEntries = slot.SetValue().Entries(); | |||
20203 | ||||
20204 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | |||
20205 | JS::RootedVector<jsid> ids(cx); | |||
20206 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20207 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20208 | return false; | |||
20209 | } | |||
20210 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20211 | JS_ReportOutOfMemory(cx); | |||
20212 | return false; | |||
20213 | } | |||
20214 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20215 | JS::Rooted<JS::Value> temp(cx); | |||
20216 | JS::Rooted<jsid> curId(cx); | |||
20217 | JS::Rooted<JS::Value> idVal(cx); | |||
20218 | // Use a hashset to keep track of ids seen, to avoid | |||
20219 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20220 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20221 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20222 | // around. | |||
20223 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20224 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20225 | curId = ids[i]; | |||
20226 | ||||
20227 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20228 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20229 | &desc)) { | |||
20230 | return false; | |||
20231 | } | |||
20232 | ||||
20233 | if (desc.isNothing() || !desc->enumerable()) { | |||
20234 | continue; | |||
20235 | } | |||
20236 | ||||
20237 | idVal = js::IdToValue(curId); | |||
20238 | nsString propName; | |||
20239 | // This will just throw if idVal is a Symbol, like the spec says | |||
20240 | // to do. | |||
20241 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | |||
20242 | return false; | |||
20243 | } | |||
20244 | ||||
20245 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20246 | return false; | |||
20247 | } | |||
20248 | ||||
20249 | Record<nsString, JS::Value>::EntryType* entry; | |||
20250 | if (!idsSeen.EnsureInserted(propName)) { | |||
20251 | // Find the existing entry. | |||
20252 | auto idx = recordEntries.IndexOf(propName); | |||
20253 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20254); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20254; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20254 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20254); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20254; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20255 | // Now blow it away to make it look like it was just added | |||
20256 | // to the array, because it's not obvious that it's | |||
20257 | // safe to write to its already-initialized mValue via our | |||
20258 | // normal codegen conversions. For example, the value | |||
20259 | // could be a union and this would change its type, but | |||
20260 | // codegen assumes we won't do that. | |||
20261 | entry = recordEntries.ReconstructElementAt(idx); | |||
20262 | } else { | |||
20263 | // Safe to do an infallible append here, because we did a | |||
20264 | // SetCapacity above to the right capacity. | |||
20265 | entry = recordEntries.AppendElement(); | |||
20266 | } | |||
20267 | entry->mKey = propName; | |||
20268 | JS::Value& slot = entry->mValue; | |||
20269 | slot = temp; | |||
20270 | } | |||
20271 | } else if (temp.isNullOrUndefined()) { | |||
20272 | slot.SetNull(); | |||
20273 | } else { | |||
20274 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
20275 | return false; | |||
20276 | } | |||
20277 | } | |||
20278 | } else { | |||
20279 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
20280 | return false; | |||
20281 | } | |||
20282 | // NOTE: This assert does NOT call the function. | |||
20283 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfNullableRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
20284 | MOZ_KnownLive(self)(self)->PassRecordOfNullableRecordOfAny(cx, Constify(arg0)); | |||
20285 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 20285); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20285; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
20286 | args.rval().setUndefined(); | |||
20287 | return true; | |||
20288 | } | |||
20289 | ||||
20290 | static const JSJitInfo passRecordOfNullableRecordOfAny_methodinfo = { | |||
20291 | { (JSJitGetterOp)passRecordOfNullableRecordOfAny }, | |||
20292 | { prototypes::id::TestExampleInterface }, | |||
20293 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
20294 | JSJitInfo::Method, | |||
20295 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
20296 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
20297 | false, /* isInfallible. False in setters. */ | |||
20298 | false, /* isMovable. Not relevant for setters. */ | |||
20299 | false, /* isEliminatable. Not relevant for setters. */ | |||
20300 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
20301 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
20302 | false, /* isTypedMethod. Only relevant for methods. */ | |||
20303 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
20304 | }; | |||
20305 | ||||
20306 | MOZ_CAN_RUN_SCRIPT static bool | |||
20307 | passNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
20308 | { | |||
20309 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableRecordOfNullableRecordOfAny"); | |||
20310 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20313( cx, "TestExampleInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20311 | "TestExampleInterface", "passNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20313( cx, "TestExampleInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20312 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20313( cx, "TestExampleInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20313 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20313( cx, "TestExampleInterface" , "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
20314 | ||||
20315 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
20316 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableRecordOfNullableRecordOfAny", 1)) { | |||
20317 | return false; | |||
20318 | } | |||
20319 | Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>> arg0; | |||
20320 | RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0.SetValue()); | |||
20321 | if (args[0].isObject()) { | |||
20322 | auto& recordEntries = arg0.SetValue().Entries(); | |||
20323 | ||||
20324 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
20325 | JS::RootedVector<jsid> ids(cx); | |||
20326 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20327 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20328 | return false; | |||
20329 | } | |||
20330 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20331 | JS_ReportOutOfMemory(cx); | |||
20332 | return false; | |||
20333 | } | |||
20334 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20335 | JS::Rooted<JS::Value> temp(cx); | |||
20336 | JS::Rooted<jsid> curId(cx); | |||
20337 | JS::Rooted<JS::Value> idVal(cx); | |||
20338 | // Use a hashset to keep track of ids seen, to avoid | |||
20339 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20340 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20341 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20342 | // around. | |||
20343 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20344 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20345 | curId = ids[i]; | |||
20346 | ||||
20347 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20348 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20349 | &desc)) { | |||
20350 | return false; | |||
20351 | } | |||
20352 | ||||
20353 | if (desc.isNothing() || !desc->enumerable()) { | |||
20354 | continue; | |||
20355 | } | |||
20356 | ||||
20357 | idVal = js::IdToValue(curId); | |||
20358 | nsString propName; | |||
20359 | // This will just throw if idVal is a Symbol, like the spec says | |||
20360 | // to do. | |||
20361 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
20362 | return false; | |||
20363 | } | |||
20364 | ||||
20365 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20366 | return false; | |||
20367 | } | |||
20368 | ||||
20369 | Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry; | |||
20370 | if (!idsSeen.EnsureInserted(propName)) { | |||
20371 | // Find the existing entry. | |||
20372 | auto idx = recordEntries.IndexOf(propName); | |||
20373 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20374); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20374; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20374 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20374); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20374; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20375 | // Now blow it away to make it look like it was just added | |||
20376 | // to the array, because it's not obvious that it's | |||
20377 | // safe to write to its already-initialized mValue via our | |||
20378 | // normal codegen conversions. For example, the value | |||
20379 | // could be a union and this would change its type, but | |||
20380 | // codegen assumes we won't do that. | |||
20381 | entry = recordEntries.ReconstructElementAt(idx); | |||
20382 | } else { | |||
20383 | // Safe to do an infallible append here, because we did a | |||
20384 | // SetCapacity above to the right capacity. | |||
20385 | entry = recordEntries.AppendElement(); | |||
20386 | } | |||
20387 | entry->mKey = propName; | |||
20388 | Nullable<Record<nsString, JS::Value>>& slot = entry->mValue; | |||
20389 | if (temp.isObject()) { | |||
20390 | auto& recordEntries = slot.SetValue().Entries(); | |||
20391 | ||||
20392 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | |||
20393 | JS::RootedVector<jsid> ids(cx); | |||
20394 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20395 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20396 | return false; | |||
20397 | } | |||
20398 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20399 | JS_ReportOutOfMemory(cx); | |||
20400 | return false; | |||
20401 | } | |||
20402 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20403 | JS::Rooted<JS::Value> temp(cx); | |||
20404 | JS::Rooted<jsid> curId(cx); | |||
20405 | JS::Rooted<JS::Value> idVal(cx); | |||
20406 | // Use a hashset to keep track of ids seen, to avoid | |||
20407 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20408 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20409 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20410 | // around. | |||
20411 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20412 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20413 | curId = ids[i]; | |||
20414 | ||||
20415 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20416 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20417 | &desc)) { | |||
20418 | return false; | |||
20419 | } | |||
20420 | ||||
20421 | if (desc.isNothing() || !desc->enumerable()) { | |||
20422 | continue; | |||
20423 | } | |||
20424 | ||||
20425 | idVal = js::IdToValue(curId); | |||
20426 | nsString propName; | |||
20427 | // This will just throw if idVal is a Symbol, like the spec says | |||
20428 | // to do. | |||
20429 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | |||
20430 | return false; | |||
20431 | } | |||
20432 | ||||
20433 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20434 | return false; | |||
20435 | } | |||
20436 | ||||
20437 | Record<nsString, JS::Value>::EntryType* entry; | |||
20438 | if (!idsSeen.EnsureInserted(propName)) { | |||
20439 | // Find the existing entry. | |||
20440 | auto idx = recordEntries.IndexOf(propName); | |||
20441 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20442); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20442; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20442 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20442); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20442; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20443 | // Now blow it away to make it look like it was just added | |||
20444 | // to the array, because it's not obvious that it's | |||
20445 | // safe to write to its already-initialized mValue via our | |||
20446 | // normal codegen conversions. For example, the value | |||
20447 | // could be a union and this would change its type, but | |||
20448 | // codegen assumes we won't do that. | |||
20449 | entry = recordEntries.ReconstructElementAt(idx); | |||
20450 | } else { | |||
20451 | // Safe to do an infallible append here, because we did a | |||
20452 | // SetCapacity above to the right capacity. | |||
20453 | entry = recordEntries.AppendElement(); | |||
20454 | } | |||
20455 | entry->mKey = propName; | |||
20456 | JS::Value& slot = entry->mValue; | |||
20457 | slot = temp; | |||
20458 | } | |||
20459 | } else if (temp.isNullOrUndefined()) { | |||
20460 | slot.SetNull(); | |||
20461 | } else { | |||
20462 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
20463 | return false; | |||
20464 | } | |||
20465 | } | |||
20466 | } else if (args[0].isNullOrUndefined()) { | |||
20467 | arg0.SetNull(); | |||
20468 | } else { | |||
20469 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
20470 | return false; | |||
20471 | } | |||
20472 | // NOTE: This assert does NOT call the function. | |||
20473 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableRecordOfNullableRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
20474 | MOZ_KnownLive(self)(self)->PassNullableRecordOfNullableRecordOfAny(cx, Constify(arg0)); | |||
20475 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 20475); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20475; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
20476 | args.rval().setUndefined(); | |||
20477 | return true; | |||
20478 | } | |||
20479 | ||||
20480 | static const JSJitInfo passNullableRecordOfNullableRecordOfAny_methodinfo = { | |||
20481 | { (JSJitGetterOp)passNullableRecordOfNullableRecordOfAny }, | |||
20482 | { prototypes::id::TestExampleInterface }, | |||
20483 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
20484 | JSJitInfo::Method, | |||
20485 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
20486 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
20487 | false, /* isInfallible. False in setters. */ | |||
20488 | false, /* isMovable. Not relevant for setters. */ | |||
20489 | false, /* isEliminatable. Not relevant for setters. */ | |||
20490 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
20491 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
20492 | false, /* isTypedMethod. Only relevant for methods. */ | |||
20493 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
20494 | }; | |||
20495 | ||||
20496 | MOZ_CAN_RUN_SCRIPT static bool | |||
20497 | passOptionalNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
20498 | { | |||
20499 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableRecordOfNullableRecordOfAny"); | |||
20500 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20503( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20501 | "TestExampleInterface", "passOptionalNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20503( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20502 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20503( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20503 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20503( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
20504 | ||||
20505 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
20506 | Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>> arg0; | |||
20507 | Maybe<RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>>> arg0_holder; | |||
20508 | if (args.hasDefined(0)) { | |||
20509 | arg0.Construct(); | |||
20510 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
20511 | if (args[0].isObject()) { | |||
20512 | auto& recordEntries = arg0.Value().SetValue().Entries(); | |||
20513 | ||||
20514 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
20515 | JS::RootedVector<jsid> ids(cx); | |||
20516 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20517 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20518 | return false; | |||
20519 | } | |||
20520 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20521 | JS_ReportOutOfMemory(cx); | |||
20522 | return false; | |||
20523 | } | |||
20524 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20525 | JS::Rooted<JS::Value> temp(cx); | |||
20526 | JS::Rooted<jsid> curId(cx); | |||
20527 | JS::Rooted<JS::Value> idVal(cx); | |||
20528 | // Use a hashset to keep track of ids seen, to avoid | |||
20529 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20530 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20531 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20532 | // around. | |||
20533 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20534 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20535 | curId = ids[i]; | |||
20536 | ||||
20537 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20538 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20539 | &desc)) { | |||
20540 | return false; | |||
20541 | } | |||
20542 | ||||
20543 | if (desc.isNothing() || !desc->enumerable()) { | |||
20544 | continue; | |||
20545 | } | |||
20546 | ||||
20547 | idVal = js::IdToValue(curId); | |||
20548 | nsString propName; | |||
20549 | // This will just throw if idVal is a Symbol, like the spec says | |||
20550 | // to do. | |||
20551 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
20552 | return false; | |||
20553 | } | |||
20554 | ||||
20555 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20556 | return false; | |||
20557 | } | |||
20558 | ||||
20559 | Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry; | |||
20560 | if (!idsSeen.EnsureInserted(propName)) { | |||
20561 | // Find the existing entry. | |||
20562 | auto idx = recordEntries.IndexOf(propName); | |||
20563 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20564); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20564; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20564 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20564); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20564; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20565 | // Now blow it away to make it look like it was just added | |||
20566 | // to the array, because it's not obvious that it's | |||
20567 | // safe to write to its already-initialized mValue via our | |||
20568 | // normal codegen conversions. For example, the value | |||
20569 | // could be a union and this would change its type, but | |||
20570 | // codegen assumes we won't do that. | |||
20571 | entry = recordEntries.ReconstructElementAt(idx); | |||
20572 | } else { | |||
20573 | // Safe to do an infallible append here, because we did a | |||
20574 | // SetCapacity above to the right capacity. | |||
20575 | entry = recordEntries.AppendElement(); | |||
20576 | } | |||
20577 | entry->mKey = propName; | |||
20578 | Nullable<Record<nsString, JS::Value>>& slot = entry->mValue; | |||
20579 | if (temp.isObject()) { | |||
20580 | auto& recordEntries = slot.SetValue().Entries(); | |||
20581 | ||||
20582 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | |||
20583 | JS::RootedVector<jsid> ids(cx); | |||
20584 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20585 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20586 | return false; | |||
20587 | } | |||
20588 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20589 | JS_ReportOutOfMemory(cx); | |||
20590 | return false; | |||
20591 | } | |||
20592 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20593 | JS::Rooted<JS::Value> temp(cx); | |||
20594 | JS::Rooted<jsid> curId(cx); | |||
20595 | JS::Rooted<JS::Value> idVal(cx); | |||
20596 | // Use a hashset to keep track of ids seen, to avoid | |||
20597 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20598 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20599 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20600 | // around. | |||
20601 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20602 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20603 | curId = ids[i]; | |||
20604 | ||||
20605 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20606 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20607 | &desc)) { | |||
20608 | return false; | |||
20609 | } | |||
20610 | ||||
20611 | if (desc.isNothing() || !desc->enumerable()) { | |||
20612 | continue; | |||
20613 | } | |||
20614 | ||||
20615 | idVal = js::IdToValue(curId); | |||
20616 | nsString propName; | |||
20617 | // This will just throw if idVal is a Symbol, like the spec says | |||
20618 | // to do. | |||
20619 | if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) { | |||
20620 | return false; | |||
20621 | } | |||
20622 | ||||
20623 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20624 | return false; | |||
20625 | } | |||
20626 | ||||
20627 | Record<nsString, JS::Value>::EntryType* entry; | |||
20628 | if (!idsSeen.EnsureInserted(propName)) { | |||
20629 | // Find the existing entry. | |||
20630 | auto idx = recordEntries.IndexOf(propName); | |||
20631 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20632); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20632; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20632 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20632); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20632; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20633 | // Now blow it away to make it look like it was just added | |||
20634 | // to the array, because it's not obvious that it's | |||
20635 | // safe to write to its already-initialized mValue via our | |||
20636 | // normal codegen conversions. For example, the value | |||
20637 | // could be a union and this would change its type, but | |||
20638 | // codegen assumes we won't do that. | |||
20639 | entry = recordEntries.ReconstructElementAt(idx); | |||
20640 | } else { | |||
20641 | // Safe to do an infallible append here, because we did a | |||
20642 | // SetCapacity above to the right capacity. | |||
20643 | entry = recordEntries.AppendElement(); | |||
20644 | } | |||
20645 | entry->mKey = propName; | |||
20646 | JS::Value& slot = entry->mValue; | |||
20647 | slot = temp; | |||
20648 | } | |||
20649 | } else if (temp.isNullOrUndefined()) { | |||
20650 | slot.SetNull(); | |||
20651 | } else { | |||
20652 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
20653 | return false; | |||
20654 | } | |||
20655 | } | |||
20656 | } else if (args[0].isNullOrUndefined()) { | |||
20657 | arg0.Value().SetNull(); | |||
20658 | } else { | |||
20659 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
20660 | return false; | |||
20661 | } | |||
20662 | } | |||
20663 | // NOTE: This assert does NOT call the function. | |||
20664 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
20665 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableRecordOfAny(cx, Constify(arg0)); | |||
20666 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 20666); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20666; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
20667 | args.rval().setUndefined(); | |||
20668 | return true; | |||
20669 | } | |||
20670 | ||||
20671 | static const JSJitInfo passOptionalNullableRecordOfNullableRecordOfAny_methodinfo = { | |||
20672 | { (JSJitGetterOp)passOptionalNullableRecordOfNullableRecordOfAny }, | |||
20673 | { prototypes::id::TestExampleInterface }, | |||
20674 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
20675 | JSJitInfo::Method, | |||
20676 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
20677 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
20678 | false, /* isInfallible. False in setters. */ | |||
20679 | false, /* isMovable. Not relevant for setters. */ | |||
20680 | false, /* isEliminatable. Not relevant for setters. */ | |||
20681 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
20682 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
20683 | false, /* isTypedMethod. Only relevant for methods. */ | |||
20684 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
20685 | }; | |||
20686 | ||||
20687 | MOZ_CAN_RUN_SCRIPT static bool | |||
20688 | passOptionalNullableRecordOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
20689 | { | |||
20690 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableRecordOfNullableSequenceOfAny"); | |||
20691 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20694( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20692 | "TestExampleInterface", "passOptionalNullableRecordOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20694( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20693 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20694( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20694 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20694( cx, "TestExampleInterface" , "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
20695 | ||||
20696 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
20697 | Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>> arg0; | |||
20698 | Maybe<RecordRooter<nsString, Nullable<Sequence<JS::Value>>>> arg0_holder; | |||
20699 | if (args.hasDefined(0)) { | |||
20700 | arg0.Construct(); | |||
20701 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
20702 | if (args[0].isObject()) { | |||
20703 | auto& recordEntries = arg0.Value().SetValue().Entries(); | |||
20704 | ||||
20705 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
20706 | JS::RootedVector<jsid> ids(cx); | |||
20707 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20708 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20709 | return false; | |||
20710 | } | |||
20711 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20712 | JS_ReportOutOfMemory(cx); | |||
20713 | return false; | |||
20714 | } | |||
20715 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20716 | JS::Rooted<JS::Value> temp(cx); | |||
20717 | JS::Rooted<jsid> curId(cx); | |||
20718 | JS::Rooted<JS::Value> idVal(cx); | |||
20719 | // Use a hashset to keep track of ids seen, to avoid | |||
20720 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20721 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20722 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20723 | // around. | |||
20724 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20725 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20726 | curId = ids[i]; | |||
20727 | ||||
20728 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20729 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20730 | &desc)) { | |||
20731 | return false; | |||
20732 | } | |||
20733 | ||||
20734 | if (desc.isNothing() || !desc->enumerable()) { | |||
20735 | continue; | |||
20736 | } | |||
20737 | ||||
20738 | idVal = js::IdToValue(curId); | |||
20739 | nsString propName; | |||
20740 | // This will just throw if idVal is a Symbol, like the spec says | |||
20741 | // to do. | |||
20742 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
20743 | return false; | |||
20744 | } | |||
20745 | ||||
20746 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20747 | return false; | |||
20748 | } | |||
20749 | ||||
20750 | Record<nsString, Nullable<Sequence<JS::Value>>>::EntryType* entry; | |||
20751 | if (!idsSeen.EnsureInserted(propName)) { | |||
20752 | // Find the existing entry. | |||
20753 | auto idx = recordEntries.IndexOf(propName); | |||
20754 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20755); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20755; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20755 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20755); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20755; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20756 | // Now blow it away to make it look like it was just added | |||
20757 | // to the array, because it's not obvious that it's | |||
20758 | // safe to write to its already-initialized mValue via our | |||
20759 | // normal codegen conversions. For example, the value | |||
20760 | // could be a union and this would change its type, but | |||
20761 | // codegen assumes we won't do that. | |||
20762 | entry = recordEntries.ReconstructElementAt(idx); | |||
20763 | } else { | |||
20764 | // Safe to do an infallible append here, because we did a | |||
20765 | // SetCapacity above to the right capacity. | |||
20766 | entry = recordEntries.AppendElement(); | |||
20767 | } | |||
20768 | entry->mKey = propName; | |||
20769 | Nullable<Sequence<JS::Value>>& slot = entry->mValue; | |||
20770 | if (temp.isObject()) { | |||
20771 | JS::ForOfIterator iter1(cx); | |||
20772 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
20773 | return false; | |||
20774 | } | |||
20775 | if (!iter1.valueIsIterable()) { | |||
20776 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence"); | |||
20777 | return false; | |||
20778 | } | |||
20779 | Sequence<JS::Value> &arr1 = slot.SetValue(); | |||
20780 | JS::Rooted<JS::Value> temp1(cx); | |||
20781 | while (true) { | |||
20782 | bool done1; | |||
20783 | if (!iter1.next(&temp1, &done1)) { | |||
20784 | return false; | |||
20785 | } | |||
20786 | if (done1) { | |||
20787 | break; | |||
20788 | } | |||
20789 | JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible); | |||
20790 | if (!slotPtr1) { | |||
20791 | JS_ReportOutOfMemory(cx); | |||
20792 | return false; | |||
20793 | } | |||
20794 | JS::Value& slot1 = *slotPtr1; | |||
20795 | slot1 = temp1; | |||
20796 | } | |||
20797 | } else if (temp.isNullOrUndefined()) { | |||
20798 | slot.SetNull(); | |||
20799 | } else { | |||
20800 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence"); | |||
20801 | return false; | |||
20802 | } | |||
20803 | } | |||
20804 | } else if (args[0].isNullOrUndefined()) { | |||
20805 | arg0.Value().SetNull(); | |||
20806 | } else { | |||
20807 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
20808 | return false; | |||
20809 | } | |||
20810 | } | |||
20811 | // NOTE: This assert does NOT call the function. | |||
20812 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableSequenceOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
20813 | MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableSequenceOfAny(cx, Constify(arg0)); | |||
20814 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 20814); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20814; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
20815 | args.rval().setUndefined(); | |||
20816 | return true; | |||
20817 | } | |||
20818 | ||||
20819 | static const JSJitInfo passOptionalNullableRecordOfNullableSequenceOfAny_methodinfo = { | |||
20820 | { (JSJitGetterOp)passOptionalNullableRecordOfNullableSequenceOfAny }, | |||
20821 | { prototypes::id::TestExampleInterface }, | |||
20822 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
20823 | JSJitInfo::Method, | |||
20824 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
20825 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
20826 | false, /* isInfallible. False in setters. */ | |||
20827 | false, /* isMovable. Not relevant for setters. */ | |||
20828 | false, /* isEliminatable. Not relevant for setters. */ | |||
20829 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
20830 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
20831 | false, /* isTypedMethod. Only relevant for methods. */ | |||
20832 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
20833 | }; | |||
20834 | ||||
20835 | MOZ_CAN_RUN_SCRIPT static bool | |||
20836 | passOptionalNullableSequenceOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
20837 | { | |||
20838 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceOfNullableRecordOfAny"); | |||
20839 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20842( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20840 | "TestExampleInterface", "passOptionalNullableSequenceOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20842( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20841 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20842( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
20842 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20842( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
20843 | ||||
20844 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
20845 | Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>> arg0; | |||
20846 | Maybe<SequenceRooter<Nullable<Record<nsString, JS::Value>>>> arg0_holder; | |||
20847 | if (args.hasDefined(0)) { | |||
20848 | arg0.Construct(); | |||
20849 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
20850 | if (args[0].isObject()) { | |||
20851 | JS::ForOfIterator iter(cx); | |||
20852 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
20853 | return false; | |||
20854 | } | |||
20855 | if (!iter.valueIsIterable()) { | |||
20856 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
20857 | return false; | |||
20858 | } | |||
20859 | Sequence<Nullable<Record<nsString, JS::Value>>> &arr = arg0.Value().SetValue(); | |||
20860 | JS::Rooted<JS::Value> temp(cx); | |||
20861 | while (true) { | |||
20862 | bool done; | |||
20863 | if (!iter.next(&temp, &done)) { | |||
20864 | return false; | |||
20865 | } | |||
20866 | if (done) { | |||
20867 | break; | |||
20868 | } | |||
20869 | Nullable<Record<nsString, JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
20870 | if (!slotPtr) { | |||
20871 | JS_ReportOutOfMemory(cx); | |||
20872 | return false; | |||
20873 | } | |||
20874 | Nullable<Record<nsString, JS::Value>>& slot = *slotPtr; | |||
20875 | if (temp.isObject()) { | |||
20876 | auto& recordEntries = slot.SetValue().Entries(); | |||
20877 | ||||
20878 | JS::Rooted<JSObject*> recordObj(cx, &temp.toObject()); | |||
20879 | JS::RootedVector<jsid> ids(cx); | |||
20880 | if (!js::GetPropertyKeys(cx, recordObj, | |||
20881 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
20882 | return false; | |||
20883 | } | |||
20884 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
20885 | JS_ReportOutOfMemory(cx); | |||
20886 | return false; | |||
20887 | } | |||
20888 | JS::Rooted<JS::Value> propNameValue(cx); | |||
20889 | JS::Rooted<JS::Value> temp(cx); | |||
20890 | JS::Rooted<jsid> curId(cx); | |||
20891 | JS::Rooted<JS::Value> idVal(cx); | |||
20892 | // Use a hashset to keep track of ids seen, to avoid | |||
20893 | // introducing nasty O(N^2) behavior scanning for them all the | |||
20894 | // time. Ideally we'd use a data structure with O(1) lookup | |||
20895 | // _and_ ordering for the MozMap, but we don't have one lying | |||
20896 | // around. | |||
20897 | nsTHashtable<nsStringHashKey> idsSeen; | |||
20898 | for (size_t i = 0; i < ids.length(); ++i) { | |||
20899 | curId = ids[i]; | |||
20900 | ||||
20901 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
20902 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
20903 | &desc)) { | |||
20904 | return false; | |||
20905 | } | |||
20906 | ||||
20907 | if (desc.isNothing() || !desc->enumerable()) { | |||
20908 | continue; | |||
20909 | } | |||
20910 | ||||
20911 | idVal = js::IdToValue(curId); | |||
20912 | nsString propName; | |||
20913 | // This will just throw if idVal is a Symbol, like the spec says | |||
20914 | // to do. | |||
20915 | if (!ConvertJSValueToString(cx, idVal, "key of element of argument 1", propName)) { | |||
20916 | return false; | |||
20917 | } | |||
20918 | ||||
20919 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
20920 | return false; | |||
20921 | } | |||
20922 | ||||
20923 | Record<nsString, JS::Value>::EntryType* entry; | |||
20924 | if (!idsSeen.EnsureInserted(propName)) { | |||
20925 | // Find the existing entry. | |||
20926 | auto idx = recordEntries.IndexOf(propName); | |||
20927 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20928); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20928; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
20928 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 20928); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 20928; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
20929 | // Now blow it away to make it look like it was just added | |||
20930 | // to the array, because it's not obvious that it's | |||
20931 | // safe to write to its already-initialized mValue via our | |||
20932 | // normal codegen conversions. For example, the value | |||
20933 | // could be a union and this would change its type, but | |||
20934 | // codegen assumes we won't do that. | |||
20935 | entry = recordEntries.ReconstructElementAt(idx); | |||
20936 | } else { | |||
20937 | // Safe to do an infallible append here, because we did a | |||
20938 | // SetCapacity above to the right capacity. | |||
20939 | entry = recordEntries.AppendElement(); | |||
20940 | } | |||
20941 | entry->mKey = propName; | |||
20942 | JS::Value& slot = entry->mValue; | |||
20943 | slot = temp; | |||
20944 | } | |||
20945 | } else if (temp.isNullOrUndefined()) { | |||
20946 | slot.SetNull(); | |||
20947 | } else { | |||
20948 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
20949 | return false; | |||
20950 | } | |||
20951 | } | |||
20952 | } else if (args[0].isNullOrUndefined()) { | |||
20953 | arg0.Value().SetNull(); | |||
20954 | } else { | |||
20955 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
20956 | return false; | |||
20957 | } | |||
20958 | } | |||
20959 | // NOTE: This assert does NOT call the function. | |||
20960 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableRecordOfAny(cx, Constify(arg0)))>, "Should be returning void here"); | |||
20961 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableRecordOfAny(cx, Constify(arg0)); | |||
20962 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 20962); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20962; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
20963 | args.rval().setUndefined(); | |||
20964 | return true; | |||
20965 | } | |||
20966 | ||||
20967 | static const JSJitInfo passOptionalNullableSequenceOfNullableRecordOfAny_methodinfo = { | |||
20968 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableRecordOfAny }, | |||
20969 | { prototypes::id::TestExampleInterface }, | |||
20970 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
20971 | JSJitInfo::Method, | |||
20972 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
20973 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
20974 | false, /* isInfallible. False in setters. */ | |||
20975 | false, /* isMovable. Not relevant for setters. */ | |||
20976 | false, /* isEliminatable. Not relevant for setters. */ | |||
20977 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
20978 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
20979 | false, /* isTypedMethod. Only relevant for methods. */ | |||
20980 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
20981 | }; | |||
20982 | ||||
20983 | MOZ_CAN_RUN_SCRIPT static bool | |||
20984 | receiveAny(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
20985 | { | |||
20986 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20989( cx, "TestExampleInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
20987 | "TestExampleInterface", "receiveAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20989( cx, "TestExampleInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
20988 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20989( cx, "TestExampleInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
20989 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20989( cx, "TestExampleInterface" , "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
20990 | ||||
20991 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
20992 | JS::Rooted<JS::Value> result(cx); | |||
20993 | // NOTE: This assert does NOT call the function. | |||
20994 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveAny(cx, &result))>, "Should be returning void here"); | |||
20995 | MOZ_KnownLive(self)(self)->ReceiveAny(cx, &result); | |||
20996 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 20996); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 20996; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
20997 | JS::ExposeValueToActiveJS(result); | |||
20998 | args.rval().set(result); | |||
20999 | if (!MaybeWrapValue(cx, args.rval())) { | |||
21000 | return false; | |||
21001 | } | |||
21002 | return true; | |||
21003 | } | |||
21004 | ||||
21005 | static const JSJitInfo receiveAny_methodinfo = { | |||
21006 | { (JSJitGetterOp)receiveAny }, | |||
21007 | { prototypes::id::TestExampleInterface }, | |||
21008 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21009 | JSJitInfo::Method, | |||
21010 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21011 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
21012 | false, /* isInfallible. False in setters. */ | |||
21013 | false, /* isMovable. Not relevant for setters. */ | |||
21014 | false, /* isEliminatable. Not relevant for setters. */ | |||
21015 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21016 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21017 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21018 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21019 | }; | |||
21020 | ||||
21021 | MOZ_CAN_RUN_SCRIPT static bool | |||
21022 | passObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21023 | { | |||
21024 | BindingCallContext cx(cx_, "TestExampleInterface.passObject"); | |||
21025 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21028( cx, "TestExampleInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21026 | "TestExampleInterface", "passObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21028( cx, "TestExampleInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21027 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21028( cx, "TestExampleInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21028 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21028( cx, "TestExampleInterface" , "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21029 | ||||
21030 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21031 | if (!args.requireAtLeast(cx, "TestExampleInterface.passObject", 1)) { | |||
21032 | return false; | |||
21033 | } | |||
21034 | JS::Rooted<JSObject*> arg0(cx); | |||
21035 | if (args[0].isObject()) { | |||
21036 | arg0 = &args[0].toObject(); | |||
21037 | } else { | |||
21038 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21039 | return false; | |||
21040 | } | |||
21041 | // NOTE: This assert does NOT call the function. | |||
21042 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassObject(cx, arg0))>, "Should be returning void here"); | |||
21043 | MOZ_KnownLive(self)(self)->PassObject(cx, arg0); | |||
21044 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21044); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21044; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21045 | args.rval().setUndefined(); | |||
21046 | return true; | |||
21047 | } | |||
21048 | ||||
21049 | static const JSJitInfo passObject_methodinfo = { | |||
21050 | { (JSJitGetterOp)passObject }, | |||
21051 | { prototypes::id::TestExampleInterface }, | |||
21052 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21053 | JSJitInfo::Method, | |||
21054 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21055 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21056 | false, /* isInfallible. False in setters. */ | |||
21057 | false, /* isMovable. Not relevant for setters. */ | |||
21058 | false, /* isEliminatable. Not relevant for setters. */ | |||
21059 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21060 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21061 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21062 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21063 | }; | |||
21064 | ||||
21065 | MOZ_CAN_RUN_SCRIPT static bool | |||
21066 | passVariadicObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21067 | { | |||
21068 | BindingCallContext cx(cx_, "TestExampleInterface.passVariadicObject"); | |||
21069 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21072( cx, "TestExampleInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21070 | "TestExampleInterface", "passVariadicObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21072( cx, "TestExampleInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21071 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21072( cx, "TestExampleInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21072 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21072( cx, "TestExampleInterface" , "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21073 | ||||
21074 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21075 | AutoSequence<JSObject*> arg0; | |||
21076 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | |||
21077 | if (args.length() > 0) { | |||
21078 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
21079 | JS_ReportOutOfMemory(cx); | |||
21080 | return false; | |||
21081 | } | |||
21082 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
21083 | // OK to do infallible append here, since we ensured capacity already. | |||
21084 | JSObject*& slot = *arg0.AppendElement(nullptr); | |||
21085 | if (args[variadicArg].isObject()) { | |||
21086 | slot = &args[variadicArg].toObject(); | |||
21087 | } else { | |||
21088 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21089 | return false; | |||
21090 | } | |||
21091 | } | |||
21092 | } | |||
21093 | // NOTE: This assert does NOT call the function. | |||
21094 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21095 | MOZ_KnownLive(self)(self)->PassVariadicObject(cx, Constify(arg0)); | |||
21096 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21096); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21096; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21097 | args.rval().setUndefined(); | |||
21098 | return true; | |||
21099 | } | |||
21100 | ||||
21101 | static const JSJitInfo passVariadicObject_methodinfo = { | |||
21102 | { (JSJitGetterOp)passVariadicObject }, | |||
21103 | { prototypes::id::TestExampleInterface }, | |||
21104 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21105 | JSJitInfo::Method, | |||
21106 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21107 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21108 | false, /* isInfallible. False in setters. */ | |||
21109 | false, /* isMovable. Not relevant for setters. */ | |||
21110 | false, /* isEliminatable. Not relevant for setters. */ | |||
21111 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21112 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21113 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21114 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21115 | }; | |||
21116 | ||||
21117 | MOZ_CAN_RUN_SCRIPT static bool | |||
21118 | passNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21119 | { | |||
21120 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableObject"); | |||
21121 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21124( cx, "TestExampleInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21122 | "TestExampleInterface", "passNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21124( cx, "TestExampleInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21123 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21124( cx, "TestExampleInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21124 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21124( cx, "TestExampleInterface" , "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21125 | ||||
21126 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21127 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableObject", 1)) { | |||
21128 | return false; | |||
21129 | } | |||
21130 | JS::Rooted<JSObject*> arg0(cx); | |||
21131 | if (args[0].isObject()) { | |||
21132 | arg0 = &args[0].toObject(); | |||
21133 | } else if (args[0].isNullOrUndefined()) { | |||
21134 | arg0 = nullptr; | |||
21135 | } else { | |||
21136 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21137 | return false; | |||
21138 | } | |||
21139 | // NOTE: This assert does NOT call the function. | |||
21140 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableObject(cx, arg0))>, "Should be returning void here"); | |||
21141 | MOZ_KnownLive(self)(self)->PassNullableObject(cx, arg0); | |||
21142 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21142); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21142; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21143 | args.rval().setUndefined(); | |||
21144 | return true; | |||
21145 | } | |||
21146 | ||||
21147 | static const JSJitInfo passNullableObject_methodinfo = { | |||
21148 | { (JSJitGetterOp)passNullableObject }, | |||
21149 | { prototypes::id::TestExampleInterface }, | |||
21150 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21151 | JSJitInfo::Method, | |||
21152 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21153 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21154 | false, /* isInfallible. False in setters. */ | |||
21155 | false, /* isMovable. Not relevant for setters. */ | |||
21156 | false, /* isEliminatable. Not relevant for setters. */ | |||
21157 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21158 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21159 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21160 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21161 | }; | |||
21162 | ||||
21163 | MOZ_CAN_RUN_SCRIPT static bool | |||
21164 | passVariadicNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21165 | { | |||
21166 | BindingCallContext cx(cx_, "TestExampleInterface.passVariadicNullableObject"); | |||
21167 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21170( cx, "TestExampleInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21168 | "TestExampleInterface", "passVariadicNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21170( cx, "TestExampleInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21169 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21170( cx, "TestExampleInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21170 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21170( cx, "TestExampleInterface" , "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
21171 | ||||
21172 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21173 | AutoSequence<JSObject*> arg0; | |||
21174 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | |||
21175 | if (args.length() > 0) { | |||
21176 | if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) { | |||
21177 | JS_ReportOutOfMemory(cx); | |||
21178 | return false; | |||
21179 | } | |||
21180 | for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) { | |||
21181 | // OK to do infallible append here, since we ensured capacity already. | |||
21182 | JSObject*& slot = *arg0.AppendElement(nullptr); | |||
21183 | if (args[variadicArg].isObject()) { | |||
21184 | slot = &args[variadicArg].toObject(); | |||
21185 | } else { | |||
21186 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21187 | return false; | |||
21188 | } | |||
21189 | } | |||
21190 | } | |||
21191 | // NOTE: This assert does NOT call the function. | |||
21192 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicNullableObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21193 | MOZ_KnownLive(self)(self)->PassVariadicNullableObject(cx, Constify(arg0)); | |||
21194 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21194); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21194; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21195 | args.rval().setUndefined(); | |||
21196 | return true; | |||
21197 | } | |||
21198 | ||||
21199 | static const JSJitInfo passVariadicNullableObject_methodinfo = { | |||
21200 | { (JSJitGetterOp)passVariadicNullableObject }, | |||
21201 | { prototypes::id::TestExampleInterface }, | |||
21202 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21203 | JSJitInfo::Method, | |||
21204 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21205 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21206 | false, /* isInfallible. False in setters. */ | |||
21207 | false, /* isMovable. Not relevant for setters. */ | |||
21208 | false, /* isEliminatable. Not relevant for setters. */ | |||
21209 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21210 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21211 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21212 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21213 | }; | |||
21214 | ||||
21215 | MOZ_CAN_RUN_SCRIPT static bool | |||
21216 | passOptionalObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21217 | { | |||
21218 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalObject"); | |||
21219 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestExampleInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21220 | "TestExampleInterface", "passOptionalObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestExampleInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21221 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestExampleInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21222 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21222( cx, "TestExampleInterface" , "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21223 | ||||
21224 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21225 | Optional<JS::Handle<JSObject*>> arg0; | |||
| ||||
21226 | if (args.hasDefined(0)) { | |||
21227 | arg0.Construct(cx); | |||
21228 | if (args[0].isObject()) { | |||
21229 | arg0.Value() = &args[0].toObject(); | |||
21230 | } else { | |||
21231 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21232 | return false; | |||
21233 | } | |||
21234 | } | |||
21235 | // NOTE: This assert does NOT call the function. | |||
21236 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21237 | MOZ_KnownLive(self)(self)->PassOptionalObject(cx, Constify(arg0)); | |||
21238 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21238); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21238; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21239 | args.rval().setUndefined(); | |||
21240 | return true; | |||
21241 | } | |||
21242 | ||||
21243 | static const JSJitInfo passOptionalObject_methodinfo = { | |||
21244 | { (JSJitGetterOp)passOptionalObject }, | |||
21245 | { prototypes::id::TestExampleInterface }, | |||
21246 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21247 | JSJitInfo::Method, | |||
21248 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21249 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21250 | false, /* isInfallible. False in setters. */ | |||
21251 | false, /* isMovable. Not relevant for setters. */ | |||
21252 | false, /* isEliminatable. Not relevant for setters. */ | |||
21253 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21254 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21255 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21256 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21257 | }; | |||
21258 | ||||
21259 | MOZ_CAN_RUN_SCRIPT static bool | |||
21260 | passOptionalNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21261 | { | |||
21262 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableObject"); | |||
21263 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21266( cx, "TestExampleInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21264 | "TestExampleInterface", "passOptionalNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21266( cx, "TestExampleInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21265 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21266( cx, "TestExampleInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21266 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21266( cx, "TestExampleInterface" , "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
21267 | ||||
21268 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21269 | Optional<JS::Handle<JSObject*>> arg0; | |||
21270 | if (args.hasDefined(0)) { | |||
21271 | arg0.Construct(cx); | |||
21272 | if (args[0].isObject()) { | |||
21273 | arg0.Value() = &args[0].toObject(); | |||
21274 | } else if (args[0].isNullOrUndefined()) { | |||
21275 | arg0.Value() = nullptr; | |||
21276 | } else { | |||
21277 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21278 | return false; | |||
21279 | } | |||
21280 | } | |||
21281 | // NOTE: This assert does NOT call the function. | |||
21282 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21283 | MOZ_KnownLive(self)(self)->PassOptionalNullableObject(cx, Constify(arg0)); | |||
21284 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21284); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21284; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21285 | args.rval().setUndefined(); | |||
21286 | return true; | |||
21287 | } | |||
21288 | ||||
21289 | static const JSJitInfo passOptionalNullableObject_methodinfo = { | |||
21290 | { (JSJitGetterOp)passOptionalNullableObject }, | |||
21291 | { prototypes::id::TestExampleInterface }, | |||
21292 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21293 | JSJitInfo::Method, | |||
21294 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21295 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21296 | false, /* isInfallible. False in setters. */ | |||
21297 | false, /* isMovable. Not relevant for setters. */ | |||
21298 | false, /* isEliminatable. Not relevant for setters. */ | |||
21299 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21300 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21301 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21302 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21303 | }; | |||
21304 | ||||
21305 | MOZ_CAN_RUN_SCRIPT static bool | |||
21306 | passOptionalNullableObjectWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21307 | { | |||
21308 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableObjectWithDefaultValue"); | |||
21309 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21312( cx, "TestExampleInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21310 | "TestExampleInterface", "passOptionalNullableObjectWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21312( cx, "TestExampleInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21311 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21312( cx, "TestExampleInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21312 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21312( cx, "TestExampleInterface" , "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
21313 | ||||
21314 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21315 | JS::Rooted<JSObject*> arg0(cx); | |||
21316 | if (args.hasDefined(0)) { | |||
21317 | if (args[0].isObject()) { | |||
21318 | arg0 = &args[0].toObject(); | |||
21319 | } else if (args[0].isNullOrUndefined()) { | |||
21320 | arg0 = nullptr; | |||
21321 | } else { | |||
21322 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21323 | return false; | |||
21324 | } | |||
21325 | } else { | |||
21326 | arg0 = nullptr; | |||
21327 | } | |||
21328 | // NOTE: This assert does NOT call the function. | |||
21329 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableObjectWithDefaultValue(cx, arg0))>, "Should be returning void here"); | |||
21330 | MOZ_KnownLive(self)(self)->PassOptionalNullableObjectWithDefaultValue(cx, arg0); | |||
21331 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21331); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21331; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21332 | args.rval().setUndefined(); | |||
21333 | return true; | |||
21334 | } | |||
21335 | ||||
21336 | static const JSJitInfo passOptionalNullableObjectWithDefaultValue_methodinfo = { | |||
21337 | { (JSJitGetterOp)passOptionalNullableObjectWithDefaultValue }, | |||
21338 | { prototypes::id::TestExampleInterface }, | |||
21339 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21340 | JSJitInfo::Method, | |||
21341 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21342 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21343 | false, /* isInfallible. False in setters. */ | |||
21344 | false, /* isMovable. Not relevant for setters. */ | |||
21345 | false, /* isEliminatable. Not relevant for setters. */ | |||
21346 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21347 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21348 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21349 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21350 | }; | |||
21351 | ||||
21352 | MOZ_CAN_RUN_SCRIPT static bool | |||
21353 | passSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21354 | { | |||
21355 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfObject"); | |||
21356 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21359( cx, "TestExampleInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21357 | "TestExampleInterface", "passSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21359( cx, "TestExampleInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21358 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21359( cx, "TestExampleInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21359 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21359( cx, "TestExampleInterface" , "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21360 | ||||
21361 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21362 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfObject", 1)) { | |||
21363 | return false; | |||
21364 | } | |||
21365 | binding_detail::AutoSequence<JSObject*> arg0; | |||
21366 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | |||
21367 | if (args[0].isObject()) { | |||
21368 | JS::ForOfIterator iter(cx); | |||
21369 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
21370 | return false; | |||
21371 | } | |||
21372 | if (!iter.valueIsIterable()) { | |||
21373 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21374 | return false; | |||
21375 | } | |||
21376 | binding_detail::AutoSequence<JSObject*> &arr = arg0; | |||
21377 | JS::Rooted<JS::Value> temp(cx); | |||
21378 | while (true) { | |||
21379 | bool done; | |||
21380 | if (!iter.next(&temp, &done)) { | |||
21381 | return false; | |||
21382 | } | |||
21383 | if (done) { | |||
21384 | break; | |||
21385 | } | |||
21386 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | |||
21387 | if (!slotPtr) { | |||
21388 | JS_ReportOutOfMemory(cx); | |||
21389 | return false; | |||
21390 | } | |||
21391 | JSObject*& slot = *slotPtr; | |||
21392 | if (temp.isObject()) { | |||
21393 | slot = &temp.toObject(); | |||
21394 | } else { | |||
21395 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
21396 | return false; | |||
21397 | } | |||
21398 | } | |||
21399 | } else { | |||
21400 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21401 | return false; | |||
21402 | } | |||
21403 | // NOTE: This assert does NOT call the function. | |||
21404 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21405 | MOZ_KnownLive(self)(self)->PassSequenceOfObject(cx, Constify(arg0)); | |||
21406 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21406); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21406; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21407 | args.rval().setUndefined(); | |||
21408 | return true; | |||
21409 | } | |||
21410 | ||||
21411 | static const JSJitInfo passSequenceOfObject_methodinfo = { | |||
21412 | { (JSJitGetterOp)passSequenceOfObject }, | |||
21413 | { prototypes::id::TestExampleInterface }, | |||
21414 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21415 | JSJitInfo::Method, | |||
21416 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21417 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21418 | false, /* isInfallible. False in setters. */ | |||
21419 | false, /* isMovable. Not relevant for setters. */ | |||
21420 | false, /* isEliminatable. Not relevant for setters. */ | |||
21421 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21422 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21423 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21424 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21425 | }; | |||
21426 | ||||
21427 | MOZ_CAN_RUN_SCRIPT static bool | |||
21428 | passSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21429 | { | |||
21430 | BindingCallContext cx(cx_, "TestExampleInterface.passSequenceOfNullableObject"); | |||
21431 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21434( cx, "TestExampleInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21432 | "TestExampleInterface", "passSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21434( cx, "TestExampleInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21433 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21434( cx, "TestExampleInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21434 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21434( cx, "TestExampleInterface" , "passSequenceOfNullableObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
21435 | ||||
21436 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21437 | if (!args.requireAtLeast(cx, "TestExampleInterface.passSequenceOfNullableObject", 1)) { | |||
21438 | return false; | |||
21439 | } | |||
21440 | binding_detail::AutoSequence<JSObject*> arg0; | |||
21441 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0); | |||
21442 | if (args[0].isObject()) { | |||
21443 | JS::ForOfIterator iter(cx); | |||
21444 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
21445 | return false; | |||
21446 | } | |||
21447 | if (!iter.valueIsIterable()) { | |||
21448 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21449 | return false; | |||
21450 | } | |||
21451 | binding_detail::AutoSequence<JSObject*> &arr = arg0; | |||
21452 | JS::Rooted<JS::Value> temp(cx); | |||
21453 | while (true) { | |||
21454 | bool done; | |||
21455 | if (!iter.next(&temp, &done)) { | |||
21456 | return false; | |||
21457 | } | |||
21458 | if (done) { | |||
21459 | break; | |||
21460 | } | |||
21461 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | |||
21462 | if (!slotPtr) { | |||
21463 | JS_ReportOutOfMemory(cx); | |||
21464 | return false; | |||
21465 | } | |||
21466 | JSObject*& slot = *slotPtr; | |||
21467 | if (temp.isObject()) { | |||
21468 | slot = &temp.toObject(); | |||
21469 | } else if (temp.isNullOrUndefined()) { | |||
21470 | slot = nullptr; | |||
21471 | } else { | |||
21472 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
21473 | return false; | |||
21474 | } | |||
21475 | } | |||
21476 | } else { | |||
21477 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21478 | return false; | |||
21479 | } | |||
21480 | // NOTE: This assert does NOT call the function. | |||
21481 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21482 | MOZ_KnownLive(self)(self)->PassSequenceOfNullableObject(cx, Constify(arg0)); | |||
21483 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21483); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21483; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21484 | args.rval().setUndefined(); | |||
21485 | return true; | |||
21486 | } | |||
21487 | ||||
21488 | static const JSJitInfo passSequenceOfNullableObject_methodinfo = { | |||
21489 | { (JSJitGetterOp)passSequenceOfNullableObject }, | |||
21490 | { prototypes::id::TestExampleInterface }, | |||
21491 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21492 | JSJitInfo::Method, | |||
21493 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21494 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21495 | false, /* isInfallible. False in setters. */ | |||
21496 | false, /* isMovable. Not relevant for setters. */ | |||
21497 | false, /* isEliminatable. Not relevant for setters. */ | |||
21498 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21499 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21500 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21501 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21502 | }; | |||
21503 | ||||
21504 | MOZ_CAN_RUN_SCRIPT static bool | |||
21505 | passNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21506 | { | |||
21507 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableSequenceOfObject"); | |||
21508 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21511( cx, "TestExampleInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21509 | "TestExampleInterface", "passNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21511( cx, "TestExampleInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21510 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21511( cx, "TestExampleInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
21511 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21511( cx, "TestExampleInterface" , "passNullableSequenceOfObject", JS::ProfilingCategoryPair:: DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
21512 | ||||
21513 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21514 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableSequenceOfObject", 1)) { | |||
21515 | return false; | |||
21516 | } | |||
21517 | Nullable<Sequence<JSObject*>> arg0; | |||
21518 | SequenceRooter<JSObject*> arg0_holder(cx, &arg0.SetValue()); | |||
21519 | if (args[0].isObject()) { | |||
21520 | JS::ForOfIterator iter(cx); | |||
21521 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
21522 | return false; | |||
21523 | } | |||
21524 | if (!iter.valueIsIterable()) { | |||
21525 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21526 | return false; | |||
21527 | } | |||
21528 | Sequence<JSObject*> &arr = arg0.SetValue(); | |||
21529 | JS::Rooted<JS::Value> temp(cx); | |||
21530 | while (true) { | |||
21531 | bool done; | |||
21532 | if (!iter.next(&temp, &done)) { | |||
21533 | return false; | |||
21534 | } | |||
21535 | if (done) { | |||
21536 | break; | |||
21537 | } | |||
21538 | JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible); | |||
21539 | if (!slotPtr) { | |||
21540 | JS_ReportOutOfMemory(cx); | |||
21541 | return false; | |||
21542 | } | |||
21543 | JSObject*& slot = *slotPtr; | |||
21544 | if (temp.isObject()) { | |||
21545 | slot = &temp.toObject(); | |||
21546 | } else { | |||
21547 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1"); | |||
21548 | return false; | |||
21549 | } | |||
21550 | } | |||
21551 | } else if (args[0].isNullOrUndefined()) { | |||
21552 | arg0.SetNull(); | |||
21553 | } else { | |||
21554 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21555 | return false; | |||
21556 | } | |||
21557 | // NOTE: This assert does NOT call the function. | |||
21558 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequenceOfObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21559 | MOZ_KnownLive(self)(self)->PassNullableSequenceOfObject(cx, Constify(arg0)); | |||
21560 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21560); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21560; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21561 | args.rval().setUndefined(); | |||
21562 | return true; | |||
21563 | } | |||
21564 | ||||
21565 | static const JSJitInfo passNullableSequenceOfObject_methodinfo = { | |||
21566 | { (JSJitGetterOp)passNullableSequenceOfObject }, | |||
21567 | { prototypes::id::TestExampleInterface }, | |||
21568 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21569 | JSJitInfo::Method, | |||
21570 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21571 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21572 | false, /* isInfallible. False in setters. */ | |||
21573 | false, /* isMovable. Not relevant for setters. */ | |||
21574 | false, /* isEliminatable. Not relevant for setters. */ | |||
21575 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21576 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21577 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21578 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21579 | }; | |||
21580 | ||||
21581 | MOZ_CAN_RUN_SCRIPT static bool | |||
21582 | passOptionalNullableSequenceOfNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21583 | { | |||
21584 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceOfNullableSequenceOfObject"); | |||
21585 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21588( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
21586 | "TestExampleInterface", "passOptionalNullableSequenceOfNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21588( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
21587 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21588( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
21588 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21588( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfObject", JS ::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
21589 | ||||
21590 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21591 | Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0; | |||
21592 | Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder; | |||
21593 | if (args.hasDefined(0)) { | |||
21594 | arg0.Construct(); | |||
21595 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
21596 | if (args[0].isObject()) { | |||
21597 | JS::ForOfIterator iter(cx); | |||
21598 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
21599 | return false; | |||
21600 | } | |||
21601 | if (!iter.valueIsIterable()) { | |||
21602 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21603 | return false; | |||
21604 | } | |||
21605 | Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue(); | |||
21606 | JS::Rooted<JS::Value> temp(cx); | |||
21607 | while (true) { | |||
21608 | bool done; | |||
21609 | if (!iter.next(&temp, &done)) { | |||
21610 | return false; | |||
21611 | } | |||
21612 | if (done) { | |||
21613 | break; | |||
21614 | } | |||
21615 | Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
21616 | if (!slotPtr) { | |||
21617 | JS_ReportOutOfMemory(cx); | |||
21618 | return false; | |||
21619 | } | |||
21620 | Nullable<Sequence<JSObject*>>& slot = *slotPtr; | |||
21621 | if (temp.isObject()) { | |||
21622 | JS::ForOfIterator iter1(cx); | |||
21623 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
21624 | return false; | |||
21625 | } | |||
21626 | if (!iter1.valueIsIterable()) { | |||
21627 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
21628 | return false; | |||
21629 | } | |||
21630 | Sequence<JSObject*> &arr1 = slot.SetValue(); | |||
21631 | JS::Rooted<JS::Value> temp1(cx); | |||
21632 | while (true) { | |||
21633 | bool done1; | |||
21634 | if (!iter1.next(&temp1, &done1)) { | |||
21635 | return false; | |||
21636 | } | |||
21637 | if (done1) { | |||
21638 | break; | |||
21639 | } | |||
21640 | JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible); | |||
21641 | if (!slotPtr1) { | |||
21642 | JS_ReportOutOfMemory(cx); | |||
21643 | return false; | |||
21644 | } | |||
21645 | JSObject*& slot1 = *slotPtr1; | |||
21646 | if (temp1.isObject()) { | |||
21647 | slot1 = &temp1.toObject(); | |||
21648 | } else { | |||
21649 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1"); | |||
21650 | return false; | |||
21651 | } | |||
21652 | } | |||
21653 | } else if (temp.isNullOrUndefined()) { | |||
21654 | slot.SetNull(); | |||
21655 | } else { | |||
21656 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
21657 | return false; | |||
21658 | } | |||
21659 | } | |||
21660 | } else if (args[0].isNullOrUndefined()) { | |||
21661 | arg0.Value().SetNull(); | |||
21662 | } else { | |||
21663 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21664 | return false; | |||
21665 | } | |||
21666 | } | |||
21667 | // NOTE: This assert does NOT call the function. | |||
21668 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21669 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfObject(cx, Constify(arg0)); | |||
21670 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21670); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21670; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21671 | args.rval().setUndefined(); | |||
21672 | return true; | |||
21673 | } | |||
21674 | ||||
21675 | static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfObject_methodinfo = { | |||
21676 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfObject }, | |||
21677 | { prototypes::id::TestExampleInterface }, | |||
21678 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21679 | JSJitInfo::Method, | |||
21680 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21681 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21682 | false, /* isInfallible. False in setters. */ | |||
21683 | false, /* isMovable. Not relevant for setters. */ | |||
21684 | false, /* isEliminatable. Not relevant for setters. */ | |||
21685 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21686 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21687 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21688 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21689 | }; | |||
21690 | ||||
21691 | MOZ_CAN_RUN_SCRIPT static bool | |||
21692 | passOptionalNullableSequenceOfNullableSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21693 | { | |||
21694 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject"); | |||
21695 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21698( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
21696 | "TestExampleInterface", "passOptionalNullableSequenceOfNullableSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21698( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
21697 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21698( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
21698 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21698( cx, "TestExampleInterface" , "passOptionalNullableSequenceOfNullableSequenceOfNullableObject" , JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
21699 | ||||
21700 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21701 | Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0; | |||
21702 | Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder; | |||
21703 | if (args.hasDefined(0)) { | |||
21704 | arg0.Construct(); | |||
21705 | arg0_holder.emplace(cx, &arg0.Value().SetValue()); | |||
21706 | if (args[0].isObject()) { | |||
21707 | JS::ForOfIterator iter(cx); | |||
21708 | if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) { | |||
21709 | return false; | |||
21710 | } | |||
21711 | if (!iter.valueIsIterable()) { | |||
21712 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21713 | return false; | |||
21714 | } | |||
21715 | Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue(); | |||
21716 | JS::Rooted<JS::Value> temp(cx); | |||
21717 | while (true) { | |||
21718 | bool done; | |||
21719 | if (!iter.next(&temp, &done)) { | |||
21720 | return false; | |||
21721 | } | |||
21722 | if (done) { | |||
21723 | break; | |||
21724 | } | |||
21725 | Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible); | |||
21726 | if (!slotPtr) { | |||
21727 | JS_ReportOutOfMemory(cx); | |||
21728 | return false; | |||
21729 | } | |||
21730 | Nullable<Sequence<JSObject*>>& slot = *slotPtr; | |||
21731 | if (temp.isObject()) { | |||
21732 | JS::ForOfIterator iter1(cx); | |||
21733 | if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) { | |||
21734 | return false; | |||
21735 | } | |||
21736 | if (!iter1.valueIsIterable()) { | |||
21737 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
21738 | return false; | |||
21739 | } | |||
21740 | Sequence<JSObject*> &arr1 = slot.SetValue(); | |||
21741 | JS::Rooted<JS::Value> temp1(cx); | |||
21742 | while (true) { | |||
21743 | bool done1; | |||
21744 | if (!iter1.next(&temp1, &done1)) { | |||
21745 | return false; | |||
21746 | } | |||
21747 | if (done1) { | |||
21748 | break; | |||
21749 | } | |||
21750 | JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible); | |||
21751 | if (!slotPtr1) { | |||
21752 | JS_ReportOutOfMemory(cx); | |||
21753 | return false; | |||
21754 | } | |||
21755 | JSObject*& slot1 = *slotPtr1; | |||
21756 | if (temp1.isObject()) { | |||
21757 | slot1 = &temp1.toObject(); | |||
21758 | } else if (temp1.isNullOrUndefined()) { | |||
21759 | slot1 = nullptr; | |||
21760 | } else { | |||
21761 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1"); | |||
21762 | return false; | |||
21763 | } | |||
21764 | } | |||
21765 | } else if (temp.isNullOrUndefined()) { | |||
21766 | slot.SetNull(); | |||
21767 | } else { | |||
21768 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence"); | |||
21769 | return false; | |||
21770 | } | |||
21771 | } | |||
21772 | } else if (args[0].isNullOrUndefined()) { | |||
21773 | arg0.Value().SetNull(); | |||
21774 | } else { | |||
21775 | cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence"); | |||
21776 | return false; | |||
21777 | } | |||
21778 | } | |||
21779 | // NOTE: This assert does NOT call the function. | |||
21780 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21781 | MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(cx, Constify(arg0)); | |||
21782 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21782); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21782; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21783 | args.rval().setUndefined(); | |||
21784 | return true; | |||
21785 | } | |||
21786 | ||||
21787 | static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfNullableObject_methodinfo = { | |||
21788 | { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfNullableObject }, | |||
21789 | { prototypes::id::TestExampleInterface }, | |||
21790 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21791 | JSJitInfo::Method, | |||
21792 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21793 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21794 | false, /* isInfallible. False in setters. */ | |||
21795 | false, /* isMovable. Not relevant for setters. */ | |||
21796 | false, /* isEliminatable. Not relevant for setters. */ | |||
21797 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21798 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21799 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21800 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21801 | }; | |||
21802 | ||||
21803 | MOZ_CAN_RUN_SCRIPT static bool | |||
21804 | passRecordOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21805 | { | |||
21806 | BindingCallContext cx(cx_, "TestExampleInterface.passRecordOfObject"); | |||
21807 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21810( cx, "TestExampleInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21808 | "TestExampleInterface", "passRecordOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21810( cx, "TestExampleInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21809 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21810( cx, "TestExampleInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21810 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21810( cx, "TestExampleInterface" , "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21811 | ||||
21812 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21813 | if (!args.requireAtLeast(cx, "TestExampleInterface.passRecordOfObject", 1)) { | |||
21814 | return false; | |||
21815 | } | |||
21816 | Record<nsString, JSObject*> arg0; | |||
21817 | RecordRooter<nsString, JSObject*> arg0_holder(cx, &arg0); | |||
21818 | if (args[0].isObject()) { | |||
21819 | auto& recordEntries = arg0.Entries(); | |||
21820 | ||||
21821 | JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject()); | |||
21822 | JS::RootedVector<jsid> ids(cx); | |||
21823 | if (!js::GetPropertyKeys(cx, recordObj, | |||
21824 | JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) { | |||
21825 | return false; | |||
21826 | } | |||
21827 | if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) { | |||
21828 | JS_ReportOutOfMemory(cx); | |||
21829 | return false; | |||
21830 | } | |||
21831 | JS::Rooted<JS::Value> propNameValue(cx); | |||
21832 | JS::Rooted<JS::Value> temp(cx); | |||
21833 | JS::Rooted<jsid> curId(cx); | |||
21834 | JS::Rooted<JS::Value> idVal(cx); | |||
21835 | // Use a hashset to keep track of ids seen, to avoid | |||
21836 | // introducing nasty O(N^2) behavior scanning for them all the | |||
21837 | // time. Ideally we'd use a data structure with O(1) lookup | |||
21838 | // _and_ ordering for the MozMap, but we don't have one lying | |||
21839 | // around. | |||
21840 | nsTHashtable<nsStringHashKey> idsSeen; | |||
21841 | for (size_t i = 0; i < ids.length(); ++i) { | |||
21842 | curId = ids[i]; | |||
21843 | ||||
21844 | JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx); | |||
21845 | if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId, | |||
21846 | &desc)) { | |||
21847 | return false; | |||
21848 | } | |||
21849 | ||||
21850 | if (desc.isNothing() || !desc->enumerable()) { | |||
21851 | continue; | |||
21852 | } | |||
21853 | ||||
21854 | idVal = js::IdToValue(curId); | |||
21855 | nsString propName; | |||
21856 | // This will just throw if idVal is a Symbol, like the spec says | |||
21857 | // to do. | |||
21858 | if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) { | |||
21859 | return false; | |||
21860 | } | |||
21861 | ||||
21862 | if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) { | |||
21863 | return false; | |||
21864 | } | |||
21865 | ||||
21866 | Record<nsString, JSObject*>::EntryType* entry; | |||
21867 | if (!idsSeen.EnsureInserted(propName)) { | |||
21868 | // Find the existing entry. | |||
21869 | auto idx = recordEntries.IndexOf(propName); | |||
21870 | MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 21871); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 21871; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false) | |||
21871 | "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "idx != recordEntries.NoIndex" " (" "Why is it not found?" ")" , "../TestExampleGenBinding.cpp", 21871); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?" ")"); do { *((volatile int*)__null) = 21871; __attribute__(( nomerge)) ::abort(); } while (false); } } while (false); | |||
21872 | // Now blow it away to make it look like it was just added | |||
21873 | // to the array, because it's not obvious that it's | |||
21874 | // safe to write to its already-initialized mValue via our | |||
21875 | // normal codegen conversions. For example, the value | |||
21876 | // could be a union and this would change its type, but | |||
21877 | // codegen assumes we won't do that. | |||
21878 | entry = recordEntries.ReconstructElementAt(idx); | |||
21879 | } else { | |||
21880 | // Safe to do an infallible append here, because we did a | |||
21881 | // SetCapacity above to the right capacity. | |||
21882 | entry = recordEntries.AppendElement(); | |||
21883 | } | |||
21884 | entry->mKey = propName; | |||
21885 | JSObject*& slot = entry->mValue; | |||
21886 | if (temp.isObject()) { | |||
21887 | slot = &temp.toObject(); | |||
21888 | } else { | |||
21889 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1"); | |||
21890 | return false; | |||
21891 | } | |||
21892 | } | |||
21893 | } else { | |||
21894 | cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1"); | |||
21895 | return false; | |||
21896 | } | |||
21897 | // NOTE: This assert does NOT call the function. | |||
21898 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfObject(cx, Constify(arg0)))>, "Should be returning void here"); | |||
21899 | MOZ_KnownLive(self)(self)->PassRecordOfObject(cx, Constify(arg0)); | |||
21900 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21900); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21900; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21901 | args.rval().setUndefined(); | |||
21902 | return true; | |||
21903 | } | |||
21904 | ||||
21905 | static const JSJitInfo passRecordOfObject_methodinfo = { | |||
21906 | { (JSJitGetterOp)passRecordOfObject }, | |||
21907 | { prototypes::id::TestExampleInterface }, | |||
21908 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21909 | JSJitInfo::Method, | |||
21910 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21911 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
21912 | false, /* isInfallible. False in setters. */ | |||
21913 | false, /* isMovable. Not relevant for setters. */ | |||
21914 | false, /* isEliminatable. Not relevant for setters. */ | |||
21915 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21916 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21917 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21918 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21919 | }; | |||
21920 | ||||
21921 | MOZ_CAN_RUN_SCRIPT static bool | |||
21922 | receiveObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21923 | { | |||
21924 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21927( cx, "TestExampleInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21925 | "TestExampleInterface", "receiveObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21927( cx, "TestExampleInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21926 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21927( cx, "TestExampleInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21927 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21927( cx, "TestExampleInterface" , "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js ::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21928 | ||||
21929 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21930 | JS::Rooted<JSObject*> result(cx); | |||
21931 | // NOTE: This assert does NOT call the function. | |||
21932 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveObject(cx, &result))>, "Should be returning void here"); | |||
21933 | MOZ_KnownLive(self)(self)->ReceiveObject(cx, &result); | |||
21934 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21934); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21934; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21935 | JS::ExposeObjectToActiveJS(result); | |||
21936 | args.rval().setObject(*result); | |||
21937 | if (!MaybeWrapObjectValue(cx, args.rval())) { | |||
21938 | return false; | |||
21939 | } | |||
21940 | return true; | |||
21941 | } | |||
21942 | ||||
21943 | static const JSJitInfo receiveObject_methodinfo = { | |||
21944 | { (JSJitGetterOp)receiveObject }, | |||
21945 | { prototypes::id::TestExampleInterface }, | |||
21946 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21947 | JSJitInfo::Method, | |||
21948 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21949 | JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */ | |||
21950 | false, /* isInfallible. False in setters. */ | |||
21951 | false, /* isMovable. Not relevant for setters. */ | |||
21952 | false, /* isEliminatable. Not relevant for setters. */ | |||
21953 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21954 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21955 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21956 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21957 | }; | |||
21958 | ||||
21959 | MOZ_CAN_RUN_SCRIPT static bool | |||
21960 | receiveNullableObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
21961 | { | |||
21962 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21965( cx, "TestExampleInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21963 | "TestExampleInterface", "receiveNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21965( cx, "TestExampleInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21964 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21965( cx, "TestExampleInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
21965 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21965( cx, "TestExampleInterface" , "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
21966 | ||||
21967 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
21968 | JS::Rooted<JSObject*> result(cx); | |||
21969 | // NOTE: This assert does NOT call the function. | |||
21970 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableObject(cx, &result))>, "Should be returning void here"); | |||
21971 | MOZ_KnownLive(self)(self)->ReceiveNullableObject(cx, &result); | |||
21972 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 21972); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 21972; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
21973 | if (result) { | |||
21974 | JS::ExposeObjectToActiveJS(result); | |||
21975 | } | |||
21976 | args.rval().setObjectOrNull(result); | |||
21977 | if (!MaybeWrapObjectOrNullValue(cx, args.rval())) { | |||
21978 | return false; | |||
21979 | } | |||
21980 | return true; | |||
21981 | } | |||
21982 | ||||
21983 | static const JSJitInfo receiveNullableObject_methodinfo = { | |||
21984 | { (JSJitGetterOp)receiveNullableObject }, | |||
21985 | { prototypes::id::TestExampleInterface }, | |||
21986 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
21987 | JSJitInfo::Method, | |||
21988 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
21989 | JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */ | |||
21990 | false, /* isInfallible. False in setters. */ | |||
21991 | false, /* isMovable. Not relevant for setters. */ | |||
21992 | false, /* isEliminatable. Not relevant for setters. */ | |||
21993 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
21994 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
21995 | false, /* isTypedMethod. Only relevant for methods. */ | |||
21996 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
21997 | }; | |||
21998 | ||||
21999 | MOZ_CAN_RUN_SCRIPT static bool | |||
22000 | passUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22001 | { | |||
22002 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion"); | |||
22003 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22006( cx, "TestExampleInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
22004 | "TestExampleInterface", "passUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22006( cx, "TestExampleInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
22005 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22006( cx, "TestExampleInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)) | |||
22006 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22006( cx, "TestExampleInterface" , "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame ::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame ::Flags::RELEVANT_FOR_JS)); | |||
22007 | ||||
22008 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22009 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion", 1)) { | |||
22010 | return false; | |||
22011 | } | |||
22012 | ObjectOrLong arg0; | |||
22013 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22014 | return false; | |||
22015 | } | |||
22016 | // NOTE: This assert does NOT call the function. | |||
22017 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22018 | MOZ_KnownLive(self)(self)->PassUnion(cx, Constify(arg0)); | |||
22019 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22019); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22019; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22020 | args.rval().setUndefined(); | |||
22021 | return true; | |||
22022 | } | |||
22023 | ||||
22024 | static const JSJitInfo passUnion_methodinfo = { | |||
22025 | { (JSJitGetterOp)passUnion }, | |||
22026 | { prototypes::id::TestExampleInterface }, | |||
22027 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22028 | JSJitInfo::Method, | |||
22029 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22030 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22031 | false, /* isInfallible. False in setters. */ | |||
22032 | false, /* isMovable. Not relevant for setters. */ | |||
22033 | false, /* isEliminatable. Not relevant for setters. */ | |||
22034 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22035 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22036 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22037 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22038 | }; | |||
22039 | ||||
22040 | MOZ_CAN_RUN_SCRIPT static bool | |||
22041 | passUnion2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22042 | { | |||
22043 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion2"); | |||
22044 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22047( cx, "TestExampleInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22045 | "TestExampleInterface", "passUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22047( cx, "TestExampleInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22046 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22047( cx, "TestExampleInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22047 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22047( cx, "TestExampleInterface" , "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22048 | ||||
22049 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22050 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion2", 1)) { | |||
22051 | return false; | |||
22052 | } | |||
22053 | LongOrBoolean arg0; | |||
22054 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22055 | return false; | |||
22056 | } | |||
22057 | // NOTE: This assert does NOT call the function. | |||
22058 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion2(Constify(arg0)))>, "Should be returning void here"); | |||
22059 | MOZ_KnownLive(self)(self)->PassUnion2(Constify(arg0)); | |||
22060 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22060); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22060; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22061 | args.rval().setUndefined(); | |||
22062 | return true; | |||
22063 | } | |||
22064 | ||||
22065 | static const JSJitInfo passUnion2_methodinfo = { | |||
22066 | { (JSJitGetterOp)passUnion2 }, | |||
22067 | { prototypes::id::TestExampleInterface }, | |||
22068 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22069 | JSJitInfo::Method, | |||
22070 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22071 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22072 | false, /* isInfallible. False in setters. */ | |||
22073 | false, /* isMovable. Not relevant for setters. */ | |||
22074 | false, /* isEliminatable. Not relevant for setters. */ | |||
22075 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22076 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22077 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22078 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22079 | }; | |||
22080 | ||||
22081 | MOZ_CAN_RUN_SCRIPT static bool | |||
22082 | passUnion3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22083 | { | |||
22084 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion3"); | |||
22085 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22088( cx, "TestExampleInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22086 | "TestExampleInterface", "passUnion3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22088( cx, "TestExampleInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22087 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22088( cx, "TestExampleInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22088 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22088( cx, "TestExampleInterface" , "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22089 | ||||
22090 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22091 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion3", 1)) { | |||
22092 | return false; | |||
22093 | } | |||
22094 | ObjectOrLongOrBoolean arg0; | |||
22095 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22096 | return false; | |||
22097 | } | |||
22098 | // NOTE: This assert does NOT call the function. | |||
22099 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion3(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22100 | MOZ_KnownLive(self)(self)->PassUnion3(cx, Constify(arg0)); | |||
22101 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22101); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22101; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22102 | args.rval().setUndefined(); | |||
22103 | return true; | |||
22104 | } | |||
22105 | ||||
22106 | static const JSJitInfo passUnion3_methodinfo = { | |||
22107 | { (JSJitGetterOp)passUnion3 }, | |||
22108 | { prototypes::id::TestExampleInterface }, | |||
22109 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22110 | JSJitInfo::Method, | |||
22111 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22112 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22113 | false, /* isInfallible. False in setters. */ | |||
22114 | false, /* isMovable. Not relevant for setters. */ | |||
22115 | false, /* isEliminatable. Not relevant for setters. */ | |||
22116 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22117 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22118 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22119 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22120 | }; | |||
22121 | ||||
22122 | MOZ_CAN_RUN_SCRIPT static bool | |||
22123 | passUnion4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22124 | { | |||
22125 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion4"); | |||
22126 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22129( cx, "TestExampleInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22127 | "TestExampleInterface", "passUnion4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22129( cx, "TestExampleInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22128 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22129( cx, "TestExampleInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22129 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22129( cx, "TestExampleInterface" , "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22130 | ||||
22131 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22132 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion4", 1)) { | |||
22133 | return false; | |||
22134 | } | |||
22135 | NodeOrLongOrBoolean arg0; | |||
22136 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22137 | return false; | |||
22138 | } | |||
22139 | // NOTE: This assert does NOT call the function. | |||
22140 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion4(Constify(arg0)))>, "Should be returning void here"); | |||
22141 | MOZ_KnownLive(self)(self)->PassUnion4(Constify(arg0)); | |||
22142 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22142); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22142; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22143 | args.rval().setUndefined(); | |||
22144 | return true; | |||
22145 | } | |||
22146 | ||||
22147 | static const JSJitInfo passUnion4_methodinfo = { | |||
22148 | { (JSJitGetterOp)passUnion4 }, | |||
22149 | { prototypes::id::TestExampleInterface }, | |||
22150 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22151 | JSJitInfo::Method, | |||
22152 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22153 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22154 | false, /* isInfallible. False in setters. */ | |||
22155 | false, /* isMovable. Not relevant for setters. */ | |||
22156 | false, /* isEliminatable. Not relevant for setters. */ | |||
22157 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22158 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22159 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22160 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22161 | }; | |||
22162 | ||||
22163 | MOZ_CAN_RUN_SCRIPT static bool | |||
22164 | passUnion5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22165 | { | |||
22166 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion5"); | |||
22167 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22170( cx, "TestExampleInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22168 | "TestExampleInterface", "passUnion5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22170( cx, "TestExampleInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22169 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22170( cx, "TestExampleInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22170 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22170( cx, "TestExampleInterface" , "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22171 | ||||
22172 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22173 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion5", 1)) { | |||
22174 | return false; | |||
22175 | } | |||
22176 | ObjectOrBoolean arg0; | |||
22177 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22178 | return false; | |||
22179 | } | |||
22180 | // NOTE: This assert does NOT call the function. | |||
22181 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion5(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22182 | MOZ_KnownLive(self)(self)->PassUnion5(cx, Constify(arg0)); | |||
22183 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22183); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22183; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22184 | args.rval().setUndefined(); | |||
22185 | return true; | |||
22186 | } | |||
22187 | ||||
22188 | static const JSJitInfo passUnion5_methodinfo = { | |||
22189 | { (JSJitGetterOp)passUnion5 }, | |||
22190 | { prototypes::id::TestExampleInterface }, | |||
22191 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22192 | JSJitInfo::Method, | |||
22193 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22194 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22195 | false, /* isInfallible. False in setters. */ | |||
22196 | false, /* isMovable. Not relevant for setters. */ | |||
22197 | false, /* isEliminatable. Not relevant for setters. */ | |||
22198 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22199 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22200 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22201 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22202 | }; | |||
22203 | ||||
22204 | MOZ_CAN_RUN_SCRIPT static bool | |||
22205 | passUnion6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22206 | { | |||
22207 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion6"); | |||
22208 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22211( cx, "TestExampleInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22209 | "TestExampleInterface", "passUnion6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22211( cx, "TestExampleInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22210 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22211( cx, "TestExampleInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22211 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22211( cx, "TestExampleInterface" , "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22212 | ||||
22213 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22214 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion6", 1)) { | |||
22215 | return false; | |||
22216 | } | |||
22217 | ObjectOrString arg0; | |||
22218 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22219 | return false; | |||
22220 | } | |||
22221 | // NOTE: This assert does NOT call the function. | |||
22222 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion6(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22223 | MOZ_KnownLive(self)(self)->PassUnion6(cx, Constify(arg0)); | |||
22224 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22224); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22224; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22225 | args.rval().setUndefined(); | |||
22226 | return true; | |||
22227 | } | |||
22228 | ||||
22229 | static const JSJitInfo passUnion6_methodinfo = { | |||
22230 | { (JSJitGetterOp)passUnion6 }, | |||
22231 | { prototypes::id::TestExampleInterface }, | |||
22232 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22233 | JSJitInfo::Method, | |||
22234 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22235 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22236 | false, /* isInfallible. False in setters. */ | |||
22237 | false, /* isMovable. Not relevant for setters. */ | |||
22238 | false, /* isEliminatable. Not relevant for setters. */ | |||
22239 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22240 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22241 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22242 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22243 | }; | |||
22244 | ||||
22245 | MOZ_CAN_RUN_SCRIPT static bool | |||
22246 | passUnion7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22247 | { | |||
22248 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion7"); | |||
22249 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22252( cx, "TestExampleInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22250 | "TestExampleInterface", "passUnion7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22252( cx, "TestExampleInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22251 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22252( cx, "TestExampleInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22252 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22252( cx, "TestExampleInterface" , "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22253 | ||||
22254 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22255 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion7", 1)) { | |||
22256 | return false; | |||
22257 | } | |||
22258 | ObjectOrStringOrLong arg0; | |||
22259 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22260 | return false; | |||
22261 | } | |||
22262 | // NOTE: This assert does NOT call the function. | |||
22263 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion7(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22264 | MOZ_KnownLive(self)(self)->PassUnion7(cx, Constify(arg0)); | |||
22265 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22265); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22265; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22266 | args.rval().setUndefined(); | |||
22267 | return true; | |||
22268 | } | |||
22269 | ||||
22270 | static const JSJitInfo passUnion7_methodinfo = { | |||
22271 | { (JSJitGetterOp)passUnion7 }, | |||
22272 | { prototypes::id::TestExampleInterface }, | |||
22273 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22274 | JSJitInfo::Method, | |||
22275 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22276 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22277 | false, /* isInfallible. False in setters. */ | |||
22278 | false, /* isMovable. Not relevant for setters. */ | |||
22279 | false, /* isEliminatable. Not relevant for setters. */ | |||
22280 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22281 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22282 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22283 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22284 | }; | |||
22285 | ||||
22286 | MOZ_CAN_RUN_SCRIPT static bool | |||
22287 | passUnion8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22288 | { | |||
22289 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion8"); | |||
22290 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22293( cx, "TestExampleInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22291 | "TestExampleInterface", "passUnion8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22293( cx, "TestExampleInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22292 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22293( cx, "TestExampleInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22293 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22293( cx, "TestExampleInterface" , "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22294 | ||||
22295 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22296 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion8", 1)) { | |||
22297 | return false; | |||
22298 | } | |||
22299 | ObjectOrStringOrBoolean arg0; | |||
22300 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22301 | return false; | |||
22302 | } | |||
22303 | // NOTE: This assert does NOT call the function. | |||
22304 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion8(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22305 | MOZ_KnownLive(self)(self)->PassUnion8(cx, Constify(arg0)); | |||
22306 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22306); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22306; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22307 | args.rval().setUndefined(); | |||
22308 | return true; | |||
22309 | } | |||
22310 | ||||
22311 | static const JSJitInfo passUnion8_methodinfo = { | |||
22312 | { (JSJitGetterOp)passUnion8 }, | |||
22313 | { prototypes::id::TestExampleInterface }, | |||
22314 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22315 | JSJitInfo::Method, | |||
22316 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22317 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22318 | false, /* isInfallible. False in setters. */ | |||
22319 | false, /* isMovable. Not relevant for setters. */ | |||
22320 | false, /* isEliminatable. Not relevant for setters. */ | |||
22321 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22322 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22323 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22324 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22325 | }; | |||
22326 | ||||
22327 | MOZ_CAN_RUN_SCRIPT static bool | |||
22328 | passUnion9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22329 | { | |||
22330 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion9"); | |||
22331 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22334( cx, "TestExampleInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22332 | "TestExampleInterface", "passUnion9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22334( cx, "TestExampleInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22333 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22334( cx, "TestExampleInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22334 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22334( cx, "TestExampleInterface" , "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22335 | ||||
22336 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22337 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion9", 1)) { | |||
22338 | return false; | |||
22339 | } | |||
22340 | ObjectOrStringOrLongOrBoolean arg0; | |||
22341 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22342 | return false; | |||
22343 | } | |||
22344 | // NOTE: This assert does NOT call the function. | |||
22345 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion9(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22346 | MOZ_KnownLive(self)(self)->PassUnion9(cx, Constify(arg0)); | |||
22347 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22347); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22347; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22348 | args.rval().setUndefined(); | |||
22349 | return true; | |||
22350 | } | |||
22351 | ||||
22352 | static const JSJitInfo passUnion9_methodinfo = { | |||
22353 | { (JSJitGetterOp)passUnion9 }, | |||
22354 | { prototypes::id::TestExampleInterface }, | |||
22355 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22356 | JSJitInfo::Method, | |||
22357 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22358 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22359 | false, /* isInfallible. False in setters. */ | |||
22360 | false, /* isMovable. Not relevant for setters. */ | |||
22361 | false, /* isEliminatable. Not relevant for setters. */ | |||
22362 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22363 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22364 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22365 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22366 | }; | |||
22367 | ||||
22368 | MOZ_CAN_RUN_SCRIPT static bool | |||
22369 | passUnion10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22370 | { | |||
22371 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion10"); | |||
22372 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22375( cx, "TestExampleInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22373 | "TestExampleInterface", "passUnion10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22375( cx, "TestExampleInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22374 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22375( cx, "TestExampleInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22375 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22375( cx, "TestExampleInterface" , "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22376 | ||||
22377 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22378 | EventInitOrLong arg0; | |||
22379 | if (!(args.hasDefined(0))) { | |||
22380 | if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or long)")) { | |||
22381 | return false; | |||
22382 | } | |||
22383 | } else { | |||
22384 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22385 | return false; | |||
22386 | } | |||
22387 | } | |||
22388 | // NOTE: This assert does NOT call the function. | |||
22389 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion10(Constify(arg0)))>, "Should be returning void here"); | |||
22390 | MOZ_KnownLive(self)(self)->PassUnion10(Constify(arg0)); | |||
22391 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22391); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22391; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22392 | args.rval().setUndefined(); | |||
22393 | return true; | |||
22394 | } | |||
22395 | ||||
22396 | static const JSJitInfo passUnion10_methodinfo = { | |||
22397 | { (JSJitGetterOp)passUnion10 }, | |||
22398 | { prototypes::id::TestExampleInterface }, | |||
22399 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22400 | JSJitInfo::Method, | |||
22401 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22402 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22403 | false, /* isInfallible. False in setters. */ | |||
22404 | false, /* isMovable. Not relevant for setters. */ | |||
22405 | false, /* isEliminatable. Not relevant for setters. */ | |||
22406 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22407 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22408 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22409 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22410 | }; | |||
22411 | ||||
22412 | MOZ_CAN_RUN_SCRIPT static bool | |||
22413 | passUnion11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22414 | { | |||
22415 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion11"); | |||
22416 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22419( cx, "TestExampleInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22417 | "TestExampleInterface", "passUnion11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22419( cx, "TestExampleInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22418 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22419( cx, "TestExampleInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22419 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22419( cx, "TestExampleInterface" , "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22420 | ||||
22421 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22422 | CustomEventInitOrLong arg0; | |||
22423 | if (!(args.hasDefined(0))) { | |||
22424 | if (!arg0.RawSetAsCustomEventInit(cx).Init(cx, JS::NullHandleValue, "Member of (CustomEventInit or long)")) { | |||
22425 | return false; | |||
22426 | } | |||
22427 | } else { | |||
22428 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22429 | return false; | |||
22430 | } | |||
22431 | } | |||
22432 | // NOTE: This assert does NOT call the function. | |||
22433 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion11(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22434 | MOZ_KnownLive(self)(self)->PassUnion11(cx, Constify(arg0)); | |||
22435 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22435); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22435; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22436 | args.rval().setUndefined(); | |||
22437 | return true; | |||
22438 | } | |||
22439 | ||||
22440 | static const JSJitInfo passUnion11_methodinfo = { | |||
22441 | { (JSJitGetterOp)passUnion11 }, | |||
22442 | { prototypes::id::TestExampleInterface }, | |||
22443 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22444 | JSJitInfo::Method, | |||
22445 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22446 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22447 | false, /* isInfallible. False in setters. */ | |||
22448 | false, /* isMovable. Not relevant for setters. */ | |||
22449 | false, /* isEliminatable. Not relevant for setters. */ | |||
22450 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22451 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22452 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22453 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22454 | }; | |||
22455 | ||||
22456 | MOZ_CAN_RUN_SCRIPT static bool | |||
22457 | passUnion12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22458 | { | |||
22459 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion12"); | |||
22460 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22463( cx, "TestExampleInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22461 | "TestExampleInterface", "passUnion12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22463( cx, "TestExampleInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22462 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22463( cx, "TestExampleInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22463 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22463( cx, "TestExampleInterface" , "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22464 | ||||
22465 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22466 | EventInitOrLong arg0; | |||
22467 | if (!(args.hasDefined(0))) { | |||
22468 | arg0.RawSetAsLong() = 5; | |||
22469 | } else { | |||
22470 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22471 | return false; | |||
22472 | } | |||
22473 | } | |||
22474 | // NOTE: This assert does NOT call the function. | |||
22475 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion12(Constify(arg0)))>, "Should be returning void here"); | |||
22476 | MOZ_KnownLive(self)(self)->PassUnion12(Constify(arg0)); | |||
22477 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22477); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22477; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22478 | args.rval().setUndefined(); | |||
22479 | return true; | |||
22480 | } | |||
22481 | ||||
22482 | static const JSJitInfo passUnion12_methodinfo = { | |||
22483 | { (JSJitGetterOp)passUnion12 }, | |||
22484 | { prototypes::id::TestExampleInterface }, | |||
22485 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22486 | JSJitInfo::Method, | |||
22487 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22488 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22489 | false, /* isInfallible. False in setters. */ | |||
22490 | false, /* isMovable. Not relevant for setters. */ | |||
22491 | false, /* isEliminatable. Not relevant for setters. */ | |||
22492 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22493 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22494 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22495 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22496 | }; | |||
22497 | ||||
22498 | MOZ_CAN_RUN_SCRIPT static bool | |||
22499 | passUnion13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22500 | { | |||
22501 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion13"); | |||
22502 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22505( cx, "TestExampleInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22503 | "TestExampleInterface", "passUnion13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22505( cx, "TestExampleInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22504 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22505( cx, "TestExampleInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22505 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22505( cx, "TestExampleInterface" , "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22506 | ||||
22507 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22508 | ObjectOrLongOrNull arg0; | |||
22509 | if (!(args.hasDefined(0))) { | |||
22510 | arg0.SetNull(); | |||
22511 | } else { | |||
22512 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22513 | return false; | |||
22514 | } | |||
22515 | } | |||
22516 | // NOTE: This assert does NOT call the function. | |||
22517 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion13(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22518 | MOZ_KnownLive(self)(self)->PassUnion13(cx, Constify(arg0)); | |||
22519 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22519); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22519; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22520 | args.rval().setUndefined(); | |||
22521 | return true; | |||
22522 | } | |||
22523 | ||||
22524 | static const JSJitInfo passUnion13_methodinfo = { | |||
22525 | { (JSJitGetterOp)passUnion13 }, | |||
22526 | { prototypes::id::TestExampleInterface }, | |||
22527 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22528 | JSJitInfo::Method, | |||
22529 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22530 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22531 | false, /* isInfallible. False in setters. */ | |||
22532 | false, /* isMovable. Not relevant for setters. */ | |||
22533 | false, /* isEliminatable. Not relevant for setters. */ | |||
22534 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22535 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22536 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22537 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22538 | }; | |||
22539 | ||||
22540 | MOZ_CAN_RUN_SCRIPT static bool | |||
22541 | passUnion14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22542 | { | |||
22543 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion14"); | |||
22544 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22547( cx, "TestExampleInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22545 | "TestExampleInterface", "passUnion14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22547( cx, "TestExampleInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22546 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22547( cx, "TestExampleInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22547 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22547( cx, "TestExampleInterface" , "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22548 | ||||
22549 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22550 | ObjectOrLongOrNull arg0; | |||
22551 | if (!(args.hasDefined(0))) { | |||
22552 | arg0.RawSetAsLong() = 5; | |||
22553 | } else { | |||
22554 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22555 | return false; | |||
22556 | } | |||
22557 | } | |||
22558 | // NOTE: This assert does NOT call the function. | |||
22559 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion14(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22560 | MOZ_KnownLive(self)(self)->PassUnion14(cx, Constify(arg0)); | |||
22561 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22561); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22561; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22562 | args.rval().setUndefined(); | |||
22563 | return true; | |||
22564 | } | |||
22565 | ||||
22566 | static const JSJitInfo passUnion14_methodinfo = { | |||
22567 | { (JSJitGetterOp)passUnion14 }, | |||
22568 | { prototypes::id::TestExampleInterface }, | |||
22569 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22570 | JSJitInfo::Method, | |||
22571 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22572 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22573 | false, /* isInfallible. False in setters. */ | |||
22574 | false, /* isMovable. Not relevant for setters. */ | |||
22575 | false, /* isEliminatable. Not relevant for setters. */ | |||
22576 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22577 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22578 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22579 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22580 | }; | |||
22581 | ||||
22582 | MOZ_CAN_RUN_SCRIPT static bool | |||
22583 | passUnion15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22584 | { | |||
22585 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion15"); | |||
22586 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22589( cx, "TestExampleInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22587 | "TestExampleInterface", "passUnion15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22589( cx, "TestExampleInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22588 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22589( cx, "TestExampleInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22589 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22589( cx, "TestExampleInterface" , "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22590 | ||||
22591 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22592 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion15", 1)) { | |||
22593 | return false; | |||
22594 | } | |||
22595 | LongSequenceOrLong arg0; | |||
22596 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22597 | return false; | |||
22598 | } | |||
22599 | // NOTE: This assert does NOT call the function. | |||
22600 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion15(Constify(arg0)))>, "Should be returning void here"); | |||
22601 | MOZ_KnownLive(self)(self)->PassUnion15(Constify(arg0)); | |||
22602 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22602); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22602; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22603 | args.rval().setUndefined(); | |||
22604 | return true; | |||
22605 | } | |||
22606 | ||||
22607 | static const JSJitInfo passUnion15_methodinfo = { | |||
22608 | { (JSJitGetterOp)passUnion15 }, | |||
22609 | { prototypes::id::TestExampleInterface }, | |||
22610 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22611 | JSJitInfo::Method, | |||
22612 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22613 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22614 | false, /* isInfallible. False in setters. */ | |||
22615 | false, /* isMovable. Not relevant for setters. */ | |||
22616 | false, /* isEliminatable. Not relevant for setters. */ | |||
22617 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22618 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22619 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22620 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22621 | }; | |||
22622 | ||||
22623 | MOZ_CAN_RUN_SCRIPT static bool | |||
22624 | passUnion16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22625 | { | |||
22626 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion16"); | |||
22627 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22630( cx, "TestExampleInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22628 | "TestExampleInterface", "passUnion16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22630( cx, "TestExampleInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22629 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22630( cx, "TestExampleInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22630 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22630( cx, "TestExampleInterface" , "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22631 | ||||
22632 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22633 | Optional<LongSequenceOrLong> arg0; | |||
22634 | if (args.hasDefined(0)) { | |||
22635 | arg0.Construct(); | |||
22636 | if (!arg0.Value().Init(cx, args[0], "Argument 1", false)) { | |||
22637 | return false; | |||
22638 | } | |||
22639 | } | |||
22640 | // NOTE: This assert does NOT call the function. | |||
22641 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion16(Constify(arg0)))>, "Should be returning void here"); | |||
22642 | MOZ_KnownLive(self)(self)->PassUnion16(Constify(arg0)); | |||
22643 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22643); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22643; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22644 | args.rval().setUndefined(); | |||
22645 | return true; | |||
22646 | } | |||
22647 | ||||
22648 | static const JSJitInfo passUnion16_methodinfo = { | |||
22649 | { (JSJitGetterOp)passUnion16 }, | |||
22650 | { prototypes::id::TestExampleInterface }, | |||
22651 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22652 | JSJitInfo::Method, | |||
22653 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22654 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22655 | false, /* isInfallible. False in setters. */ | |||
22656 | false, /* isMovable. Not relevant for setters. */ | |||
22657 | false, /* isEliminatable. Not relevant for setters. */ | |||
22658 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22659 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22660 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22661 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22662 | }; | |||
22663 | ||||
22664 | MOZ_CAN_RUN_SCRIPT static bool | |||
22665 | passUnion17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22666 | { | |||
22667 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion17"); | |||
22668 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22671( cx, "TestExampleInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22669 | "TestExampleInterface", "passUnion17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22671( cx, "TestExampleInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22670 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22671( cx, "TestExampleInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22671 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22671( cx, "TestExampleInterface" , "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22672 | ||||
22673 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22674 | LongSequenceOrNullOrLong arg0; | |||
22675 | if (!(args.hasDefined(0))) { | |||
22676 | arg0.RawSetAsLong() = 5; | |||
22677 | } else { | |||
22678 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22679 | return false; | |||
22680 | } | |||
22681 | } | |||
22682 | // NOTE: This assert does NOT call the function. | |||
22683 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion17(Constify(arg0)))>, "Should be returning void here"); | |||
22684 | MOZ_KnownLive(self)(self)->PassUnion17(Constify(arg0)); | |||
22685 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22685); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22685; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22686 | args.rval().setUndefined(); | |||
22687 | return true; | |||
22688 | } | |||
22689 | ||||
22690 | static const JSJitInfo passUnion17_methodinfo = { | |||
22691 | { (JSJitGetterOp)passUnion17 }, | |||
22692 | { prototypes::id::TestExampleInterface }, | |||
22693 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22694 | JSJitInfo::Method, | |||
22695 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22696 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22697 | false, /* isInfallible. False in setters. */ | |||
22698 | false, /* isMovable. Not relevant for setters. */ | |||
22699 | false, /* isEliminatable. Not relevant for setters. */ | |||
22700 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22701 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22702 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22703 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22704 | }; | |||
22705 | ||||
22706 | MOZ_CAN_RUN_SCRIPT static bool | |||
22707 | passUnion18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22708 | { | |||
22709 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion18"); | |||
22710 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22713( cx, "TestExampleInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22711 | "TestExampleInterface", "passUnion18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22713( cx, "TestExampleInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22712 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22713( cx, "TestExampleInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22713 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22713( cx, "TestExampleInterface" , "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22714 | ||||
22715 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22716 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion18", 1)) { | |||
22717 | return false; | |||
22718 | } | |||
22719 | ObjectSequenceOrLong arg0; | |||
22720 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22721 | return false; | |||
22722 | } | |||
22723 | // NOTE: This assert does NOT call the function. | |||
22724 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion18(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22725 | MOZ_KnownLive(self)(self)->PassUnion18(cx, Constify(arg0)); | |||
22726 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22726); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22726; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22727 | args.rval().setUndefined(); | |||
22728 | return true; | |||
22729 | } | |||
22730 | ||||
22731 | static const JSJitInfo passUnion18_methodinfo = { | |||
22732 | { (JSJitGetterOp)passUnion18 }, | |||
22733 | { prototypes::id::TestExampleInterface }, | |||
22734 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22735 | JSJitInfo::Method, | |||
22736 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22737 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22738 | false, /* isInfallible. False in setters. */ | |||
22739 | false, /* isMovable. Not relevant for setters. */ | |||
22740 | false, /* isEliminatable. Not relevant for setters. */ | |||
22741 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22742 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22743 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22744 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22745 | }; | |||
22746 | ||||
22747 | MOZ_CAN_RUN_SCRIPT static bool | |||
22748 | passUnion19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22749 | { | |||
22750 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion19"); | |||
22751 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22754( cx, "TestExampleInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22752 | "TestExampleInterface", "passUnion19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22754( cx, "TestExampleInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22753 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22754( cx, "TestExampleInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22754 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22754( cx, "TestExampleInterface" , "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22755 | ||||
22756 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22757 | Optional<ObjectSequenceOrLong> arg0; | |||
22758 | if (args.hasDefined(0)) { | |||
22759 | arg0.Construct(); | |||
22760 | if (!arg0.Value().Init(cx, args[0], "Argument 1", false)) { | |||
22761 | return false; | |||
22762 | } | |||
22763 | } | |||
22764 | // NOTE: This assert does NOT call the function. | |||
22765 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion19(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22766 | MOZ_KnownLive(self)(self)->PassUnion19(cx, Constify(arg0)); | |||
22767 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22767); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22767; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22768 | args.rval().setUndefined(); | |||
22769 | return true; | |||
22770 | } | |||
22771 | ||||
22772 | static const JSJitInfo passUnion19_methodinfo = { | |||
22773 | { (JSJitGetterOp)passUnion19 }, | |||
22774 | { prototypes::id::TestExampleInterface }, | |||
22775 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22776 | JSJitInfo::Method, | |||
22777 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22778 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22779 | false, /* isInfallible. False in setters. */ | |||
22780 | false, /* isMovable. Not relevant for setters. */ | |||
22781 | false, /* isEliminatable. Not relevant for setters. */ | |||
22782 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22783 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22784 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22785 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22786 | }; | |||
22787 | ||||
22788 | MOZ_CAN_RUN_SCRIPT static bool | |||
22789 | passUnion20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22790 | { | |||
22791 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion20"); | |||
22792 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22795( cx, "TestExampleInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22793 | "TestExampleInterface", "passUnion20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22795( cx, "TestExampleInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22794 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22795( cx, "TestExampleInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22795 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22795( cx, "TestExampleInterface" , "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22796 | ||||
22797 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22798 | ObjectSequenceOrLong arg0; | |||
22799 | if (!(args.hasDefined(0))) { | |||
22800 | Unused << arg0.RawSetAsObjectSequence(cx); | |||
22801 | } else { | |||
22802 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22803 | return false; | |||
22804 | } | |||
22805 | } | |||
22806 | // NOTE: This assert does NOT call the function. | |||
22807 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion20(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22808 | MOZ_KnownLive(self)(self)->PassUnion20(cx, Constify(arg0)); | |||
22809 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22809); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22809; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22810 | args.rval().setUndefined(); | |||
22811 | return true; | |||
22812 | } | |||
22813 | ||||
22814 | static const JSJitInfo passUnion20_methodinfo = { | |||
22815 | { (JSJitGetterOp)passUnion20 }, | |||
22816 | { prototypes::id::TestExampleInterface }, | |||
22817 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22818 | JSJitInfo::Method, | |||
22819 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22820 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22821 | false, /* isInfallible. False in setters. */ | |||
22822 | false, /* isMovable. Not relevant for setters. */ | |||
22823 | false, /* isEliminatable. Not relevant for setters. */ | |||
22824 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22825 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22826 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22827 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22828 | }; | |||
22829 | ||||
22830 | MOZ_CAN_RUN_SCRIPT static bool | |||
22831 | passUnion21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22832 | { | |||
22833 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion21"); | |||
22834 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22837( cx, "TestExampleInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22835 | "TestExampleInterface", "passUnion21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22837( cx, "TestExampleInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22836 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22837( cx, "TestExampleInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22837 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22837( cx, "TestExampleInterface" , "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22838 | ||||
22839 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22840 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion21", 1)) { | |||
22841 | return false; | |||
22842 | } | |||
22843 | StringLongRecordOrLong arg0; | |||
22844 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22845 | return false; | |||
22846 | } | |||
22847 | // NOTE: This assert does NOT call the function. | |||
22848 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion21(Constify(arg0)))>, "Should be returning void here"); | |||
22849 | MOZ_KnownLive(self)(self)->PassUnion21(Constify(arg0)); | |||
22850 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22850); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22850; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22851 | args.rval().setUndefined(); | |||
22852 | return true; | |||
22853 | } | |||
22854 | ||||
22855 | static const JSJitInfo passUnion21_methodinfo = { | |||
22856 | { (JSJitGetterOp)passUnion21 }, | |||
22857 | { prototypes::id::TestExampleInterface }, | |||
22858 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22859 | JSJitInfo::Method, | |||
22860 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22861 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22862 | false, /* isInfallible. False in setters. */ | |||
22863 | false, /* isMovable. Not relevant for setters. */ | |||
22864 | false, /* isEliminatable. Not relevant for setters. */ | |||
22865 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22866 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22867 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22868 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22869 | }; | |||
22870 | ||||
22871 | MOZ_CAN_RUN_SCRIPT static bool | |||
22872 | passUnion22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22873 | { | |||
22874 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion22"); | |||
22875 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22878( cx, "TestExampleInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22876 | "TestExampleInterface", "passUnion22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22878( cx, "TestExampleInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22877 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22878( cx, "TestExampleInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22878 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22878( cx, "TestExampleInterface" , "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22879 | ||||
22880 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22881 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion22", 1)) { | |||
22882 | return false; | |||
22883 | } | |||
22884 | StringObjectRecordOrLong arg0; | |||
22885 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22886 | return false; | |||
22887 | } | |||
22888 | // NOTE: This assert does NOT call the function. | |||
22889 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion22(cx, Constify(arg0)))>, "Should be returning void here"); | |||
22890 | MOZ_KnownLive(self)(self)->PassUnion22(cx, Constify(arg0)); | |||
22891 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22891); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22891; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22892 | args.rval().setUndefined(); | |||
22893 | return true; | |||
22894 | } | |||
22895 | ||||
22896 | static const JSJitInfo passUnion22_methodinfo = { | |||
22897 | { (JSJitGetterOp)passUnion22 }, | |||
22898 | { prototypes::id::TestExampleInterface }, | |||
22899 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22900 | JSJitInfo::Method, | |||
22901 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22902 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22903 | false, /* isInfallible. False in setters. */ | |||
22904 | false, /* isMovable. Not relevant for setters. */ | |||
22905 | false, /* isEliminatable. Not relevant for setters. */ | |||
22906 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22907 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22908 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22909 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22910 | }; | |||
22911 | ||||
22912 | MOZ_CAN_RUN_SCRIPT static bool | |||
22913 | passUnion23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22914 | { | |||
22915 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion23"); | |||
22916 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22919( cx, "TestExampleInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22917 | "TestExampleInterface", "passUnion23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22919( cx, "TestExampleInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22918 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22919( cx, "TestExampleInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22919 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22919( cx, "TestExampleInterface" , "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22920 | ||||
22921 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22922 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion23", 1)) { | |||
22923 | return false; | |||
22924 | } | |||
22925 | ImageDataSequenceOrLong arg0; | |||
22926 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22927 | return false; | |||
22928 | } | |||
22929 | // NOTE: This assert does NOT call the function. | |||
22930 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion23(Constify(arg0)))>, "Should be returning void here"); | |||
22931 | MOZ_KnownLive(self)(self)->PassUnion23(Constify(arg0)); | |||
22932 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22932); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22932; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22933 | args.rval().setUndefined(); | |||
22934 | return true; | |||
22935 | } | |||
22936 | ||||
22937 | static const JSJitInfo passUnion23_methodinfo = { | |||
22938 | { (JSJitGetterOp)passUnion23 }, | |||
22939 | { prototypes::id::TestExampleInterface }, | |||
22940 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22941 | JSJitInfo::Method, | |||
22942 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22943 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22944 | false, /* isInfallible. False in setters. */ | |||
22945 | false, /* isMovable. Not relevant for setters. */ | |||
22946 | false, /* isEliminatable. Not relevant for setters. */ | |||
22947 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22948 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22949 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22950 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22951 | }; | |||
22952 | ||||
22953 | MOZ_CAN_RUN_SCRIPT static bool | |||
22954 | passUnion24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22955 | { | |||
22956 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion24"); | |||
22957 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22960( cx, "TestExampleInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22958 | "TestExampleInterface", "passUnion24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22960( cx, "TestExampleInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22959 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22960( cx, "TestExampleInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22960 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22960( cx, "TestExampleInterface" , "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
22961 | ||||
22962 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
22963 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion24", 1)) { | |||
22964 | return false; | |||
22965 | } | |||
22966 | ImageDataOrNullSequenceOrLong arg0; | |||
22967 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
22968 | return false; | |||
22969 | } | |||
22970 | // NOTE: This assert does NOT call the function. | |||
22971 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion24(Constify(arg0)))>, "Should be returning void here"); | |||
22972 | MOZ_KnownLive(self)(self)->PassUnion24(Constify(arg0)); | |||
22973 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 22973); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 22973; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
22974 | args.rval().setUndefined(); | |||
22975 | return true; | |||
22976 | } | |||
22977 | ||||
22978 | static const JSJitInfo passUnion24_methodinfo = { | |||
22979 | { (JSJitGetterOp)passUnion24 }, | |||
22980 | { prototypes::id::TestExampleInterface }, | |||
22981 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
22982 | JSJitInfo::Method, | |||
22983 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
22984 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
22985 | false, /* isInfallible. False in setters. */ | |||
22986 | false, /* isMovable. Not relevant for setters. */ | |||
22987 | false, /* isEliminatable. Not relevant for setters. */ | |||
22988 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
22989 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
22990 | false, /* isTypedMethod. Only relevant for methods. */ | |||
22991 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
22992 | }; | |||
22993 | ||||
22994 | MOZ_CAN_RUN_SCRIPT static bool | |||
22995 | passUnion25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
22996 | { | |||
22997 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion25"); | |||
22998 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23001( cx, "TestExampleInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
22999 | "TestExampleInterface", "passUnion25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23001( cx, "TestExampleInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23000 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23001( cx, "TestExampleInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23001 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23001( cx, "TestExampleInterface" , "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23002 | ||||
23003 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23004 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion25", 1)) { | |||
23005 | return false; | |||
23006 | } | |||
23007 | ImageDataSequenceSequenceOrLong arg0; | |||
23008 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23009 | return false; | |||
23010 | } | |||
23011 | // NOTE: This assert does NOT call the function. | |||
23012 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion25(Constify(arg0)))>, "Should be returning void here"); | |||
23013 | MOZ_KnownLive(self)(self)->PassUnion25(Constify(arg0)); | |||
23014 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23014); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23014; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23015 | args.rval().setUndefined(); | |||
23016 | return true; | |||
23017 | } | |||
23018 | ||||
23019 | static const JSJitInfo passUnion25_methodinfo = { | |||
23020 | { (JSJitGetterOp)passUnion25 }, | |||
23021 | { prototypes::id::TestExampleInterface }, | |||
23022 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23023 | JSJitInfo::Method, | |||
23024 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23025 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23026 | false, /* isInfallible. False in setters. */ | |||
23027 | false, /* isMovable. Not relevant for setters. */ | |||
23028 | false, /* isEliminatable. Not relevant for setters. */ | |||
23029 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23030 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23031 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23032 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23033 | }; | |||
23034 | ||||
23035 | MOZ_CAN_RUN_SCRIPT static bool | |||
23036 | passUnion26(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23037 | { | |||
23038 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion26"); | |||
23039 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23042( cx, "TestExampleInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23040 | "TestExampleInterface", "passUnion26", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23042( cx, "TestExampleInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23041 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23042( cx, "TestExampleInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23042 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23042( cx, "TestExampleInterface" , "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23043 | ||||
23044 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23045 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnion26", 1)) { | |||
23046 | return false; | |||
23047 | } | |||
23048 | ImageDataOrNullSequenceSequenceOrLong arg0; | |||
23049 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23050 | return false; | |||
23051 | } | |||
23052 | // NOTE: This assert does NOT call the function. | |||
23053 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion26(Constify(arg0)))>, "Should be returning void here"); | |||
23054 | MOZ_KnownLive(self)(self)->PassUnion26(Constify(arg0)); | |||
23055 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23055); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23055; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23056 | args.rval().setUndefined(); | |||
23057 | return true; | |||
23058 | } | |||
23059 | ||||
23060 | static const JSJitInfo passUnion26_methodinfo = { | |||
23061 | { (JSJitGetterOp)passUnion26 }, | |||
23062 | { prototypes::id::TestExampleInterface }, | |||
23063 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23064 | JSJitInfo::Method, | |||
23065 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23066 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23067 | false, /* isInfallible. False in setters. */ | |||
23068 | false, /* isMovable. Not relevant for setters. */ | |||
23069 | false, /* isEliminatable. Not relevant for setters. */ | |||
23070 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23071 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23072 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23073 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23074 | }; | |||
23075 | ||||
23076 | MOZ_CAN_RUN_SCRIPT static bool | |||
23077 | passUnion27(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23078 | { | |||
23079 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion27"); | |||
23080 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23083( cx, "TestExampleInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23081 | "TestExampleInterface", "passUnion27", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23083( cx, "TestExampleInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23082 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23083( cx, "TestExampleInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23083 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23083( cx, "TestExampleInterface" , "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23084 | ||||
23085 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23086 | StringSequenceOrEventInit arg0; | |||
23087 | if (!(args.hasDefined(0))) { | |||
23088 | if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (sequence<DOMString> or EventInit)")) { | |||
23089 | return false; | |||
23090 | } | |||
23091 | } else { | |||
23092 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23093 | return false; | |||
23094 | } | |||
23095 | } | |||
23096 | // NOTE: This assert does NOT call the function. | |||
23097 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion27(Constify(arg0)))>, "Should be returning void here"); | |||
23098 | MOZ_KnownLive(self)(self)->PassUnion27(Constify(arg0)); | |||
23099 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23099); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23099; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23100 | args.rval().setUndefined(); | |||
23101 | return true; | |||
23102 | } | |||
23103 | ||||
23104 | static const JSJitInfo passUnion27_methodinfo = { | |||
23105 | { (JSJitGetterOp)passUnion27 }, | |||
23106 | { prototypes::id::TestExampleInterface }, | |||
23107 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23108 | JSJitInfo::Method, | |||
23109 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23110 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23111 | false, /* isInfallible. False in setters. */ | |||
23112 | false, /* isMovable. Not relevant for setters. */ | |||
23113 | false, /* isEliminatable. Not relevant for setters. */ | |||
23114 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23115 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23116 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23117 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23118 | }; | |||
23119 | ||||
23120 | MOZ_CAN_RUN_SCRIPT static bool | |||
23121 | passUnion28(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23122 | { | |||
23123 | BindingCallContext cx(cx_, "TestExampleInterface.passUnion28"); | |||
23124 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23127( cx, "TestExampleInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23125 | "TestExampleInterface", "passUnion28", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23127( cx, "TestExampleInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23126 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23127( cx, "TestExampleInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23127 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23127( cx, "TestExampleInterface" , "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js:: ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23128 | ||||
23129 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23130 | EventInitOrStringSequence arg0; | |||
23131 | if (!(args.hasDefined(0))) { | |||
23132 | if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or sequence<DOMString>)")) { | |||
23133 | return false; | |||
23134 | } | |||
23135 | } else { | |||
23136 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23137 | return false; | |||
23138 | } | |||
23139 | } | |||
23140 | // NOTE: This assert does NOT call the function. | |||
23141 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion28(Constify(arg0)))>, "Should be returning void here"); | |||
23142 | MOZ_KnownLive(self)(self)->PassUnion28(Constify(arg0)); | |||
23143 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23143); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23143; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23144 | args.rval().setUndefined(); | |||
23145 | return true; | |||
23146 | } | |||
23147 | ||||
23148 | static const JSJitInfo passUnion28_methodinfo = { | |||
23149 | { (JSJitGetterOp)passUnion28 }, | |||
23150 | { prototypes::id::TestExampleInterface }, | |||
23151 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23152 | JSJitInfo::Method, | |||
23153 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23154 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23155 | false, /* isInfallible. False in setters. */ | |||
23156 | false, /* isMovable. Not relevant for setters. */ | |||
23157 | false, /* isEliminatable. Not relevant for setters. */ | |||
23158 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23159 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23160 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23161 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23162 | }; | |||
23163 | ||||
23164 | MOZ_CAN_RUN_SCRIPT static bool | |||
23165 | passUnionWithCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23166 | { | |||
23167 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithCallback"); | |||
23168 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23171( cx, "TestExampleInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23169 | "TestExampleInterface", "passUnionWithCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23171( cx, "TestExampleInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23170 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23171( cx, "TestExampleInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23171 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23171( cx, "TestExampleInterface" , "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23172 | ||||
23173 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23174 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithCallback", 1)) { | |||
23175 | return false; | |||
23176 | } | |||
23177 | EventHandlerNonNullOrNullOrLong arg0; | |||
23178 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23179 | return false; | |||
23180 | } | |||
23181 | // NOTE: This assert does NOT call the function. | |||
23182 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithCallback(Constify(arg0)))>, "Should be returning void here"); | |||
23183 | MOZ_KnownLive(self)(self)->PassUnionWithCallback(Constify(arg0)); | |||
23184 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23184); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23184; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23185 | args.rval().setUndefined(); | |||
23186 | return true; | |||
23187 | } | |||
23188 | ||||
23189 | static const JSJitInfo passUnionWithCallback_methodinfo = { | |||
23190 | { (JSJitGetterOp)passUnionWithCallback }, | |||
23191 | { prototypes::id::TestExampleInterface }, | |||
23192 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23193 | JSJitInfo::Method, | |||
23194 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23195 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23196 | false, /* isInfallible. False in setters. */ | |||
23197 | false, /* isMovable. Not relevant for setters. */ | |||
23198 | false, /* isEliminatable. Not relevant for setters. */ | |||
23199 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23200 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23201 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23202 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23203 | }; | |||
23204 | ||||
23205 | MOZ_CAN_RUN_SCRIPT static bool | |||
23206 | passUnionWithByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23207 | { | |||
23208 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithByteString"); | |||
23209 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23212( cx, "TestExampleInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23210 | "TestExampleInterface", "passUnionWithByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23212( cx, "TestExampleInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23211 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23212( cx, "TestExampleInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23212 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23212( cx, "TestExampleInterface" , "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23213 | ||||
23214 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23215 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithByteString", 1)) { | |||
23216 | return false; | |||
23217 | } | |||
23218 | ByteStringOrLong arg0; | |||
23219 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23220 | return false; | |||
23221 | } | |||
23222 | // NOTE: This assert does NOT call the function. | |||
23223 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithByteString(Constify(arg0)))>, "Should be returning void here"); | |||
23224 | MOZ_KnownLive(self)(self)->PassUnionWithByteString(Constify(arg0)); | |||
23225 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23225); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23225; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23226 | args.rval().setUndefined(); | |||
23227 | return true; | |||
23228 | } | |||
23229 | ||||
23230 | static const JSJitInfo passUnionWithByteString_methodinfo = { | |||
23231 | { (JSJitGetterOp)passUnionWithByteString }, | |||
23232 | { prototypes::id::TestExampleInterface }, | |||
23233 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23234 | JSJitInfo::Method, | |||
23235 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23236 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23237 | false, /* isInfallible. False in setters. */ | |||
23238 | false, /* isMovable. Not relevant for setters. */ | |||
23239 | false, /* isEliminatable. Not relevant for setters. */ | |||
23240 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23241 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23242 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23243 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23244 | }; | |||
23245 | ||||
23246 | MOZ_CAN_RUN_SCRIPT static bool | |||
23247 | passUnionWithUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23248 | { | |||
23249 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithUTF8String"); | |||
23250 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23253( cx, "TestExampleInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23251 | "TestExampleInterface", "passUnionWithUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23253( cx, "TestExampleInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23252 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23253( cx, "TestExampleInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23253 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23253( cx, "TestExampleInterface" , "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23254 | ||||
23255 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23256 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithUTF8String", 1)) { | |||
23257 | return false; | |||
23258 | } | |||
23259 | UTF8StringOrLong arg0; | |||
23260 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23261 | return false; | |||
23262 | } | |||
23263 | // NOTE: This assert does NOT call the function. | |||
23264 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithUTF8String(Constify(arg0)))>, "Should be returning void here"); | |||
23265 | MOZ_KnownLive(self)(self)->PassUnionWithUTF8String(Constify(arg0)); | |||
23266 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23266); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23266; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23267 | args.rval().setUndefined(); | |||
23268 | return true; | |||
23269 | } | |||
23270 | ||||
23271 | static const JSJitInfo passUnionWithUTF8String_methodinfo = { | |||
23272 | { (JSJitGetterOp)passUnionWithUTF8String }, | |||
23273 | { prototypes::id::TestExampleInterface }, | |||
23274 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23275 | JSJitInfo::Method, | |||
23276 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23277 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23278 | false, /* isInfallible. False in setters. */ | |||
23279 | false, /* isMovable. Not relevant for setters. */ | |||
23280 | false, /* isEliminatable. Not relevant for setters. */ | |||
23281 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23282 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23283 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23284 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23285 | }; | |||
23286 | ||||
23287 | MOZ_CAN_RUN_SCRIPT static bool | |||
23288 | passUnionWithRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23289 | { | |||
23290 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithRecord"); | |||
23291 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23294( cx, "TestExampleInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23292 | "TestExampleInterface", "passUnionWithRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23294( cx, "TestExampleInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23293 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23294( cx, "TestExampleInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23294 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23294( cx, "TestExampleInterface" , "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23295 | ||||
23296 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23297 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithRecord", 1)) { | |||
23298 | return false; | |||
23299 | } | |||
23300 | StringStringRecordOrString arg0; | |||
23301 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23302 | return false; | |||
23303 | } | |||
23304 | // NOTE: This assert does NOT call the function. | |||
23305 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithRecord(Constify(arg0)))>, "Should be returning void here"); | |||
23306 | MOZ_KnownLive(self)(self)->PassUnionWithRecord(Constify(arg0)); | |||
23307 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23307); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23307; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23308 | args.rval().setUndefined(); | |||
23309 | return true; | |||
23310 | } | |||
23311 | ||||
23312 | static const JSJitInfo passUnionWithRecord_methodinfo = { | |||
23313 | { (JSJitGetterOp)passUnionWithRecord }, | |||
23314 | { prototypes::id::TestExampleInterface }, | |||
23315 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23316 | JSJitInfo::Method, | |||
23317 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23318 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23319 | false, /* isInfallible. False in setters. */ | |||
23320 | false, /* isMovable. Not relevant for setters. */ | |||
23321 | false, /* isEliminatable. Not relevant for setters. */ | |||
23322 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23323 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23324 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23325 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23326 | }; | |||
23327 | ||||
23328 | MOZ_CAN_RUN_SCRIPT static bool | |||
23329 | passUnionWithRecordAndSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23330 | { | |||
23331 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithRecordAndSequence"); | |||
23332 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23335( cx, "TestExampleInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23333 | "TestExampleInterface", "passUnionWithRecordAndSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23335( cx, "TestExampleInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23334 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23335( cx, "TestExampleInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23335 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23335( cx, "TestExampleInterface" , "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23336 | ||||
23337 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23338 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithRecordAndSequence", 1)) { | |||
23339 | return false; | |||
23340 | } | |||
23341 | StringStringRecordOrStringSequence arg0; | |||
23342 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23343 | return false; | |||
23344 | } | |||
23345 | // NOTE: This assert does NOT call the function. | |||
23346 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithRecordAndSequence(Constify(arg0)))>, "Should be returning void here"); | |||
23347 | MOZ_KnownLive(self)(self)->PassUnionWithRecordAndSequence(Constify(arg0)); | |||
23348 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23348); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23348; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23349 | args.rval().setUndefined(); | |||
23350 | return true; | |||
23351 | } | |||
23352 | ||||
23353 | static const JSJitInfo passUnionWithRecordAndSequence_methodinfo = { | |||
23354 | { (JSJitGetterOp)passUnionWithRecordAndSequence }, | |||
23355 | { prototypes::id::TestExampleInterface }, | |||
23356 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23357 | JSJitInfo::Method, | |||
23358 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23359 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23360 | false, /* isInfallible. False in setters. */ | |||
23361 | false, /* isMovable. Not relevant for setters. */ | |||
23362 | false, /* isEliminatable. Not relevant for setters. */ | |||
23363 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23364 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23365 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23366 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23367 | }; | |||
23368 | ||||
23369 | MOZ_CAN_RUN_SCRIPT static bool | |||
23370 | passUnionWithSequenceAndRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23371 | { | |||
23372 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithSequenceAndRecord"); | |||
23373 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23376( cx, "TestExampleInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23374 | "TestExampleInterface", "passUnionWithSequenceAndRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23376( cx, "TestExampleInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23375 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23376( cx, "TestExampleInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23376 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23376( cx, "TestExampleInterface" , "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23377 | ||||
23378 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23379 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithSequenceAndRecord", 1)) { | |||
23380 | return false; | |||
23381 | } | |||
23382 | StringSequenceOrStringStringRecord arg0; | |||
23383 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23384 | return false; | |||
23385 | } | |||
23386 | // NOTE: This assert does NOT call the function. | |||
23387 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithSequenceAndRecord(Constify(arg0)))>, "Should be returning void here"); | |||
23388 | MOZ_KnownLive(self)(self)->PassUnionWithSequenceAndRecord(Constify(arg0)); | |||
23389 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23389); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23389; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23390 | args.rval().setUndefined(); | |||
23391 | return true; | |||
23392 | } | |||
23393 | ||||
23394 | static const JSJitInfo passUnionWithSequenceAndRecord_methodinfo = { | |||
23395 | { (JSJitGetterOp)passUnionWithSequenceAndRecord }, | |||
23396 | { prototypes::id::TestExampleInterface }, | |||
23397 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23398 | JSJitInfo::Method, | |||
23399 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23400 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23401 | false, /* isInfallible. False in setters. */ | |||
23402 | false, /* isMovable. Not relevant for setters. */ | |||
23403 | false, /* isEliminatable. Not relevant for setters. */ | |||
23404 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23405 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23406 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23407 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23408 | }; | |||
23409 | ||||
23410 | MOZ_CAN_RUN_SCRIPT static bool | |||
23411 | passUnionWithSVS(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23412 | { | |||
23413 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithSVS"); | |||
23414 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23417( cx, "TestExampleInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23415 | "TestExampleInterface", "passUnionWithSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23417( cx, "TestExampleInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23416 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23417( cx, "TestExampleInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23417 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23417( cx, "TestExampleInterface" , "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23418 | ||||
23419 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23420 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithSVS", 1)) { | |||
23421 | return false; | |||
23422 | } | |||
23423 | USVStringOrLong arg0; | |||
23424 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23425 | return false; | |||
23426 | } | |||
23427 | // NOTE: This assert does NOT call the function. | |||
23428 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithSVS(Constify(arg0)))>, "Should be returning void here"); | |||
23429 | MOZ_KnownLive(self)(self)->PassUnionWithSVS(Constify(arg0)); | |||
23430 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23430); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23430; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23431 | args.rval().setUndefined(); | |||
23432 | return true; | |||
23433 | } | |||
23434 | ||||
23435 | static const JSJitInfo passUnionWithSVS_methodinfo = { | |||
23436 | { (JSJitGetterOp)passUnionWithSVS }, | |||
23437 | { prototypes::id::TestExampleInterface }, | |||
23438 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23439 | JSJitInfo::Method, | |||
23440 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23441 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23442 | false, /* isInfallible. False in setters. */ | |||
23443 | false, /* isMovable. Not relevant for setters. */ | |||
23444 | false, /* isEliminatable. Not relevant for setters. */ | |||
23445 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23446 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23447 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23448 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23449 | }; | |||
23450 | ||||
23451 | MOZ_CAN_RUN_SCRIPT static bool | |||
23452 | passUnionWithNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23453 | { | |||
23454 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithNullable"); | |||
23455 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23458( cx, "TestExampleInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23456 | "TestExampleInterface", "passUnionWithNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23458( cx, "TestExampleInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23457 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23458( cx, "TestExampleInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23458 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23458( cx, "TestExampleInterface" , "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23459 | ||||
23460 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23461 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithNullable", 1)) { | |||
23462 | return false; | |||
23463 | } | |||
23464 | ObjectOrNullOrLong arg0; | |||
23465 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23466 | return false; | |||
23467 | } | |||
23468 | // NOTE: This assert does NOT call the function. | |||
23469 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithNullable(cx, Constify(arg0)))>, "Should be returning void here"); | |||
23470 | MOZ_KnownLive(self)(self)->PassUnionWithNullable(cx, Constify(arg0)); | |||
23471 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23471); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23471; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23472 | args.rval().setUndefined(); | |||
23473 | return true; | |||
23474 | } | |||
23475 | ||||
23476 | static const JSJitInfo passUnionWithNullable_methodinfo = { | |||
23477 | { (JSJitGetterOp)passUnionWithNullable }, | |||
23478 | { prototypes::id::TestExampleInterface }, | |||
23479 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23480 | JSJitInfo::Method, | |||
23481 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23482 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23483 | false, /* isInfallible. False in setters. */ | |||
23484 | false, /* isMovable. Not relevant for setters. */ | |||
23485 | false, /* isEliminatable. Not relevant for setters. */ | |||
23486 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23487 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23488 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23489 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23490 | }; | |||
23491 | ||||
23492 | MOZ_CAN_RUN_SCRIPT static bool | |||
23493 | passNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23494 | { | |||
23495 | BindingCallContext cx(cx_, "TestExampleInterface.passNullableUnion"); | |||
23496 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23499( cx, "TestExampleInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23497 | "TestExampleInterface", "passNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23499( cx, "TestExampleInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23498 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23499( cx, "TestExampleInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23499 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23499( cx, "TestExampleInterface" , "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23500 | ||||
23501 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23502 | if (!args.requireAtLeast(cx, "TestExampleInterface.passNullableUnion", 1)) { | |||
23503 | return false; | |||
23504 | } | |||
23505 | Nullable<ObjectOrLong > arg0; | |||
23506 | if (args[0].isNullOrUndefined()) { | |||
23507 | arg0.SetNull(); | |||
23508 | } else { | |||
23509 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", false)) { | |||
23510 | return false; | |||
23511 | } | |||
23512 | } | |||
23513 | // NOTE: This assert does NOT call the function. | |||
23514 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnion(cx, Constify(arg0)))>, "Should be returning void here"); | |||
23515 | MOZ_KnownLive(self)(self)->PassNullableUnion(cx, Constify(arg0)); | |||
23516 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23516); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23516; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23517 | args.rval().setUndefined(); | |||
23518 | return true; | |||
23519 | } | |||
23520 | ||||
23521 | static const JSJitInfo passNullableUnion_methodinfo = { | |||
23522 | { (JSJitGetterOp)passNullableUnion }, | |||
23523 | { prototypes::id::TestExampleInterface }, | |||
23524 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23525 | JSJitInfo::Method, | |||
23526 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23527 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23528 | false, /* isInfallible. False in setters. */ | |||
23529 | false, /* isMovable. Not relevant for setters. */ | |||
23530 | false, /* isEliminatable. Not relevant for setters. */ | |||
23531 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23532 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23533 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23534 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23535 | }; | |||
23536 | ||||
23537 | MOZ_CAN_RUN_SCRIPT static bool | |||
23538 | passOptionalUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23539 | { | |||
23540 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalUnion"); | |||
23541 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23544( cx, "TestExampleInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23542 | "TestExampleInterface", "passOptionalUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23544( cx, "TestExampleInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23543 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23544( cx, "TestExampleInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23544 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23544( cx, "TestExampleInterface" , "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23545 | ||||
23546 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23547 | Optional<ObjectOrLong> arg0; | |||
23548 | if (args.hasDefined(0)) { | |||
23549 | arg0.Construct(); | |||
23550 | if (!arg0.Value().Init(cx, args[0], "Argument 1", false)) { | |||
23551 | return false; | |||
23552 | } | |||
23553 | } | |||
23554 | // NOTE: This assert does NOT call the function. | |||
23555 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnion(cx, Constify(arg0)))>, "Should be returning void here"); | |||
23556 | MOZ_KnownLive(self)(self)->PassOptionalUnion(cx, Constify(arg0)); | |||
23557 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23557); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23557; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23558 | args.rval().setUndefined(); | |||
23559 | return true; | |||
23560 | } | |||
23561 | ||||
23562 | static const JSJitInfo passOptionalUnion_methodinfo = { | |||
23563 | { (JSJitGetterOp)passOptionalUnion }, | |||
23564 | { prototypes::id::TestExampleInterface }, | |||
23565 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23566 | JSJitInfo::Method, | |||
23567 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23568 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23569 | false, /* isInfallible. False in setters. */ | |||
23570 | false, /* isMovable. Not relevant for setters. */ | |||
23571 | false, /* isEliminatable. Not relevant for setters. */ | |||
23572 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23573 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23574 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23575 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23576 | }; | |||
23577 | ||||
23578 | MOZ_CAN_RUN_SCRIPT static bool | |||
23579 | passOptionalNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23580 | { | |||
23581 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableUnion"); | |||
23582 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23585( cx, "TestExampleInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23583 | "TestExampleInterface", "passOptionalNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23585( cx, "TestExampleInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23584 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23585( cx, "TestExampleInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23585 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23585( cx, "TestExampleInterface" , "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM , uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23586 | ||||
23587 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23588 | Optional<Nullable<ObjectOrLong >> arg0; | |||
23589 | if (args.hasDefined(0)) { | |||
23590 | arg0.Construct(); | |||
23591 | if (args[0].isNullOrUndefined()) { | |||
23592 | arg0.Value().SetNull(); | |||
23593 | } else { | |||
23594 | if (!arg0.Value().SetValue().Init(cx, args[0], "Argument 1", false)) { | |||
23595 | return false; | |||
23596 | } | |||
23597 | } | |||
23598 | } | |||
23599 | // NOTE: This assert does NOT call the function. | |||
23600 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUnion(cx, Constify(arg0)))>, "Should be returning void here"); | |||
23601 | MOZ_KnownLive(self)(self)->PassOptionalNullableUnion(cx, Constify(arg0)); | |||
23602 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23602); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23602; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23603 | args.rval().setUndefined(); | |||
23604 | return true; | |||
23605 | } | |||
23606 | ||||
23607 | static const JSJitInfo passOptionalNullableUnion_methodinfo = { | |||
23608 | { (JSJitGetterOp)passOptionalNullableUnion }, | |||
23609 | { prototypes::id::TestExampleInterface }, | |||
23610 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23611 | JSJitInfo::Method, | |||
23612 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23613 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23614 | false, /* isInfallible. False in setters. */ | |||
23615 | false, /* isMovable. Not relevant for setters. */ | |||
23616 | false, /* isEliminatable. Not relevant for setters. */ | |||
23617 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23618 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23619 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23620 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23621 | }; | |||
23622 | ||||
23623 | MOZ_CAN_RUN_SCRIPT static bool | |||
23624 | passOptionalNullableUnionWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23625 | { | |||
23626 | BindingCallContext cx(cx_, "TestExampleInterface.passOptionalNullableUnionWithDefaultValue"); | |||
23627 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23630( cx, "TestExampleInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23628 | "TestExampleInterface", "passOptionalNullableUnionWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23630( cx, "TestExampleInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23629 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23630( cx, "TestExampleInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23630 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23630( cx, "TestExampleInterface" , "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23631 | ||||
23632 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23633 | Nullable<ObjectOrLong > arg0; | |||
23634 | if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) { | |||
23635 | arg0.SetNull(); | |||
23636 | } else { | |||
23637 | if (!arg0.SetValue().Init(cx, args[0], "Argument 1", false)) { | |||
23638 | return false; | |||
23639 | } | |||
23640 | } | |||
23641 | // NOTE: This assert does NOT call the function. | |||
23642 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUnionWithDefaultValue(cx, Constify(arg0)))>, "Should be returning void here"); | |||
23643 | MOZ_KnownLive(self)(self)->PassOptionalNullableUnionWithDefaultValue(cx, Constify(arg0)); | |||
23644 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23644); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23644; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23645 | args.rval().setUndefined(); | |||
23646 | return true; | |||
23647 | } | |||
23648 | ||||
23649 | static const JSJitInfo passOptionalNullableUnionWithDefaultValue_methodinfo = { | |||
23650 | { (JSJitGetterOp)passOptionalNullableUnionWithDefaultValue }, | |||
23651 | { prototypes::id::TestExampleInterface }, | |||
23652 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23653 | JSJitInfo::Method, | |||
23654 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23655 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23656 | false, /* isInfallible. False in setters. */ | |||
23657 | false, /* isMovable. Not relevant for setters. */ | |||
23658 | false, /* isEliminatable. Not relevant for setters. */ | |||
23659 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23660 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23661 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23662 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23663 | }; | |||
23664 | ||||
23665 | MOZ_CAN_RUN_SCRIPT static bool | |||
23666 | passUnionWithArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23667 | { | |||
23668 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithArrayBuffer"); | |||
23669 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23672( cx, "TestExampleInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23670 | "TestExampleInterface", "passUnionWithArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23672( cx, "TestExampleInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23671 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23672( cx, "TestExampleInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23672 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23672( cx, "TestExampleInterface" , "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23673 | ||||
23674 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23675 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithArrayBuffer", 1)) { | |||
23676 | return false; | |||
23677 | } | |||
23678 | UTF8StringOrArrayBuffer arg0; | |||
23679 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23680 | return false; | |||
23681 | } | |||
23682 | // NOTE: This assert does NOT call the function. | |||
23683 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithArrayBuffer(Constify(arg0)))>, "Should be returning void here"); | |||
23684 | MOZ_KnownLive(self)(self)->PassUnionWithArrayBuffer(Constify(arg0)); | |||
23685 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23685); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23685; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23686 | args.rval().setUndefined(); | |||
23687 | return true; | |||
23688 | } | |||
23689 | ||||
23690 | static const JSJitInfo passUnionWithArrayBuffer_methodinfo = { | |||
23691 | { (JSJitGetterOp)passUnionWithArrayBuffer }, | |||
23692 | { prototypes::id::TestExampleInterface }, | |||
23693 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23694 | JSJitInfo::Method, | |||
23695 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23696 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23697 | false, /* isInfallible. False in setters. */ | |||
23698 | false, /* isMovable. Not relevant for setters. */ | |||
23699 | false, /* isEliminatable. Not relevant for setters. */ | |||
23700 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23701 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23702 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23703 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23704 | }; | |||
23705 | ||||
23706 | MOZ_CAN_RUN_SCRIPT static bool | |||
23707 | passUnionWithArrayBufferOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23708 | { | |||
23709 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithArrayBufferOrNull"); | |||
23710 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23713( cx, "TestExampleInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23711 | "TestExampleInterface", "passUnionWithArrayBufferOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23713( cx, "TestExampleInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23712 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23713( cx, "TestExampleInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23713 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23713( cx, "TestExampleInterface" , "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23714 | ||||
23715 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23716 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithArrayBufferOrNull", 1)) { | |||
23717 | return false; | |||
23718 | } | |||
23719 | UTF8StringOrArrayBufferOrNull arg0; | |||
23720 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23721 | return false; | |||
23722 | } | |||
23723 | // NOTE: This assert does NOT call the function. | |||
23724 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithArrayBufferOrNull(Constify(arg0)))>, "Should be returning void here"); | |||
23725 | MOZ_KnownLive(self)(self)->PassUnionWithArrayBufferOrNull(Constify(arg0)); | |||
23726 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23726); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23726; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23727 | args.rval().setUndefined(); | |||
23728 | return true; | |||
23729 | } | |||
23730 | ||||
23731 | static const JSJitInfo passUnionWithArrayBufferOrNull_methodinfo = { | |||
23732 | { (JSJitGetterOp)passUnionWithArrayBufferOrNull }, | |||
23733 | { prototypes::id::TestExampleInterface }, | |||
23734 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23735 | JSJitInfo::Method, | |||
23736 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23737 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23738 | false, /* isInfallible. False in setters. */ | |||
23739 | false, /* isMovable. Not relevant for setters. */ | |||
23740 | false, /* isEliminatable. Not relevant for setters. */ | |||
23741 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23742 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23743 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23744 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23745 | }; | |||
23746 | ||||
23747 | MOZ_CAN_RUN_SCRIPT static bool | |||
23748 | passUnionWithTypedArrays(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23749 | { | |||
23750 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithTypedArrays"); | |||
23751 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23754( cx, "TestExampleInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23752 | "TestExampleInterface", "passUnionWithTypedArrays", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23754( cx, "TestExampleInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23753 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23754( cx, "TestExampleInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23754 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23754( cx, "TestExampleInterface" , "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23755 | ||||
23756 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23757 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithTypedArrays", 1)) { | |||
23758 | return false; | |||
23759 | } | |||
23760 | ArrayBufferViewOrArrayBuffer arg0; | |||
23761 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23762 | return false; | |||
23763 | } | |||
23764 | // NOTE: This assert does NOT call the function. | |||
23765 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithTypedArrays(Constify(arg0)))>, "Should be returning void here"); | |||
23766 | MOZ_KnownLive(self)(self)->PassUnionWithTypedArrays(Constify(arg0)); | |||
23767 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23767); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23767; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23768 | args.rval().setUndefined(); | |||
23769 | return true; | |||
23770 | } | |||
23771 | ||||
23772 | static const JSJitInfo passUnionWithTypedArrays_methodinfo = { | |||
23773 | { (JSJitGetterOp)passUnionWithTypedArrays }, | |||
23774 | { prototypes::id::TestExampleInterface }, | |||
23775 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23776 | JSJitInfo::Method, | |||
23777 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23778 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23779 | false, /* isInfallible. False in setters. */ | |||
23780 | false, /* isMovable. Not relevant for setters. */ | |||
23781 | false, /* isEliminatable. Not relevant for setters. */ | |||
23782 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23783 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23784 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23785 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23786 | }; | |||
23787 | ||||
23788 | MOZ_CAN_RUN_SCRIPT static bool | |||
23789 | passUnionWithTypedArraysOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23790 | { | |||
23791 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithTypedArraysOrNull"); | |||
23792 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23795( cx, "TestExampleInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23793 | "TestExampleInterface", "passUnionWithTypedArraysOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23795( cx, "TestExampleInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23794 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23795( cx, "TestExampleInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ) | |||
23795 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23795( cx, "TestExampleInterface" , "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair ::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD ) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS) ); | |||
23796 | ||||
23797 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23798 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithTypedArraysOrNull", 1)) { | |||
23799 | return false; | |||
23800 | } | |||
23801 | ArrayBufferViewOrArrayBufferOrNull arg0; | |||
23802 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23803 | return false; | |||
23804 | } | |||
23805 | // NOTE: This assert does NOT call the function. | |||
23806 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithTypedArraysOrNull(Constify(arg0)))>, "Should be returning void here"); | |||
23807 | MOZ_KnownLive(self)(self)->PassUnionWithTypedArraysOrNull(Constify(arg0)); | |||
23808 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23808); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23808; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23809 | args.rval().setUndefined(); | |||
23810 | return true; | |||
23811 | } | |||
23812 | ||||
23813 | static const JSJitInfo passUnionWithTypedArraysOrNull_methodinfo = { | |||
23814 | { (JSJitGetterOp)passUnionWithTypedArraysOrNull }, | |||
23815 | { prototypes::id::TestExampleInterface }, | |||
23816 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23817 | JSJitInfo::Method, | |||
23818 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23819 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23820 | false, /* isInfallible. False in setters. */ | |||
23821 | false, /* isMovable. Not relevant for setters. */ | |||
23822 | false, /* isEliminatable. Not relevant for setters. */ | |||
23823 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23824 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23825 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23826 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23827 | }; | |||
23828 | ||||
23829 | MOZ_CAN_RUN_SCRIPT static bool | |||
23830 | passUnionWithString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23831 | { | |||
23832 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithString"); | |||
23833 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23836( cx, "TestExampleInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23834 | "TestExampleInterface", "passUnionWithString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23836( cx, "TestExampleInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23835 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23836( cx, "TestExampleInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23836 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23836( cx, "TestExampleInterface" , "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23837 | ||||
23838 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23839 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithString", 1)) { | |||
23840 | return false; | |||
23841 | } | |||
23842 | StringOrObject arg0; | |||
23843 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23844 | return false; | |||
23845 | } | |||
23846 | // NOTE: This assert does NOT call the function. | |||
23847 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithString(cx, Constify(arg0)))>, "Should be returning void here"); | |||
23848 | MOZ_KnownLive(self)(self)->PassUnionWithString(cx, Constify(arg0)); | |||
23849 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23849); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23849; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23850 | args.rval().setUndefined(); | |||
23851 | return true; | |||
23852 | } | |||
23853 | ||||
23854 | static const JSJitInfo passUnionWithString_methodinfo = { | |||
23855 | { (JSJitGetterOp)passUnionWithString }, | |||
23856 | { prototypes::id::TestExampleInterface }, | |||
23857 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23858 | JSJitInfo::Method, | |||
23859 | JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */ | |||
23860 | JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */ | |||
23861 | false, /* isInfallible. False in setters. */ | |||
23862 | false, /* isMovable. Not relevant for setters. */ | |||
23863 | false, /* isEliminatable. Not relevant for setters. */ | |||
23864 | false, /* isAlwaysInSlot. Only relevant for getters. */ | |||
23865 | false, /* isLazilyCachedInSlot. Only relevant for getters. */ | |||
23866 | false, /* isTypedMethod. Only relevant for methods. */ | |||
23867 | 0 /* Reserved slot index, if we're stored in a slot, else 0. */ | |||
23868 | }; | |||
23869 | ||||
23870 | MOZ_CAN_RUN_SCRIPT static bool | |||
23871 | passUnionWithEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args) | |||
23872 | { | |||
23873 | BindingCallContext cx(cx_, "TestExampleInterface.passUnionWithEnum"); | |||
23874 | AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23877( cx, "TestExampleInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23875 | "TestExampleInterface", "passUnionWithEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23877( cx, "TestExampleInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23876 | uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23877( cx, "TestExampleInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)) | |||
23877 | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23877( cx, "TestExampleInterface" , "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t (js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t (js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)); | |||
23878 | ||||
23879 | auto* self = static_cast<mozilla::dom::TestExampleInterface*>(void_self); | |||
23880 | if (!args.requireAtLeast(cx, "TestExampleInterface.passUnionWithEnum", 1)) { | |||
23881 | return false; | |||
23882 | } | |||
23883 | SupportedTypeOrObject arg0; | |||
23884 | if (!arg0.Init(cx, args[0], "Argument 1", false)) { | |||
23885 | return false; | |||
23886 | } | |||
23887 | // NOTE: This assert does NOT call the function. | |||
23888 | static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithEnum(cx, Constify(arg0)))>, "Should be returning void here"); | |||
23889 | MOZ_KnownLive(self)(self)->PassUnionWithEnum(cx, Constify(arg0)); | |||
23890 | MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)" , "../TestExampleGenBinding.cpp", 23890); AnnotateMozCrashReason ("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *(( volatile int*)__null) = 23890; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
23891 | args.rval().setUndefined(); | |||
23892 | return true; | |||
23893 | } | |||
23894 | ||||
23895 | static const JSJitInfo passUnionWithEnum_methodinfo = { | |||
23896 | { (JSJitGetterOp)passUnionWithEnum }, | |||
23897 | { prototypes::id::TestExampleInterface }, | |||
23898 | { PrototypeTraits<prototypes::id::TestExampleInterface>::Depth }, | |||
23899 | JSJitInfo::Method, | |||