Bug Summary

File:var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h
Warning:line 322, column 11
Assigned value is garbage or undefined

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name TestJSImplGenBinding.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings/test -fcoverage-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings/test -resource-dir /usr/lib/llvm-18/lib/clang/18 -include /var/lib/jenkins/workspace/firefox-scan-build/config/gcc_hidden.h -include /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/mozilla-config.h -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D DEBUG=1 -D IMPL_LIBXUL -D MOZILLA_INTERNAL_API -I /var/lib/jenkins/workspace/firefox-scan-build/dom/bindings/test -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings/test -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings -I /var/lib/jenkins/workspace/firefox-scan-build/dom/bindings -I /var/lib/jenkins/workspace/firefox-scan-build/js/xpconnect/src -I /var/lib/jenkins/workspace/firefox-scan-build/js/xpconnect/wrappers -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/ipc/ipdl/_ipdlheaders -I /var/lib/jenkins/workspace/firefox-scan-build/ipc/chromium/src -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/backward -internal-isystem /usr/lib/llvm-18/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wno-error=tautological-type-limit-compare -Wno-invalid-offsetof -Wno-range-loop-analysis -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-deprecated-this-capture -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -fdeprecated-macro -ferror-limit 19 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -fno-aligned-allocation -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2024-05-16-034744-15991-1 -x c++ ../TestJSImplGenBinding.cpp

../TestJSImplGenBinding.cpp

1/* THIS FILE IS AUTOGENERATED FROM TestJSImplGen.webidl BY Codegen.py - DO NOT EDIT */
2
3#include <type_traits>
4#include "AtomList.h"
5#include "CustomEventBinding.h"
6#include "EventBinding.h"
7#include "EventHandlerBinding.h"
8#include "MainThreadUtils.h"
9#include "TestBindingHeader.h"
10#include "TestCImplementedInterface.h"
11#include "TestCodeGenBinding.h"
12#include "TestDictionaryBinding.h"
13#include "TestJSImplGenBinding.h"
14#include "WrapperFactory.h"
15#include "js/Array.h"
16#include "js/CallAndConstruct.h"
17#include "js/Exception.h"
18#include "js/ForOfIterator.h"
19#include "js/MapAndSet.h"
20#include "js/Object.h"
21#include "js/PropertyAndElement.h"
22#include "js/PropertyDescriptor.h"
23#include "js/experimental/JitInfo.h"
24#include "jsapi.h"
25#include "jsfriendapi.h"
26#include "mozilla/Atomics.h"
27#include "mozilla/FloatingPoint.h"
28#include "mozilla/OwningNonNull.h"
29#include "mozilla/ProfilerLabels.h"
30#include "mozilla/dom/BindingCallContext.h"
31#include "mozilla/dom/BindingUtils.h"
32#include "mozilla/dom/CanvasGradient.h"
33#include "mozilla/dom/CanvasPattern.h"
34#include "mozilla/dom/CustomElementRegistry.h"
35#include "mozilla/dom/DOMJSClass.h"
36#include "mozilla/dom/DocGroup.h"
37#include "mozilla/dom/Document.h"
38#include "mozilla/dom/ImageData.h"
39#include "mozilla/dom/NonRefcountedDOMObject.h"
40#include "mozilla/dom/Nullable.h"
41#include "mozilla/dom/PrimitiveConversions.h"
42#include "mozilla/dom/Promise.h"
43#include "mozilla/dom/RootedDictionary.h"
44#include "mozilla/dom/ToJSValue.h"
45#include "mozilla/dom/UnionTypes.h"
46#include "mozilla/dom/WebIDLPrefs.h"
47#include "mozilla/dom/XrayExpandoClass.h"
48#include "nsContentUtils.h"
49#include "nsGenericHTMLElement.h"
50#include "nsIContent.h"
51#include "nsIGlobalObject.h"
52
53namespace mozilla {
54
55namespace dom {
56
57namespace binding_detail {}; // Just to make sure it's known as a namespace
58using namespace mozilla::dom::binding_detail;
59
60
61namespace binding_detail {
62const nsLiteralCString EnumStrings<MyTestEnum>::Values[2] = {
63 "a"_ns,
64 "b"_ns,
65};
66} // namespace binding_detail
67
68bool
69ToJSValue(JSContext* aCx, MyTestEnum aArgument, JS::MutableHandle<JS::Value> aValue)
70{
71 MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<MyTestEnum>::Values))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(uint32_t(aArgument) < ArrayLength(binding_detail::
EnumStrings<MyTestEnum>::Values))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(uint32_t(aArgument) < ArrayLength
(binding_detail::EnumStrings<MyTestEnum>::Values)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<MyTestEnum>::Values)"
, "../TestJSImplGenBinding.cpp", 71); AnnotateMozCrashReason(
"MOZ_ASSERT" "(" "uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<MyTestEnum>::Values)"
")"); do { *((volatile int*)__null) = 71; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
72 JSString* resultStr =
73 JS_NewStringCopyN(aCx, binding_detail::EnumStrings<MyTestEnum>::Values[uint32_t(aArgument)].BeginReading(),
74 binding_detail::EnumStrings<MyTestEnum>::Values[uint32_t(aArgument)].Length());
75 if (!resultStr) {
76 return false;
77 }
78 aValue.setString(resultStr);
79 return true;
80}
81
82
83MOZ_CAN_RUN_SCRIPT void
84MyTestCallback::Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, ErrorResult& aRv)
85{
86 JS::Rooted<JS::Value> rval(cx);
87
88 JS::Rooted<JS::Value> callable(cx, JS::ObjectValue(*mCallback));
89 if (!JS::Call(cx, aThisVal, callable,
90 JS::HandleValueArray::empty(), &rval)) {
91 aRv.NoteJSContextException(cx);
92 return;
93 }
94}
95
96
97
98namespace TestCImplementedInterface_Binding {
99
100static_assert(IsRefcounted<NativeType>::value == IsRefcounted<TestJSImplInterface_Binding::NativeType>::value,
101 "Can't inherit from an interface with a different ownership model.");
102
103bool sNativePropertiesInited = false;
104const NativePropertyHooks sNativePropertyHooks = {
105 nullptr,
106 { nullptr, nullptr, &sNativePropertiesInited },
107 prototypes::id::TestCImplementedInterface,
108 constructors::id::TestCImplementedInterface,
109 &DefaultXrayExpandoObjectClass
110};
111
112static const DOMInterfaceInfo sInterfaceObjectInfo = {
113 { ThrowingConstructor, &sNativePropertyHooks },
114 TestJSImplInterface_Binding::GetConstructorObject,
115 prototypes::id::TestCImplementedInterface,
116 PrototypeTraits<prototypes::id::TestCImplementedInterface>::Depth,
117 true,
118};
119
120static const DOMIfaceAndProtoJSClass sPrototypeClass = {
121 {
122 "TestCImplementedInterfacePrototype",
123 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
124 JS_NULL_CLASS_OPS,
125 JS_NULL_CLASS_SPEC,
126 JS_NULL_CLASS_EXT,
127 JS_NULL_OBJECT_OPS
128 },
129 eInterfacePrototype,
130 prototypes::id::TestCImplementedInterface,
131 PrototypeTraits<prototypes::id::TestCImplementedInterface>::Depth,
132 &sNativePropertyHooks,
133 TestJSImplInterface_Binding::GetProtoObject
134};
135
136void
137CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
138{
139 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestCImplementedInterface);
140 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestCImplementedInterface);
141
142 JS::Handle<JSObject*> parentProto(TestJSImplInterface_Binding::GetProtoObjectHandle(aCx));
143 if (!parentProto) {
144 return;
145 }
146
147 JS::Handle<JSObject*> constructorProto(TestJSImplInterface_Binding::GetConstructorObjectHandle(aCx));
148 if (!constructorProto) {
149 return;
150 }
151
152 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
153 &sPrototypeClass, protoCache,
154 constructorProto, &sInterfaceObjectInfo, 0, false, Span<const LegacyFactoryFunction, 0>{},
155 interfaceCache,
156 nullptr,
157 nullptr,
158 "TestCImplementedInterface", aDefineOnGlobal,
159 nullptr,
160 false,
161 nullptr);
162}
163
164JSObject*
165GetProtoObject(JSContext* aCx)
166{
167 return GetProtoObjectHandle(aCx);
168}
169
170JSObject*
171GetConstructorObject(JSContext* aCx)
172{
173 return GetConstructorObjectHandle(aCx);
174}
175
176} // namespace TestCImplementedInterface_Binding
177
178
179
180namespace TestCImplementedInterface2_Binding {
181
182bool sNativePropertiesInited = false;
183const NativePropertyHooks sNativePropertyHooks = {
184 nullptr,
185 { nullptr, nullptr, &sNativePropertiesInited },
186 prototypes::id::TestCImplementedInterface2,
187 constructors::id::TestCImplementedInterface2,
188 &DefaultXrayExpandoObjectClass
189};
190
191static const DOMInterfaceInfo sInterfaceObjectInfo = {
192 { ThrowingConstructor, &sNativePropertyHooks },
193 JS::GetRealmFunctionPrototype,
194 prototypes::id::TestCImplementedInterface2,
195 PrototypeTraits<prototypes::id::TestCImplementedInterface2>::Depth,
196 true,
197};
198
199static const DOMIfaceAndProtoJSClass sPrototypeClass = {
200 {
201 "TestCImplementedInterface2Prototype",
202 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
203 JS_NULL_CLASS_OPS,
204 JS_NULL_CLASS_SPEC,
205 JS_NULL_CLASS_EXT,
206 JS_NULL_OBJECT_OPS
207 },
208 eInterfacePrototype,
209 prototypes::id::TestCImplementedInterface2,
210 PrototypeTraits<prototypes::id::TestCImplementedInterface2>::Depth,
211 &sNativePropertyHooks,
212 JS::GetRealmObjectPrototype
213};
214
215void
216CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
217{
218 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestCImplementedInterface2);
219 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestCImplementedInterface2);
220
221 JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx));
222 if (!parentProto) {
223 return;
224 }
225
226 JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx));
227 if (!constructorProto) {
228 return;
229 }
230
231 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
232 &sPrototypeClass, protoCache,
233 constructorProto, &sInterfaceObjectInfo, 0, false, Span<const LegacyFactoryFunction, 0>{},
234 interfaceCache,
235 nullptr,
236 nullptr,
237 "TestCImplementedInterface2", aDefineOnGlobal,
238 nullptr,
239 false,
240 nullptr);
241}
242
243JSObject*
244GetProtoObject(JSContext* aCx)
245{
246 return GetProtoObjectHandle(aCx);
247}
248
249JSObject*
250GetConstructorObject(JSContext* aCx)
251{
252 return GetConstructorObjectHandle(aCx);
253}
254
255} // namespace TestCImplementedInterface2_Binding
256
257
258
259namespace TestJSImplInterface_Binding {
260
261MOZ_CAN_RUN_SCRIPT static bool
262get_readonlyByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
263{
264 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject267( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
265 "TestJSImplInterface", "readonlyByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject267( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
266 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject267( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
267 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject267( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
268
269 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
270 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
271 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
272 if (objIsXray) {
273 unwrappedObj.emplace(cx, obj);
274 }
275 if (objIsXray) {
276 // Since our object is an Xray, we can just CheckedUnwrapStatic:
277 // we know Xrays have no dynamic unwrap behavior.
278 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
279 if (!unwrappedObj.ref()) {
280 return false;
281 }
282 }
283 FastErrorResult rv;
284 int8_t result(MOZ_KnownLive(self)(self)->GetReadonlyByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
285 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyByte getter"
)), 0))
) {
286 return false;
287 }
288 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 288); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 288; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
289 args.rval().setInt32(int32_t(result));
290 return true;
291}
292
293static const JSJitInfo readonlyByte_getterinfo = {
294 { get_readonlyByte },
295 { prototypes::id::TestJSImplInterface },
296 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
297 JSJitInfo::Getter,
298 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
299 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
300 false, /* isInfallible. False in setters. */
301 false, /* isMovable. Not relevant for setters. */
302 false, /* isEliminatable. Not relevant for setters. */
303 false, /* isAlwaysInSlot. Only relevant for getters. */
304 false, /* isLazilyCachedInSlot. Only relevant for getters. */
305 false, /* isTypedMethod. Only relevant for methods. */
306 0 /* Reserved slot index, if we're stored in a slot, else 0. */
307};
308
309MOZ_CAN_RUN_SCRIPT static bool
310get_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
311{
312 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject315( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
313 "TestJSImplInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject315( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
314 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject315( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
315 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject315( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
316
317 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
318 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
319 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
320 if (objIsXray) {
321 unwrappedObj.emplace(cx, obj);
322 }
323 if (objIsXray) {
324 // Since our object is an Xray, we can just CheckedUnwrapStatic:
325 // we know Xrays have no dynamic unwrap behavior.
326 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
327 if (!unwrappedObj.ref()) {
328 return false;
329 }
330 }
331 FastErrorResult rv;
332 int8_t result(MOZ_KnownLive(self)(self)->GetWritableByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
333 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte getter"
)), 0))
) {
334 return false;
335 }
336 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 336); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 336; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
337 args.rval().setInt32(int32_t(result));
338 return true;
339}
340
341MOZ_CAN_RUN_SCRIPT static bool
342set_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
343{
344 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject347( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
345 "TestJSImplInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject347( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
346 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject347( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
347 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject347( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
348
349 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
350 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
351 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
352 if (objIsXray) {
353 unwrappedObj.emplace(cx, obj);
354 }
355 int8_t arg0;
356 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
357 return false;
358 }
359 if (objIsXray) {
360 // Since our object is an Xray, we can just CheckedUnwrapStatic:
361 // we know Xrays have no dynamic unwrap behavior.
362 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
363 if (!unwrappedObj.ref()) {
364 return false;
365 }
366 }
367 FastErrorResult rv;
368 // NOTE: This assert does NOT call the function.
369 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
370 MOZ_KnownLive(self)(self)->SetWritableByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
371 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte setter"
)), 0))
) {
372 return false;
373 }
374 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 374); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 374; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
375
376 return true;
377}
378
379static const JSJitInfo writableByte_getterinfo = {
380 { get_writableByte },
381 { prototypes::id::TestJSImplInterface },
382 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
383 JSJitInfo::Getter,
384 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
385 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
386 false, /* isInfallible. False in setters. */
387 false, /* isMovable. Not relevant for setters. */
388 false, /* isEliminatable. Not relevant for setters. */
389 false, /* isAlwaysInSlot. Only relevant for getters. */
390 false, /* isLazilyCachedInSlot. Only relevant for getters. */
391 false, /* isTypedMethod. Only relevant for methods. */
392 0 /* Reserved slot index, if we're stored in a slot, else 0. */
393};
394static const JSJitInfo writableByte_setterinfo = {
395 { (JSJitGetterOp)set_writableByte },
396 { prototypes::id::TestJSImplInterface },
397 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
398 JSJitInfo::Setter,
399 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
400 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
401 false, /* isInfallible. False in setters. */
402 false, /* isMovable. Not relevant for setters. */
403 false, /* isEliminatable. Not relevant for setters. */
404 false, /* isAlwaysInSlot. Only relevant for getters. */
405 false, /* isLazilyCachedInSlot. Only relevant for getters. */
406 false, /* isTypedMethod. Only relevant for methods. */
407 0 /* Reserved slot index, if we're stored in a slot, else 0. */
408};
409
410MOZ_CAN_RUN_SCRIPT static bool
411passByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
412{
413 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject416( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
414 "TestJSImplInterface", "passByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject416( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
415 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject416( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
416 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject416( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
417
418 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
419 if (!args.requireAtLeast(cx, "TestJSImplInterface.passByte", 1)) {
420 return false;
421 }
422 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
423 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
424 if (objIsXray) {
425 unwrappedObj.emplace(cx, obj);
426 }
427 int8_t arg0;
428 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
429 return false;
430 }
431 if (objIsXray) {
432 // Since our object is an Xray, we can just CheckedUnwrapStatic:
433 // we know Xrays have no dynamic unwrap behavior.
434 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
435 if (!unwrappedObj.ref()) {
436 return false;
437 }
438 }
439 FastErrorResult rv;
440 // NOTE: This assert does NOT call the function.
441 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
442 MOZ_KnownLive(self)(self)->PassByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
443 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByte"
)), 0))
) {
444 return false;
445 }
446 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 446); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 446; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
447 args.rval().setUndefined();
448 return true;
449}
450
451static const JSJitInfo passByte_methodinfo = {
452 { (JSJitGetterOp)passByte },
453 { prototypes::id::TestJSImplInterface },
454 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
455 JSJitInfo::Method,
456 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
457 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
458 false, /* isInfallible. False in setters. */
459 false, /* isMovable. Not relevant for setters. */
460 false, /* isEliminatable. Not relevant for setters. */
461 false, /* isAlwaysInSlot. Only relevant for getters. */
462 false, /* isLazilyCachedInSlot. Only relevant for getters. */
463 false, /* isTypedMethod. Only relevant for methods. */
464 0 /* Reserved slot index, if we're stored in a slot, else 0. */
465};
466
467MOZ_CAN_RUN_SCRIPT static bool
468receiveByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
469{
470 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject473( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
471 "TestJSImplInterface", "receiveByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject473( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
472 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject473( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
473 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject473( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
474
475 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
476 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
477 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
478 if (objIsXray) {
479 unwrappedObj.emplace(cx, obj);
480 }
481 if (objIsXray) {
482 // Since our object is an Xray, we can just CheckedUnwrapStatic:
483 // we know Xrays have no dynamic unwrap behavior.
484 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
485 if (!unwrappedObj.ref()) {
486 return false;
487 }
488 }
489 FastErrorResult rv;
490 int8_t result(MOZ_KnownLive(self)(self)->ReceiveByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
491 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByte"
)), 0))
) {
492 return false;
493 }
494 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 494); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 494; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
495 args.rval().setInt32(int32_t(result));
496 return true;
497}
498
499static const JSJitInfo receiveByte_methodinfo = {
500 { (JSJitGetterOp)receiveByte },
501 { prototypes::id::TestJSImplInterface },
502 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
503 JSJitInfo::Method,
504 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
505 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
506 false, /* isInfallible. False in setters. */
507 false, /* isMovable. Not relevant for setters. */
508 false, /* isEliminatable. Not relevant for setters. */
509 false, /* isAlwaysInSlot. Only relevant for getters. */
510 false, /* isLazilyCachedInSlot. Only relevant for getters. */
511 false, /* isTypedMethod. Only relevant for methods. */
512 0 /* Reserved slot index, if we're stored in a slot, else 0. */
513};
514
515MOZ_CAN_RUN_SCRIPT static bool
516passOptionalByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
517{
518 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject521( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
519 "TestJSImplInterface", "passOptionalByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject521( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
520 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject521( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
521 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject521( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
522
523 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
524 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
525 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
526 if (objIsXray) {
527 unwrappedObj.emplace(cx, obj);
528 }
529 Optional<int8_t> arg0;
530 if (args.hasDefined(0)) {
531 arg0.Construct();
532 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
533 return false;
534 }
535 }
536 if (objIsXray) {
537 // Since our object is an Xray, we can just CheckedUnwrapStatic:
538 // we know Xrays have no dynamic unwrap behavior.
539 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
540 if (!unwrappedObj.ref()) {
541 return false;
542 }
543 }
544 FastErrorResult rv;
545 // NOTE: This assert does NOT call the function.
546 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
547 MOZ_KnownLive(self)(self)->PassOptionalByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
548 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByte"
)), 0))
) {
549 return false;
550 }
551 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 551); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 551; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
552 args.rval().setUndefined();
553 return true;
554}
555
556static const JSJitInfo passOptionalByte_methodinfo = {
557 { (JSJitGetterOp)passOptionalByte },
558 { prototypes::id::TestJSImplInterface },
559 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
560 JSJitInfo::Method,
561 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
562 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
563 false, /* isInfallible. False in setters. */
564 false, /* isMovable. Not relevant for setters. */
565 false, /* isEliminatable. Not relevant for setters. */
566 false, /* isAlwaysInSlot. Only relevant for getters. */
567 false, /* isLazilyCachedInSlot. Only relevant for getters. */
568 false, /* isTypedMethod. Only relevant for methods. */
569 0 /* Reserved slot index, if we're stored in a slot, else 0. */
570};
571
572MOZ_CAN_RUN_SCRIPT static bool
573passOptionalByteBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
574{
575 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject578( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
576 "TestJSImplInterface", "passOptionalByteBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject578( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
577 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject578( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
578 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject578( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
579
580 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
581 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOptionalByteBeforeRequired", 2)) {
582 return false;
583 }
584 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
585 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
586 if (objIsXray) {
587 unwrappedObj.emplace(cx, obj);
588 }
589 Optional<int8_t> arg0;
590 if (args.hasDefined(0)) {
591 arg0.Construct();
592 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
593 return false;
594 }
595 }
596 int8_t arg1;
597 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
598 return false;
599 }
600 if (objIsXray) {
601 // Since our object is an Xray, we can just CheckedUnwrapStatic:
602 // we know Xrays have no dynamic unwrap behavior.
603 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
604 if (!unwrappedObj.ref()) {
605 return false;
606 }
607 }
608 FastErrorResult rv;
609 // NOTE: This assert does NOT call the function.
610 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteBeforeRequired(Constify(arg0), arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
611 MOZ_KnownLive(self)(self)->PassOptionalByteBeforeRequired(Constify(arg0), arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
612 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteBeforeRequired"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteBeforeRequired"
)), 0))
) {
613 return false;
614 }
615 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 615); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 615; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
616 args.rval().setUndefined();
617 return true;
618}
619
620static const JSJitInfo passOptionalByteBeforeRequired_methodinfo = {
621 { (JSJitGetterOp)passOptionalByteBeforeRequired },
622 { prototypes::id::TestJSImplInterface },
623 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
624 JSJitInfo::Method,
625 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
626 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
627 false, /* isInfallible. False in setters. */
628 false, /* isMovable. Not relevant for setters. */
629 false, /* isEliminatable. Not relevant for setters. */
630 false, /* isAlwaysInSlot. Only relevant for getters. */
631 false, /* isLazilyCachedInSlot. Only relevant for getters. */
632 false, /* isTypedMethod. Only relevant for methods. */
633 0 /* Reserved slot index, if we're stored in a slot, else 0. */
634};
635
636MOZ_CAN_RUN_SCRIPT static bool
637passOptionalByteWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
638{
639 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject642( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
640 "TestJSImplInterface", "passOptionalByteWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject642( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
641 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject642( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
642 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject642( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
643
644 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
645 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
646 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
647 if (objIsXray) {
648 unwrappedObj.emplace(cx, obj);
649 }
650 int8_t arg0;
651 if (args.hasDefined(0)) {
652 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
653 return false;
654 }
655 } else {
656 arg0 = 0;
657 }
658 if (objIsXray) {
659 // Since our object is an Xray, we can just CheckedUnwrapStatic:
660 // we know Xrays have no dynamic unwrap behavior.
661 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
662 if (!unwrappedObj.ref()) {
663 return false;
664 }
665 }
666 FastErrorResult rv;
667 // NOTE: This assert does NOT call the function.
668 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
669 MOZ_KnownLive(self)(self)->PassOptionalByteWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
670 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefault"
)), 0))
) {
671 return false;
672 }
673 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 673); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 673; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
674 args.rval().setUndefined();
675 return true;
676}
677
678static const JSJitInfo passOptionalByteWithDefault_methodinfo = {
679 { (JSJitGetterOp)passOptionalByteWithDefault },
680 { prototypes::id::TestJSImplInterface },
681 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
682 JSJitInfo::Method,
683 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
684 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
685 false, /* isInfallible. False in setters. */
686 false, /* isMovable. Not relevant for setters. */
687 false, /* isEliminatable. Not relevant for setters. */
688 false, /* isAlwaysInSlot. Only relevant for getters. */
689 false, /* isLazilyCachedInSlot. Only relevant for getters. */
690 false, /* isTypedMethod. Only relevant for methods. */
691 0 /* Reserved slot index, if we're stored in a slot, else 0. */
692};
693
694MOZ_CAN_RUN_SCRIPT static bool
695passOptionalByteWithDefaultBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
696{
697 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject700( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
698 "TestJSImplInterface", "passOptionalByteWithDefaultBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject700( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
699 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject700( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
700 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject700( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
701
702 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
703 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired", 2)) {
704 return false;
705 }
706 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
707 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
708 if (objIsXray) {
709 unwrappedObj.emplace(cx, obj);
710 }
711 int8_t arg0;
712 if (args.hasDefined(0)) {
713 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
714 return false;
715 }
716 } else {
717 arg0 = 0;
718 }
719 int8_t arg1;
720 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
721 return false;
722 }
723 if (objIsXray) {
724 // Since our object is an Xray, we can just CheckedUnwrapStatic:
725 // we know Xrays have no dynamic unwrap behavior.
726 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
727 if (!unwrappedObj.ref()) {
728 return false;
729 }
730 }
731 FastErrorResult rv;
732 // NOTE: This assert does NOT call the function.
733 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteWithDefaultBeforeRequired(arg0, arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
734 MOZ_KnownLive(self)(self)->PassOptionalByteWithDefaultBeforeRequired(arg0, arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
735 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired"
)), 0))
) {
736 return false;
737 }
738 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 738); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 738; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
739 args.rval().setUndefined();
740 return true;
741}
742
743static const JSJitInfo passOptionalByteWithDefaultBeforeRequired_methodinfo = {
744 { (JSJitGetterOp)passOptionalByteWithDefaultBeforeRequired },
745 { prototypes::id::TestJSImplInterface },
746 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
747 JSJitInfo::Method,
748 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
749 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
750 false, /* isInfallible. False in setters. */
751 false, /* isMovable. Not relevant for setters. */
752 false, /* isEliminatable. Not relevant for setters. */
753 false, /* isAlwaysInSlot. Only relevant for getters. */
754 false, /* isLazilyCachedInSlot. Only relevant for getters. */
755 false, /* isTypedMethod. Only relevant for methods. */
756 0 /* Reserved slot index, if we're stored in a slot, else 0. */
757};
758
759MOZ_CAN_RUN_SCRIPT static bool
760passNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
761{
762 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject765( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
763 "TestJSImplInterface", "passNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject765( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
764 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject765( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
765 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject765( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
766
767 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
768 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableByte", 1)) {
769 return false;
770 }
771 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
772 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
773 if (objIsXray) {
774 unwrappedObj.emplace(cx, obj);
775 }
776 Nullable<int8_t> arg0;
777 if (args[0].isNullOrUndefined()) {
778 arg0.SetNull();
779 } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
780 return false;
781 }
782 if (objIsXray) {
783 // Since our object is an Xray, we can just CheckedUnwrapStatic:
784 // we know Xrays have no dynamic unwrap behavior.
785 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
786 if (!unwrappedObj.ref()) {
787 return false;
788 }
789 }
790 FastErrorResult rv;
791 // NOTE: This assert does NOT call the function.
792 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
793 MOZ_KnownLive(self)(self)->PassNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
794 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByte"
)), 0))
) {
795 return false;
796 }
797 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 797); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 797; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
798 args.rval().setUndefined();
799 return true;
800}
801
802static const JSJitInfo passNullableByte_methodinfo = {
803 { (JSJitGetterOp)passNullableByte },
804 { prototypes::id::TestJSImplInterface },
805 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
806 JSJitInfo::Method,
807 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
808 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
809 false, /* isInfallible. False in setters. */
810 false, /* isMovable. Not relevant for setters. */
811 false, /* isEliminatable. Not relevant for setters. */
812 false, /* isAlwaysInSlot. Only relevant for getters. */
813 false, /* isLazilyCachedInSlot. Only relevant for getters. */
814 false, /* isTypedMethod. Only relevant for methods. */
815 0 /* Reserved slot index, if we're stored in a slot, else 0. */
816};
817
818MOZ_CAN_RUN_SCRIPT static bool
819passOptionalNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
820{
821 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject824( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
822 "TestJSImplInterface", "passOptionalNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject824( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
823 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject824( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
824 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject824( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
825
826 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
827 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
828 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
829 if (objIsXray) {
830 unwrappedObj.emplace(cx, obj);
831 }
832 Optional<Nullable<int8_t>> arg0;
833 if (args.hasDefined(0)) {
834 arg0.Construct();
835 if (args[0].isNullOrUndefined()) {
836 arg0.Value().SetNull();
837 } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value().SetValue())) {
838 return false;
839 }
840 }
841 if (objIsXray) {
842 // Since our object is an Xray, we can just CheckedUnwrapStatic:
843 // we know Xrays have no dynamic unwrap behavior.
844 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
845 if (!unwrappedObj.ref()) {
846 return false;
847 }
848 }
849 FastErrorResult rv;
850 // NOTE: This assert does NOT call the function.
851 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
852 MOZ_KnownLive(self)(self)->PassOptionalNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
853 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByte"
)), 0))
) {
854 return false;
855 }
856 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 856); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 856; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
857 args.rval().setUndefined();
858 return true;
859}
860
861static const JSJitInfo passOptionalNullableByte_methodinfo = {
862 { (JSJitGetterOp)passOptionalNullableByte },
863 { prototypes::id::TestJSImplInterface },
864 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
865 JSJitInfo::Method,
866 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
867 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
868 false, /* isInfallible. False in setters. */
869 false, /* isMovable. Not relevant for setters. */
870 false, /* isEliminatable. Not relevant for setters. */
871 false, /* isAlwaysInSlot. Only relevant for getters. */
872 false, /* isLazilyCachedInSlot. Only relevant for getters. */
873 false, /* isTypedMethod. Only relevant for methods. */
874 0 /* Reserved slot index, if we're stored in a slot, else 0. */
875};
876
877MOZ_CAN_RUN_SCRIPT static bool
878passVariadicByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
879{
880 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject883( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
881 "TestJSImplInterface", "passVariadicByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject883( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
882 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject883( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
883 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject883( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
884
885 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
886 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
887 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
888 if (objIsXray) {
889 unwrappedObj.emplace(cx, obj);
890 }
891 AutoSequence<int8_t> arg0;
892 if (args.length() > 0) {
893 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
894 JS_ReportOutOfMemory(cx);
895 return false;
896 }
897 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
898 // OK to do infallible append here, since we ensured capacity already.
899 int8_t& slot = *arg0.AppendElement();
900 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[variadicArg], "Argument 1", &slot)) {
901 return false;
902 }
903 }
904 }
905 if (objIsXray) {
906 // Since our object is an Xray, we can just CheckedUnwrapStatic:
907 // we know Xrays have no dynamic unwrap behavior.
908 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
909 if (!unwrappedObj.ref()) {
910 return false;
911 }
912 }
913 FastErrorResult rv;
914 // NOTE: This assert does NOT call the function.
915 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
916 MOZ_KnownLive(self)(self)->PassVariadicByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
917 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByte"
)), 0))
) {
918 return false;
919 }
920 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 920); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 920; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
921 args.rval().setUndefined();
922 return true;
923}
924
925static const JSJitInfo passVariadicByte_methodinfo = {
926 { (JSJitGetterOp)passVariadicByte },
927 { prototypes::id::TestJSImplInterface },
928 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
929 JSJitInfo::Method,
930 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
931 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
932 false, /* isInfallible. False in setters. */
933 false, /* isMovable. Not relevant for setters. */
934 false, /* isEliminatable. Not relevant for setters. */
935 false, /* isAlwaysInSlot. Only relevant for getters. */
936 false, /* isLazilyCachedInSlot. Only relevant for getters. */
937 false, /* isTypedMethod. Only relevant for methods. */
938 0 /* Reserved slot index, if we're stored in a slot, else 0. */
939};
940
941MOZ_CAN_RUN_SCRIPT static bool
942get_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
943{
944 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject947( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
945 "TestJSImplInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject947( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
946 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject947( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
947 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject947( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
948
949 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
950 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
951 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
952 if (objIsXray) {
953 unwrappedObj.emplace(cx, obj);
954 }
955 if (objIsXray) {
956 // Since our object is an Xray, we can just CheckedUnwrapStatic:
957 // we know Xrays have no dynamic unwrap behavior.
958 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
959 if (!unwrappedObj.ref()) {
960 return false;
961 }
962 }
963 FastErrorResult rv;
964 int8_t result(MOZ_KnownLive(self)(self)->GetSideEffectFreeByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
965 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte getter"
)), 0))
) {
966 return false;
967 }
968 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 968); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 968; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
969 args.rval().setInt32(int32_t(result));
970 return true;
971}
972
973MOZ_CAN_RUN_SCRIPT static bool
974set_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
975{
976 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject979( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
977 "TestJSImplInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject979( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
978 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject979( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
979 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject979( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
980
981 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
982 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
983 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
984 if (objIsXray) {
985 unwrappedObj.emplace(cx, obj);
986 }
987 int8_t arg0;
988 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
989 return false;
990 }
991 if (objIsXray) {
992 // Since our object is an Xray, we can just CheckedUnwrapStatic:
993 // we know Xrays have no dynamic unwrap behavior.
994 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
995 if (!unwrappedObj.ref()) {
996 return false;
997 }
998 }
999 FastErrorResult rv;
1000 // NOTE: This assert does NOT call the function.
1001 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetSideEffectFreeByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1002 MOZ_KnownLive(self)(self)->SetSideEffectFreeByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1003 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte setter"
)), 0))
) {
1004 return false;
1005 }
1006 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1006); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1006; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1007
1008 return true;
1009}
1010
1011static const JSJitInfo sideEffectFreeByte_getterinfo = {
1012 { get_sideEffectFreeByte },
1013 { prototypes::id::TestJSImplInterface },
1014 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1015 JSJitInfo::Getter,
1016 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1017 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1018 false, /* isInfallible. False in setters. */
1019 false, /* isMovable. Not relevant for setters. */
1020 false, /* isEliminatable. Not relevant for setters. */
1021 false, /* isAlwaysInSlot. Only relevant for getters. */
1022 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1023 false, /* isTypedMethod. Only relevant for methods. */
1024 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1025};
1026static const JSJitInfo sideEffectFreeByte_setterinfo = {
1027 { (JSJitGetterOp)set_sideEffectFreeByte },
1028 { prototypes::id::TestJSImplInterface },
1029 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1030 JSJitInfo::Setter,
1031 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1032 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1033 false, /* isInfallible. False in setters. */
1034 false, /* isMovable. Not relevant for setters. */
1035 false, /* isEliminatable. Not relevant for setters. */
1036 false, /* isAlwaysInSlot. Only relevant for getters. */
1037 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1038 false, /* isTypedMethod. Only relevant for methods. */
1039 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1040};
1041
1042MOZ_CAN_RUN_SCRIPT static bool
1043get_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1044{
1045 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1048( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1046 "TestJSImplInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1048( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1047 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1048( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1048 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1048( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1049
1050 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1051 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1052 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1053 if (objIsXray) {
1054 unwrappedObj.emplace(cx, obj);
1055 }
1056 if (objIsXray) {
1057 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1058 // we know Xrays have no dynamic unwrap behavior.
1059 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1060 if (!unwrappedObj.ref()) {
1061 return false;
1062 }
1063 }
1064 FastErrorResult rv;
1065 int8_t result(MOZ_KnownLive(self)(self)->GetDomDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1066 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte getter"
)), 0))
) {
1067 return false;
1068 }
1069 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1069); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1069; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1070 args.rval().setInt32(int32_t(result));
1071 return true;
1072}
1073
1074MOZ_CAN_RUN_SCRIPT static bool
1075set_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1076{
1077 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1080( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1078 "TestJSImplInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1080( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1079 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1080( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1080 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1080( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1081
1082 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1083 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1084 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1085 if (objIsXray) {
1086 unwrappedObj.emplace(cx, obj);
1087 }
1088 int8_t arg0;
1089 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1090 return false;
1091 }
1092 if (objIsXray) {
1093 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1094 // we know Xrays have no dynamic unwrap behavior.
1095 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1096 if (!unwrappedObj.ref()) {
1097 return false;
1098 }
1099 }
1100 FastErrorResult rv;
1101 // NOTE: This assert does NOT call the function.
1102 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetDomDependentByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1103 MOZ_KnownLive(self)(self)->SetDomDependentByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1104 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte setter"
)), 0))
) {
1105 return false;
1106 }
1107 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1107); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1107; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1108
1109 return true;
1110}
1111
1112static const JSJitInfo domDependentByte_getterinfo = {
1113 { get_domDependentByte },
1114 { prototypes::id::TestJSImplInterface },
1115 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1116 JSJitInfo::Getter,
1117 JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
1118 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1119 false, /* isInfallible. False in setters. */
1120 false, /* isMovable. Not relevant for setters. */
1121 false, /* isEliminatable. Not relevant for setters. */
1122 false, /* isAlwaysInSlot. Only relevant for getters. */
1123 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1124 false, /* isTypedMethod. Only relevant for methods. */
1125 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1126};
1127static const JSJitInfo domDependentByte_setterinfo = {
1128 { (JSJitGetterOp)set_domDependentByte },
1129 { prototypes::id::TestJSImplInterface },
1130 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1131 JSJitInfo::Setter,
1132 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1133 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1134 false, /* isInfallible. False in setters. */
1135 false, /* isMovable. Not relevant for setters. */
1136 false, /* isEliminatable. Not relevant for setters. */
1137 false, /* isAlwaysInSlot. Only relevant for getters. */
1138 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1139 false, /* isTypedMethod. Only relevant for methods. */
1140 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1141};
1142
1143MOZ_CAN_RUN_SCRIPT static bool
1144get_constantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1145{
1146 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1149( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1147 "TestJSImplInterface", "constantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1149( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1148 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1149( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1149 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1149( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1150
1151 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1152 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1153 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1154 if (objIsXray) {
1155 unwrappedObj.emplace(cx, obj);
1156 }
1157 if (objIsXray) {
1158 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1159 // we know Xrays have no dynamic unwrap behavior.
1160 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1161 if (!unwrappedObj.ref()) {
1162 return false;
1163 }
1164 }
1165 FastErrorResult rv;
1166 int8_t result(MOZ_KnownLive(self)(self)->GetConstantByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1167 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.constantByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.constantByte getter"
)), 0))
) {
1168 return false;
1169 }
1170 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1170); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1170; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1171 args.rval().setInt32(int32_t(result));
1172 return true;
1173}
1174
1175static const JSJitInfo constantByte_getterinfo = {
1176 { get_constantByte },
1177 { prototypes::id::TestJSImplInterface },
1178 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1179 JSJitInfo::Getter,
1180 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1181 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1182 false, /* isInfallible. False in setters. */
1183 false, /* isMovable. Not relevant for setters. */
1184 false, /* isEliminatable. Not relevant for setters. */
1185 false, /* isAlwaysInSlot. Only relevant for getters. */
1186 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1187 false, /* isTypedMethod. Only relevant for methods. */
1188 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1189};
1190
1191MOZ_CAN_RUN_SCRIPT static bool
1192get_deviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1193{
1194 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1197( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1195 "TestJSImplInterface", "deviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1197( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1196 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1197( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1197 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1197( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1198
1199 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1200 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1201 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1202 if (objIsXray) {
1203 unwrappedObj.emplace(cx, obj);
1204 }
1205 if (objIsXray) {
1206 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1207 // we know Xrays have no dynamic unwrap behavior.
1208 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1209 if (!unwrappedObj.ref()) {
1210 return false;
1211 }
1212 }
1213 FastErrorResult rv;
1214 int8_t result(MOZ_KnownLive(self)(self)->GetDeviceStateDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1215 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deviceStateDependentByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deviceStateDependentByte getter"
)), 0))
) {
1216 return false;
1217 }
1218 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1218); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1218; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1219 args.rval().setInt32(int32_t(result));
1220 return true;
1221}
1222
1223static const JSJitInfo deviceStateDependentByte_getterinfo = {
1224 { get_deviceStateDependentByte },
1225 { prototypes::id::TestJSImplInterface },
1226 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1227 JSJitInfo::Getter,
1228 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1229 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1230 false, /* isInfallible. False in setters. */
1231 false, /* isMovable. Not relevant for setters. */
1232 false, /* isEliminatable. Not relevant for setters. */
1233 false, /* isAlwaysInSlot. Only relevant for getters. */
1234 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1235 false, /* isTypedMethod. Only relevant for methods. */
1236 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1237};
1238
1239MOZ_CAN_RUN_SCRIPT static bool
1240returnByteSideEffectFree(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1241{
1242 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1245( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1243 "TestJSImplInterface", "returnByteSideEffectFree", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1245( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1244 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1245( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1245 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1245( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1246
1247 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1248 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1249 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1250 if (objIsXray) {
1251 unwrappedObj.emplace(cx, obj);
1252 }
1253 if (objIsXray) {
1254 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1255 // we know Xrays have no dynamic unwrap behavior.
1256 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1257 if (!unwrappedObj.ref()) {
1258 return false;
1259 }
1260 }
1261 FastErrorResult rv;
1262 int8_t result(MOZ_KnownLive(self)(self)->ReturnByteSideEffectFree(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1263 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnByteSideEffectFree"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnByteSideEffectFree"
)), 0))
) {
1264 return false;
1265 }
1266 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1266); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1266; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1267 args.rval().setInt32(int32_t(result));
1268 return true;
1269}
1270
1271static const JSJitInfo::ArgType returnByteSideEffectFree_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1272static const JSTypedMethodJitInfo returnByteSideEffectFree_methodinfo = {
1273 {
1274 { (JSJitGetterOp)returnByteSideEffectFree },
1275 { prototypes::id::TestJSImplInterface },
1276 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1277 JSJitInfo::Method,
1278 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1279 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1280 false, /* isInfallible. False in setters. */
1281 false, /* isMovable. Not relevant for setters. */
1282 false, /* isEliminatable. Not relevant for setters. */
1283 false, /* isAlwaysInSlot. Only relevant for getters. */
1284 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1285 true, /* isTypedMethod. Only relevant for methods. */
1286 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1287 },
1288 returnByteSideEffectFree_methodinfo_argTypes
1289};
1290
1291MOZ_CAN_RUN_SCRIPT static bool
1292returnDOMDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1293{
1294 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1297( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1295 "TestJSImplInterface", "returnDOMDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1297( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1296 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1297( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1297 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1297( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1298
1299 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1300 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1301 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1302 if (objIsXray) {
1303 unwrappedObj.emplace(cx, obj);
1304 }
1305 if (objIsXray) {
1306 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1307 // we know Xrays have no dynamic unwrap behavior.
1308 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1309 if (!unwrappedObj.ref()) {
1310 return false;
1311 }
1312 }
1313 FastErrorResult rv;
1314 int8_t result(MOZ_KnownLive(self)(self)->ReturnDOMDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1315 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDOMDependentByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDOMDependentByte"
)), 0))
) {
1316 return false;
1317 }
1318 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1318); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1318; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1319 args.rval().setInt32(int32_t(result));
1320 return true;
1321}
1322
1323static const JSJitInfo::ArgType returnDOMDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1324static const JSTypedMethodJitInfo returnDOMDependentByte_methodinfo = {
1325 {
1326 { (JSJitGetterOp)returnDOMDependentByte },
1327 { prototypes::id::TestJSImplInterface },
1328 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1329 JSJitInfo::Method,
1330 JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
1331 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1332 false, /* isInfallible. False in setters. */
1333 false, /* isMovable. Not relevant for setters. */
1334 false, /* isEliminatable. Not relevant for setters. */
1335 false, /* isAlwaysInSlot. Only relevant for getters. */
1336 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1337 true, /* isTypedMethod. Only relevant for methods. */
1338 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1339 },
1340 returnDOMDependentByte_methodinfo_argTypes
1341};
1342
1343MOZ_CAN_RUN_SCRIPT static bool
1344returnConstantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1345{
1346 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1349( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1347 "TestJSImplInterface", "returnConstantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1349( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1348 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1349( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1349 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1349( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1350
1351 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1352 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1353 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1354 if (objIsXray) {
1355 unwrappedObj.emplace(cx, obj);
1356 }
1357 if (objIsXray) {
1358 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1359 // we know Xrays have no dynamic unwrap behavior.
1360 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1361 if (!unwrappedObj.ref()) {
1362 return false;
1363 }
1364 }
1365 FastErrorResult rv;
1366 int8_t result(MOZ_KnownLive(self)(self)->ReturnConstantByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1367 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnConstantByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnConstantByte"
)), 0))
) {
1368 return false;
1369 }
1370 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1370); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1370; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1371 args.rval().setInt32(int32_t(result));
1372 return true;
1373}
1374
1375static const JSJitInfo::ArgType returnConstantByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1376static const JSTypedMethodJitInfo returnConstantByte_methodinfo = {
1377 {
1378 { (JSJitGetterOp)returnConstantByte },
1379 { prototypes::id::TestJSImplInterface },
1380 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1381 JSJitInfo::Method,
1382 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1383 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1384 false, /* isInfallible. False in setters. */
1385 false, /* isMovable. Not relevant for setters. */
1386 false, /* isEliminatable. Not relevant for setters. */
1387 false, /* isAlwaysInSlot. Only relevant for getters. */
1388 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1389 true, /* isTypedMethod. Only relevant for methods. */
1390 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1391 },
1392 returnConstantByte_methodinfo_argTypes
1393};
1394
1395MOZ_CAN_RUN_SCRIPT static bool
1396returnDeviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1397{
1398 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1401( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1399 "TestJSImplInterface", "returnDeviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1401( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1400 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1401( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1401 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1401( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1402
1403 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1404 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1405 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1406 if (objIsXray) {
1407 unwrappedObj.emplace(cx, obj);
1408 }
1409 if (objIsXray) {
1410 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1411 // we know Xrays have no dynamic unwrap behavior.
1412 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1413 if (!unwrappedObj.ref()) {
1414 return false;
1415 }
1416 }
1417 FastErrorResult rv;
1418 int8_t result(MOZ_KnownLive(self)(self)->ReturnDeviceStateDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1419 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDeviceStateDependentByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDeviceStateDependentByte"
)), 0))
) {
1420 return false;
1421 }
1422 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1422); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1422; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1423 args.rval().setInt32(int32_t(result));
1424 return true;
1425}
1426
1427static const JSJitInfo::ArgType returnDeviceStateDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1428static const JSTypedMethodJitInfo returnDeviceStateDependentByte_methodinfo = {
1429 {
1430 { (JSJitGetterOp)returnDeviceStateDependentByte },
1431 { prototypes::id::TestJSImplInterface },
1432 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1433 JSJitInfo::Method,
1434 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1435 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1436 false, /* isInfallible. False in setters. */
1437 false, /* isMovable. Not relevant for setters. */
1438 false, /* isEliminatable. Not relevant for setters. */
1439 false, /* isAlwaysInSlot. Only relevant for getters. */
1440 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1441 true, /* isTypedMethod. Only relevant for methods. */
1442 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1443 },
1444 returnDeviceStateDependentByte_methodinfo_argTypes
1445};
1446
1447MOZ_CAN_RUN_SCRIPT static bool
1448get_readonlyShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1449{
1450 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1453( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1451 "TestJSImplInterface", "readonlyShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1453( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1452 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1453( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1453 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1453( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1454
1455 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1456 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1457 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1458 if (objIsXray) {
1459 unwrappedObj.emplace(cx, obj);
1460 }
1461 if (objIsXray) {
1462 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1463 // we know Xrays have no dynamic unwrap behavior.
1464 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1465 if (!unwrappedObj.ref()) {
1466 return false;
1467 }
1468 }
1469 FastErrorResult rv;
1470 int16_t result(MOZ_KnownLive(self)(self)->GetReadonlyShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1471 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyShort getter"
)), 0))
) {
1472 return false;
1473 }
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)"
, "../TestJSImplGenBinding.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
1479static const JSJitInfo readonlyShort_getterinfo = {
1480 { get_readonlyShort },
1481 { prototypes::id::TestJSImplInterface },
1482 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1483 JSJitInfo::Getter,
1484 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1485 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1486 false, /* isInfallible. False in setters. */
1487 false, /* isMovable. Not relevant for setters. */
1488 false, /* isEliminatable. Not relevant for setters. */
1489 false, /* isAlwaysInSlot. Only relevant for getters. */
1490 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1491 false, /* isTypedMethod. Only relevant for methods. */
1492 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1493};
1494
1495MOZ_CAN_RUN_SCRIPT static bool
1496get_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1497{
1498 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1501( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1499 "TestJSImplInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1501( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1500 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1501( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1501 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1501( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1502
1503 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1504 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1505 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1506 if (objIsXray) {
1507 unwrappedObj.emplace(cx, obj);
1508 }
1509 if (objIsXray) {
1510 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1511 // we know Xrays have no dynamic unwrap behavior.
1512 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1513 if (!unwrappedObj.ref()) {
1514 return false;
1515 }
1516 }
1517 FastErrorResult rv;
1518 int16_t result(MOZ_KnownLive(self)(self)->GetWritableShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1519 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort getter"
)), 0))
) {
1520 return false;
1521 }
1522 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1522); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1522; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1523 args.rval().setInt32(int32_t(result));
1524 return true;
1525}
1526
1527MOZ_CAN_RUN_SCRIPT static bool
1528set_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1529{
1530 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1533( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1531 "TestJSImplInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1533( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1532 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1533( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1533 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1533( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1534
1535 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1536 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1537 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1538 if (objIsXray) {
1539 unwrappedObj.emplace(cx, obj);
1540 }
1541 int16_t arg0;
1542 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1543 return false;
1544 }
1545 if (objIsXray) {
1546 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1547 // we know Xrays have no dynamic unwrap behavior.
1548 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1549 if (!unwrappedObj.ref()) {
1550 return false;
1551 }
1552 }
1553 FastErrorResult rv;
1554 // NOTE: This assert does NOT call the function.
1555 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1556 MOZ_KnownLive(self)(self)->SetWritableShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1557 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort setter"
)), 0))
) {
1558 return false;
1559 }
1560 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1560); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1560; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1561
1562 return true;
1563}
1564
1565static const JSJitInfo writableShort_getterinfo = {
1566 { get_writableShort },
1567 { prototypes::id::TestJSImplInterface },
1568 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1569 JSJitInfo::Getter,
1570 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1571 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1572 false, /* isInfallible. False in setters. */
1573 false, /* isMovable. Not relevant for setters. */
1574 false, /* isEliminatable. Not relevant for setters. */
1575 false, /* isAlwaysInSlot. Only relevant for getters. */
1576 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1577 false, /* isTypedMethod. Only relevant for methods. */
1578 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1579};
1580static const JSJitInfo writableShort_setterinfo = {
1581 { (JSJitGetterOp)set_writableShort },
1582 { prototypes::id::TestJSImplInterface },
1583 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1584 JSJitInfo::Setter,
1585 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1586 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1587 false, /* isInfallible. False in setters. */
1588 false, /* isMovable. Not relevant for setters. */
1589 false, /* isEliminatable. Not relevant for setters. */
1590 false, /* isAlwaysInSlot. Only relevant for getters. */
1591 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1592 false, /* isTypedMethod. Only relevant for methods. */
1593 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1594};
1595
1596MOZ_CAN_RUN_SCRIPT static bool
1597passShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1598{
1599 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1602( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1600 "TestJSImplInterface", "passShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1602( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1601 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1602( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1602 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1602( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
1603
1604 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1605 if (!args.requireAtLeast(cx, "TestJSImplInterface.passShort", 1)) {
1606 return false;
1607 }
1608 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1609 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1610 if (objIsXray) {
1611 unwrappedObj.emplace(cx, obj);
1612 }
1613 int16_t arg0;
1614 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
1615 return false;
1616 }
1617 if (objIsXray) {
1618 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1619 // we know Xrays have no dynamic unwrap behavior.
1620 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1621 if (!unwrappedObj.ref()) {
1622 return false;
1623 }
1624 }
1625 FastErrorResult rv;
1626 // NOTE: This assert does NOT call the function.
1627 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1628 MOZ_KnownLive(self)(self)->PassShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1629 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passShort"
)), 0))
) {
1630 return false;
1631 }
1632 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1632); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1632; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1633 args.rval().setUndefined();
1634 return true;
1635}
1636
1637static const JSJitInfo passShort_methodinfo = {
1638 { (JSJitGetterOp)passShort },
1639 { prototypes::id::TestJSImplInterface },
1640 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1641 JSJitInfo::Method,
1642 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1643 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1644 false, /* isInfallible. False in setters. */
1645 false, /* isMovable. Not relevant for setters. */
1646 false, /* isEliminatable. Not relevant for setters. */
1647 false, /* isAlwaysInSlot. Only relevant for getters. */
1648 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1649 false, /* isTypedMethod. Only relevant for methods. */
1650 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1651};
1652
1653MOZ_CAN_RUN_SCRIPT static bool
1654receiveShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1655{
1656 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1659( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1657 "TestJSImplInterface", "receiveShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1659( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1658 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1659( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1659 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1659( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1660
1661 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1662 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1663 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1664 if (objIsXray) {
1665 unwrappedObj.emplace(cx, obj);
1666 }
1667 if (objIsXray) {
1668 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1669 // we know Xrays have no dynamic unwrap behavior.
1670 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1671 if (!unwrappedObj.ref()) {
1672 return false;
1673 }
1674 }
1675 FastErrorResult rv;
1676 int16_t result(MOZ_KnownLive(self)(self)->ReceiveShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1677 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveShort"
)), 0))
) {
1678 return false;
1679 }
1680 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1680); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1680; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1681 args.rval().setInt32(int32_t(result));
1682 return true;
1683}
1684
1685static const JSJitInfo receiveShort_methodinfo = {
1686 { (JSJitGetterOp)receiveShort },
1687 { prototypes::id::TestJSImplInterface },
1688 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1689 JSJitInfo::Method,
1690 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1691 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1692 false, /* isInfallible. False in setters. */
1693 false, /* isMovable. Not relevant for setters. */
1694 false, /* isEliminatable. Not relevant for setters. */
1695 false, /* isAlwaysInSlot. Only relevant for getters. */
1696 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1697 false, /* isTypedMethod. Only relevant for methods. */
1698 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1699};
1700
1701MOZ_CAN_RUN_SCRIPT static bool
1702passOptionalShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1703{
1704 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1707( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1705 "TestJSImplInterface", "passOptionalShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1707( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1706 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1707( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1707 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1707( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1708
1709 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1710 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1711 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1712 if (objIsXray) {
1713 unwrappedObj.emplace(cx, obj);
1714 }
1715 Optional<int16_t> arg0;
1716 if (args.hasDefined(0)) {
1717 arg0.Construct();
1718 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
1719 return false;
1720 }
1721 }
1722 if (objIsXray) {
1723 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1724 // we know Xrays have no dynamic unwrap behavior.
1725 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1726 if (!unwrappedObj.ref()) {
1727 return false;
1728 }
1729 }
1730 FastErrorResult rv;
1731 // NOTE: This assert does NOT call the function.
1732 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1733 MOZ_KnownLive(self)(self)->PassOptionalShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1734 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShort"
)), 0))
) {
1735 return false;
1736 }
1737 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1737); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1737; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1738 args.rval().setUndefined();
1739 return true;
1740}
1741
1742static const JSJitInfo passOptionalShort_methodinfo = {
1743 { (JSJitGetterOp)passOptionalShort },
1744 { prototypes::id::TestJSImplInterface },
1745 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1746 JSJitInfo::Method,
1747 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1748 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1749 false, /* isInfallible. False in setters. */
1750 false, /* isMovable. Not relevant for setters. */
1751 false, /* isEliminatable. Not relevant for setters. */
1752 false, /* isAlwaysInSlot. Only relevant for getters. */
1753 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1754 false, /* isTypedMethod. Only relevant for methods. */
1755 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1756};
1757
1758MOZ_CAN_RUN_SCRIPT static bool
1759passOptionalShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1760{
1761 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1764( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1762 "TestJSImplInterface", "passOptionalShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1764( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1763 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1764( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1764 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1764( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1765
1766 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1767 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1768 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1769 if (objIsXray) {
1770 unwrappedObj.emplace(cx, obj);
1771 }
1772 int16_t arg0;
1773 if (args.hasDefined(0)) {
1774 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
1775 return false;
1776 }
1777 } else {
1778 arg0 = 5;
1779 }
1780 if (objIsXray) {
1781 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1782 // we know Xrays have no dynamic unwrap behavior.
1783 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1784 if (!unwrappedObj.ref()) {
1785 return false;
1786 }
1787 }
1788 FastErrorResult rv;
1789 // NOTE: This assert does NOT call the function.
1790 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1791 MOZ_KnownLive(self)(self)->PassOptionalShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1792 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShortWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShortWithDefault"
)), 0))
) {
1793 return false;
1794 }
1795 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1795); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1795; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1796 args.rval().setUndefined();
1797 return true;
1798}
1799
1800static const JSJitInfo passOptionalShortWithDefault_methodinfo = {
1801 { (JSJitGetterOp)passOptionalShortWithDefault },
1802 { prototypes::id::TestJSImplInterface },
1803 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1804 JSJitInfo::Method,
1805 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1806 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1807 false, /* isInfallible. False in setters. */
1808 false, /* isMovable. Not relevant for setters. */
1809 false, /* isEliminatable. Not relevant for setters. */
1810 false, /* isAlwaysInSlot. Only relevant for getters. */
1811 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1812 false, /* isTypedMethod. Only relevant for methods. */
1813 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1814};
1815
1816MOZ_CAN_RUN_SCRIPT static bool
1817get_readonlyLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1818{
1819 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1822( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1820 "TestJSImplInterface", "readonlyLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1822( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1821 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1822( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1822 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1822( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1823
1824 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1825 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1826 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1827 if (objIsXray) {
1828 unwrappedObj.emplace(cx, obj);
1829 }
1830 if (objIsXray) {
1831 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1832 // we know Xrays have no dynamic unwrap behavior.
1833 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1834 if (!unwrappedObj.ref()) {
1835 return false;
1836 }
1837 }
1838 FastErrorResult rv;
1839 int32_t result(MOZ_KnownLive(self)(self)->GetReadonlyLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1840 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLong getter"
)), 0))
) {
1841 return false;
1842 }
1843 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1843); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1843; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1844 args.rval().setInt32(int32_t(result));
1845 return true;
1846}
1847
1848static const JSJitInfo readonlyLong_getterinfo = {
1849 { get_readonlyLong },
1850 { prototypes::id::TestJSImplInterface },
1851 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1852 JSJitInfo::Getter,
1853 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1854 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1855 false, /* isInfallible. False in setters. */
1856 false, /* isMovable. Not relevant for setters. */
1857 false, /* isEliminatable. Not relevant for setters. */
1858 false, /* isAlwaysInSlot. Only relevant for getters. */
1859 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1860 false, /* isTypedMethod. Only relevant for methods. */
1861 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1862};
1863
1864MOZ_CAN_RUN_SCRIPT static bool
1865get_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1866{
1867 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1870( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1868 "TestJSImplInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1870( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1869 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1870( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1870 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1870( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1871
1872 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1873 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1874 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1875 if (objIsXray) {
1876 unwrappedObj.emplace(cx, obj);
1877 }
1878 if (objIsXray) {
1879 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1880 // we know Xrays have no dynamic unwrap behavior.
1881 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1882 if (!unwrappedObj.ref()) {
1883 return false;
1884 }
1885 }
1886 FastErrorResult rv;
1887 int32_t result(MOZ_KnownLive(self)(self)->GetWritableLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1888 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong getter"
)), 0))
) {
1889 return false;
1890 }
1891 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1891); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1891; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1892 args.rval().setInt32(int32_t(result));
1893 return true;
1894}
1895
1896MOZ_CAN_RUN_SCRIPT static bool
1897set_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1898{
1899 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1902( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1900 "TestJSImplInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1902( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1901 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1902( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1902 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1902( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1903
1904 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1905 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1906 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1907 if (objIsXray) {
1908 unwrappedObj.emplace(cx, obj);
1909 }
1910 int32_t arg0;
1911 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1912 return false;
1913 }
1914 if (objIsXray) {
1915 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1916 // we know Xrays have no dynamic unwrap behavior.
1917 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1918 if (!unwrappedObj.ref()) {
1919 return false;
1920 }
1921 }
1922 FastErrorResult rv;
1923 // NOTE: This assert does NOT call the function.
1924 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1925 MOZ_KnownLive(self)(self)->SetWritableLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1926 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong setter"
)), 0))
) {
1927 return false;
1928 }
1929 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1929); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1929; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1930
1931 return true;
1932}
1933
1934static const JSJitInfo writableLong_getterinfo = {
1935 { get_writableLong },
1936 { prototypes::id::TestJSImplInterface },
1937 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1938 JSJitInfo::Getter,
1939 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1940 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1941 false, /* isInfallible. False in setters. */
1942 false, /* isMovable. Not relevant for setters. */
1943 false, /* isEliminatable. Not relevant for setters. */
1944 false, /* isAlwaysInSlot. Only relevant for getters. */
1945 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1946 false, /* isTypedMethod. Only relevant for methods. */
1947 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1948};
1949static const JSJitInfo writableLong_setterinfo = {
1950 { (JSJitGetterOp)set_writableLong },
1951 { prototypes::id::TestJSImplInterface },
1952 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1953 JSJitInfo::Setter,
1954 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1955 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1956 false, /* isInfallible. False in setters. */
1957 false, /* isMovable. Not relevant for setters. */
1958 false, /* isEliminatable. Not relevant for setters. */
1959 false, /* isAlwaysInSlot. Only relevant for getters. */
1960 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1961 false, /* isTypedMethod. Only relevant for methods. */
1962 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1963};
1964
1965MOZ_CAN_RUN_SCRIPT static bool
1966passLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1967{
1968 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1971( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1969 "TestJSImplInterface", "passLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1971( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1970 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1971( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1971 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1971( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
1972
1973 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1974 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLong", 1)) {
1975 return false;
1976 }
1977 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1978 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1979 if (objIsXray) {
1980 unwrappedObj.emplace(cx, obj);
1981 }
1982 int32_t arg0;
1983 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
1984 return false;
1985 }
1986 if (objIsXray) {
1987 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1988 // we know Xrays have no dynamic unwrap behavior.
1989 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1990 if (!unwrappedObj.ref()) {
1991 return false;
1992 }
1993 }
1994 FastErrorResult rv;
1995 // NOTE: This assert does NOT call the function.
1996 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1997 MOZ_KnownLive(self)(self)->PassLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1998 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLong"
)), 0))
) {
1999 return false;
2000 }
2001 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2001); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2001; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2002 args.rval().setUndefined();
2003 return true;
2004}
2005
2006static const JSJitInfo passLong_methodinfo = {
2007 { (JSJitGetterOp)passLong },
2008 { prototypes::id::TestJSImplInterface },
2009 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2010 JSJitInfo::Method,
2011 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2012 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2013 false, /* isInfallible. False in setters. */
2014 false, /* isMovable. Not relevant for setters. */
2015 false, /* isEliminatable. Not relevant for setters. */
2016 false, /* isAlwaysInSlot. Only relevant for getters. */
2017 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2018 false, /* isTypedMethod. Only relevant for methods. */
2019 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2020};
2021
2022MOZ_CAN_RUN_SCRIPT static bool
2023receiveLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2024{
2025 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2028( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2026 "TestJSImplInterface", "receiveLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2028( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2027 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2028( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2028 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2028( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2029
2030 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2031 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2032 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2033 if (objIsXray) {
2034 unwrappedObj.emplace(cx, obj);
2035 }
2036 if (objIsXray) {
2037 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2038 // we know Xrays have no dynamic unwrap behavior.
2039 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2040 if (!unwrappedObj.ref()) {
2041 return false;
2042 }
2043 }
2044 FastErrorResult rv;
2045 int32_t result(MOZ_KnownLive(self)(self)->ReceiveLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2046 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLong"
)), 0))
) {
2047 return false;
2048 }
2049 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2049); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2049; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2050 args.rval().setInt32(int32_t(result));
2051 return true;
2052}
2053
2054static const JSJitInfo receiveLong_methodinfo = {
2055 { (JSJitGetterOp)receiveLong },
2056 { prototypes::id::TestJSImplInterface },
2057 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2058 JSJitInfo::Method,
2059 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2060 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2061 false, /* isInfallible. False in setters. */
2062 false, /* isMovable. Not relevant for setters. */
2063 false, /* isEliminatable. Not relevant for setters. */
2064 false, /* isAlwaysInSlot. Only relevant for getters. */
2065 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2066 false, /* isTypedMethod. Only relevant for methods. */
2067 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2068};
2069
2070MOZ_CAN_RUN_SCRIPT static bool
2071passOptionalLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2072{
2073 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2076( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2074 "TestJSImplInterface", "passOptionalLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2076( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2075 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2076( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2076 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2076( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2077
2078 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2079 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2080 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2081 if (objIsXray) {
2082 unwrappedObj.emplace(cx, obj);
2083 }
2084 Optional<int32_t> arg0;
2085 if (args.hasDefined(0)) {
2086 arg0.Construct();
2087 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2088 return false;
2089 }
2090 }
2091 if (objIsXray) {
2092 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2093 // we know Xrays have no dynamic unwrap behavior.
2094 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2095 if (!unwrappedObj.ref()) {
2096 return false;
2097 }
2098 }
2099 FastErrorResult rv;
2100 // NOTE: This assert does NOT call the function.
2101 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2102 MOZ_KnownLive(self)(self)->PassOptionalLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2103 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLong"
)), 0))
) {
2104 return false;
2105 }
2106 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2106); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2106; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2107 args.rval().setUndefined();
2108 return true;
2109}
2110
2111static const JSJitInfo passOptionalLong_methodinfo = {
2112 { (JSJitGetterOp)passOptionalLong },
2113 { prototypes::id::TestJSImplInterface },
2114 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2115 JSJitInfo::Method,
2116 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2117 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2118 false, /* isInfallible. False in setters. */
2119 false, /* isMovable. Not relevant for setters. */
2120 false, /* isEliminatable. Not relevant for setters. */
2121 false, /* isAlwaysInSlot. Only relevant for getters. */
2122 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2123 false, /* isTypedMethod. Only relevant for methods. */
2124 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2125};
2126
2127MOZ_CAN_RUN_SCRIPT static bool
2128passOptionalLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2129{
2130 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2133( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2131 "TestJSImplInterface", "passOptionalLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2133( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2132 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2133( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2133 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2133( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2134
2135 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2136 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2137 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2138 if (objIsXray) {
2139 unwrappedObj.emplace(cx, obj);
2140 }
2141 int32_t arg0;
2142 if (args.hasDefined(0)) {
2143 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2144 return false;
2145 }
2146 } else {
2147 arg0 = 7;
2148 }
2149 if (objIsXray) {
2150 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2151 // we know Xrays have no dynamic unwrap behavior.
2152 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2153 if (!unwrappedObj.ref()) {
2154 return false;
2155 }
2156 }
2157 FastErrorResult rv;
2158 // NOTE: This assert does NOT call the function.
2159 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2160 MOZ_KnownLive(self)(self)->PassOptionalLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2161 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongWithDefault"
)), 0))
) {
2162 return false;
2163 }
2164 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2164); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2164; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2165 args.rval().setUndefined();
2166 return true;
2167}
2168
2169static const JSJitInfo passOptionalLongWithDefault_methodinfo = {
2170 { (JSJitGetterOp)passOptionalLongWithDefault },
2171 { prototypes::id::TestJSImplInterface },
2172 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2173 JSJitInfo::Method,
2174 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2175 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2176 false, /* isInfallible. False in setters. */
2177 false, /* isMovable. Not relevant for setters. */
2178 false, /* isEliminatable. Not relevant for setters. */
2179 false, /* isAlwaysInSlot. Only relevant for getters. */
2180 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2181 false, /* isTypedMethod. Only relevant for methods. */
2182 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2183};
2184
2185MOZ_CAN_RUN_SCRIPT static bool
2186get_readonlyLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2187{
2188 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2191( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2189 "TestJSImplInterface", "readonlyLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2191( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2190 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2191( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2191 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2191( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2192
2193 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2194 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2195 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2196 if (objIsXray) {
2197 unwrappedObj.emplace(cx, obj);
2198 }
2199 if (objIsXray) {
2200 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2201 // we know Xrays have no dynamic unwrap behavior.
2202 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2203 if (!unwrappedObj.ref()) {
2204 return false;
2205 }
2206 }
2207 FastErrorResult rv;
2208 int64_t result(MOZ_KnownLive(self)(self)->GetReadonlyLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2209 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLongLong getter"
)), 0))
) {
2210 return false;
2211 }
2212 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2212); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2212; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2213 args.rval().set(JS_NumberValue(double(result)));
2214 return true;
2215}
2216
2217static const JSJitInfo readonlyLongLong_getterinfo = {
2218 { get_readonlyLongLong },
2219 { prototypes::id::TestJSImplInterface },
2220 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2221 JSJitInfo::Getter,
2222 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2223 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2224 false, /* isInfallible. False in setters. */
2225 false, /* isMovable. Not relevant for setters. */
2226 false, /* isEliminatable. Not relevant for setters. */
2227 false, /* isAlwaysInSlot. Only relevant for getters. */
2228 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2229 false, /* isTypedMethod. Only relevant for methods. */
2230 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2231};
2232
2233MOZ_CAN_RUN_SCRIPT static bool
2234get_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2235{
2236 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2239( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2237 "TestJSImplInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2239( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2238 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2239( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2239 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2239( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2240
2241 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2242 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2243 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2244 if (objIsXray) {
2245 unwrappedObj.emplace(cx, obj);
2246 }
2247 if (objIsXray) {
2248 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2249 // we know Xrays have no dynamic unwrap behavior.
2250 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2251 if (!unwrappedObj.ref()) {
2252 return false;
2253 }
2254 }
2255 FastErrorResult rv;
2256 int64_t result(MOZ_KnownLive(self)(self)->GetWritableLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2257 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong getter"
)), 0))
) {
2258 return false;
2259 }
2260 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2260); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2260; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2261 args.rval().set(JS_NumberValue(double(result)));
2262 return true;
2263}
2264
2265MOZ_CAN_RUN_SCRIPT static bool
2266set_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
2267{
2268 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2271( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2269 "TestJSImplInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2271( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2270 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2271( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2271 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2271( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2272
2273 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2274 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2275 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2276 if (objIsXray) {
2277 unwrappedObj.emplace(cx, obj);
2278 }
2279 int64_t arg0;
2280 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
2281 return false;
2282 }
2283 if (objIsXray) {
2284 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2285 // we know Xrays have no dynamic unwrap behavior.
2286 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2287 if (!unwrappedObj.ref()) {
2288 return false;
2289 }
2290 }
2291 FastErrorResult rv;
2292 // NOTE: This assert does NOT call the function.
2293 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2294 MOZ_KnownLive(self)(self)->SetWritableLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2295 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong setter"
)), 0))
) {
2296 return false;
2297 }
2298 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2298); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2298; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2299
2300 return true;
2301}
2302
2303static const JSJitInfo writableLongLong_getterinfo = {
2304 { get_writableLongLong },
2305 { prototypes::id::TestJSImplInterface },
2306 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2307 JSJitInfo::Getter,
2308 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2309 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2310 false, /* isInfallible. False in setters. */
2311 false, /* isMovable. Not relevant for setters. */
2312 false, /* isEliminatable. Not relevant for setters. */
2313 false, /* isAlwaysInSlot. Only relevant for getters. */
2314 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2315 false, /* isTypedMethod. Only relevant for methods. */
2316 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2317};
2318static const JSJitInfo writableLongLong_setterinfo = {
2319 { (JSJitGetterOp)set_writableLongLong },
2320 { prototypes::id::TestJSImplInterface },
2321 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2322 JSJitInfo::Setter,
2323 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2324 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2325 false, /* isInfallible. False in setters. */
2326 false, /* isMovable. Not relevant for setters. */
2327 false, /* isEliminatable. Not relevant for setters. */
2328 false, /* isAlwaysInSlot. Only relevant for getters. */
2329 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2330 false, /* isTypedMethod. Only relevant for methods. */
2331 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2332};
2333
2334MOZ_CAN_RUN_SCRIPT static bool
2335passLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2336{
2337 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2340( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2338 "TestJSImplInterface", "passLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2340( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2339 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2340( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2340 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2340( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2341
2342 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2343 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLongLong", 1)) {
2344 return false;
2345 }
2346 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2347 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2348 if (objIsXray) {
2349 unwrappedObj.emplace(cx, obj);
2350 }
2351 int64_t arg0;
2352 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2353 return false;
2354 }
2355 if (objIsXray) {
2356 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2357 // we know Xrays have no dynamic unwrap behavior.
2358 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2359 if (!unwrappedObj.ref()) {
2360 return false;
2361 }
2362 }
2363 FastErrorResult rv;
2364 // NOTE: This assert does NOT call the function.
2365 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2366 MOZ_KnownLive(self)(self)->PassLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2367 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLongLong"
)), 0))
) {
2368 return false;
2369 }
2370 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2370); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2370; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2371 args.rval().setUndefined();
2372 return true;
2373}
2374
2375static const JSJitInfo passLongLong_methodinfo = {
2376 { (JSJitGetterOp)passLongLong },
2377 { prototypes::id::TestJSImplInterface },
2378 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2379 JSJitInfo::Method,
2380 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2381 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2382 false, /* isInfallible. False in setters. */
2383 false, /* isMovable. Not relevant for setters. */
2384 false, /* isEliminatable. Not relevant for setters. */
2385 false, /* isAlwaysInSlot. Only relevant for getters. */
2386 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2387 false, /* isTypedMethod. Only relevant for methods. */
2388 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2389};
2390
2391MOZ_CAN_RUN_SCRIPT static bool
2392receiveLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2393{
2394 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2397( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2395 "TestJSImplInterface", "receiveLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2397( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2396 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2397( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2397 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2397( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2398
2399 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2400 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2401 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2402 if (objIsXray) {
2403 unwrappedObj.emplace(cx, obj);
2404 }
2405 if (objIsXray) {
2406 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2407 // we know Xrays have no dynamic unwrap behavior.
2408 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2409 if (!unwrappedObj.ref()) {
2410 return false;
2411 }
2412 }
2413 FastErrorResult rv;
2414 int64_t result(MOZ_KnownLive(self)(self)->ReceiveLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2415 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLongLong"
)), 0))
) {
2416 return false;
2417 }
2418 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2418; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2419 args.rval().set(JS_NumberValue(double(result)));
2420 return true;
2421}
2422
2423static const JSJitInfo receiveLongLong_methodinfo = {
2424 { (JSJitGetterOp)receiveLongLong },
2425 { prototypes::id::TestJSImplInterface },
2426 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2427 JSJitInfo::Method,
2428 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2429 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2430 false, /* isInfallible. False in setters. */
2431 false, /* isMovable. Not relevant for setters. */
2432 false, /* isEliminatable. Not relevant for setters. */
2433 false, /* isAlwaysInSlot. Only relevant for getters. */
2434 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2435 false, /* isTypedMethod. Only relevant for methods. */
2436 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2437};
2438
2439MOZ_CAN_RUN_SCRIPT static bool
2440passOptionalLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2441{
2442 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2445( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2443 "TestJSImplInterface", "passOptionalLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2445( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2444 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2445( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2445 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2445( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2446
2447 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2448 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2449 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2450 if (objIsXray) {
2451 unwrappedObj.emplace(cx, obj);
2452 }
2453 Optional<int64_t> arg0;
2454 if (args.hasDefined(0)) {
2455 arg0.Construct();
2456 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2457 return false;
2458 }
2459 }
2460 if (objIsXray) {
2461 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2462 // we know Xrays have no dynamic unwrap behavior.
2463 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2464 if (!unwrappedObj.ref()) {
2465 return false;
2466 }
2467 }
2468 FastErrorResult rv;
2469 // NOTE: This assert does NOT call the function.
2470 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2471 MOZ_KnownLive(self)(self)->PassOptionalLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2472 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLong"
)), 0))
) {
2473 return false;
2474 }
2475 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2475); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2475; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2476 args.rval().setUndefined();
2477 return true;
2478}
2479
2480static const JSJitInfo passOptionalLongLong_methodinfo = {
2481 { (JSJitGetterOp)passOptionalLongLong },
2482 { prototypes::id::TestJSImplInterface },
2483 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2484 JSJitInfo::Method,
2485 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2486 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2487 false, /* isInfallible. False in setters. */
2488 false, /* isMovable. Not relevant for setters. */
2489 false, /* isEliminatable. Not relevant for setters. */
2490 false, /* isAlwaysInSlot. Only relevant for getters. */
2491 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2492 false, /* isTypedMethod. Only relevant for methods. */
2493 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2494};
2495
2496MOZ_CAN_RUN_SCRIPT static bool
2497passOptionalLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2498{
2499 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2502( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2500 "TestJSImplInterface", "passOptionalLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2502( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2501 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2502( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2502 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2502( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2503
2504 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2505 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2506 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2507 if (objIsXray) {
2508 unwrappedObj.emplace(cx, obj);
2509 }
2510 int64_t arg0;
2511 if (args.hasDefined(0)) {
2512 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2513 return false;
2514 }
2515 } else {
2516 arg0 = -12LL;
2517 }
2518 if (objIsXray) {
2519 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2520 // we know Xrays have no dynamic unwrap behavior.
2521 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2522 if (!unwrappedObj.ref()) {
2523 return false;
2524 }
2525 }
2526 FastErrorResult rv;
2527 // NOTE: This assert does NOT call the function.
2528 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2529 MOZ_KnownLive(self)(self)->PassOptionalLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2530 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLongWithDefault"
)), 0))
) {
2531 return false;
2532 }
2533 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2533); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2533; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2534 args.rval().setUndefined();
2535 return true;
2536}
2537
2538static const JSJitInfo passOptionalLongLongWithDefault_methodinfo = {
2539 { (JSJitGetterOp)passOptionalLongLongWithDefault },
2540 { prototypes::id::TestJSImplInterface },
2541 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2542 JSJitInfo::Method,
2543 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2544 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2545 false, /* isInfallible. False in setters. */
2546 false, /* isMovable. Not relevant for setters. */
2547 false, /* isEliminatable. Not relevant for setters. */
2548 false, /* isAlwaysInSlot. Only relevant for getters. */
2549 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2550 false, /* isTypedMethod. Only relevant for methods. */
2551 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2552};
2553
2554MOZ_CAN_RUN_SCRIPT static bool
2555get_readonlyOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2556{
2557 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2560( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2558 "TestJSImplInterface", "readonlyOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2560( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2559 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2560( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2560 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2560( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2561
2562 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2563 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2564 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2565 if (objIsXray) {
2566 unwrappedObj.emplace(cx, obj);
2567 }
2568 if (objIsXray) {
2569 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2570 // we know Xrays have no dynamic unwrap behavior.
2571 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2572 if (!unwrappedObj.ref()) {
2573 return false;
2574 }
2575 }
2576 FastErrorResult rv;
2577 uint8_t result(MOZ_KnownLive(self)(self)->GetReadonlyOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2578 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyOctet getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyOctet getter"
)), 0))
) {
2579 return false;
2580 }
2581 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2581); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2581; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2582 args.rval().setInt32(int32_t(result));
2583 return true;
2584}
2585
2586static const JSJitInfo readonlyOctet_getterinfo = {
2587 { get_readonlyOctet },
2588 { prototypes::id::TestJSImplInterface },
2589 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2590 JSJitInfo::Getter,
2591 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2592 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2593 false, /* isInfallible. False in setters. */
2594 false, /* isMovable. Not relevant for setters. */
2595 false, /* isEliminatable. Not relevant for setters. */
2596 false, /* isAlwaysInSlot. Only relevant for getters. */
2597 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2598 false, /* isTypedMethod. Only relevant for methods. */
2599 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2600};
2601
2602MOZ_CAN_RUN_SCRIPT static bool
2603get_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2604{
2605 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2608( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2606 "TestJSImplInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2608( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2607 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2608( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2608 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2608( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2609
2610 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2611 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2612 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2613 if (objIsXray) {
2614 unwrappedObj.emplace(cx, obj);
2615 }
2616 if (objIsXray) {
2617 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2618 // we know Xrays have no dynamic unwrap behavior.
2619 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2620 if (!unwrappedObj.ref()) {
2621 return false;
2622 }
2623 }
2624 FastErrorResult rv;
2625 uint8_t result(MOZ_KnownLive(self)(self)->GetWritableOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2626 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet getter"
)), 0))
) {
2627 return false;
2628 }
2629 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2629); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2629; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2630 args.rval().setInt32(int32_t(result));
2631 return true;
2632}
2633
2634MOZ_CAN_RUN_SCRIPT static bool
2635set_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
2636{
2637 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2640( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2638 "TestJSImplInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2640( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2639 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2640( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2640 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2640( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2641
2642 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2643 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2644 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2645 if (objIsXray) {
2646 unwrappedObj.emplace(cx, obj);
2647 }
2648 uint8_t arg0;
2649 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
2650 return false;
2651 }
2652 if (objIsXray) {
2653 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2654 // we know Xrays have no dynamic unwrap behavior.
2655 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2656 if (!unwrappedObj.ref()) {
2657 return false;
2658 }
2659 }
2660 FastErrorResult rv;
2661 // NOTE: This assert does NOT call the function.
2662 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2663 MOZ_KnownLive(self)(self)->SetWritableOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2664 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet setter"
)), 0))
) {
2665 return false;
2666 }
2667 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2667); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2667; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2668
2669 return true;
2670}
2671
2672static const JSJitInfo writableOctet_getterinfo = {
2673 { get_writableOctet },
2674 { prototypes::id::TestJSImplInterface },
2675 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2676 JSJitInfo::Getter,
2677 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2678 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2679 false, /* isInfallible. False in setters. */
2680 false, /* isMovable. Not relevant for setters. */
2681 false, /* isEliminatable. Not relevant for setters. */
2682 false, /* isAlwaysInSlot. Only relevant for getters. */
2683 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2684 false, /* isTypedMethod. Only relevant for methods. */
2685 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2686};
2687static const JSJitInfo writableOctet_setterinfo = {
2688 { (JSJitGetterOp)set_writableOctet },
2689 { prototypes::id::TestJSImplInterface },
2690 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2691 JSJitInfo::Setter,
2692 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2693 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2694 false, /* isInfallible. False in setters. */
2695 false, /* isMovable. Not relevant for setters. */
2696 false, /* isEliminatable. Not relevant for setters. */
2697 false, /* isAlwaysInSlot. Only relevant for getters. */
2698 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2699 false, /* isTypedMethod. Only relevant for methods. */
2700 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2701};
2702
2703MOZ_CAN_RUN_SCRIPT static bool
2704passOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2705{
2706 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2709( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2707 "TestJSImplInterface", "passOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2709( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2708 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2709( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2709 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2709( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
2710
2711 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2712 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOctet", 1)) {
2713 return false;
2714 }
2715 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2716 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2717 if (objIsXray) {
2718 unwrappedObj.emplace(cx, obj);
2719 }
2720 uint8_t arg0;
2721 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2722 return false;
2723 }
2724 if (objIsXray) {
2725 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2726 // we know Xrays have no dynamic unwrap behavior.
2727 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2728 if (!unwrappedObj.ref()) {
2729 return false;
2730 }
2731 }
2732 FastErrorResult rv;
2733 // NOTE: This assert does NOT call the function.
2734 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2735 MOZ_KnownLive(self)(self)->PassOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2736 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOctet"
)), 0))
) {
2737 return false;
2738 }
2739 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2739); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2739; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2740 args.rval().setUndefined();
2741 return true;
2742}
2743
2744static const JSJitInfo passOctet_methodinfo = {
2745 { (JSJitGetterOp)passOctet },
2746 { prototypes::id::TestJSImplInterface },
2747 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2748 JSJitInfo::Method,
2749 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2750 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2751 false, /* isInfallible. False in setters. */
2752 false, /* isMovable. Not relevant for setters. */
2753 false, /* isEliminatable. Not relevant for setters. */
2754 false, /* isAlwaysInSlot. Only relevant for getters. */
2755 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2756 false, /* isTypedMethod. Only relevant for methods. */
2757 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2758};
2759
2760MOZ_CAN_RUN_SCRIPT static bool
2761receiveOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2762{
2763 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2766( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2764 "TestJSImplInterface", "receiveOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2766( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2765 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2766( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2766 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2766( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2767
2768 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2769 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2770 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2771 if (objIsXray) {
2772 unwrappedObj.emplace(cx, obj);
2773 }
2774 if (objIsXray) {
2775 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2776 // we know Xrays have no dynamic unwrap behavior.
2777 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2778 if (!unwrappedObj.ref()) {
2779 return false;
2780 }
2781 }
2782 FastErrorResult rv;
2783 uint8_t result(MOZ_KnownLive(self)(self)->ReceiveOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2784 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveOctet"
)), 0))
) {
2785 return false;
2786 }
2787 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2787); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2787; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2788 args.rval().setInt32(int32_t(result));
2789 return true;
2790}
2791
2792static const JSJitInfo receiveOctet_methodinfo = {
2793 { (JSJitGetterOp)receiveOctet },
2794 { prototypes::id::TestJSImplInterface },
2795 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2796 JSJitInfo::Method,
2797 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2798 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2799 false, /* isInfallible. False in setters. */
2800 false, /* isMovable. Not relevant for setters. */
2801 false, /* isEliminatable. Not relevant for setters. */
2802 false, /* isAlwaysInSlot. Only relevant for getters. */
2803 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2804 false, /* isTypedMethod. Only relevant for methods. */
2805 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2806};
2807
2808MOZ_CAN_RUN_SCRIPT static bool
2809passOptionalOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2810{
2811 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2814( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2812 "TestJSImplInterface", "passOptionalOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2814( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2813 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2814( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2814 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2814( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2815
2816 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2817 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2818 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2819 if (objIsXray) {
2820 unwrappedObj.emplace(cx, obj);
2821 }
2822 Optional<uint8_t> arg0;
2823 if (args.hasDefined(0)) {
2824 arg0.Construct();
2825 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2826 return false;
2827 }
2828 }
2829 if (objIsXray) {
2830 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2831 // we know Xrays have no dynamic unwrap behavior.
2832 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2833 if (!unwrappedObj.ref()) {
2834 return false;
2835 }
2836 }
2837 FastErrorResult rv;
2838 // NOTE: This assert does NOT call the function.
2839 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalOctet(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2840 MOZ_KnownLive(self)(self)->PassOptionalOctet(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2841 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctet"
)), 0))
) {
2842 return false;
2843 }
2844 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2844); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2844; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2845 args.rval().setUndefined();
2846 return true;
2847}
2848
2849static const JSJitInfo passOptionalOctet_methodinfo = {
2850 { (JSJitGetterOp)passOptionalOctet },
2851 { prototypes::id::TestJSImplInterface },
2852 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2853 JSJitInfo::Method,
2854 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2855 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2856 false, /* isInfallible. False in setters. */
2857 false, /* isMovable. Not relevant for setters. */
2858 false, /* isEliminatable. Not relevant for setters. */
2859 false, /* isAlwaysInSlot. Only relevant for getters. */
2860 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2861 false, /* isTypedMethod. Only relevant for methods. */
2862 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2863};
2864
2865MOZ_CAN_RUN_SCRIPT static bool
2866passOptionalOctetWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2867{
2868 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2871( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2869 "TestJSImplInterface", "passOptionalOctetWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2871( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2870 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2871( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2871 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2871( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2872
2873 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2874 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2875 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2876 if (objIsXray) {
2877 unwrappedObj.emplace(cx, obj);
2878 }
2879 uint8_t arg0;
2880 if (args.hasDefined(0)) {
2881 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2882 return false;
2883 }
2884 } else {
2885 arg0 = 19;
2886 }
2887 if (objIsXray) {
2888 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2889 // we know Xrays have no dynamic unwrap behavior.
2890 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2891 if (!unwrappedObj.ref()) {
2892 return false;
2893 }
2894 }
2895 FastErrorResult rv;
2896 // NOTE: This assert does NOT call the function.
2897 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalOctetWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2898 MOZ_KnownLive(self)(self)->PassOptionalOctetWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2899 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctetWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctetWithDefault"
)), 0))
) {
2900 return false;
2901 }
2902 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2902); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2902; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2903 args.rval().setUndefined();
2904 return true;
2905}
2906
2907static const JSJitInfo passOptionalOctetWithDefault_methodinfo = {
2908 { (JSJitGetterOp)passOptionalOctetWithDefault },
2909 { prototypes::id::TestJSImplInterface },
2910 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2911 JSJitInfo::Method,
2912 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2913 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2914 false, /* isInfallible. False in setters. */
2915 false, /* isMovable. Not relevant for setters. */
2916 false, /* isEliminatable. Not relevant for setters. */
2917 false, /* isAlwaysInSlot. Only relevant for getters. */
2918 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2919 false, /* isTypedMethod. Only relevant for methods. */
2920 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2921};
2922
2923MOZ_CAN_RUN_SCRIPT static bool
2924get_readonlyUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2925{
2926 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2929( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2927 "TestJSImplInterface", "readonlyUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2929( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2928 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2929( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2929 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2929( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2930
2931 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2932 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2933 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2934 if (objIsXray) {
2935 unwrappedObj.emplace(cx, obj);
2936 }
2937 if (objIsXray) {
2938 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2939 // we know Xrays have no dynamic unwrap behavior.
2940 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2941 if (!unwrappedObj.ref()) {
2942 return false;
2943 }
2944 }
2945 FastErrorResult rv;
2946 uint16_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2947 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedShort getter"
)), 0))
) {
2948 return false;
2949 }
2950 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2950); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2950; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2951 args.rval().setInt32(int32_t(result));
2952 return true;
2953}
2954
2955static const JSJitInfo readonlyUnsignedShort_getterinfo = {
2956 { get_readonlyUnsignedShort },
2957 { prototypes::id::TestJSImplInterface },
2958 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2959 JSJitInfo::Getter,
2960 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2961 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2962 false, /* isInfallible. False in setters. */
2963 false, /* isMovable. Not relevant for setters. */
2964 false, /* isEliminatable. Not relevant for setters. */
2965 false, /* isAlwaysInSlot. Only relevant for getters. */
2966 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2967 false, /* isTypedMethod. Only relevant for methods. */
2968 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2969};
2970
2971MOZ_CAN_RUN_SCRIPT static bool
2972get_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2973{
2974 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2977( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2975 "TestJSImplInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2977( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2976 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2977( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2977 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2977( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2978
2979 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2980 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2981 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2982 if (objIsXray) {
2983 unwrappedObj.emplace(cx, obj);
2984 }
2985 if (objIsXray) {
2986 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2987 // we know Xrays have no dynamic unwrap behavior.
2988 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2989 if (!unwrappedObj.ref()) {
2990 return false;
2991 }
2992 }
2993 FastErrorResult rv;
2994 uint16_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2995 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort getter"
)), 0))
) {
2996 return false;
2997 }
2998 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2998); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2998; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2999 args.rval().setInt32(int32_t(result));
3000 return true;
3001}
3002
3003MOZ_CAN_RUN_SCRIPT static bool
3004set_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3005{
3006 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3009( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3007 "TestJSImplInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3009( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3008 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3009( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3009 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3009( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3010
3011 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3012 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3013 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3014 if (objIsXray) {
3015 unwrappedObj.emplace(cx, obj);
3016 }
3017 uint16_t arg0;
3018 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3019 return false;
3020 }
3021 if (objIsXray) {
3022 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3023 // we know Xrays have no dynamic unwrap behavior.
3024 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3025 if (!unwrappedObj.ref()) {
3026 return false;
3027 }
3028 }
3029 FastErrorResult rv;
3030 // NOTE: This assert does NOT call the function.
3031 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3032 MOZ_KnownLive(self)(self)->SetWritableUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3033 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort setter"
)), 0))
) {
3034 return false;
3035 }
3036 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3036); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3036; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3037
3038 return true;
3039}
3040
3041static const JSJitInfo writableUnsignedShort_getterinfo = {
3042 { get_writableUnsignedShort },
3043 { prototypes::id::TestJSImplInterface },
3044 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3045 JSJitInfo::Getter,
3046 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3047 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
3048 false, /* isInfallible. False in setters. */
3049 false, /* isMovable. Not relevant for setters. */
3050 false, /* isEliminatable. Not relevant for setters. */
3051 false, /* isAlwaysInSlot. Only relevant for getters. */
3052 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3053 false, /* isTypedMethod. Only relevant for methods. */
3054 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3055};
3056static const JSJitInfo writableUnsignedShort_setterinfo = {
3057 { (JSJitGetterOp)set_writableUnsignedShort },
3058 { prototypes::id::TestJSImplInterface },
3059 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3060 JSJitInfo::Setter,
3061 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3062 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3063 false, /* isInfallible. False in setters. */
3064 false, /* isMovable. Not relevant for setters. */
3065 false, /* isEliminatable. Not relevant for setters. */
3066 false, /* isAlwaysInSlot. Only relevant for getters. */
3067 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3068 false, /* isTypedMethod. Only relevant for methods. */
3069 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3070};
3071
3072MOZ_CAN_RUN_SCRIPT static bool
3073passUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3074{
3075 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3078( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3076 "TestJSImplInterface", "passUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3078( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3077 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3078( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3078 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3078( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3079
3080 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3081 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedShort", 1)) {
3082 return false;
3083 }
3084 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3085 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3086 if (objIsXray) {
3087 unwrappedObj.emplace(cx, obj);
3088 }
3089 uint16_t arg0;
3090 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3091 return false;
3092 }
3093 if (objIsXray) {
3094 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3095 // we know Xrays have no dynamic unwrap behavior.
3096 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3097 if (!unwrappedObj.ref()) {
3098 return false;
3099 }
3100 }
3101 FastErrorResult rv;
3102 // NOTE: This assert does NOT call the function.
3103 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3104 MOZ_KnownLive(self)(self)->PassUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3105 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedShort"
)), 0))
) {
3106 return false;
3107 }
3108 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3108); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3108; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3109 args.rval().setUndefined();
3110 return true;
3111}
3112
3113static const JSJitInfo passUnsignedShort_methodinfo = {
3114 { (JSJitGetterOp)passUnsignedShort },
3115 { prototypes::id::TestJSImplInterface },
3116 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3117 JSJitInfo::Method,
3118 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3119 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3120 false, /* isInfallible. False in setters. */
3121 false, /* isMovable. Not relevant for setters. */
3122 false, /* isEliminatable. Not relevant for setters. */
3123 false, /* isAlwaysInSlot. Only relevant for getters. */
3124 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3125 false, /* isTypedMethod. Only relevant for methods. */
3126 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3127};
3128
3129MOZ_CAN_RUN_SCRIPT static bool
3130receiveUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3131{
3132 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3135( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3133 "TestJSImplInterface", "receiveUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3135( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3134 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3135( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3135 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3135( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3136
3137 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3138 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3139 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3140 if (objIsXray) {
3141 unwrappedObj.emplace(cx, obj);
3142 }
3143 if (objIsXray) {
3144 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3145 // we know Xrays have no dynamic unwrap behavior.
3146 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3147 if (!unwrappedObj.ref()) {
3148 return false;
3149 }
3150 }
3151 FastErrorResult rv;
3152 uint16_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3153 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedShort"
)), 0))
) {
3154 return false;
3155 }
3156 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3156; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3157 args.rval().setInt32(int32_t(result));
3158 return true;
3159}
3160
3161static const JSJitInfo receiveUnsignedShort_methodinfo = {
3162 { (JSJitGetterOp)receiveUnsignedShort },
3163 { prototypes::id::TestJSImplInterface },
3164 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3165 JSJitInfo::Method,
3166 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3167 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
3168 false, /* isInfallible. False in setters. */
3169 false, /* isMovable. Not relevant for setters. */
3170 false, /* isEliminatable. Not relevant for setters. */
3171 false, /* isAlwaysInSlot. Only relevant for getters. */
3172 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3173 false, /* isTypedMethod. Only relevant for methods. */
3174 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3175};
3176
3177MOZ_CAN_RUN_SCRIPT static bool
3178passOptionalUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3179{
3180 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3183( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3181 "TestJSImplInterface", "passOptionalUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3183( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3182 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3183( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3183 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3183( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3184
3185 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3186 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3187 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3188 if (objIsXray) {
3189 unwrappedObj.emplace(cx, obj);
3190 }
3191 Optional<uint16_t> arg0;
3192 if (args.hasDefined(0)) {
3193 arg0.Construct();
3194 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3195 return false;
3196 }
3197 }
3198 if (objIsXray) {
3199 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3200 // we know Xrays have no dynamic unwrap behavior.
3201 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3202 if (!unwrappedObj.ref()) {
3203 return false;
3204 }
3205 }
3206 FastErrorResult rv;
3207 // NOTE: This assert does NOT call the function.
3208 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3209 MOZ_KnownLive(self)(self)->PassOptionalUnsignedShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3210 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShort"
)), 0))
) {
3211 return false;
3212 }
3213 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3213); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3213; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3214 args.rval().setUndefined();
3215 return true;
3216}
3217
3218static const JSJitInfo passOptionalUnsignedShort_methodinfo = {
3219 { (JSJitGetterOp)passOptionalUnsignedShort },
3220 { prototypes::id::TestJSImplInterface },
3221 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3222 JSJitInfo::Method,
3223 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3224 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3225 false, /* isInfallible. False in setters. */
3226 false, /* isMovable. Not relevant for setters. */
3227 false, /* isEliminatable. Not relevant for setters. */
3228 false, /* isAlwaysInSlot. Only relevant for getters. */
3229 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3230 false, /* isTypedMethod. Only relevant for methods. */
3231 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3232};
3233
3234MOZ_CAN_RUN_SCRIPT static bool
3235passOptionalUnsignedShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3236{
3237 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3240( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3238 "TestJSImplInterface", "passOptionalUnsignedShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3240( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3239 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3240( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3240 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3240( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3241
3242 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3243 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3244 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3245 if (objIsXray) {
3246 unwrappedObj.emplace(cx, obj);
3247 }
3248 uint16_t arg0;
3249 if (args.hasDefined(0)) {
3250 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3251 return false;
3252 }
3253 } else {
3254 arg0 = 2;
3255 }
3256 if (objIsXray) {
3257 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3258 // we know Xrays have no dynamic unwrap behavior.
3259 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3260 if (!unwrappedObj.ref()) {
3261 return false;
3262 }
3263 }
3264 FastErrorResult rv;
3265 // NOTE: This assert does NOT call the function.
3266 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3267 MOZ_KnownLive(self)(self)->PassOptionalUnsignedShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3268 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShortWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShortWithDefault"
)), 0))
) {
3269 return false;
3270 }
3271 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3271); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3271; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3272 args.rval().setUndefined();
3273 return true;
3274}
3275
3276static const JSJitInfo passOptionalUnsignedShortWithDefault_methodinfo = {
3277 { (JSJitGetterOp)passOptionalUnsignedShortWithDefault },
3278 { prototypes::id::TestJSImplInterface },
3279 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3280 JSJitInfo::Method,
3281 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3282 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3283 false, /* isInfallible. False in setters. */
3284 false, /* isMovable. Not relevant for setters. */
3285 false, /* isEliminatable. Not relevant for setters. */
3286 false, /* isAlwaysInSlot. Only relevant for getters. */
3287 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3288 false, /* isTypedMethod. Only relevant for methods. */
3289 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3290};
3291
3292MOZ_CAN_RUN_SCRIPT static bool
3293get_readonlyUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3294{
3295 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3298( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3296 "TestJSImplInterface", "readonlyUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3298( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3297 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3298( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3298 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3298( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3299
3300 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3301 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3302 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3303 if (objIsXray) {
3304 unwrappedObj.emplace(cx, obj);
3305 }
3306 if (objIsXray) {
3307 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3308 // we know Xrays have no dynamic unwrap behavior.
3309 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3310 if (!unwrappedObj.ref()) {
3311 return false;
3312 }
3313 }
3314 FastErrorResult rv;
3315 uint32_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3316 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLong getter"
)), 0))
) {
3317 return false;
3318 }
3319 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3319); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3319; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3320 args.rval().setNumber(result);
3321 return true;
3322}
3323
3324static const JSJitInfo readonlyUnsignedLong_getterinfo = {
3325 { get_readonlyUnsignedLong },
3326 { prototypes::id::TestJSImplInterface },
3327 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3328 JSJitInfo::Getter,
3329 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3330 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3331 false, /* isInfallible. False in setters. */
3332 false, /* isMovable. Not relevant for setters. */
3333 false, /* isEliminatable. Not relevant for setters. */
3334 false, /* isAlwaysInSlot. Only relevant for getters. */
3335 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3336 false, /* isTypedMethod. Only relevant for methods. */
3337 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3338};
3339
3340MOZ_CAN_RUN_SCRIPT static bool
3341get_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3342{
3343 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3346( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3344 "TestJSImplInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3346( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3345 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3346( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3346 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3346( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3347
3348 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3349 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3350 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3351 if (objIsXray) {
3352 unwrappedObj.emplace(cx, obj);
3353 }
3354 if (objIsXray) {
3355 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3356 // we know Xrays have no dynamic unwrap behavior.
3357 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3358 if (!unwrappedObj.ref()) {
3359 return false;
3360 }
3361 }
3362 FastErrorResult rv;
3363 uint32_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3364 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong getter"
)), 0))
) {
3365 return false;
3366 }
3367 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3367); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3367; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3368 args.rval().setNumber(result);
3369 return true;
3370}
3371
3372MOZ_CAN_RUN_SCRIPT static bool
3373set_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3374{
3375 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3378( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3376 "TestJSImplInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3378( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3377 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3378( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3378 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3378( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3379
3380 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3381 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3382 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3383 if (objIsXray) {
3384 unwrappedObj.emplace(cx, obj);
3385 }
3386 uint32_t arg0;
3387 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3388 return false;
3389 }
3390 if (objIsXray) {
3391 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3392 // we know Xrays have no dynamic unwrap behavior.
3393 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3394 if (!unwrappedObj.ref()) {
3395 return false;
3396 }
3397 }
3398 FastErrorResult rv;
3399 // NOTE: This assert does NOT call the function.
3400 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3401 MOZ_KnownLive(self)(self)->SetWritableUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3402 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong setter"
)), 0))
) {
3403 return false;
3404 }
3405 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3405; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3406
3407 return true;
3408}
3409
3410static const JSJitInfo writableUnsignedLong_getterinfo = {
3411 { get_writableUnsignedLong },
3412 { prototypes::id::TestJSImplInterface },
3413 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3414 JSJitInfo::Getter,
3415 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3416 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3417 false, /* isInfallible. False in setters. */
3418 false, /* isMovable. Not relevant for setters. */
3419 false, /* isEliminatable. Not relevant for setters. */
3420 false, /* isAlwaysInSlot. Only relevant for getters. */
3421 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3422 false, /* isTypedMethod. Only relevant for methods. */
3423 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3424};
3425static const JSJitInfo writableUnsignedLong_setterinfo = {
3426 { (JSJitGetterOp)set_writableUnsignedLong },
3427 { prototypes::id::TestJSImplInterface },
3428 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3429 JSJitInfo::Setter,
3430 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3431 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3432 false, /* isInfallible. False in setters. */
3433 false, /* isMovable. Not relevant for setters. */
3434 false, /* isEliminatable. Not relevant for setters. */
3435 false, /* isAlwaysInSlot. Only relevant for getters. */
3436 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3437 false, /* isTypedMethod. Only relevant for methods. */
3438 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3439};
3440
3441MOZ_CAN_RUN_SCRIPT static bool
3442passUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3443{
3444 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3447( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3445 "TestJSImplInterface", "passUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3447( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3446 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3447( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3447 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3447( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3448
3449 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3450 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedLong", 1)) {
3451 return false;
3452 }
3453 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3454 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3455 if (objIsXray) {
3456 unwrappedObj.emplace(cx, obj);
3457 }
3458 uint32_t arg0;
3459 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3460 return false;
3461 }
3462 if (objIsXray) {
3463 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3464 // we know Xrays have no dynamic unwrap behavior.
3465 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3466 if (!unwrappedObj.ref()) {
3467 return false;
3468 }
3469 }
3470 FastErrorResult rv;
3471 // NOTE: This assert does NOT call the function.
3472 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3473 MOZ_KnownLive(self)(self)->PassUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3474 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLong"
)), 0))
) {
3475 return false;
3476 }
3477 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3477); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3477; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3478 args.rval().setUndefined();
3479 return true;
3480}
3481
3482static const JSJitInfo passUnsignedLong_methodinfo = {
3483 { (JSJitGetterOp)passUnsignedLong },
3484 { prototypes::id::TestJSImplInterface },
3485 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3486 JSJitInfo::Method,
3487 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3488 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3489 false, /* isInfallible. False in setters. */
3490 false, /* isMovable. Not relevant for setters. */
3491 false, /* isEliminatable. Not relevant for setters. */
3492 false, /* isAlwaysInSlot. Only relevant for getters. */
3493 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3494 false, /* isTypedMethod. Only relevant for methods. */
3495 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3496};
3497
3498MOZ_CAN_RUN_SCRIPT static bool
3499receiveUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3500{
3501 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3504( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3502 "TestJSImplInterface", "receiveUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3504( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3503 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3504( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3504 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3504( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3505
3506 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3507 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3508 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3509 if (objIsXray) {
3510 unwrappedObj.emplace(cx, obj);
3511 }
3512 if (objIsXray) {
3513 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3514 // we know Xrays have no dynamic unwrap behavior.
3515 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3516 if (!unwrappedObj.ref()) {
3517 return false;
3518 }
3519 }
3520 FastErrorResult rv;
3521 uint32_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3522 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLong"
)), 0))
) {
3523 return false;
3524 }
3525 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3525; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3526 args.rval().setNumber(result);
3527 return true;
3528}
3529
3530static const JSJitInfo receiveUnsignedLong_methodinfo = {
3531 { (JSJitGetterOp)receiveUnsignedLong },
3532 { prototypes::id::TestJSImplInterface },
3533 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3534 JSJitInfo::Method,
3535 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3536 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3537 false, /* isInfallible. False in setters. */
3538 false, /* isMovable. Not relevant for setters. */
3539 false, /* isEliminatable. Not relevant for setters. */
3540 false, /* isAlwaysInSlot. Only relevant for getters. */
3541 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3542 false, /* isTypedMethod. Only relevant for methods. */
3543 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3544};
3545
3546MOZ_CAN_RUN_SCRIPT static bool
3547passOptionalUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3548{
3549 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3552( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3550 "TestJSImplInterface", "passOptionalUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3552( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3551 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3552( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3552 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3552( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3553
3554 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3555 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3556 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3557 if (objIsXray) {
3558 unwrappedObj.emplace(cx, obj);
3559 }
3560 Optional<uint32_t> arg0;
3561 if (args.hasDefined(0)) {
3562 arg0.Construct();
3563 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3564 return false;
3565 }
3566 }
3567 if (objIsXray) {
3568 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3569 // we know Xrays have no dynamic unwrap behavior.
3570 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3571 if (!unwrappedObj.ref()) {
3572 return false;
3573 }
3574 }
3575 FastErrorResult rv;
3576 // NOTE: This assert does NOT call the function.
3577 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3578 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3579 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLong"
)), 0))
) {
3580 return false;
3581 }
3582 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3582); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3582; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3583 args.rval().setUndefined();
3584 return true;
3585}
3586
3587static const JSJitInfo passOptionalUnsignedLong_methodinfo = {
3588 { (JSJitGetterOp)passOptionalUnsignedLong },
3589 { prototypes::id::TestJSImplInterface },
3590 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3591 JSJitInfo::Method,
3592 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3593 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3594 false, /* isInfallible. False in setters. */
3595 false, /* isMovable. Not relevant for setters. */
3596 false, /* isEliminatable. Not relevant for setters. */
3597 false, /* isAlwaysInSlot. Only relevant for getters. */
3598 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3599 false, /* isTypedMethod. Only relevant for methods. */
3600 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3601};
3602
3603MOZ_CAN_RUN_SCRIPT static bool
3604passOptionalUnsignedLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3605{
3606 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3609( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3607 "TestJSImplInterface", "passOptionalUnsignedLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3609( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3608 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3609( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3609 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3609( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3610
3611 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3612 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3613 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3614 if (objIsXray) {
3615 unwrappedObj.emplace(cx, obj);
3616 }
3617 uint32_t arg0;
3618 if (args.hasDefined(0)) {
3619 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3620 return false;
3621 }
3622 } else {
3623 arg0 = 6U;
3624 }
3625 if (objIsXray) {
3626 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3627 // we know Xrays have no dynamic unwrap behavior.
3628 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3629 if (!unwrappedObj.ref()) {
3630 return false;
3631 }
3632 }
3633 FastErrorResult rv;
3634 // NOTE: This assert does NOT call the function.
3635 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3636 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3637 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongWithDefault"
)), 0))
) {
3638 return false;
3639 }
3640 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3640); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3640; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3641 args.rval().setUndefined();
3642 return true;
3643}
3644
3645static const JSJitInfo passOptionalUnsignedLongWithDefault_methodinfo = {
3646 { (JSJitGetterOp)passOptionalUnsignedLongWithDefault },
3647 { prototypes::id::TestJSImplInterface },
3648 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3649 JSJitInfo::Method,
3650 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3651 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3652 false, /* isInfallible. False in setters. */
3653 false, /* isMovable. Not relevant for setters. */
3654 false, /* isEliminatable. Not relevant for setters. */
3655 false, /* isAlwaysInSlot. Only relevant for getters. */
3656 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3657 false, /* isTypedMethod. Only relevant for methods. */
3658 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3659};
3660
3661MOZ_CAN_RUN_SCRIPT static bool
3662get_readonlyUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3663{
3664 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3667( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3665 "TestJSImplInterface", "readonlyUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3667( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3666 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3667( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3667 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3667( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3668
3669 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3670 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3671 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3672 if (objIsXray) {
3673 unwrappedObj.emplace(cx, obj);
3674 }
3675 if (objIsXray) {
3676 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3677 // we know Xrays have no dynamic unwrap behavior.
3678 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3679 if (!unwrappedObj.ref()) {
3680 return false;
3681 }
3682 }
3683 FastErrorResult rv;
3684 uint64_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3685 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLongLong getter"
)), 0))
) {
3686 return false;
3687 }
3688 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3688); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3688; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3689 args.rval().set(JS_NumberValue(double(result)));
3690 return true;
3691}
3692
3693static const JSJitInfo readonlyUnsignedLongLong_getterinfo = {
3694 { get_readonlyUnsignedLongLong },
3695 { prototypes::id::TestJSImplInterface },
3696 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3697 JSJitInfo::Getter,
3698 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3699 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3700 false, /* isInfallible. False in setters. */
3701 false, /* isMovable. Not relevant for setters. */
3702 false, /* isEliminatable. Not relevant for setters. */
3703 false, /* isAlwaysInSlot. Only relevant for getters. */
3704 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3705 false, /* isTypedMethod. Only relevant for methods. */
3706 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3707};
3708
3709MOZ_CAN_RUN_SCRIPT static bool
3710get_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3711{
3712 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3715( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3713 "TestJSImplInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3715( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3714 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3715( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3715 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3715( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3716
3717 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3718 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3719 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3720 if (objIsXray) {
3721 unwrappedObj.emplace(cx, obj);
3722 }
3723 if (objIsXray) {
3724 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3725 // we know Xrays have no dynamic unwrap behavior.
3726 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3727 if (!unwrappedObj.ref()) {
3728 return false;
3729 }
3730 }
3731 FastErrorResult rv;
3732 uint64_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3733 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong getter"
)), 0))
) {
3734 return false;
3735 }
3736 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3736); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3736; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3737 args.rval().set(JS_NumberValue(double(result)));
3738 return true;
3739}
3740
3741MOZ_CAN_RUN_SCRIPT static bool
3742set_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3743{
3744 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3747( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3745 "TestJSImplInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3747( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3746 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3747( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3747 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3747( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3748
3749 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3750 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3751 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3752 if (objIsXray) {
3753 unwrappedObj.emplace(cx, obj);
3754 }
3755 uint64_t arg0;
3756 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3757 return false;
3758 }
3759 if (objIsXray) {
3760 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3761 // we know Xrays have no dynamic unwrap behavior.
3762 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3763 if (!unwrappedObj.ref()) {
3764 return false;
3765 }
3766 }
3767 FastErrorResult rv;
3768 // NOTE: This assert does NOT call the function.
3769 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3770 MOZ_KnownLive(self)(self)->SetWritableUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3771 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong setter"
)), 0))
) {
3772 return false;
3773 }
3774 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3774); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3774; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3775
3776 return true;
3777}
3778
3779static const JSJitInfo writableUnsignedLongLong_getterinfo = {
3780 { get_writableUnsignedLongLong },
3781 { prototypes::id::TestJSImplInterface },
3782 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3783 JSJitInfo::Getter,
3784 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3785 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3786 false, /* isInfallible. False in setters. */
3787 false, /* isMovable. Not relevant for setters. */
3788 false, /* isEliminatable. Not relevant for setters. */
3789 false, /* isAlwaysInSlot. Only relevant for getters. */
3790 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3791 false, /* isTypedMethod. Only relevant for methods. */
3792 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3793};
3794static const JSJitInfo writableUnsignedLongLong_setterinfo = {
3795 { (JSJitGetterOp)set_writableUnsignedLongLong },
3796 { prototypes::id::TestJSImplInterface },
3797 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3798 JSJitInfo::Setter,
3799 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3800 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3801 false, /* isInfallible. False in setters. */
3802 false, /* isMovable. Not relevant for setters. */
3803 false, /* isEliminatable. Not relevant for setters. */
3804 false, /* isAlwaysInSlot. Only relevant for getters. */
3805 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3806 false, /* isTypedMethod. Only relevant for methods. */
3807 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3808};
3809
3810MOZ_CAN_RUN_SCRIPT static bool
3811passUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3812{
3813 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3816( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3814 "TestJSImplInterface", "passUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3816( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3815 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3816( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3816 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3816( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3817
3818 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3819 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedLongLong", 1)) {
3820 return false;
3821 }
3822 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3823 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3824 if (objIsXray) {
3825 unwrappedObj.emplace(cx, obj);
3826 }
3827 uint64_t arg0;
3828 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3829 return false;
3830 }
3831 if (objIsXray) {
3832 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3833 // we know Xrays have no dynamic unwrap behavior.
3834 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3835 if (!unwrappedObj.ref()) {
3836 return false;
3837 }
3838 }
3839 FastErrorResult rv;
3840 // NOTE: This assert does NOT call the function.
3841 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3842 MOZ_KnownLive(self)(self)->PassUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3843 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLongLong"
)), 0))
) {
3844 return false;
3845 }
3846 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3846); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3846; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3847 args.rval().setUndefined();
3848 return true;
3849}
3850
3851static const JSJitInfo passUnsignedLongLong_methodinfo = {
3852 { (JSJitGetterOp)passUnsignedLongLong },
3853 { prototypes::id::TestJSImplInterface },
3854 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3855 JSJitInfo::Method,
3856 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3857 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3858 false, /* isInfallible. False in setters. */
3859 false, /* isMovable. Not relevant for setters. */
3860 false, /* isEliminatable. Not relevant for setters. */
3861 false, /* isAlwaysInSlot. Only relevant for getters. */
3862 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3863 false, /* isTypedMethod. Only relevant for methods. */
3864 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3865};
3866
3867MOZ_CAN_RUN_SCRIPT static bool
3868receiveUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3869{
3870 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3873( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3871 "TestJSImplInterface", "receiveUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3873( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3872 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3873( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3873 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3873( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3874
3875 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3876 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3877 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3878 if (objIsXray) {
3879 unwrappedObj.emplace(cx, obj);
3880 }
3881 if (objIsXray) {
3882 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3883 // we know Xrays have no dynamic unwrap behavior.
3884 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3885 if (!unwrappedObj.ref()) {
3886 return false;
3887 }
3888 }
3889 FastErrorResult rv;
3890 uint64_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3891 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLongLong"
)), 0))
) {
3892 return false;
3893 }
3894 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3894); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3894; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3895 args.rval().set(JS_NumberValue(double(result)));
3896 return true;
3897}
3898
3899static const JSJitInfo receiveUnsignedLongLong_methodinfo = {
3900 { (JSJitGetterOp)receiveUnsignedLongLong },
3901 { prototypes::id::TestJSImplInterface },
3902 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3903 JSJitInfo::Method,
3904 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3905 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3906 false, /* isInfallible. False in setters. */
3907 false, /* isMovable. Not relevant for setters. */
3908 false, /* isEliminatable. Not relevant for setters. */
3909 false, /* isAlwaysInSlot. Only relevant for getters. */
3910 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3911 false, /* isTypedMethod. Only relevant for methods. */
3912 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3913};
3914
3915MOZ_CAN_RUN_SCRIPT static bool
3916passOptionalUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3917{
3918 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3921( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3919 "TestJSImplInterface", "passOptionalUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3921( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3920 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3921( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3921 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3921( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3922
3923 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3924 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3925 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3926 if (objIsXray) {
3927 unwrappedObj.emplace(cx, obj);
3928 }
3929 Optional<uint64_t> arg0;
3930 if (args.hasDefined(0)) {
3931 arg0.Construct();
3932 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3933 return false;
3934 }
3935 }
3936 if (objIsXray) {
3937 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3938 // we know Xrays have no dynamic unwrap behavior.
3939 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3940 if (!unwrappedObj.ref()) {
3941 return false;
3942 }
3943 }
3944 FastErrorResult rv;
3945 // NOTE: This assert does NOT call the function.
3946 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3947 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3948 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLong"
)), 0))
) {
3949 return false;
3950 }
3951 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3951); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3951; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3952 args.rval().setUndefined();
3953 return true;
3954}
3955
3956static const JSJitInfo passOptionalUnsignedLongLong_methodinfo = {
3957 { (JSJitGetterOp)passOptionalUnsignedLongLong },
3958 { prototypes::id::TestJSImplInterface },
3959 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3960 JSJitInfo::Method,
3961 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3962 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3963 false, /* isInfallible. False in setters. */
3964 false, /* isMovable. Not relevant for setters. */
3965 false, /* isEliminatable. Not relevant for setters. */
3966 false, /* isAlwaysInSlot. Only relevant for getters. */
3967 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3968 false, /* isTypedMethod. Only relevant for methods. */
3969 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3970};
3971
3972MOZ_CAN_RUN_SCRIPT static bool
3973passOptionalUnsignedLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3974{
3975 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3978( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3976 "TestJSImplInterface", "passOptionalUnsignedLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3978( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3977 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3978( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3978 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3978( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3979
3980 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3981 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3982 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3983 if (objIsXray) {
3984 unwrappedObj.emplace(cx, obj);
3985 }
3986 uint64_t arg0;
3987 if (args.hasDefined(0)) {
3988 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3989 return false;
3990 }
3991 } else {
3992 arg0 = 17ULL;
3993 }
3994 if (objIsXray) {
3995 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3996 // we know Xrays have no dynamic unwrap behavior.
3997 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3998 if (!unwrappedObj.ref()) {
3999 return false;
4000 }
4001 }
4002 FastErrorResult rv;
4003 // NOTE: This assert does NOT call the function.
4004 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4005 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4006 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault"
)), 0))
) {
4007 return false;
4008 }
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)"
, "../TestJSImplGenBinding.cpp", 4009); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4009; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4010 args.rval().setUndefined();
4011 return true;
4012}
4013
4014static const JSJitInfo passOptionalUnsignedLongLongWithDefault_methodinfo = {
4015 { (JSJitGetterOp)passOptionalUnsignedLongLongWithDefault },
4016 { prototypes::id::TestJSImplInterface },
4017 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4018 JSJitInfo::Method,
4019 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4020 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4021 false, /* 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
4030MOZ_CAN_RUN_SCRIPT static bool
4031get_writableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4032{
4033 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4036( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4034 "TestJSImplInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4036( cx, "TestJSImplInterface"
, "writableFloat", 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, "TestJSImplInterface"
, "writableFloat", 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, "TestJSImplInterface"
, "writableFloat", 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::TestJSImplInterface*>(void_self);
4039 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4040 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4041 if (objIsXray) {
4042 unwrappedObj.emplace(cx, obj);
4043 }
4044 if (objIsXray) {
4045 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4046 // we know Xrays have no dynamic unwrap behavior.
4047 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4048 if (!unwrappedObj.ref()) {
4049 return false;
4050 }
4051 }
4052 FastErrorResult rv;
4053 float result(MOZ_KnownLive(self)(self)->GetWritableFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4054 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat getter"
)), 0))
) {
4055 return false;
4056 }
4057 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4057; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4058 args.rval().set(JS_NumberValue(double(result)));
4059 return true;
4060}
4061
4062MOZ_CAN_RUN_SCRIPT static bool
4063set_writableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4064{
4065 BindingCallContext cx(cx_, "TestJSImplInterface.writableFloat setter");
4066 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4069( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4067 "TestJSImplInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4069( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4068 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4069( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4069 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4069( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4070
4071 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4072 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4073 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4074 if (objIsXray) {
4075 unwrappedObj.emplace(cx, obj);
4076 }
4077 float arg0;
4078 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4079 return false;
4080 } else if (!std::isfinite(arg0)) {
4081 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4082 return false;
4083 }
4084 if (objIsXray) {
4085 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4086 // we know Xrays have no dynamic unwrap behavior.
4087 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4088 if (!unwrappedObj.ref()) {
4089 return false;
4090 }
4091 }
4092 FastErrorResult rv;
4093 // NOTE: This assert does NOT call the function.
4094 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4095 MOZ_KnownLive(self)(self)->SetWritableFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4096 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat setter"
)), 0))
) {
4097 return false;
4098 }
4099 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4099); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4099; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4100
4101 return true;
4102}
4103
4104static const JSJitInfo writableFloat_getterinfo = {
4105 { get_writableFloat },
4106 { prototypes::id::TestJSImplInterface },
4107 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4108 JSJitInfo::Getter,
4109 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4110 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4111 false, /* isInfallible. False in setters. */
4112 false, /* isMovable. Not relevant for setters. */
4113 false, /* isEliminatable. Not relevant for setters. */
4114 false, /* isAlwaysInSlot. Only relevant for getters. */
4115 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4116 false, /* isTypedMethod. Only relevant for methods. */
4117 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4118};
4119static const JSJitInfo writableFloat_setterinfo = {
4120 { (JSJitGetterOp)set_writableFloat },
4121 { prototypes::id::TestJSImplInterface },
4122 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4123 JSJitInfo::Setter,
4124 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4125 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4126 false, /* isInfallible. False in setters. */
4127 false, /* isMovable. Not relevant for setters. */
4128 false, /* isEliminatable. Not relevant for setters. */
4129 false, /* isAlwaysInSlot. Only relevant for getters. */
4130 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4131 false, /* isTypedMethod. Only relevant for methods. */
4132 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4133};
4134
4135MOZ_CAN_RUN_SCRIPT static bool
4136get_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4137{
4138 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4141( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4139 "TestJSImplInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4141( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4140 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4141( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4141 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4141( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4142
4143 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4144 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4145 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4146 if (objIsXray) {
4147 unwrappedObj.emplace(cx, obj);
4148 }
4149 if (objIsXray) {
4150 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4151 // we know Xrays have no dynamic unwrap behavior.
4152 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4153 if (!unwrappedObj.ref()) {
4154 return false;
4155 }
4156 }
4157 FastErrorResult rv;
4158 float result(MOZ_KnownLive(self)(self)->GetWritableUnrestrictedFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4159 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat getter"
)), 0))
) {
4160 return false;
4161 }
4162 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4162); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4162; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4163 args.rval().set(JS_NumberValue(double(result)));
4164 return true;
4165}
4166
4167MOZ_CAN_RUN_SCRIPT static bool
4168set_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4169{
4170 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4173( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4171 "TestJSImplInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4173( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4172 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4173( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4173 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4173( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4174
4175 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4176 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4177 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4178 if (objIsXray) {
4179 unwrappedObj.emplace(cx, obj);
4180 }
4181 float arg0;
4182 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4183 return false;
4184 }
4185 if (objIsXray) {
4186 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4187 // we know Xrays have no dynamic unwrap behavior.
4188 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4189 if (!unwrappedObj.ref()) {
4190 return false;
4191 }
4192 }
4193 FastErrorResult rv;
4194 // NOTE: This assert does NOT call the function.
4195 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnrestrictedFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4196 MOZ_KnownLive(self)(self)->SetWritableUnrestrictedFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4197 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat setter"
)), 0))
) {
4198 return false;
4199 }
4200 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4200); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4200; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4201
4202 return true;
4203}
4204
4205static const JSJitInfo writableUnrestrictedFloat_getterinfo = {
4206 { get_writableUnrestrictedFloat },
4207 { prototypes::id::TestJSImplInterface },
4208 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4209 JSJitInfo::Getter,
4210 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4211 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4212 false, /* isInfallible. False in setters. */
4213 false, /* isMovable. Not relevant for setters. */
4214 false, /* isEliminatable. Not relevant for setters. */
4215 false, /* isAlwaysInSlot. Only relevant for getters. */
4216 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4217 false, /* isTypedMethod. Only relevant for methods. */
4218 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4219};
4220static const JSJitInfo writableUnrestrictedFloat_setterinfo = {
4221 { (JSJitGetterOp)set_writableUnrestrictedFloat },
4222 { prototypes::id::TestJSImplInterface },
4223 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4224 JSJitInfo::Setter,
4225 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4226 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4227 false, /* isInfallible. False in setters. */
4228 false, /* isMovable. Not relevant for setters. */
4229 false, /* isEliminatable. Not relevant for setters. */
4230 false, /* isAlwaysInSlot. Only relevant for getters. */
4231 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4232 false, /* isTypedMethod. Only relevant for methods. */
4233 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4234};
4235
4236MOZ_CAN_RUN_SCRIPT static bool
4237get_writableNullableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4238{
4239 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4242( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4240 "TestJSImplInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4242( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4241 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4242( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4242 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4242( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4243
4244 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4245 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4246 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4247 if (objIsXray) {
4248 unwrappedObj.emplace(cx, obj);
4249 }
4250 if (objIsXray) {
4251 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4252 // we know Xrays have no dynamic unwrap behavior.
4253 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4254 if (!unwrappedObj.ref()) {
4255 return false;
4256 }
4257 }
4258 FastErrorResult rv;
4259 Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4260 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat getter"
)), 0))
) {
4261 return false;
4262 }
4263 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4263; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4264 if (result.IsNull()) {
4265 args.rval().setNull();
4266 return true;
4267 }
4268 args.rval().set(JS_NumberValue(double(result.Value())));
4269 return true;
4270}
4271
4272MOZ_CAN_RUN_SCRIPT static bool
4273set_writableNullableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4274{
4275 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableFloat setter");
4276 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4279( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4277 "TestJSImplInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4279( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4278 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4279( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4279 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4279( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4280
4281 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4282 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4283 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4284 if (objIsXray) {
4285 unwrappedObj.emplace(cx, obj);
4286 }
4287 Nullable<float> arg0;
4288 if (args[0].isNullOrUndefined()) {
4289 arg0.SetNull();
4290 } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4291 return false;
4292 } else if (!std::isfinite(arg0.Value())) {
4293 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4294 return false;
4295 }
4296 if (objIsXray) {
4297 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4298 // we know Xrays have no dynamic unwrap behavior.
4299 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4300 if (!unwrappedObj.ref()) {
4301 return false;
4302 }
4303 }
4304 FastErrorResult rv;
4305 // NOTE: This assert does NOT call the function.
4306 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4307 MOZ_KnownLive(self)(self)->SetWritableNullableFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4308 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat setter"
)), 0))
) {
4309 return false;
4310 }
4311 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4311); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4311; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4312
4313 return true;
4314}
4315
4316static const JSJitInfo writableNullableFloat_getterinfo = {
4317 { get_writableNullableFloat },
4318 { prototypes::id::TestJSImplInterface },
4319 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4320 JSJitInfo::Getter,
4321 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4322 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4323 false, /* isInfallible. False in setters. */
4324 false, /* isMovable. Not relevant for setters. */
4325 false, /* isEliminatable. Not relevant for setters. */
4326 false, /* isAlwaysInSlot. Only relevant for getters. */
4327 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4328 false, /* isTypedMethod. Only relevant for methods. */
4329 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4330};
4331static const JSJitInfo writableNullableFloat_setterinfo = {
4332 { (JSJitGetterOp)set_writableNullableFloat },
4333 { prototypes::id::TestJSImplInterface },
4334 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4335 JSJitInfo::Setter,
4336 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4337 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4338 false, /* isInfallible. False in setters. */
4339 false, /* isMovable. Not relevant for setters. */
4340 false, /* isEliminatable. Not relevant for setters. */
4341 false, /* isAlwaysInSlot. Only relevant for getters. */
4342 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4343 false, /* isTypedMethod. Only relevant for methods. */
4344 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4345};
4346
4347MOZ_CAN_RUN_SCRIPT static bool
4348get_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4349{
4350 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4353( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4351 "TestJSImplInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4353( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4352 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4353( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4353 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4353( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4354
4355 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4356 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4357 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4358 if (objIsXray) {
4359 unwrappedObj.emplace(cx, obj);
4360 }
4361 if (objIsXray) {
4362 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4363 // we know Xrays have no dynamic unwrap behavior.
4364 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4365 if (!unwrappedObj.ref()) {
4366 return false;
4367 }
4368 }
4369 FastErrorResult rv;
4370 Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableUnrestrictedFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4371 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat getter"
)), 0))
) {
4372 return false;
4373 }
4374 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4374); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4374; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4375 if (result.IsNull()) {
4376 args.rval().setNull();
4377 return true;
4378 }
4379 args.rval().set(JS_NumberValue(double(result.Value())));
4380 return true;
4381}
4382
4383MOZ_CAN_RUN_SCRIPT static bool
4384set_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4385{
4386 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4389( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4387 "TestJSImplInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4389( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4388 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4389( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4389 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4389( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4390
4391 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4392 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4393 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4394 if (objIsXray) {
4395 unwrappedObj.emplace(cx, obj);
4396 }
4397 Nullable<float> arg0;
4398 if (args[0].isNullOrUndefined()) {
4399 arg0.SetNull();
4400 } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4401 return false;
4402 }
4403 if (objIsXray) {
4404 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4405 // we know Xrays have no dynamic unwrap behavior.
4406 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4407 if (!unwrappedObj.ref()) {
4408 return false;
4409 }
4410 }
4411 FastErrorResult rv;
4412 // NOTE: This assert does NOT call the function.
4413 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4414 MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4415 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat setter"
)), 0))
) {
4416 return false;
4417 }
4418 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4418; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4419
4420 return true;
4421}
4422
4423static const JSJitInfo writableNullableUnrestrictedFloat_getterinfo = {
4424 { get_writableNullableUnrestrictedFloat },
4425 { prototypes::id::TestJSImplInterface },
4426 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4427 JSJitInfo::Getter,
4428 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4429 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4430 false, /* isInfallible. False in setters. */
4431 false, /* isMovable. Not relevant for setters. */
4432 false, /* isEliminatable. Not relevant for setters. */
4433 false, /* isAlwaysInSlot. Only relevant for getters. */
4434 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4435 false, /* isTypedMethod. Only relevant for methods. */
4436 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4437};
4438static const JSJitInfo writableNullableUnrestrictedFloat_setterinfo = {
4439 { (JSJitGetterOp)set_writableNullableUnrestrictedFloat },
4440 { prototypes::id::TestJSImplInterface },
4441 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4442 JSJitInfo::Setter,
4443 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4444 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4445 false, /* isInfallible. False in setters. */
4446 false, /* isMovable. Not relevant for setters. */
4447 false, /* isEliminatable. Not relevant for setters. */
4448 false, /* isAlwaysInSlot. Only relevant for getters. */
4449 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4450 false, /* isTypedMethod. Only relevant for methods. */
4451 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4452};
4453
4454MOZ_CAN_RUN_SCRIPT static bool
4455get_writableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4456{
4457 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4460( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4458 "TestJSImplInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4460( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4459 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4460( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4460 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4460( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4461
4462 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4463 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4464 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4465 if (objIsXray) {
4466 unwrappedObj.emplace(cx, obj);
4467 }
4468 if (objIsXray) {
4469 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4470 // we know Xrays have no dynamic unwrap behavior.
4471 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4472 if (!unwrappedObj.ref()) {
4473 return false;
4474 }
4475 }
4476 FastErrorResult rv;
4477 double result(MOZ_KnownLive(self)(self)->GetWritableDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4478 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble getter"
)), 0))
) {
4479 return false;
4480 }
4481 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4481); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4481; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4482 args.rval().set(JS_NumberValue(double(result)));
4483 return true;
4484}
4485
4486MOZ_CAN_RUN_SCRIPT static bool
4487set_writableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4488{
4489 BindingCallContext cx(cx_, "TestJSImplInterface.writableDouble setter");
4490 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4493( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4491 "TestJSImplInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4493( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4492 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4493( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4493 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4493( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4494
4495 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4496 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4497 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4498 if (objIsXray) {
4499 unwrappedObj.emplace(cx, obj);
4500 }
4501 double arg0;
4502 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4503 return false;
4504 } else if (!std::isfinite(arg0)) {
4505 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4506 return false;
4507 }
4508 if (objIsXray) {
4509 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4510 // we know Xrays have no dynamic unwrap behavior.
4511 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4512 if (!unwrappedObj.ref()) {
4513 return false;
4514 }
4515 }
4516 FastErrorResult rv;
4517 // NOTE: This assert does NOT call the function.
4518 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4519 MOZ_KnownLive(self)(self)->SetWritableDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4520 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble setter"
)), 0))
) {
4521 return false;
4522 }
4523 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4523); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4523; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4524
4525 return true;
4526}
4527
4528static const JSJitInfo writableDouble_getterinfo = {
4529 { get_writableDouble },
4530 { prototypes::id::TestJSImplInterface },
4531 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4532 JSJitInfo::Getter,
4533 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4534 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4535 false, /* isInfallible. False in setters. */
4536 false, /* isMovable. Not relevant for setters. */
4537 false, /* isEliminatable. Not relevant for setters. */
4538 false, /* isAlwaysInSlot. Only relevant for getters. */
4539 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4540 false, /* isTypedMethod. Only relevant for methods. */
4541 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4542};
4543static const JSJitInfo writableDouble_setterinfo = {
4544 { (JSJitGetterOp)set_writableDouble },
4545 { prototypes::id::TestJSImplInterface },
4546 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4547 JSJitInfo::Setter,
4548 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4549 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4550 false, /* isInfallible. False in setters. */
4551 false, /* isMovable. Not relevant for setters. */
4552 false, /* isEliminatable. Not relevant for setters. */
4553 false, /* isAlwaysInSlot. Only relevant for getters. */
4554 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4555 false, /* isTypedMethod. Only relevant for methods. */
4556 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4557};
4558
4559MOZ_CAN_RUN_SCRIPT static bool
4560get_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4561{
4562 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4565( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4563 "TestJSImplInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4565( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4564 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4565( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4565 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4565( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4566
4567 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4568 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4569 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4570 if (objIsXray) {
4571 unwrappedObj.emplace(cx, obj);
4572 }
4573 if (objIsXray) {
4574 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4575 // we know Xrays have no dynamic unwrap behavior.
4576 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4577 if (!unwrappedObj.ref()) {
4578 return false;
4579 }
4580 }
4581 FastErrorResult rv;
4582 double result(MOZ_KnownLive(self)(self)->GetWritableUnrestrictedDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4583 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble getter"
)), 0))
) {
4584 return false;
4585 }
4586 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4586); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4586; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4587 args.rval().set(JS_NumberValue(double(result)));
4588 return true;
4589}
4590
4591MOZ_CAN_RUN_SCRIPT static bool
4592set_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4593{
4594 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4597( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4595 "TestJSImplInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4597( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4596 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4597( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4597 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4597( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4598
4599 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4600 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4601 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4602 if (objIsXray) {
4603 unwrappedObj.emplace(cx, obj);
4604 }
4605 double arg0;
4606 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4607 return false;
4608 }
4609 if (objIsXray) {
4610 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4611 // we know Xrays have no dynamic unwrap behavior.
4612 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4613 if (!unwrappedObj.ref()) {
4614 return false;
4615 }
4616 }
4617 FastErrorResult rv;
4618 // NOTE: This assert does NOT call the function.
4619 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnrestrictedDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4620 MOZ_KnownLive(self)(self)->SetWritableUnrestrictedDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4621 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble setter"
)), 0))
) {
4622 return false;
4623 }
4624 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4624); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4624; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4625
4626 return true;
4627}
4628
4629static const JSJitInfo writableUnrestrictedDouble_getterinfo = {
4630 { get_writableUnrestrictedDouble },
4631 { prototypes::id::TestJSImplInterface },
4632 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4633 JSJitInfo::Getter,
4634 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4635 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4636 false, /* isInfallible. False in setters. */
4637 false, /* isMovable. Not relevant for setters. */
4638 false, /* isEliminatable. Not relevant for setters. */
4639 false, /* isAlwaysInSlot. Only relevant for getters. */
4640 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4641 false, /* isTypedMethod. Only relevant for methods. */
4642 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4643};
4644static const JSJitInfo writableUnrestrictedDouble_setterinfo = {
4645 { (JSJitGetterOp)set_writableUnrestrictedDouble },
4646 { prototypes::id::TestJSImplInterface },
4647 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4648 JSJitInfo::Setter,
4649 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4650 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4651 false, /* 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
4660MOZ_CAN_RUN_SCRIPT static bool
4661get_writableNullableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4662{
4663 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4666( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4664 "TestJSImplInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4666( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4665 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4666( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4666 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4666( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4667
4668 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4669 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4670 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4671 if (objIsXray) {
4672 unwrappedObj.emplace(cx, obj);
4673 }
4674 if (objIsXray) {
4675 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4676 // we know Xrays have no dynamic unwrap behavior.
4677 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4678 if (!unwrappedObj.ref()) {
4679 return false;
4680 }
4681 }
4682 FastErrorResult rv;
4683 Nullable<double> result(MOZ_KnownLive(self)(self)->GetWritableNullableDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4684 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble getter"
)), 0))
) {
4685 return false;
4686 }
4687 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4687); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4687; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4688 if (result.IsNull()) {
4689 args.rval().setNull();
4690 return true;
4691 }
4692 args.rval().set(JS_NumberValue(double(result.Value())));
4693 return true;
4694}
4695
4696MOZ_CAN_RUN_SCRIPT static bool
4697set_writableNullableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4698{
4699 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableDouble setter");
4700 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4703( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4701 "TestJSImplInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4703( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4702 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4703( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4703 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4703( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4704
4705 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4706 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4707 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4708 if (objIsXray) {
4709 unwrappedObj.emplace(cx, obj);
4710 }
4711 Nullable<double> arg0;
4712 if (args[0].isNullOrUndefined()) {
4713 arg0.SetNull();
4714 } else if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4715 return false;
4716 } else if (!std::isfinite(arg0.Value())) {
4717 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4718 return false;
4719 }
4720 if (objIsXray) {
4721 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4722 // we know Xrays have no dynamic unwrap behavior.
4723 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4724 if (!unwrappedObj.ref()) {
4725 return false;
4726 }
4727 }
4728 FastErrorResult rv;
4729 // NOTE: This assert does NOT call the function.
4730 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4731 MOZ_KnownLive(self)(self)->SetWritableNullableDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4732 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble setter"
)), 0))
) {
4733 return false;
4734 }
4735 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4735); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4735; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;