Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/DOMMatrixBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM DOMMatrix.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "DOMMatrixBinding.h"
4
#include "DOMPointBinding.h"
5
#include "WrapperFactory.h"
6
#include "jsfriendapi.h"
7
#include "mozilla/OwningNonNull.h"
8
#include "mozilla/Preferences.h"
9
#include "mozilla/dom/BindingUtils.h"
10
#include "mozilla/dom/DOMJSClass.h"
11
#include "mozilla/dom/DOMMatrix.h"
12
#include "mozilla/dom/DOMPoint.h"
13
#include "mozilla/dom/NonRefcountedDOMObject.h"
14
#include "mozilla/dom/PrimitiveConversions.h"
15
#include "mozilla/dom/TypedArray.h"
16
#include "mozilla/dom/UnionConversions.h"
17
#include "mozilla/dom/XrayExpandoClass.h"
18
19
namespace mozilla {
20
namespace dom {
21
22
namespace binding_detail {}; // Just to make sure it's known as a namespace
23
using namespace mozilla::dom::binding_detail;
24
25
26
bool
27
StringOrUnrestrictedDoubleSequence::ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const
28
0
{
29
0
  switch (mType) {
30
0
    case eUninitialized: {
31
0
      return false;
32
0
      break;
33
0
    }
34
0
    case eString: {
35
0
      if (!xpc::NonVoidStringToJsval(cx, mValue.mString.Value(), rval)) {
36
0
        return false;
37
0
      }
38
0
      return true;
39
0
      break;
40
0
    }
41
0
    case eUnrestrictedDoubleSequence: {
42
0
43
0
      uint32_t length = mValue.mUnrestrictedDoubleSequence.Value().Length();
44
0
      JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length));
45
0
      if (!returnArray) {
46
0
        return false;
47
0
      }
48
0
      // Scope for 'tmp'
49
0
      {
50
0
        JS::Rooted<JS::Value> tmp(cx);
51
0
        for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52
0
          // Control block to let us common up the JS_DefineElement calls when there
53
0
          // are different ways to succeed at wrapping the object.
54
0
          do {
55
0
            tmp.set(JS_NumberValue(double(mValue.mUnrestrictedDoubleSequence.Value()[sequenceIdx0])));
56
0
            break;
57
0
          } while (false);
58
0
          if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59
0
                                JSPROP_ENUMERATE)) {
60
0
            return false;
61
0
          }
62
0
        }
63
0
      }
64
0
      rval.setObject(*returnArray);
65
0
      return true;
66
0
      break;
67
0
    }
68
0
    default: {
69
0
      return false;
70
0
      break;
71
0
    }
72
0
  }
73
0
74
0
  return false;
75
0
}
76
77
78
nsString&
79
OwningStringOrUnrestrictedDoubleSequence::RawSetAsString()
80
0
{
81
0
  if (mType == eString) {
82
0
    return mValue.mString.Value();
83
0
  }
84
0
  MOZ_ASSERT(mType == eUninitialized);
85
0
  mType = eString;
86
0
  return mValue.mString.SetValue();
87
0
}
88
89
nsString&
90
OwningStringOrUnrestrictedDoubleSequence::SetAsString()
91
0
{
92
0
  if (mType == eString) {
93
0
    return mValue.mString.Value();
94
0
  }
95
0
  Uninit();
96
0
  mType = eString;
97
0
  return mValue.mString.SetValue();
98
0
}
99
100
bool
101
OwningStringOrUnrestrictedDoubleSequence::TrySetToString(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
102
0
{
103
0
  tryNext = false;
104
0
  { // scope for memberSlot
105
0
    nsString& memberSlot = RawSetAsString();
106
0
    if (!ConvertJSValueToString(cx, value, eStringify, eStringify, memberSlot)) {
107
0
      return false;
108
0
    }
109
0
  }
110
0
  return true;
111
0
}
112
113
114
void
115
OwningStringOrUnrestrictedDoubleSequence::DestroyString()
116
0
{
117
0
  MOZ_ASSERT(IsString(), "Wrong type!");
118
0
  mValue.mString.Destroy();
119
0
  mType = eUninitialized;
120
0
}
121
122
123
124
125
Sequence<double>&
126
OwningStringOrUnrestrictedDoubleSequence::RawSetAsUnrestrictedDoubleSequence()
127
0
{
128
0
  if (mType == eUnrestrictedDoubleSequence) {
129
0
    return mValue.mUnrestrictedDoubleSequence.Value();
130
0
  }
131
0
  MOZ_ASSERT(mType == eUninitialized);
132
0
  mType = eUnrestrictedDoubleSequence;
133
0
  return mValue.mUnrestrictedDoubleSequence.SetValue();
134
0
}
135
136
Sequence<double>&
137
OwningStringOrUnrestrictedDoubleSequence::SetAsUnrestrictedDoubleSequence()
138
0
{
139
0
  if (mType == eUnrestrictedDoubleSequence) {
140
0
    return mValue.mUnrestrictedDoubleSequence.Value();
141
0
  }
142
0
  Uninit();
143
0
  mType = eUnrestrictedDoubleSequence;
144
0
  return mValue.mUnrestrictedDoubleSequence.SetValue();
145
0
}
146
147
bool
148
OwningStringOrUnrestrictedDoubleSequence::TrySetToUnrestrictedDoubleSequence(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl)
149
0
{
150
0
  tryNext = false;
151
0
  { // scope for memberSlot
152
0
    Sequence<double>& memberSlot = RawSetAsUnrestrictedDoubleSequence();
153
0
    JS::ForOfIterator iter(cx);
154
0
    if (!iter.init(value, JS::ForOfIterator::AllowNonIterable)) {
155
0
      return false;
156
0
    }
157
0
    if (!iter.valueIsIterable()) {
158
0
      DestroyUnrestrictedDoubleSequence();
159
0
      tryNext = true;
160
0
      return true;
161
0
    }
162
0
    Sequence<double> &arr = memberSlot;
163
0
    JS::Rooted<JS::Value> temp(cx);
164
0
    while (true) {
165
0
      bool done;
166
0
      if (!iter.next(&temp, &done)) {
167
0
        return false;
168
0
      }
169
0
      if (done) {
170
0
        break;
171
0
      }
172
0
      double* slotPtr = arr.AppendElement(mozilla::fallible);
173
0
      if (!slotPtr) {
174
0
        JS_ReportOutOfMemory(cx);
175
0
        return false;
176
0
      }
177
0
      double& slot = *slotPtr;
178
0
      if (!ValueToPrimitive<double, eDefault>(cx, temp, &slot)) {
179
0
        return false;
180
0
      }
181
0
    }
182
0
  }
183
0
  return true;
184
0
}
185
186
void
187
OwningStringOrUnrestrictedDoubleSequence::DestroyUnrestrictedDoubleSequence()
188
0
{
189
0
  MOZ_ASSERT(IsUnrestrictedDoubleSequence(), "Wrong type!");
190
0
  mValue.mUnrestrictedDoubleSequence.Destroy();
191
0
  mType = eUninitialized;
192
0
}
193
194
195
196
197
void
198
OwningStringOrUnrestrictedDoubleSequence::Uninit()
199
{
200
  switch (mType) {
201
    case eUninitialized: {
202
      break;
203
    }
204
    case eString: {
205
      DestroyString();
206
      break;
207
    }
208
    case eUnrestrictedDoubleSequence: {
209
      DestroyUnrestrictedDoubleSequence();
210
      break;
211
    }
212
  }
213
}
214
215
bool
216
OwningStringOrUnrestrictedDoubleSequence::ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const
217
0
{
218
0
  switch (mType) {
219
0
    case eUninitialized: {
220
0
      return false;
221
0
      break;
222
0
    }
223
0
    case eString: {
224
0
      if (!xpc::NonVoidStringToJsval(cx, mValue.mString.Value(), rval)) {
225
0
        return false;
226
0
      }
227
0
      return true;
228
0
      break;
229
0
    }
230
0
    case eUnrestrictedDoubleSequence: {
231
0
232
0
      uint32_t length = mValue.mUnrestrictedDoubleSequence.Value().Length();
233
0
      JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length));
234
0
      if (!returnArray) {
235
0
        return false;
236
0
      }
237
0
      // Scope for 'tmp'
238
0
      {
239
0
        JS::Rooted<JS::Value> tmp(cx);
240
0
        for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
241
0
          // Control block to let us common up the JS_DefineElement calls when there
242
0
          // are different ways to succeed at wrapping the object.
243
0
          do {
244
0
            tmp.set(JS_NumberValue(double(mValue.mUnrestrictedDoubleSequence.Value()[sequenceIdx0])));
245
0
            break;
246
0
          } while (false);
247
0
          if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
248
0
                                JSPROP_ENUMERATE)) {
249
0
            return false;
250
0
          }
251
0
        }
252
0
      }
253
0
      rval.setObject(*returnArray);
254
0
      return true;
255
0
      break;
256
0
    }
257
0
    default: {
258
0
      return false;
259
0
      break;
260
0
    }
261
0
  }
262
0
263
0
  return false;
264
0
}
265
266
void
267
OwningStringOrUnrestrictedDoubleSequence::TraceUnion(JSTracer* trc)
268
0
{
269
0
}
270
271
OwningStringOrUnrestrictedDoubleSequence&
272
OwningStringOrUnrestrictedDoubleSequence::operator=(const OwningStringOrUnrestrictedDoubleSequence& aOther)
273
0
{
274
0
  switch (aOther.mType) {
275
0
    case eUninitialized: {
276
0
      MOZ_ASSERT(mType == eUninitialized,
277
0
                 "We need to destroy ourselves?");
278
0
      break;
279
0
    }
280
0
    case eString: {
281
0
      SetAsString() = aOther.GetAsString();
282
0
      break;
283
0
    }
284
0
    case eUnrestrictedDoubleSequence: {
285
0
      SetAsUnrestrictedDoubleSequence() = aOther.GetAsUnrestrictedDoubleSequence();
286
0
      break;
287
0
    }
288
0
  }
289
0
  return *this;
290
0
}
291
292
293
namespace DOMMatrix_Binding {
294
295
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<DOMMatrixReadOnly_Binding::NativeType>::value,
296
              "Can't inherit from an interface with a different ownership model.");
297
298
MOZ_CAN_RUN_SCRIPT static bool
299
get_a(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
300
0
{
301
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.a", DOM, cx);
302
0
303
0
  double result(self->A());
304
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
305
0
  args.rval().set(JS_NumberValue(double(result)));
306
0
  return true;
307
0
}
308
309
MOZ_CAN_RUN_SCRIPT static bool
310
set_a(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
311
0
{
312
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.a", DOM, cx);
313
0
314
0
  double arg0;
315
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
316
0
    return false;
317
0
  }
318
0
  self->SetA(arg0);
319
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
320
0
321
0
  return true;
322
0
}
323
324
static const JSJitInfo a_getterinfo = {
325
  { (JSJitGetterOp)get_a },
326
  { prototypes::id::DOMMatrix },
327
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
328
  JSJitInfo::Getter,
329
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
330
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
331
  true,  /* isInfallible. False in setters. */
332
  false,  /* isMovable.  Not relevant for setters. */
333
  false, /* isEliminatable.  Not relevant for setters. */
334
  false, /* isAlwaysInSlot.  Only relevant for getters. */
335
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
336
  false,  /* isTypedMethod.  Only relevant for methods. */
337
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
338
};
339
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
340
static_assert(0 < 1, "There is no slot for us");
341
static const JSJitInfo a_setterinfo = {
342
  { (JSJitGetterOp)set_a },
343
  { prototypes::id::DOMMatrix },
344
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
345
  JSJitInfo::Setter,
346
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
347
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
348
  false,  /* isInfallible. False in setters. */
349
  false,  /* isMovable.  Not relevant for setters. */
350
  false, /* isEliminatable.  Not relevant for setters. */
351
  false, /* isAlwaysInSlot.  Only relevant for getters. */
352
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
353
  false,  /* isTypedMethod.  Only relevant for methods. */
354
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
355
};
356
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
357
static_assert(0 < 1, "There is no slot for us");
358
359
MOZ_CAN_RUN_SCRIPT static bool
360
get_b(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
361
0
{
362
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.b", DOM, cx);
363
0
364
0
  double result(self->B());
365
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
366
0
  args.rval().set(JS_NumberValue(double(result)));
367
0
  return true;
368
0
}
369
370
MOZ_CAN_RUN_SCRIPT static bool
371
set_b(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
372
0
{
373
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.b", DOM, cx);
374
0
375
0
  double arg0;
376
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
377
0
    return false;
378
0
  }
379
0
  self->SetB(arg0);
380
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
381
0
382
0
  return true;
383
0
}
384
385
static const JSJitInfo b_getterinfo = {
386
  { (JSJitGetterOp)get_b },
387
  { prototypes::id::DOMMatrix },
388
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
389
  JSJitInfo::Getter,
390
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
391
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
392
  true,  /* isInfallible. False in setters. */
393
  false,  /* isMovable.  Not relevant for setters. */
394
  false, /* isEliminatable.  Not relevant for setters. */
395
  false, /* isAlwaysInSlot.  Only relevant for getters. */
396
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
397
  false,  /* isTypedMethod.  Only relevant for methods. */
398
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
399
};
400
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
401
static_assert(0 < 1, "There is no slot for us");
402
static const JSJitInfo b_setterinfo = {
403
  { (JSJitGetterOp)set_b },
404
  { prototypes::id::DOMMatrix },
405
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
406
  JSJitInfo::Setter,
407
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
408
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
409
  false,  /* isInfallible. False in setters. */
410
  false,  /* isMovable.  Not relevant for setters. */
411
  false, /* isEliminatable.  Not relevant for setters. */
412
  false, /* isAlwaysInSlot.  Only relevant for getters. */
413
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
414
  false,  /* isTypedMethod.  Only relevant for methods. */
415
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
416
};
417
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
418
static_assert(0 < 1, "There is no slot for us");
419
420
MOZ_CAN_RUN_SCRIPT static bool
421
get_c(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
422
0
{
423
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.c", DOM, cx);
424
0
425
0
  double result(self->C());
426
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
427
0
  args.rval().set(JS_NumberValue(double(result)));
428
0
  return true;
429
0
}
430
431
MOZ_CAN_RUN_SCRIPT static bool
432
set_c(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
433
0
{
434
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.c", DOM, cx);
435
0
436
0
  double arg0;
437
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
438
0
    return false;
439
0
  }
440
0
  self->SetC(arg0);
441
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
442
0
443
0
  return true;
444
0
}
445
446
static const JSJitInfo c_getterinfo = {
447
  { (JSJitGetterOp)get_c },
448
  { prototypes::id::DOMMatrix },
449
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
450
  JSJitInfo::Getter,
451
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
452
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
453
  true,  /* isInfallible. False in setters. */
454
  false,  /* isMovable.  Not relevant for setters. */
455
  false, /* isEliminatable.  Not relevant for setters. */
456
  false, /* isAlwaysInSlot.  Only relevant for getters. */
457
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
458
  false,  /* isTypedMethod.  Only relevant for methods. */
459
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
460
};
461
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
462
static_assert(0 < 1, "There is no slot for us");
463
static const JSJitInfo c_setterinfo = {
464
  { (JSJitGetterOp)set_c },
465
  { prototypes::id::DOMMatrix },
466
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
467
  JSJitInfo::Setter,
468
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
469
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
470
  false,  /* isInfallible. False in setters. */
471
  false,  /* isMovable.  Not relevant for setters. */
472
  false, /* isEliminatable.  Not relevant for setters. */
473
  false, /* isAlwaysInSlot.  Only relevant for getters. */
474
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
475
  false,  /* isTypedMethod.  Only relevant for methods. */
476
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
477
};
478
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
479
static_assert(0 < 1, "There is no slot for us");
480
481
MOZ_CAN_RUN_SCRIPT static bool
482
get_d(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
483
0
{
484
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.d", DOM, cx);
485
0
486
0
  double result(self->D());
487
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
488
0
  args.rval().set(JS_NumberValue(double(result)));
489
0
  return true;
490
0
}
491
492
MOZ_CAN_RUN_SCRIPT static bool
493
set_d(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
494
0
{
495
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.d", DOM, cx);
496
0
497
0
  double arg0;
498
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
499
0
    return false;
500
0
  }
501
0
  self->SetD(arg0);
502
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
503
0
504
0
  return true;
505
0
}
506
507
static const JSJitInfo d_getterinfo = {
508
  { (JSJitGetterOp)get_d },
509
  { prototypes::id::DOMMatrix },
510
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
511
  JSJitInfo::Getter,
512
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
513
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
514
  true,  /* isInfallible. False in setters. */
515
  false,  /* isMovable.  Not relevant for setters. */
516
  false, /* isEliminatable.  Not relevant for setters. */
517
  false, /* isAlwaysInSlot.  Only relevant for getters. */
518
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
519
  false,  /* isTypedMethod.  Only relevant for methods. */
520
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
521
};
522
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
523
static_assert(0 < 1, "There is no slot for us");
524
static const JSJitInfo d_setterinfo = {
525
  { (JSJitGetterOp)set_d },
526
  { prototypes::id::DOMMatrix },
527
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
528
  JSJitInfo::Setter,
529
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
530
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
531
  false,  /* isInfallible. False in setters. */
532
  false,  /* isMovable.  Not relevant for setters. */
533
  false, /* isEliminatable.  Not relevant for setters. */
534
  false, /* isAlwaysInSlot.  Only relevant for getters. */
535
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
536
  false,  /* isTypedMethod.  Only relevant for methods. */
537
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
538
};
539
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
540
static_assert(0 < 1, "There is no slot for us");
541
542
MOZ_CAN_RUN_SCRIPT static bool
543
get_e(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
544
0
{
545
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.e", DOM, cx);
546
0
547
0
  double result(self->E());
548
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
549
0
  args.rval().set(JS_NumberValue(double(result)));
550
0
  return true;
551
0
}
552
553
MOZ_CAN_RUN_SCRIPT static bool
554
set_e(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
555
0
{
556
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.e", DOM, cx);
557
0
558
0
  double arg0;
559
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
560
0
    return false;
561
0
  }
562
0
  self->SetE(arg0);
563
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
564
0
565
0
  return true;
566
0
}
567
568
static const JSJitInfo e_getterinfo = {
569
  { (JSJitGetterOp)get_e },
570
  { prototypes::id::DOMMatrix },
571
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
572
  JSJitInfo::Getter,
573
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
574
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
575
  true,  /* isInfallible. False in setters. */
576
  false,  /* isMovable.  Not relevant for setters. */
577
  false, /* isEliminatable.  Not relevant for setters. */
578
  false, /* isAlwaysInSlot.  Only relevant for getters. */
579
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
580
  false,  /* isTypedMethod.  Only relevant for methods. */
581
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
582
};
583
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
584
static_assert(0 < 1, "There is no slot for us");
585
static const JSJitInfo e_setterinfo = {
586
  { (JSJitGetterOp)set_e },
587
  { prototypes::id::DOMMatrix },
588
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
589
  JSJitInfo::Setter,
590
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
591
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
592
  false,  /* isInfallible. False in setters. */
593
  false,  /* isMovable.  Not relevant for setters. */
594
  false, /* isEliminatable.  Not relevant for setters. */
595
  false, /* isAlwaysInSlot.  Only relevant for getters. */
596
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
597
  false,  /* isTypedMethod.  Only relevant for methods. */
598
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
599
};
600
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
601
static_assert(0 < 1, "There is no slot for us");
602
603
MOZ_CAN_RUN_SCRIPT static bool
604
get_f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
605
0
{
606
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.f", DOM, cx);
607
0
608
0
  double result(self->F());
609
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
610
0
  args.rval().set(JS_NumberValue(double(result)));
611
0
  return true;
612
0
}
613
614
MOZ_CAN_RUN_SCRIPT static bool
615
set_f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
616
0
{
617
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.f", DOM, cx);
618
0
619
0
  double arg0;
620
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
621
0
    return false;
622
0
  }
623
0
  self->SetF(arg0);
624
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
625
0
626
0
  return true;
627
0
}
628
629
static const JSJitInfo f_getterinfo = {
630
  { (JSJitGetterOp)get_f },
631
  { prototypes::id::DOMMatrix },
632
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
633
  JSJitInfo::Getter,
634
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
635
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
636
  true,  /* isInfallible. False in setters. */
637
  false,  /* isMovable.  Not relevant for setters. */
638
  false, /* isEliminatable.  Not relevant for setters. */
639
  false, /* isAlwaysInSlot.  Only relevant for getters. */
640
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
641
  false,  /* isTypedMethod.  Only relevant for methods. */
642
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
643
};
644
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
645
static_assert(0 < 1, "There is no slot for us");
646
static const JSJitInfo f_setterinfo = {
647
  { (JSJitGetterOp)set_f },
648
  { prototypes::id::DOMMatrix },
649
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
650
  JSJitInfo::Setter,
651
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
652
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
653
  false,  /* isInfallible. False in setters. */
654
  false,  /* isMovable.  Not relevant for setters. */
655
  false, /* isEliminatable.  Not relevant for setters. */
656
  false, /* isAlwaysInSlot.  Only relevant for getters. */
657
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
658
  false,  /* isTypedMethod.  Only relevant for methods. */
659
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
660
};
661
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
662
static_assert(0 < 1, "There is no slot for us");
663
664
MOZ_CAN_RUN_SCRIPT static bool
665
get_m11(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
666
0
{
667
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m11", DOM, cx);
668
0
669
0
  double result(self->M11());
670
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
671
0
  args.rval().set(JS_NumberValue(double(result)));
672
0
  return true;
673
0
}
674
675
MOZ_CAN_RUN_SCRIPT static bool
676
set_m11(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
677
0
{
678
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m11", DOM, cx);
679
0
680
0
  double arg0;
681
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
682
0
    return false;
683
0
  }
684
0
  self->SetM11(arg0);
685
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
686
0
687
0
  return true;
688
0
}
689
690
static const JSJitInfo m11_getterinfo = {
691
  { (JSJitGetterOp)get_m11 },
692
  { prototypes::id::DOMMatrix },
693
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
694
  JSJitInfo::Getter,
695
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
696
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
697
  true,  /* isInfallible. False in setters. */
698
  false,  /* isMovable.  Not relevant for setters. */
699
  false, /* isEliminatable.  Not relevant for setters. */
700
  false, /* isAlwaysInSlot.  Only relevant for getters. */
701
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
702
  false,  /* isTypedMethod.  Only relevant for methods. */
703
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
704
};
705
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
706
static_assert(0 < 1, "There is no slot for us");
707
static const JSJitInfo m11_setterinfo = {
708
  { (JSJitGetterOp)set_m11 },
709
  { prototypes::id::DOMMatrix },
710
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
711
  JSJitInfo::Setter,
712
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
713
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
714
  false,  /* isInfallible. False in setters. */
715
  false,  /* isMovable.  Not relevant for setters. */
716
  false, /* isEliminatable.  Not relevant for setters. */
717
  false, /* isAlwaysInSlot.  Only relevant for getters. */
718
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
719
  false,  /* isTypedMethod.  Only relevant for methods. */
720
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
721
};
722
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
723
static_assert(0 < 1, "There is no slot for us");
724
725
MOZ_CAN_RUN_SCRIPT static bool
726
get_m12(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
727
0
{
728
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m12", DOM, cx);
729
0
730
0
  double result(self->M12());
731
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
732
0
  args.rval().set(JS_NumberValue(double(result)));
733
0
  return true;
734
0
}
735
736
MOZ_CAN_RUN_SCRIPT static bool
737
set_m12(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
738
0
{
739
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m12", DOM, cx);
740
0
741
0
  double arg0;
742
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
743
0
    return false;
744
0
  }
745
0
  self->SetM12(arg0);
746
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
747
0
748
0
  return true;
749
0
}
750
751
static const JSJitInfo m12_getterinfo = {
752
  { (JSJitGetterOp)get_m12 },
753
  { prototypes::id::DOMMatrix },
754
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
755
  JSJitInfo::Getter,
756
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
757
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
758
  true,  /* isInfallible. False in setters. */
759
  false,  /* isMovable.  Not relevant for setters. */
760
  false, /* isEliminatable.  Not relevant for setters. */
761
  false, /* isAlwaysInSlot.  Only relevant for getters. */
762
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
763
  false,  /* isTypedMethod.  Only relevant for methods. */
764
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
765
};
766
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
767
static_assert(0 < 1, "There is no slot for us");
768
static const JSJitInfo m12_setterinfo = {
769
  { (JSJitGetterOp)set_m12 },
770
  { prototypes::id::DOMMatrix },
771
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
772
  JSJitInfo::Setter,
773
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
774
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
775
  false,  /* isInfallible. False in setters. */
776
  false,  /* isMovable.  Not relevant for setters. */
777
  false, /* isEliminatable.  Not relevant for setters. */
778
  false, /* isAlwaysInSlot.  Only relevant for getters. */
779
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
780
  false,  /* isTypedMethod.  Only relevant for methods. */
781
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
782
};
783
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
784
static_assert(0 < 1, "There is no slot for us");
785
786
MOZ_CAN_RUN_SCRIPT static bool
787
get_m13(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
788
0
{
789
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m13", DOM, cx);
790
0
791
0
  double result(self->M13());
792
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
793
0
  args.rval().set(JS_NumberValue(double(result)));
794
0
  return true;
795
0
}
796
797
MOZ_CAN_RUN_SCRIPT static bool
798
set_m13(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
799
0
{
800
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m13", DOM, cx);
801
0
802
0
  double arg0;
803
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
804
0
    return false;
805
0
  }
806
0
  self->SetM13(arg0);
807
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
808
0
809
0
  return true;
810
0
}
811
812
static const JSJitInfo m13_getterinfo = {
813
  { (JSJitGetterOp)get_m13 },
814
  { prototypes::id::DOMMatrix },
815
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
816
  JSJitInfo::Getter,
817
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
818
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
819
  true,  /* isInfallible. False in setters. */
820
  false,  /* isMovable.  Not relevant for setters. */
821
  false, /* isEliminatable.  Not relevant for setters. */
822
  false, /* isAlwaysInSlot.  Only relevant for getters. */
823
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
824
  false,  /* isTypedMethod.  Only relevant for methods. */
825
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
826
};
827
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
828
static_assert(0 < 1, "There is no slot for us");
829
static const JSJitInfo m13_setterinfo = {
830
  { (JSJitGetterOp)set_m13 },
831
  { prototypes::id::DOMMatrix },
832
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
833
  JSJitInfo::Setter,
834
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
835
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
836
  false,  /* isInfallible. False in setters. */
837
  false,  /* isMovable.  Not relevant for setters. */
838
  false, /* isEliminatable.  Not relevant for setters. */
839
  false, /* isAlwaysInSlot.  Only relevant for getters. */
840
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
841
  false,  /* isTypedMethod.  Only relevant for methods. */
842
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
843
};
844
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
845
static_assert(0 < 1, "There is no slot for us");
846
847
MOZ_CAN_RUN_SCRIPT static bool
848
get_m14(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
849
0
{
850
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m14", DOM, cx);
851
0
852
0
  double result(self->M14());
853
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
854
0
  args.rval().set(JS_NumberValue(double(result)));
855
0
  return true;
856
0
}
857
858
MOZ_CAN_RUN_SCRIPT static bool
859
set_m14(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
860
0
{
861
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m14", DOM, cx);
862
0
863
0
  double arg0;
864
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
865
0
    return false;
866
0
  }
867
0
  self->SetM14(arg0);
868
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
869
0
870
0
  return true;
871
0
}
872
873
static const JSJitInfo m14_getterinfo = {
874
  { (JSJitGetterOp)get_m14 },
875
  { prototypes::id::DOMMatrix },
876
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
877
  JSJitInfo::Getter,
878
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
879
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
880
  true,  /* isInfallible. False in setters. */
881
  false,  /* isMovable.  Not relevant for setters. */
882
  false, /* isEliminatable.  Not relevant for setters. */
883
  false, /* isAlwaysInSlot.  Only relevant for getters. */
884
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
885
  false,  /* isTypedMethod.  Only relevant for methods. */
886
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
887
};
888
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
889
static_assert(0 < 1, "There is no slot for us");
890
static const JSJitInfo m14_setterinfo = {
891
  { (JSJitGetterOp)set_m14 },
892
  { prototypes::id::DOMMatrix },
893
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
894
  JSJitInfo::Setter,
895
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
896
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
897
  false,  /* isInfallible. False in setters. */
898
  false,  /* isMovable.  Not relevant for setters. */
899
  false, /* isEliminatable.  Not relevant for setters. */
900
  false, /* isAlwaysInSlot.  Only relevant for getters. */
901
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
902
  false,  /* isTypedMethod.  Only relevant for methods. */
903
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
904
};
905
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
906
static_assert(0 < 1, "There is no slot for us");
907
908
MOZ_CAN_RUN_SCRIPT static bool
909
get_m21(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
910
0
{
911
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m21", DOM, cx);
912
0
913
0
  double result(self->M21());
914
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
915
0
  args.rval().set(JS_NumberValue(double(result)));
916
0
  return true;
917
0
}
918
919
MOZ_CAN_RUN_SCRIPT static bool
920
set_m21(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
921
0
{
922
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m21", DOM, cx);
923
0
924
0
  double arg0;
925
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
926
0
    return false;
927
0
  }
928
0
  self->SetM21(arg0);
929
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
930
0
931
0
  return true;
932
0
}
933
934
static const JSJitInfo m21_getterinfo = {
935
  { (JSJitGetterOp)get_m21 },
936
  { prototypes::id::DOMMatrix },
937
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
938
  JSJitInfo::Getter,
939
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
940
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
941
  true,  /* isInfallible. False in setters. */
942
  false,  /* isMovable.  Not relevant for setters. */
943
  false, /* isEliminatable.  Not relevant for setters. */
944
  false, /* isAlwaysInSlot.  Only relevant for getters. */
945
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
946
  false,  /* isTypedMethod.  Only relevant for methods. */
947
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
948
};
949
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
950
static_assert(0 < 1, "There is no slot for us");
951
static const JSJitInfo m21_setterinfo = {
952
  { (JSJitGetterOp)set_m21 },
953
  { prototypes::id::DOMMatrix },
954
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
955
  JSJitInfo::Setter,
956
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
957
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
958
  false,  /* isInfallible. False in setters. */
959
  false,  /* isMovable.  Not relevant for setters. */
960
  false, /* isEliminatable.  Not relevant for setters. */
961
  false, /* isAlwaysInSlot.  Only relevant for getters. */
962
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
963
  false,  /* isTypedMethod.  Only relevant for methods. */
964
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
965
};
966
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
967
static_assert(0 < 1, "There is no slot for us");
968
969
MOZ_CAN_RUN_SCRIPT static bool
970
get_m22(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
971
0
{
972
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m22", DOM, cx);
973
0
974
0
  double result(self->M22());
975
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
976
0
  args.rval().set(JS_NumberValue(double(result)));
977
0
  return true;
978
0
}
979
980
MOZ_CAN_RUN_SCRIPT static bool
981
set_m22(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
982
0
{
983
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m22", DOM, cx);
984
0
985
0
  double arg0;
986
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
987
0
    return false;
988
0
  }
989
0
  self->SetM22(arg0);
990
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
991
0
992
0
  return true;
993
0
}
994
995
static const JSJitInfo m22_getterinfo = {
996
  { (JSJitGetterOp)get_m22 },
997
  { prototypes::id::DOMMatrix },
998
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
999
  JSJitInfo::Getter,
1000
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1001
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1002
  true,  /* isInfallible. False in setters. */
1003
  false,  /* isMovable.  Not relevant for setters. */
1004
  false, /* isEliminatable.  Not relevant for setters. */
1005
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1006
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1007
  false,  /* isTypedMethod.  Only relevant for methods. */
1008
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1009
};
1010
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1011
static_assert(0 < 1, "There is no slot for us");
1012
static const JSJitInfo m22_setterinfo = {
1013
  { (JSJitGetterOp)set_m22 },
1014
  { prototypes::id::DOMMatrix },
1015
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1016
  JSJitInfo::Setter,
1017
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1018
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1019
  false,  /* isInfallible. False in setters. */
1020
  false,  /* isMovable.  Not relevant for setters. */
1021
  false, /* isEliminatable.  Not relevant for setters. */
1022
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1023
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1024
  false,  /* isTypedMethod.  Only relevant for methods. */
1025
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1026
};
1027
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1028
static_assert(0 < 1, "There is no slot for us");
1029
1030
MOZ_CAN_RUN_SCRIPT static bool
1031
get_m23(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1032
0
{
1033
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m23", DOM, cx);
1034
0
1035
0
  double result(self->M23());
1036
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1037
0
  args.rval().set(JS_NumberValue(double(result)));
1038
0
  return true;
1039
0
}
1040
1041
MOZ_CAN_RUN_SCRIPT static bool
1042
set_m23(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1043
0
{
1044
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m23", DOM, cx);
1045
0
1046
0
  double arg0;
1047
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1048
0
    return false;
1049
0
  }
1050
0
  self->SetM23(arg0);
1051
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1052
0
1053
0
  return true;
1054
0
}
1055
1056
static const JSJitInfo m23_getterinfo = {
1057
  { (JSJitGetterOp)get_m23 },
1058
  { prototypes::id::DOMMatrix },
1059
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1060
  JSJitInfo::Getter,
1061
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1062
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1063
  true,  /* isInfallible. False in setters. */
1064
  false,  /* isMovable.  Not relevant for setters. */
1065
  false, /* isEliminatable.  Not relevant for setters. */
1066
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1067
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1068
  false,  /* isTypedMethod.  Only relevant for methods. */
1069
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1070
};
1071
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1072
static_assert(0 < 1, "There is no slot for us");
1073
static const JSJitInfo m23_setterinfo = {
1074
  { (JSJitGetterOp)set_m23 },
1075
  { prototypes::id::DOMMatrix },
1076
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1077
  JSJitInfo::Setter,
1078
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1079
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1080
  false,  /* isInfallible. False in setters. */
1081
  false,  /* isMovable.  Not relevant for setters. */
1082
  false, /* isEliminatable.  Not relevant for setters. */
1083
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1084
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1085
  false,  /* isTypedMethod.  Only relevant for methods. */
1086
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1087
};
1088
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1089
static_assert(0 < 1, "There is no slot for us");
1090
1091
MOZ_CAN_RUN_SCRIPT static bool
1092
get_m24(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1093
0
{
1094
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m24", DOM, cx);
1095
0
1096
0
  double result(self->M24());
1097
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1098
0
  args.rval().set(JS_NumberValue(double(result)));
1099
0
  return true;
1100
0
}
1101
1102
MOZ_CAN_RUN_SCRIPT static bool
1103
set_m24(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1104
0
{
1105
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m24", DOM, cx);
1106
0
1107
0
  double arg0;
1108
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1109
0
    return false;
1110
0
  }
1111
0
  self->SetM24(arg0);
1112
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1113
0
1114
0
  return true;
1115
0
}
1116
1117
static const JSJitInfo m24_getterinfo = {
1118
  { (JSJitGetterOp)get_m24 },
1119
  { prototypes::id::DOMMatrix },
1120
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1121
  JSJitInfo::Getter,
1122
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1123
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1124
  true,  /* isInfallible. False in setters. */
1125
  false,  /* isMovable.  Not relevant for setters. */
1126
  false, /* isEliminatable.  Not relevant for setters. */
1127
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1128
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1129
  false,  /* isTypedMethod.  Only relevant for methods. */
1130
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1131
};
1132
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1133
static_assert(0 < 1, "There is no slot for us");
1134
static const JSJitInfo m24_setterinfo = {
1135
  { (JSJitGetterOp)set_m24 },
1136
  { prototypes::id::DOMMatrix },
1137
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1138
  JSJitInfo::Setter,
1139
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1140
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1141
  false,  /* isInfallible. False in setters. */
1142
  false,  /* isMovable.  Not relevant for setters. */
1143
  false, /* isEliminatable.  Not relevant for setters. */
1144
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1145
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1146
  false,  /* isTypedMethod.  Only relevant for methods. */
1147
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1148
};
1149
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1150
static_assert(0 < 1, "There is no slot for us");
1151
1152
MOZ_CAN_RUN_SCRIPT static bool
1153
get_m31(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1154
0
{
1155
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m31", DOM, cx);
1156
0
1157
0
  double result(self->M31());
1158
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1159
0
  args.rval().set(JS_NumberValue(double(result)));
1160
0
  return true;
1161
0
}
1162
1163
MOZ_CAN_RUN_SCRIPT static bool
1164
set_m31(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1165
0
{
1166
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m31", DOM, cx);
1167
0
1168
0
  double arg0;
1169
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1170
0
    return false;
1171
0
  }
1172
0
  self->SetM31(arg0);
1173
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1174
0
1175
0
  return true;
1176
0
}
1177
1178
static const JSJitInfo m31_getterinfo = {
1179
  { (JSJitGetterOp)get_m31 },
1180
  { prototypes::id::DOMMatrix },
1181
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1182
  JSJitInfo::Getter,
1183
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1184
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1185
  true,  /* isInfallible. False in setters. */
1186
  false,  /* isMovable.  Not relevant for setters. */
1187
  false, /* isEliminatable.  Not relevant for setters. */
1188
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1189
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1190
  false,  /* isTypedMethod.  Only relevant for methods. */
1191
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1192
};
1193
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1194
static_assert(0 < 1, "There is no slot for us");
1195
static const JSJitInfo m31_setterinfo = {
1196
  { (JSJitGetterOp)set_m31 },
1197
  { prototypes::id::DOMMatrix },
1198
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1199
  JSJitInfo::Setter,
1200
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1201
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1202
  false,  /* isInfallible. False in setters. */
1203
  false,  /* isMovable.  Not relevant for setters. */
1204
  false, /* isEliminatable.  Not relevant for setters. */
1205
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1206
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1207
  false,  /* isTypedMethod.  Only relevant for methods. */
1208
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1209
};
1210
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1211
static_assert(0 < 1, "There is no slot for us");
1212
1213
MOZ_CAN_RUN_SCRIPT static bool
1214
get_m32(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1215
0
{
1216
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m32", DOM, cx);
1217
0
1218
0
  double result(self->M32());
1219
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1220
0
  args.rval().set(JS_NumberValue(double(result)));
1221
0
  return true;
1222
0
}
1223
1224
MOZ_CAN_RUN_SCRIPT static bool
1225
set_m32(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1226
0
{
1227
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m32", DOM, cx);
1228
0
1229
0
  double arg0;
1230
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1231
0
    return false;
1232
0
  }
1233
0
  self->SetM32(arg0);
1234
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1235
0
1236
0
  return true;
1237
0
}
1238
1239
static const JSJitInfo m32_getterinfo = {
1240
  { (JSJitGetterOp)get_m32 },
1241
  { prototypes::id::DOMMatrix },
1242
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1243
  JSJitInfo::Getter,
1244
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1245
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1246
  true,  /* isInfallible. False in setters. */
1247
  false,  /* isMovable.  Not relevant for setters. */
1248
  false, /* isEliminatable.  Not relevant for setters. */
1249
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1250
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1251
  false,  /* isTypedMethod.  Only relevant for methods. */
1252
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1253
};
1254
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1255
static_assert(0 < 1, "There is no slot for us");
1256
static const JSJitInfo m32_setterinfo = {
1257
  { (JSJitGetterOp)set_m32 },
1258
  { prototypes::id::DOMMatrix },
1259
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1260
  JSJitInfo::Setter,
1261
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1262
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1263
  false,  /* isInfallible. False in setters. */
1264
  false,  /* isMovable.  Not relevant for setters. */
1265
  false, /* isEliminatable.  Not relevant for setters. */
1266
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1267
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1268
  false,  /* isTypedMethod.  Only relevant for methods. */
1269
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1270
};
1271
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1272
static_assert(0 < 1, "There is no slot for us");
1273
1274
MOZ_CAN_RUN_SCRIPT static bool
1275
get_m33(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1276
0
{
1277
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m33", DOM, cx);
1278
0
1279
0
  double result(self->M33());
1280
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1281
0
  args.rval().set(JS_NumberValue(double(result)));
1282
0
  return true;
1283
0
}
1284
1285
MOZ_CAN_RUN_SCRIPT static bool
1286
set_m33(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1287
0
{
1288
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m33", DOM, cx);
1289
0
1290
0
  double arg0;
1291
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1292
0
    return false;
1293
0
  }
1294
0
  self->SetM33(arg0);
1295
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1296
0
1297
0
  return true;
1298
0
}
1299
1300
static const JSJitInfo m33_getterinfo = {
1301
  { (JSJitGetterOp)get_m33 },
1302
  { prototypes::id::DOMMatrix },
1303
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1304
  JSJitInfo::Getter,
1305
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1306
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1307
  true,  /* isInfallible. False in setters. */
1308
  false,  /* isMovable.  Not relevant for setters. */
1309
  false, /* isEliminatable.  Not relevant for setters. */
1310
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1311
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1312
  false,  /* isTypedMethod.  Only relevant for methods. */
1313
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1314
};
1315
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1316
static_assert(0 < 1, "There is no slot for us");
1317
static const JSJitInfo m33_setterinfo = {
1318
  { (JSJitGetterOp)set_m33 },
1319
  { prototypes::id::DOMMatrix },
1320
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1321
  JSJitInfo::Setter,
1322
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1323
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1324
  false,  /* isInfallible. False in setters. */
1325
  false,  /* isMovable.  Not relevant for setters. */
1326
  false, /* isEliminatable.  Not relevant for setters. */
1327
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1328
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1329
  false,  /* isTypedMethod.  Only relevant for methods. */
1330
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1331
};
1332
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1333
static_assert(0 < 1, "There is no slot for us");
1334
1335
MOZ_CAN_RUN_SCRIPT static bool
1336
get_m34(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1337
0
{
1338
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m34", DOM, cx);
1339
0
1340
0
  double result(self->M34());
1341
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1342
0
  args.rval().set(JS_NumberValue(double(result)));
1343
0
  return true;
1344
0
}
1345
1346
MOZ_CAN_RUN_SCRIPT static bool
1347
set_m34(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1348
0
{
1349
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m34", DOM, cx);
1350
0
1351
0
  double arg0;
1352
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1353
0
    return false;
1354
0
  }
1355
0
  self->SetM34(arg0);
1356
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1357
0
1358
0
  return true;
1359
0
}
1360
1361
static const JSJitInfo m34_getterinfo = {
1362
  { (JSJitGetterOp)get_m34 },
1363
  { prototypes::id::DOMMatrix },
1364
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1365
  JSJitInfo::Getter,
1366
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1367
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1368
  true,  /* isInfallible. False in setters. */
1369
  false,  /* isMovable.  Not relevant for setters. */
1370
  false, /* isEliminatable.  Not relevant for setters. */
1371
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1372
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1373
  false,  /* isTypedMethod.  Only relevant for methods. */
1374
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1375
};
1376
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1377
static_assert(0 < 1, "There is no slot for us");
1378
static const JSJitInfo m34_setterinfo = {
1379
  { (JSJitGetterOp)set_m34 },
1380
  { prototypes::id::DOMMatrix },
1381
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1382
  JSJitInfo::Setter,
1383
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1384
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1385
  false,  /* isInfallible. False in setters. */
1386
  false,  /* isMovable.  Not relevant for setters. */
1387
  false, /* isEliminatable.  Not relevant for setters. */
1388
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1389
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1390
  false,  /* isTypedMethod.  Only relevant for methods. */
1391
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1392
};
1393
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1394
static_assert(0 < 1, "There is no slot for us");
1395
1396
MOZ_CAN_RUN_SCRIPT static bool
1397
get_m41(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1398
0
{
1399
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m41", DOM, cx);
1400
0
1401
0
  double result(self->M41());
1402
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1403
0
  args.rval().set(JS_NumberValue(double(result)));
1404
0
  return true;
1405
0
}
1406
1407
MOZ_CAN_RUN_SCRIPT static bool
1408
set_m41(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1409
0
{
1410
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m41", DOM, cx);
1411
0
1412
0
  double arg0;
1413
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1414
0
    return false;
1415
0
  }
1416
0
  self->SetM41(arg0);
1417
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1418
0
1419
0
  return true;
1420
0
}
1421
1422
static const JSJitInfo m41_getterinfo = {
1423
  { (JSJitGetterOp)get_m41 },
1424
  { prototypes::id::DOMMatrix },
1425
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1426
  JSJitInfo::Getter,
1427
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1428
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1429
  true,  /* isInfallible. False in setters. */
1430
  false,  /* isMovable.  Not relevant for setters. */
1431
  false, /* isEliminatable.  Not relevant for setters. */
1432
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1433
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1434
  false,  /* isTypedMethod.  Only relevant for methods. */
1435
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1436
};
1437
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1438
static_assert(0 < 1, "There is no slot for us");
1439
static const JSJitInfo m41_setterinfo = {
1440
  { (JSJitGetterOp)set_m41 },
1441
  { prototypes::id::DOMMatrix },
1442
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1443
  JSJitInfo::Setter,
1444
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1445
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1446
  false,  /* isInfallible. False in setters. */
1447
  false,  /* isMovable.  Not relevant for setters. */
1448
  false, /* isEliminatable.  Not relevant for setters. */
1449
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1450
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1451
  false,  /* isTypedMethod.  Only relevant for methods. */
1452
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1453
};
1454
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1455
static_assert(0 < 1, "There is no slot for us");
1456
1457
MOZ_CAN_RUN_SCRIPT static bool
1458
get_m42(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1459
0
{
1460
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m42", DOM, cx);
1461
0
1462
0
  double result(self->M42());
1463
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1464
0
  args.rval().set(JS_NumberValue(double(result)));
1465
0
  return true;
1466
0
}
1467
1468
MOZ_CAN_RUN_SCRIPT static bool
1469
set_m42(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1470
0
{
1471
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m42", DOM, cx);
1472
0
1473
0
  double arg0;
1474
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1475
0
    return false;
1476
0
  }
1477
0
  self->SetM42(arg0);
1478
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1479
0
1480
0
  return true;
1481
0
}
1482
1483
static const JSJitInfo m42_getterinfo = {
1484
  { (JSJitGetterOp)get_m42 },
1485
  { prototypes::id::DOMMatrix },
1486
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1487
  JSJitInfo::Getter,
1488
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1489
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1490
  true,  /* isInfallible. False in setters. */
1491
  false,  /* isMovable.  Not relevant for setters. */
1492
  false, /* isEliminatable.  Not relevant for setters. */
1493
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1494
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1495
  false,  /* isTypedMethod.  Only relevant for methods. */
1496
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1497
};
1498
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1499
static_assert(0 < 1, "There is no slot for us");
1500
static const JSJitInfo m42_setterinfo = {
1501
  { (JSJitGetterOp)set_m42 },
1502
  { prototypes::id::DOMMatrix },
1503
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1504
  JSJitInfo::Setter,
1505
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1506
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1507
  false,  /* isInfallible. False in setters. */
1508
  false,  /* isMovable.  Not relevant for setters. */
1509
  false, /* isEliminatable.  Not relevant for setters. */
1510
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1511
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1512
  false,  /* isTypedMethod.  Only relevant for methods. */
1513
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1514
};
1515
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1516
static_assert(0 < 1, "There is no slot for us");
1517
1518
MOZ_CAN_RUN_SCRIPT static bool
1519
get_m43(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1520
0
{
1521
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m43", DOM, cx);
1522
0
1523
0
  double result(self->M43());
1524
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1525
0
  args.rval().set(JS_NumberValue(double(result)));
1526
0
  return true;
1527
0
}
1528
1529
MOZ_CAN_RUN_SCRIPT static bool
1530
set_m43(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1531
0
{
1532
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m43", DOM, cx);
1533
0
1534
0
  double arg0;
1535
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1536
0
    return false;
1537
0
  }
1538
0
  self->SetM43(arg0);
1539
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1540
0
1541
0
  return true;
1542
0
}
1543
1544
static const JSJitInfo m43_getterinfo = {
1545
  { (JSJitGetterOp)get_m43 },
1546
  { prototypes::id::DOMMatrix },
1547
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1548
  JSJitInfo::Getter,
1549
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1550
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1551
  true,  /* isInfallible. False in setters. */
1552
  false,  /* isMovable.  Not relevant for setters. */
1553
  false, /* isEliminatable.  Not relevant for setters. */
1554
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1555
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1556
  false,  /* isTypedMethod.  Only relevant for methods. */
1557
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1558
};
1559
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1560
static_assert(0 < 1, "There is no slot for us");
1561
static const JSJitInfo m43_setterinfo = {
1562
  { (JSJitGetterOp)set_m43 },
1563
  { prototypes::id::DOMMatrix },
1564
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1565
  JSJitInfo::Setter,
1566
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1567
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1568
  false,  /* isInfallible. False in setters. */
1569
  false,  /* isMovable.  Not relevant for setters. */
1570
  false, /* isEliminatable.  Not relevant for setters. */
1571
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1572
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1573
  false,  /* isTypedMethod.  Only relevant for methods. */
1574
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1575
};
1576
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1577
static_assert(0 < 1, "There is no slot for us");
1578
1579
MOZ_CAN_RUN_SCRIPT static bool
1580
get_m44(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitGetterCallArgs args)
1581
0
{
1582
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrix.m44", DOM, cx);
1583
0
1584
0
  double result(self->M44());
1585
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1586
0
  args.rval().set(JS_NumberValue(double(result)));
1587
0
  return true;
1588
0
}
1589
1590
MOZ_CAN_RUN_SCRIPT static bool
1591
set_m44(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, JSJitSetterCallArgs args)
1592
0
{
1593
0
  AUTO_PROFILER_LABEL_FAST("set DOMMatrix.m44", DOM, cx);
1594
0
1595
0
  double arg0;
1596
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1597
0
    return false;
1598
0
  }
1599
0
  self->SetM44(arg0);
1600
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1601
0
1602
0
  return true;
1603
0
}
1604
1605
static const JSJitInfo m44_getterinfo = {
1606
  { (JSJitGetterOp)get_m44 },
1607
  { prototypes::id::DOMMatrix },
1608
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1609
  JSJitInfo::Getter,
1610
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1611
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
1612
  true,  /* isInfallible. False in setters. */
1613
  false,  /* isMovable.  Not relevant for setters. */
1614
  false, /* isEliminatable.  Not relevant for setters. */
1615
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1616
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1617
  false,  /* isTypedMethod.  Only relevant for methods. */
1618
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1619
};
1620
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1621
static_assert(0 < 1, "There is no slot for us");
1622
static const JSJitInfo m44_setterinfo = {
1623
  { (JSJitGetterOp)set_m44 },
1624
  { prototypes::id::DOMMatrix },
1625
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1626
  JSJitInfo::Setter,
1627
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1628
  JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
1629
  false,  /* isInfallible. False in setters. */
1630
  false,  /* isMovable.  Not relevant for setters. */
1631
  false, /* isEliminatable.  Not relevant for setters. */
1632
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1633
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1634
  false,  /* isTypedMethod.  Only relevant for methods. */
1635
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1636
};
1637
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1638
static_assert(0 < 1, "There is no slot for us");
1639
1640
MOZ_CAN_RUN_SCRIPT static bool
1641
multiplySelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
1642
0
{
1643
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.multiplySelf", DOM, cx);
1644
0
1645
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1646
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.multiplySelf");
1647
0
  }
1648
0
  NonNull<mozilla::dom::DOMMatrix> arg0;
1649
0
  if (args[0].isObject()) {
1650
0
    {
1651
0
      nsresult rv = UnwrapObject<prototypes::id::DOMMatrix, mozilla::dom::DOMMatrix>(args[0], arg0);
1652
0
      if (NS_FAILED(rv)) {
1653
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of DOMMatrix.multiplySelf", "DOMMatrix");
1654
0
        return false;
1655
0
      }
1656
0
    }
1657
0
  } else {
1658
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of DOMMatrix.multiplySelf");
1659
0
    return false;
1660
0
  }
1661
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->MultiplySelf(MOZ_KnownLive(NonNullHelper(arg0)))));
1662
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1663
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1664
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1665
0
    return false;
1666
0
  }
1667
0
  return true;
1668
0
}
1669
1670
static const JSJitInfo multiplySelf_methodinfo = {
1671
  { (JSJitGetterOp)multiplySelf },
1672
  { prototypes::id::DOMMatrix },
1673
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1674
  JSJitInfo::Method,
1675
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1676
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1677
  false,  /* isInfallible. False in setters. */
1678
  false,  /* isMovable.  Not relevant for setters. */
1679
  false, /* isEliminatable.  Not relevant for setters. */
1680
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1681
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1682
  false,  /* isTypedMethod.  Only relevant for methods. */
1683
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1684
};
1685
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1686
static_assert(0 < 1, "There is no slot for us");
1687
1688
MOZ_CAN_RUN_SCRIPT static bool
1689
preMultiplySelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
1690
0
{
1691
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.preMultiplySelf", DOM, cx);
1692
0
1693
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1694
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.preMultiplySelf");
1695
0
  }
1696
0
  NonNull<mozilla::dom::DOMMatrix> arg0;
1697
0
  if (args[0].isObject()) {
1698
0
    {
1699
0
      nsresult rv = UnwrapObject<prototypes::id::DOMMatrix, mozilla::dom::DOMMatrix>(args[0], arg0);
1700
0
      if (NS_FAILED(rv)) {
1701
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of DOMMatrix.preMultiplySelf", "DOMMatrix");
1702
0
        return false;
1703
0
      }
1704
0
    }
1705
0
  } else {
1706
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of DOMMatrix.preMultiplySelf");
1707
0
    return false;
1708
0
  }
1709
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->PreMultiplySelf(MOZ_KnownLive(NonNullHelper(arg0)))));
1710
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1711
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1712
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1713
0
    return false;
1714
0
  }
1715
0
  return true;
1716
0
}
1717
1718
static const JSJitInfo preMultiplySelf_methodinfo = {
1719
  { (JSJitGetterOp)preMultiplySelf },
1720
  { prototypes::id::DOMMatrix },
1721
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1722
  JSJitInfo::Method,
1723
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1724
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1725
  false,  /* isInfallible. False in setters. */
1726
  false,  /* isMovable.  Not relevant for setters. */
1727
  false, /* isEliminatable.  Not relevant for setters. */
1728
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1729
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1730
  false,  /* isTypedMethod.  Only relevant for methods. */
1731
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1732
};
1733
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1734
static_assert(0 < 1, "There is no slot for us");
1735
1736
MOZ_CAN_RUN_SCRIPT static bool
1737
translateSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
1738
0
{
1739
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.translateSelf", DOM, cx);
1740
0
1741
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
1742
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.translateSelf");
1743
0
  }
1744
0
  double arg0;
1745
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1746
0
    return false;
1747
0
  }
1748
0
  double arg1;
1749
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
1750
0
    return false;
1751
0
  }
1752
0
  double arg2;
1753
0
  if (args.hasDefined(2)) {
1754
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
1755
0
      return false;
1756
0
    }
1757
0
  } else {
1758
0
    arg2 = 0.0;
1759
0
  }
1760
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->TranslateSelf(arg0, arg1, arg2)));
1761
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1762
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1763
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1764
0
    return false;
1765
0
  }
1766
0
  return true;
1767
0
}
1768
1769
static const JSJitInfo translateSelf_methodinfo = {
1770
  { (JSJitGetterOp)translateSelf },
1771
  { prototypes::id::DOMMatrix },
1772
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1773
  JSJitInfo::Method,
1774
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1775
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1776
  false,  /* isInfallible. False in setters. */
1777
  false,  /* isMovable.  Not relevant for setters. */
1778
  false, /* isEliminatable.  Not relevant for setters. */
1779
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1780
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1781
  false,  /* isTypedMethod.  Only relevant for methods. */
1782
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1783
};
1784
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1785
static_assert(0 < 1, "There is no slot for us");
1786
1787
MOZ_CAN_RUN_SCRIPT static bool
1788
scaleSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
1789
0
{
1790
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.scaleSelf", DOM, cx);
1791
0
1792
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1793
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.scaleSelf");
1794
0
  }
1795
0
  double arg0;
1796
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1797
0
    return false;
1798
0
  }
1799
0
  double arg1;
1800
0
  if (args.hasDefined(1)) {
1801
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
1802
0
      return false;
1803
0
    }
1804
0
  } else {
1805
0
    arg1 = 0.0;
1806
0
  }
1807
0
  double arg2;
1808
0
  if (args.hasDefined(2)) {
1809
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
1810
0
      return false;
1811
0
    }
1812
0
  } else {
1813
0
    arg2 = 0.0;
1814
0
  }
1815
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->ScaleSelf(arg0, arg1, arg2)));
1816
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1817
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1818
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1819
0
    return false;
1820
0
  }
1821
0
  return true;
1822
0
}
1823
1824
static const JSJitInfo scaleSelf_methodinfo = {
1825
  { (JSJitGetterOp)scaleSelf },
1826
  { prototypes::id::DOMMatrix },
1827
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1828
  JSJitInfo::Method,
1829
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1830
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1831
  false,  /* isInfallible. False in setters. */
1832
  false,  /* isMovable.  Not relevant for setters. */
1833
  false, /* isEliminatable.  Not relevant for setters. */
1834
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1835
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1836
  false,  /* isTypedMethod.  Only relevant for methods. */
1837
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1838
};
1839
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1840
static_assert(0 < 1, "There is no slot for us");
1841
1842
MOZ_CAN_RUN_SCRIPT static bool
1843
scale3dSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
1844
0
{
1845
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.scale3dSelf", DOM, cx);
1846
0
1847
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1848
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.scale3dSelf");
1849
0
  }
1850
0
  double arg0;
1851
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1852
0
    return false;
1853
0
  }
1854
0
  double arg1;
1855
0
  if (args.hasDefined(1)) {
1856
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
1857
0
      return false;
1858
0
    }
1859
0
  } else {
1860
0
    arg1 = 0.0;
1861
0
  }
1862
0
  double arg2;
1863
0
  if (args.hasDefined(2)) {
1864
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
1865
0
      return false;
1866
0
    }
1867
0
  } else {
1868
0
    arg2 = 0.0;
1869
0
  }
1870
0
  double arg3;
1871
0
  if (args.hasDefined(3)) {
1872
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[3], &arg3)) {
1873
0
      return false;
1874
0
    }
1875
0
  } else {
1876
0
    arg3 = 0.0;
1877
0
  }
1878
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->Scale3dSelf(arg0, arg1, arg2, arg3)));
1879
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1880
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1881
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1882
0
    return false;
1883
0
  }
1884
0
  return true;
1885
0
}
1886
1887
static const JSJitInfo scale3dSelf_methodinfo = {
1888
  { (JSJitGetterOp)scale3dSelf },
1889
  { prototypes::id::DOMMatrix },
1890
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1891
  JSJitInfo::Method,
1892
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1893
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1894
  false,  /* isInfallible. False in setters. */
1895
  false,  /* isMovable.  Not relevant for setters. */
1896
  false, /* isEliminatable.  Not relevant for setters. */
1897
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1898
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1899
  false,  /* isTypedMethod.  Only relevant for methods. */
1900
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1901
};
1902
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1903
static_assert(0 < 1, "There is no slot for us");
1904
1905
MOZ_CAN_RUN_SCRIPT static bool
1906
scaleNonUniformSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
1907
0
{
1908
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.scaleNonUniformSelf", DOM, cx);
1909
0
1910
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1911
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.scaleNonUniformSelf");
1912
0
  }
1913
0
  double arg0;
1914
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1915
0
    return false;
1916
0
  }
1917
0
  double arg1;
1918
0
  if (args.hasDefined(1)) {
1919
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
1920
0
      return false;
1921
0
    }
1922
0
  } else {
1923
0
    arg1 = 1.0;
1924
0
  }
1925
0
  double arg2;
1926
0
  if (args.hasDefined(2)) {
1927
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
1928
0
      return false;
1929
0
    }
1930
0
  } else {
1931
0
    arg2 = 1.0;
1932
0
  }
1933
0
  double arg3;
1934
0
  if (args.hasDefined(3)) {
1935
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[3], &arg3)) {
1936
0
      return false;
1937
0
    }
1938
0
  } else {
1939
0
    arg3 = 0.0;
1940
0
  }
1941
0
  double arg4;
1942
0
  if (args.hasDefined(4)) {
1943
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[4], &arg4)) {
1944
0
      return false;
1945
0
    }
1946
0
  } else {
1947
0
    arg4 = 0.0;
1948
0
  }
1949
0
  double arg5;
1950
0
  if (args.hasDefined(5)) {
1951
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[5], &arg5)) {
1952
0
      return false;
1953
0
    }
1954
0
  } else {
1955
0
    arg5 = 0.0;
1956
0
  }
1957
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->ScaleNonUniformSelf(arg0, arg1, arg2, arg3, arg4, arg5)));
1958
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
1959
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
1960
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
1961
0
    return false;
1962
0
  }
1963
0
  return true;
1964
0
}
1965
1966
static const JSJitInfo scaleNonUniformSelf_methodinfo = {
1967
  { (JSJitGetterOp)scaleNonUniformSelf },
1968
  { prototypes::id::DOMMatrix },
1969
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
1970
  JSJitInfo::Method,
1971
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
1972
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
1973
  false,  /* isInfallible. False in setters. */
1974
  false,  /* isMovable.  Not relevant for setters. */
1975
  false, /* isEliminatable.  Not relevant for setters. */
1976
  false, /* isAlwaysInSlot.  Only relevant for getters. */
1977
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
1978
  false,  /* isTypedMethod.  Only relevant for methods. */
1979
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
1980
};
1981
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
1982
static_assert(0 < 1, "There is no slot for us");
1983
1984
MOZ_CAN_RUN_SCRIPT static bool
1985
rotateSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
1986
0
{
1987
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.rotateSelf", DOM, cx);
1988
0
1989
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
1990
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.rotateSelf");
1991
0
  }
1992
0
  double arg0;
1993
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
1994
0
    return false;
1995
0
  }
1996
0
  double arg1;
1997
0
  if (args.hasDefined(1)) {
1998
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
1999
0
      return false;
2000
0
    }
2001
0
  } else {
2002
0
    arg1 = 0.0;
2003
0
  }
2004
0
  double arg2;
2005
0
  if (args.hasDefined(2)) {
2006
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
2007
0
      return false;
2008
0
    }
2009
0
  } else {
2010
0
    arg2 = 0.0;
2011
0
  }
2012
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->RotateSelf(arg0, arg1, arg2)));
2013
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2014
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2015
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2016
0
    return false;
2017
0
  }
2018
0
  return true;
2019
0
}
2020
2021
static const JSJitInfo rotateSelf_methodinfo = {
2022
  { (JSJitGetterOp)rotateSelf },
2023
  { prototypes::id::DOMMatrix },
2024
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
2025
  JSJitInfo::Method,
2026
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2027
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2028
  false,  /* isInfallible. False in setters. */
2029
  false,  /* isMovable.  Not relevant for setters. */
2030
  false, /* isEliminatable.  Not relevant for setters. */
2031
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2032
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2033
  false,  /* isTypedMethod.  Only relevant for methods. */
2034
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2035
};
2036
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2037
static_assert(0 < 1, "There is no slot for us");
2038
2039
MOZ_CAN_RUN_SCRIPT static bool
2040
rotateFromVectorSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
2041
0
{
2042
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.rotateFromVectorSelf", DOM, cx);
2043
0
2044
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
2045
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.rotateFromVectorSelf");
2046
0
  }
2047
0
  double arg0;
2048
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
2049
0
    return false;
2050
0
  }
2051
0
  double arg1;
2052
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
2053
0
    return false;
2054
0
  }
2055
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->RotateFromVectorSelf(arg0, arg1)));
2056
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2057
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2058
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2059
0
    return false;
2060
0
  }
2061
0
  return true;
2062
0
}
2063
2064
static const JSJitInfo rotateFromVectorSelf_methodinfo = {
2065
  { (JSJitGetterOp)rotateFromVectorSelf },
2066
  { prototypes::id::DOMMatrix },
2067
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
2068
  JSJitInfo::Method,
2069
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2070
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2071
  false,  /* isInfallible. False in setters. */
2072
  false,  /* isMovable.  Not relevant for setters. */
2073
  false, /* isEliminatable.  Not relevant for setters. */
2074
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2075
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2076
  false,  /* isTypedMethod.  Only relevant for methods. */
2077
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2078
};
2079
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2080
static_assert(0 < 1, "There is no slot for us");
2081
2082
MOZ_CAN_RUN_SCRIPT static bool
2083
rotateAxisAngleSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
2084
0
{
2085
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.rotateAxisAngleSelf", DOM, cx);
2086
0
2087
0
  if (MOZ_UNLIKELY(args.length() < 4)) {
2088
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.rotateAxisAngleSelf");
2089
0
  }
2090
0
  double arg0;
2091
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
2092
0
    return false;
2093
0
  }
2094
0
  double arg1;
2095
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
2096
0
    return false;
2097
0
  }
2098
0
  double arg2;
2099
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
2100
0
    return false;
2101
0
  }
2102
0
  double arg3;
2103
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[3], &arg3)) {
2104
0
    return false;
2105
0
  }
2106
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->RotateAxisAngleSelf(arg0, arg1, arg2, arg3)));
2107
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2108
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2109
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2110
0
    return false;
2111
0
  }
2112
0
  return true;
2113
0
}
2114
2115
static const JSJitInfo rotateAxisAngleSelf_methodinfo = {
2116
  { (JSJitGetterOp)rotateAxisAngleSelf },
2117
  { prototypes::id::DOMMatrix },
2118
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
2119
  JSJitInfo::Method,
2120
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2121
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2122
  false,  /* isInfallible. False in setters. */
2123
  false,  /* isMovable.  Not relevant for setters. */
2124
  false, /* isEliminatable.  Not relevant for setters. */
2125
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2126
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2127
  false,  /* isTypedMethod.  Only relevant for methods. */
2128
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2129
};
2130
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2131
static_assert(0 < 1, "There is no slot for us");
2132
2133
MOZ_CAN_RUN_SCRIPT static bool
2134
skewXSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
2135
0
{
2136
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.skewXSelf", DOM, cx);
2137
0
2138
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2139
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.skewXSelf");
2140
0
  }
2141
0
  double arg0;
2142
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
2143
0
    return false;
2144
0
  }
2145
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->SkewXSelf(arg0)));
2146
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2147
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2148
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2149
0
    return false;
2150
0
  }
2151
0
  return true;
2152
0
}
2153
2154
static const JSJitInfo skewXSelf_methodinfo = {
2155
  { (JSJitGetterOp)skewXSelf },
2156
  { prototypes::id::DOMMatrix },
2157
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
2158
  JSJitInfo::Method,
2159
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2160
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2161
  false,  /* isInfallible. False in setters. */
2162
  false,  /* isMovable.  Not relevant for setters. */
2163
  false, /* isEliminatable.  Not relevant for setters. */
2164
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2165
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2166
  false,  /* isTypedMethod.  Only relevant for methods. */
2167
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2168
};
2169
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2170
static_assert(0 < 1, "There is no slot for us");
2171
2172
MOZ_CAN_RUN_SCRIPT static bool
2173
skewYSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
2174
0
{
2175
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.skewYSelf", DOM, cx);
2176
0
2177
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2178
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.skewYSelf");
2179
0
  }
2180
0
  double arg0;
2181
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
2182
0
    return false;
2183
0
  }
2184
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->SkewYSelf(arg0)));
2185
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2186
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2187
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2188
0
    return false;
2189
0
  }
2190
0
  return true;
2191
0
}
2192
2193
static const JSJitInfo skewYSelf_methodinfo = {
2194
  { (JSJitGetterOp)skewYSelf },
2195
  { prototypes::id::DOMMatrix },
2196
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
2197
  JSJitInfo::Method,
2198
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2199
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2200
  false,  /* isInfallible. False in setters. */
2201
  false,  /* isMovable.  Not relevant for setters. */
2202
  false, /* isEliminatable.  Not relevant for setters. */
2203
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2204
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2205
  false,  /* isTypedMethod.  Only relevant for methods. */
2206
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2207
};
2208
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2209
static_assert(0 < 1, "There is no slot for us");
2210
2211
MOZ_CAN_RUN_SCRIPT static bool
2212
invertSelf(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
2213
0
{
2214
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.invertSelf", DOM, cx);
2215
0
2216
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->InvertSelf()));
2217
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2218
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2219
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2220
0
    return false;
2221
0
  }
2222
0
  return true;
2223
0
}
2224
2225
static const JSJitInfo invertSelf_methodinfo = {
2226
  { (JSJitGetterOp)invertSelf },
2227
  { prototypes::id::DOMMatrix },
2228
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
2229
  JSJitInfo::Method,
2230
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2231
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2232
  false,  /* isInfallible. False in setters. */
2233
  false,  /* isMovable.  Not relevant for setters. */
2234
  false, /* isEliminatable.  Not relevant for setters. */
2235
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2236
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2237
  false,  /* isTypedMethod.  Only relevant for methods. */
2238
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2239
};
2240
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2241
static_assert(0 < 1, "There is no slot for us");
2242
2243
MOZ_CAN_RUN_SCRIPT static bool
2244
setMatrixValue(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrix* self, const JSJitMethodCallArgs& args)
2245
0
{
2246
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix.setMatrixValue", DOM, cx);
2247
0
2248
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
2249
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix.setMatrixValue");
2250
0
  }
2251
0
  binding_detail::FakeString arg0;
2252
0
  if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
2253
0
    return false;
2254
0
  }
2255
0
  FastErrorResult rv;
2256
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->SetMatrixValue(NonNullHelper(Constify(arg0)), rv)));
2257
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2258
0
    return false;
2259
0
  }
2260
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2261
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
2262
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
2263
0
    return false;
2264
0
  }
2265
0
  return true;
2266
0
}
2267
2268
static const JSJitInfo setMatrixValue_methodinfo = {
2269
  { (JSJitGetterOp)setMatrixValue },
2270
  { prototypes::id::DOMMatrix },
2271
  { PrototypeTraits<prototypes::id::DOMMatrix>::Depth },
2272
  JSJitInfo::Method,
2273
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2274
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
2275
  false,  /* isInfallible. False in setters. */
2276
  false,  /* isMovable.  Not relevant for setters. */
2277
  false, /* isEliminatable.  Not relevant for setters. */
2278
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2279
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2280
  false,  /* isTypedMethod.  Only relevant for methods. */
2281
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2282
};
2283
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2284
static_assert(0 < 1, "There is no slot for us");
2285
2286
static bool
2287
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
2288
0
{
2289
0
  mozilla::dom::DOMMatrix* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::DOMMatrix>(obj);
2290
0
  // We don't want to preserve if we don't have a wrapper, and we
2291
0
  // obviously can't preserve if we're not initialized.
2292
0
  if (self && self->GetWrapperPreserveColor()) {
2293
0
    PreserveWrapper(self);
2294
0
  }
2295
0
  return true;
2296
0
}
2297
2298
static void
2299
_finalize(js::FreeOp* fop, JSObject* obj)
2300
0
{
2301
0
  mozilla::dom::DOMMatrix* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::DOMMatrix>(obj);
2302
0
  if (self) {
2303
0
    ClearWrapper(self, self, obj);
2304
0
    AddForDeferredFinalization<mozilla::dom::DOMMatrix>(self);
2305
0
  }
2306
0
}
2307
2308
static size_t
2309
_objectMoved(JSObject* obj, JSObject* old)
2310
0
{
2311
0
  mozilla::dom::DOMMatrix* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::DOMMatrix>(obj);
2312
0
  if (self) {
2313
0
    UpdateWrapper(self, self, obj, old);
2314
0
  }
2315
0
2316
0
  return 0;
2317
0
}
2318
2319
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
2320
#if defined(__clang__)
2321
#pragma clang diagnostic push
2322
#pragma clang diagnostic ignored "-Wmissing-braces"
2323
#endif
2324
static const JSFunctionSpec sMethods_specs[] = {
2325
  JS_FNSPEC("multiplySelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&multiplySelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2326
  JS_FNSPEC("preMultiplySelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&preMultiplySelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2327
  JS_FNSPEC("translateSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&translateSelf_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
2328
  JS_FNSPEC("scaleSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&scaleSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2329
  JS_FNSPEC("scale3dSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&scale3dSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2330
  JS_FNSPEC("scaleNonUniformSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&scaleNonUniformSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2331
  JS_FNSPEC("rotateSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&rotateSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2332
  JS_FNSPEC("rotateFromVectorSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&rotateFromVectorSelf_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
2333
  JS_FNSPEC("rotateAxisAngleSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&rotateAxisAngleSelf_methodinfo), 4, JSPROP_ENUMERATE, nullptr),
2334
  JS_FNSPEC("skewXSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&skewXSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2335
  JS_FNSPEC("skewYSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&skewYSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2336
  JS_FNSPEC("invertSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&invertSelf_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
2337
  JS_FNSPEC("setMatrixValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&setMatrixValue_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
2338
  JS_FS_END
2339
};
2340
#if defined(__clang__)
2341
#pragma clang diagnostic pop
2342
#endif
2343
2344
2345
static const Prefable<const JSFunctionSpec> sMethods[] = {
2346
  { nullptr, &sMethods_specs[0] },
2347
  { nullptr, nullptr }
2348
};
2349
2350
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
2351
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
2352
static_assert(13 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
2353
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
2354
2355
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
2356
#if defined(__clang__)
2357
#pragma clang diagnostic push
2358
#pragma clang diagnostic ignored "-Wmissing-braces"
2359
#endif
2360
static const JSPropertySpec sAttributes_specs[] = {
2361
  { "a", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &a_getterinfo, GenericSetter<NormalThisPolicy>, &a_setterinfo },
2362
  { "b", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &b_getterinfo, GenericSetter<NormalThisPolicy>, &b_setterinfo },
2363
  { "c", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &c_getterinfo, GenericSetter<NormalThisPolicy>, &c_setterinfo },
2364
  { "d", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &d_getterinfo, GenericSetter<NormalThisPolicy>, &d_setterinfo },
2365
  { "e", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &e_getterinfo, GenericSetter<NormalThisPolicy>, &e_setterinfo },
2366
  { "f", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &f_getterinfo, GenericSetter<NormalThisPolicy>, &f_setterinfo },
2367
  { "m11", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m11_getterinfo, GenericSetter<NormalThisPolicy>, &m11_setterinfo },
2368
  { "m12", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m12_getterinfo, GenericSetter<NormalThisPolicy>, &m12_setterinfo },
2369
  { "m13", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m13_getterinfo, GenericSetter<NormalThisPolicy>, &m13_setterinfo },
2370
  { "m14", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m14_getterinfo, GenericSetter<NormalThisPolicy>, &m14_setterinfo },
2371
  { "m21", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m21_getterinfo, GenericSetter<NormalThisPolicy>, &m21_setterinfo },
2372
  { "m22", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m22_getterinfo, GenericSetter<NormalThisPolicy>, &m22_setterinfo },
2373
  { "m23", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m23_getterinfo, GenericSetter<NormalThisPolicy>, &m23_setterinfo },
2374
  { "m24", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m24_getterinfo, GenericSetter<NormalThisPolicy>, &m24_setterinfo },
2375
  { "m31", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m31_getterinfo, GenericSetter<NormalThisPolicy>, &m31_setterinfo },
2376
  { "m32", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m32_getterinfo, GenericSetter<NormalThisPolicy>, &m32_setterinfo },
2377
  { "m33", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m33_getterinfo, GenericSetter<NormalThisPolicy>, &m33_setterinfo },
2378
  { "m34", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m34_getterinfo, GenericSetter<NormalThisPolicy>, &m34_setterinfo },
2379
  { "m41", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m41_getterinfo, GenericSetter<NormalThisPolicy>, &m41_setterinfo },
2380
  { "m42", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m42_getterinfo, GenericSetter<NormalThisPolicy>, &m42_setterinfo },
2381
  { "m43", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m43_getterinfo, GenericSetter<NormalThisPolicy>, &m43_setterinfo },
2382
  { "m44", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m44_getterinfo, GenericSetter<NormalThisPolicy>, &m44_setterinfo },
2383
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
2384
};
2385
#if defined(__clang__)
2386
#pragma clang diagnostic pop
2387
#endif
2388
2389
2390
static const Prefable<const JSPropertySpec> sAttributes[] = {
2391
  { nullptr, &sAttributes_specs[0] },
2392
  { nullptr, nullptr }
2393
};
2394
2395
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
2396
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
2397
static_assert(22 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
2398
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
2399
2400
2401
static uint16_t sNativeProperties_sortedPropertyIndices[35];
2402
static PropertyInfo sNativeProperties_propertyInfos[35];
2403
2404
static const NativePropertiesN<2> sNativeProperties = {
2405
  false, 0,
2406
  false, 0,
2407
  true,  0 /* sMethods */,
2408
  true,  1 /* sAttributes */,
2409
  false, 0,
2410
  false, 0,
2411
  false, 0,
2412
  -1,
2413
  35,
2414
  sNativeProperties_sortedPropertyIndices,
2415
  {
2416
    { sMethods, &sNativeProperties_propertyInfos[0] },
2417
    { sAttributes, &sNativeProperties_propertyInfos[13] }
2418
  }
2419
};
2420
static_assert(35 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
2421
    "We have a property info count that is oversized");
2422
2423
static bool
2424
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
2425
0
{
2426
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrix constructor", DOM, cx);
2427
0
2428
0
  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
2429
0
  JS::Rooted<JSObject*> obj(cx, &args.callee());
2430
0
  if (!args.isConstructing()) {
2431
0
    // XXXbz wish I could get the name from the callee instead of
2432
0
    // Adding more relocations
2433
0
    return ThrowConstructorWithoutNew(cx, "DOMMatrix");
2434
0
  }
2435
0
2436
0
  JS::Rooted<JSObject*> desiredProto(cx);
2437
0
  if (!GetDesiredProto(cx, args, &desiredProto)) {
2438
0
    return false;
2439
0
  }
2440
0
2441
0
  unsigned argcount = std::min(args.length(), 1u);
2442
0
  switch (argcount) {
2443
0
    case 0: {
2444
0
      GlobalObject global(cx, obj);
2445
0
      if (global.Failed()) {
2446
0
        return false;
2447
0
      }
2448
0
2449
0
      bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2450
0
      Maybe<JSAutoRealm> ar;
2451
0
      if (objIsXray) {
2452
0
        obj = js::CheckedUnwrap(obj);
2453
0
        if (!obj) {
2454
0
          return false;
2455
0
        }
2456
0
        ar.emplace(cx, obj);
2457
0
        if (!JS_WrapObject(cx, &desiredProto)) {
2458
0
          return false;
2459
0
        }
2460
0
      }
2461
0
      FastErrorResult rv;
2462
0
      auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(mozilla::dom::DOMMatrix::Constructor(global, rv)));
2463
0
      if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2464
0
        return false;
2465
0
      }
2466
0
      MOZ_ASSERT(!JS_IsExceptionPending(cx));
2467
0
      static_assert(!IsPointer<decltype(result)>::value,
2468
0
                    "NewObject implies that we need to keep the object alive with a strong reference.");
2469
0
      if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
2470
0
        MOZ_ASSERT(JS_IsExceptionPending(cx));
2471
0
        return false;
2472
0
      }
2473
0
      return true;
2474
0
      break;
2475
0
    }
2476
0
    case 1: {
2477
0
      if (args[0].isObject()) {
2478
0
        do {
2479
0
          NonNull<mozilla::dom::DOMMatrixReadOnly> arg0;
2480
0
          {
2481
0
            nsresult rv = UnwrapObject<prototypes::id::DOMMatrixReadOnly, mozilla::dom::DOMMatrixReadOnly>(args[0], arg0);
2482
0
            if (NS_FAILED(rv)) {
2483
0
              break;
2484
0
            }
2485
0
          }
2486
0
          GlobalObject global(cx, obj);
2487
0
          if (global.Failed()) {
2488
0
            return false;
2489
0
          }
2490
0
2491
0
          bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2492
0
          Maybe<JSAutoRealm> ar;
2493
0
          if (objIsXray) {
2494
0
            obj = js::CheckedUnwrap(obj);
2495
0
            if (!obj) {
2496
0
              return false;
2497
0
            }
2498
0
            ar.emplace(cx, obj);
2499
0
            if (!JS_WrapObject(cx, &desiredProto)) {
2500
0
              return false;
2501
0
            }
2502
0
          }
2503
0
          FastErrorResult rv;
2504
0
          auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(mozilla::dom::DOMMatrix::Constructor(global, MOZ_KnownLive(NonNullHelper(arg0)), rv)));
2505
0
          if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2506
0
            return false;
2507
0
          }
2508
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
2509
0
          static_assert(!IsPointer<decltype(result)>::value,
2510
0
                        "NewObject implies that we need to keep the object alive with a strong reference.");
2511
0
          if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
2512
0
            MOZ_ASSERT(JS_IsExceptionPending(cx));
2513
0
            return false;
2514
0
          }
2515
0
          return true;
2516
0
        } while (false);
2517
0
        do {
2518
0
          RootedSpiderMonkeyInterface<Float32Array> arg0(cx);
2519
0
          if (!arg0.Init(&args[0].toObject())) {
2520
0
            break;
2521
0
          }
2522
0
          GlobalObject global(cx, obj);
2523
0
          if (global.Failed()) {
2524
0
            return false;
2525
0
          }
2526
0
2527
0
          bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2528
0
          Maybe<JSAutoRealm> ar;
2529
0
          if (objIsXray) {
2530
0
            obj = js::CheckedUnwrap(obj);
2531
0
            if (!obj) {
2532
0
              return false;
2533
0
            }
2534
0
            ar.emplace(cx, obj);
2535
0
            if (!JS_WrapObject(cx, &desiredProto)) {
2536
0
              return false;
2537
0
            }
2538
0
            if (!arg0.WrapIntoNewCompartment(cx)) {
2539
0
              return false;
2540
0
            }
2541
0
          }
2542
0
          FastErrorResult rv;
2543
0
          auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(mozilla::dom::DOMMatrix::Constructor(global, Constify(arg0), rv)));
2544
0
          if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2545
0
            return false;
2546
0
          }
2547
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
2548
0
          static_assert(!IsPointer<decltype(result)>::value,
2549
0
                        "NewObject implies that we need to keep the object alive with a strong reference.");
2550
0
          if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
2551
0
            MOZ_ASSERT(JS_IsExceptionPending(cx));
2552
0
            return false;
2553
0
          }
2554
0
          return true;
2555
0
        } while (false);
2556
0
        do {
2557
0
          RootedSpiderMonkeyInterface<Float64Array> arg0(cx);
2558
0
          if (!arg0.Init(&args[0].toObject())) {
2559
0
            break;
2560
0
          }
2561
0
          GlobalObject global(cx, obj);
2562
0
          if (global.Failed()) {
2563
0
            return false;
2564
0
          }
2565
0
2566
0
          bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2567
0
          Maybe<JSAutoRealm> ar;
2568
0
          if (objIsXray) {
2569
0
            obj = js::CheckedUnwrap(obj);
2570
0
            if (!obj) {
2571
0
              return false;
2572
0
            }
2573
0
            ar.emplace(cx, obj);
2574
0
            if (!JS_WrapObject(cx, &desiredProto)) {
2575
0
              return false;
2576
0
            }
2577
0
            if (!arg0.WrapIntoNewCompartment(cx)) {
2578
0
              return false;
2579
0
            }
2580
0
          }
2581
0
          FastErrorResult rv;
2582
0
          auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(mozilla::dom::DOMMatrix::Constructor(global, Constify(arg0), rv)));
2583
0
          if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2584
0
            return false;
2585
0
          }
2586
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
2587
0
          static_assert(!IsPointer<decltype(result)>::value,
2588
0
                        "NewObject implies that we need to keep the object alive with a strong reference.");
2589
0
          if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
2590
0
            MOZ_ASSERT(JS_IsExceptionPending(cx));
2591
0
            return false;
2592
0
          }
2593
0
          return true;
2594
0
        } while (false);
2595
0
        do {
2596
0
          binding_detail::AutoSequence<double> arg0;
2597
0
          JS::ForOfIterator iter(cx);
2598
0
          if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
2599
0
            return false;
2600
0
          }
2601
0
          if (!iter.valueIsIterable()) {
2602
0
            break;
2603
0
          }
2604
0
          binding_detail::AutoSequence<double> &arr = arg0;
2605
0
          JS::Rooted<JS::Value> temp(cx);
2606
0
          while (true) {
2607
0
            bool done;
2608
0
            if (!iter.next(&temp, &done)) {
2609
0
              return false;
2610
0
            }
2611
0
            if (done) {
2612
0
              break;
2613
0
            }
2614
0
            double* slotPtr = arr.AppendElement(mozilla::fallible);
2615
0
            if (!slotPtr) {
2616
0
              JS_ReportOutOfMemory(cx);
2617
0
              return false;
2618
0
            }
2619
0
            double& slot = *slotPtr;
2620
0
            if (!ValueToPrimitive<double, eDefault>(cx, temp, &slot)) {
2621
0
              return false;
2622
0
            }
2623
0
          }
2624
0
          GlobalObject global(cx, obj);
2625
0
          if (global.Failed()) {
2626
0
            return false;
2627
0
          }
2628
0
2629
0
          bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2630
0
          Maybe<JSAutoRealm> ar;
2631
0
          if (objIsXray) {
2632
0
            obj = js::CheckedUnwrap(obj);
2633
0
            if (!obj) {
2634
0
              return false;
2635
0
            }
2636
0
            ar.emplace(cx, obj);
2637
0
            if (!JS_WrapObject(cx, &desiredProto)) {
2638
0
              return false;
2639
0
            }
2640
0
          }
2641
0
          FastErrorResult rv;
2642
0
          auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(mozilla::dom::DOMMatrix::Constructor(global, Constify(arg0), rv)));
2643
0
          if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2644
0
            return false;
2645
0
          }
2646
0
          MOZ_ASSERT(!JS_IsExceptionPending(cx));
2647
0
          static_assert(!IsPointer<decltype(result)>::value,
2648
0
                        "NewObject implies that we need to keep the object alive with a strong reference.");
2649
0
          if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
2650
0
            MOZ_ASSERT(JS_IsExceptionPending(cx));
2651
0
            return false;
2652
0
          }
2653
0
          return true;
2654
0
        } while (false);
2655
0
      }
2656
0
      GlobalObject global(cx, obj);
2657
0
      if (global.Failed()) {
2658
0
        return false;
2659
0
      }
2660
0
2661
0
      bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2662
0
      binding_detail::FakeString arg0;
2663
0
      if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
2664
0
        return false;
2665
0
      }
2666
0
      Maybe<JSAutoRealm> ar;
2667
0
      if (objIsXray) {
2668
0
        obj = js::CheckedUnwrap(obj);
2669
0
        if (!obj) {
2670
0
          return false;
2671
0
        }
2672
0
        ar.emplace(cx, obj);
2673
0
        if (!JS_WrapObject(cx, &desiredProto)) {
2674
0
          return false;
2675
0
        }
2676
0
      }
2677
0
      FastErrorResult rv;
2678
0
      auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(mozilla::dom::DOMMatrix::Constructor(global, NonNullHelper(Constify(arg0)), rv)));
2679
0
      if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
2680
0
        return false;
2681
0
      }
2682
0
      MOZ_ASSERT(!JS_IsExceptionPending(cx));
2683
0
      static_assert(!IsPointer<decltype(result)>::value,
2684
0
                    "NewObject implies that we need to keep the object alive with a strong reference.");
2685
0
      if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
2686
0
        MOZ_ASSERT(JS_IsExceptionPending(cx));
2687
0
        return false;
2688
0
      }
2689
0
      return true;
2690
0
      break;
2691
0
    }
2692
0
    default: {
2693
0
      return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrix");
2694
0
      break;
2695
0
    }
2696
0
  }
2697
0
  MOZ_CRASH("We have an always-returning default case");
2698
0
  return false;
2699
0
}
2700
2701
static const js::ClassOps sInterfaceObjectClassOps = {
2702
    nullptr,               /* addProperty */
2703
    nullptr,               /* delProperty */
2704
    nullptr,               /* enumerate */
2705
    nullptr,               /* newEnumerate */
2706
    nullptr,               /* resolve */
2707
    nullptr,               /* mayResolve */
2708
    nullptr,               /* finalize */
2709
    _constructor, /* call */
2710
    nullptr,               /* hasInstance */
2711
    _constructor, /* construct */
2712
    nullptr,               /* trace */
2713
};
2714
2715
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
2716
  {
2717
    "Function",
2718
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
2719
    &sInterfaceObjectClassOps,
2720
    JS_NULL_CLASS_SPEC,
2721
    JS_NULL_CLASS_EXT,
2722
    &sInterfaceObjectClassObjectOps
2723
  },
2724
  eInterface,
2725
  true,
2726
  prototypes::id::DOMMatrix,
2727
  PrototypeTraits<prototypes::id::DOMMatrix>::Depth,
2728
  sNativePropertyHooks,
2729
  "function DOMMatrix() {\n    [native code]\n}",
2730
  DOMMatrixReadOnly_Binding::GetConstructorObject
2731
};
2732
2733
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
2734
  {
2735
    "DOMMatrixPrototype",
2736
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
2737
    JS_NULL_CLASS_OPS,
2738
    JS_NULL_CLASS_SPEC,
2739
    JS_NULL_CLASS_EXT,
2740
    JS_NULL_OBJECT_OPS
2741
  },
2742
  eInterfacePrototype,
2743
  false,
2744
  prototypes::id::DOMMatrix,
2745
  PrototypeTraits<prototypes::id::DOMMatrix>::Depth,
2746
  sNativePropertyHooks,
2747
  "[object DOMMatrixPrototype]",
2748
  DOMMatrixReadOnly_Binding::GetProtoObject
2749
};
2750
2751
bool
2752
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj)
2753
0
{
2754
0
  static bool sPrefValue;
2755
0
  static bool sPrefCacheSetUp = false;
2756
0
  if (!sPrefCacheSetUp) {
2757
0
    sPrefCacheSetUp = true;
2758
0
    Preferences::AddBoolVarCache(&sPrefValue, "layout.css.DOMMatrix.enabled");
2759
0
  }
2760
0
2761
0
  return sPrefValue;
2762
0
}
2763
2764
static const js::ClassOps sClassOps = {
2765
  _addProperty, /* addProperty */
2766
  nullptr,               /* delProperty */
2767
  nullptr,               /* enumerate */
2768
  nullptr, /* newEnumerate */
2769
  nullptr, /* resolve */
2770
  nullptr, /* mayResolve */
2771
  _finalize, /* finalize */
2772
  nullptr, /* call */
2773
  nullptr,               /* hasInstance */
2774
  nullptr,               /* construct */
2775
  nullptr, /* trace */
2776
};
2777
2778
static const js::ClassExtension sClassExtension = {
2779
  nullptr, /* weakmapKeyDelegateOp */
2780
  _objectMoved /* objectMovedOp */
2781
};
2782
2783
static const DOMJSClass sClass = {
2784
  { "DOMMatrix",
2785
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
2786
    &sClassOps,
2787
    JS_NULL_CLASS_SPEC,
2788
    &sClassExtension,
2789
    JS_NULL_OBJECT_OPS
2790
  },
2791
  { prototypes::id::DOMMatrixReadOnly, prototypes::id::DOMMatrix, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
2792
  IsBaseOf<nsISupports, mozilla::dom::DOMMatrix >::value,
2793
  sNativePropertyHooks,
2794
  FindAssociatedGlobalForNative<mozilla::dom::DOMMatrix>::Get,
2795
  GetProtoObjectHandle,
2796
  GetCCParticipant<mozilla::dom::DOMMatrix>::Get()
2797
};
2798
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
2799
              "Must have the right minimal number of reserved slots.");
2800
static_assert(1 >= 1,
2801
              "Must have enough reserved slots.");
2802
2803
const JSClass*
2804
GetJSClass()
2805
0
{
2806
0
  return sClass.ToJSClass();
2807
0
}
2808
2809
bool
2810
Wrap(JSContext* aCx, mozilla::dom::DOMMatrix* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
2811
0
{
2812
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::DOMMatrix>::value,
2813
0
                "Shouldn't have wrappercached things that are not refcounted.");
2814
0
  MOZ_ASSERT(static_cast<mozilla::dom::DOMMatrix*>(aObject) ==
2815
0
             reinterpret_cast<mozilla::dom::DOMMatrix*>(aObject),
2816
0
             "Multiple inheritance for mozilla::dom::DOMMatrix is broken.");
2817
0
  MOZ_ASSERT(static_cast<mozilla::dom::DOMMatrixReadOnly*>(aObject) ==
2818
0
             reinterpret_cast<mozilla::dom::DOMMatrixReadOnly*>(aObject),
2819
0
             "Multiple inheritance for mozilla::dom::DOMMatrixReadOnly is broken.");
2820
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
2821
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
2822
0
  MOZ_ASSERT(!aCache->GetWrapper(),
2823
0
             "You should probably not be using Wrap() directly; use "
2824
0
             "GetOrCreateDOMReflector instead");
2825
0
2826
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
2827
0
             "nsISupports must be on our primary inheritance chain");
2828
0
2829
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
2830
0
  if (!global) {
2831
0
    return false;
2832
0
  }
2833
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
2834
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
2835
0
2836
0
  // That might have ended up wrapping us already, due to the wonders
2837
0
  // of XBL.  Check for that, and bail out as needed.
2838
0
  aReflector.set(aCache->GetWrapper());
2839
0
  if (aReflector) {
2840
#ifdef DEBUG
2841
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
2842
#endif // DEBUG
2843
    return true;
2844
0
  }
2845
0
2846
0
  JSAutoRealm ar(aCx, global);
2847
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
2848
0
  if (!canonicalProto) {
2849
0
    return false;
2850
0
  }
2851
0
  JS::Rooted<JSObject*> proto(aCx);
2852
0
  if (aGivenProto) {
2853
0
    proto = aGivenProto;
2854
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
2855
0
    // coming in, we changed compartments to that of "parent" so may need
2856
0
    // to wrap the proto here.
2857
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
2858
0
      if (!JS_WrapObject(aCx, &proto)) {
2859
0
        return false;
2860
0
      }
2861
0
    }
2862
0
  } else {
2863
0
    proto = canonicalProto;
2864
0
  }
2865
0
2866
0
  BindingJSObjectCreator<mozilla::dom::DOMMatrix> creator(aCx);
2867
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
2868
0
  if (!aReflector) {
2869
0
    return false;
2870
0
  }
2871
0
2872
0
  aCache->SetWrapper(aReflector);
2873
0
  creator.InitializationSucceeded();
2874
0
2875
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
2876
0
             aCache->GetWrapperPreserveColor() == aReflector);
2877
0
  // If proto != canonicalProto, we have to preserve our wrapper;
2878
0
  // otherwise we won't be able to properly recreate it later, since
2879
0
  // we won't know what proto to use.  Note that we don't check
2880
0
  // aGivenProto here, since it's entirely possible (and even
2881
0
  // somewhat common) to have a non-null aGivenProto which is the
2882
0
  // same as canonicalProto.
2883
0
  if (proto != canonicalProto) {
2884
0
    PreserveWrapper(aObject);
2885
0
  }
2886
0
2887
0
  return true;
2888
0
}
2889
2890
const NativePropertyHooks sNativePropertyHooks[] = { {
2891
  nullptr,
2892
  nullptr,
2893
  nullptr,
2894
  { sNativeProperties.Upcast(), nullptr },
2895
  prototypes::id::DOMMatrix,
2896
  constructors::id::DOMMatrix,
2897
  DOMMatrixReadOnly_Binding::sNativePropertyHooks,
2898
  &DefaultXrayExpandoObjectClass
2899
} };
2900
2901
void
2902
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
2903
0
{
2904
0
  JS::Handle<JSObject*> parentProto(DOMMatrixReadOnly_Binding::GetProtoObjectHandle(aCx));
2905
0
  if (!parentProto) {
2906
0
    return;
2907
0
  }
2908
0
2909
0
  JS::Handle<JSObject*> constructorProto(DOMMatrixReadOnly_Binding::GetConstructorObjectHandle(aCx));
2910
0
  if (!constructorProto) {
2911
0
    return;
2912
0
  }
2913
0
2914
0
  static bool sIdsInited = false;
2915
0
  if (!sIdsInited && NS_IsMainThread()) {
2916
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
2917
0
      return;
2918
0
    }
2919
0
    sIdsInited = true;
2920
0
  }
2921
0
2922
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::DOMMatrix);
2923
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::DOMMatrix);
2924
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
2925
0
                              &sPrototypeClass.mBase, protoCache,
2926
0
                              nullptr,
2927
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
2928
0
                              interfaceCache,
2929
0
                              sNativeProperties.Upcast(),
2930
0
                              nullptr,
2931
0
                              "DOMMatrix", aDefineOnGlobal,
2932
0
                              nullptr,
2933
0
                              false);
2934
0
}
2935
2936
JSObject*
2937
GetProtoObject(JSContext* aCx)
2938
0
{
2939
0
  return GetProtoObjectHandle(aCx);
2940
0
}
2941
2942
JSObject*
2943
GetConstructorObject(JSContext* aCx)
2944
0
{
2945
0
  return GetConstructorObjectHandle(aCx);
2946
0
}
2947
2948
} // namespace DOMMatrix_Binding
2949
2950
2951
2952
namespace DOMMatrixReadOnly_Binding {
2953
2954
MOZ_CAN_RUN_SCRIPT static bool
2955
get_a(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
2956
0
{
2957
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.a", DOM, cx);
2958
0
2959
0
  double result(self->A());
2960
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2961
0
  args.rval().set(JS_NumberValue(double(result)));
2962
0
  return true;
2963
0
}
2964
2965
static const JSJitInfo a_getterinfo = {
2966
  { (JSJitGetterOp)get_a },
2967
  { prototypes::id::DOMMatrixReadOnly },
2968
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
2969
  JSJitInfo::Getter,
2970
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
2971
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
2972
  true,  /* isInfallible. False in setters. */
2973
  false,  /* isMovable.  Not relevant for setters. */
2974
  false, /* isEliminatable.  Not relevant for setters. */
2975
  false, /* isAlwaysInSlot.  Only relevant for getters. */
2976
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
2977
  false,  /* isTypedMethod.  Only relevant for methods. */
2978
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
2979
};
2980
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
2981
static_assert(0 < 1, "There is no slot for us");
2982
2983
MOZ_CAN_RUN_SCRIPT static bool
2984
get_b(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
2985
0
{
2986
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.b", DOM, cx);
2987
0
2988
0
  double result(self->B());
2989
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
2990
0
  args.rval().set(JS_NumberValue(double(result)));
2991
0
  return true;
2992
0
}
2993
2994
static const JSJitInfo b_getterinfo = {
2995
  { (JSJitGetterOp)get_b },
2996
  { prototypes::id::DOMMatrixReadOnly },
2997
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
2998
  JSJitInfo::Getter,
2999
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3000
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3001
  true,  /* isInfallible. False in setters. */
3002
  false,  /* isMovable.  Not relevant for setters. */
3003
  false, /* isEliminatable.  Not relevant for setters. */
3004
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3005
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3006
  false,  /* isTypedMethod.  Only relevant for methods. */
3007
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3008
};
3009
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3010
static_assert(0 < 1, "There is no slot for us");
3011
3012
MOZ_CAN_RUN_SCRIPT static bool
3013
get_c(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3014
0
{
3015
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.c", DOM, cx);
3016
0
3017
0
  double result(self->C());
3018
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3019
0
  args.rval().set(JS_NumberValue(double(result)));
3020
0
  return true;
3021
0
}
3022
3023
static const JSJitInfo c_getterinfo = {
3024
  { (JSJitGetterOp)get_c },
3025
  { prototypes::id::DOMMatrixReadOnly },
3026
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3027
  JSJitInfo::Getter,
3028
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3029
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3030
  true,  /* isInfallible. False in setters. */
3031
  false,  /* isMovable.  Not relevant for setters. */
3032
  false, /* isEliminatable.  Not relevant for setters. */
3033
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3034
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3035
  false,  /* isTypedMethod.  Only relevant for methods. */
3036
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3037
};
3038
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3039
static_assert(0 < 1, "There is no slot for us");
3040
3041
MOZ_CAN_RUN_SCRIPT static bool
3042
get_d(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3043
0
{
3044
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.d", DOM, cx);
3045
0
3046
0
  double result(self->D());
3047
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3048
0
  args.rval().set(JS_NumberValue(double(result)));
3049
0
  return true;
3050
0
}
3051
3052
static const JSJitInfo d_getterinfo = {
3053
  { (JSJitGetterOp)get_d },
3054
  { prototypes::id::DOMMatrixReadOnly },
3055
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3056
  JSJitInfo::Getter,
3057
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3058
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3059
  true,  /* isInfallible. False in setters. */
3060
  false,  /* isMovable.  Not relevant for setters. */
3061
  false, /* isEliminatable.  Not relevant for setters. */
3062
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3063
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3064
  false,  /* isTypedMethod.  Only relevant for methods. */
3065
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3066
};
3067
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3068
static_assert(0 < 1, "There is no slot for us");
3069
3070
MOZ_CAN_RUN_SCRIPT static bool
3071
get_e(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3072
0
{
3073
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.e", DOM, cx);
3074
0
3075
0
  double result(self->E());
3076
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3077
0
  args.rval().set(JS_NumberValue(double(result)));
3078
0
  return true;
3079
0
}
3080
3081
static const JSJitInfo e_getterinfo = {
3082
  { (JSJitGetterOp)get_e },
3083
  { prototypes::id::DOMMatrixReadOnly },
3084
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3085
  JSJitInfo::Getter,
3086
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3087
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3088
  true,  /* isInfallible. False in setters. */
3089
  false,  /* isMovable.  Not relevant for setters. */
3090
  false, /* isEliminatable.  Not relevant for setters. */
3091
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3092
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3093
  false,  /* isTypedMethod.  Only relevant for methods. */
3094
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3095
};
3096
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3097
static_assert(0 < 1, "There is no slot for us");
3098
3099
MOZ_CAN_RUN_SCRIPT static bool
3100
get_f(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3101
0
{
3102
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.f", DOM, cx);
3103
0
3104
0
  double result(self->F());
3105
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3106
0
  args.rval().set(JS_NumberValue(double(result)));
3107
0
  return true;
3108
0
}
3109
3110
static const JSJitInfo f_getterinfo = {
3111
  { (JSJitGetterOp)get_f },
3112
  { prototypes::id::DOMMatrixReadOnly },
3113
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3114
  JSJitInfo::Getter,
3115
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3116
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3117
  true,  /* isInfallible. False in setters. */
3118
  false,  /* isMovable.  Not relevant for setters. */
3119
  false, /* isEliminatable.  Not relevant for setters. */
3120
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3121
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3122
  false,  /* isTypedMethod.  Only relevant for methods. */
3123
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3124
};
3125
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3126
static_assert(0 < 1, "There is no slot for us");
3127
3128
MOZ_CAN_RUN_SCRIPT static bool
3129
get_m11(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3130
0
{
3131
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m11", DOM, cx);
3132
0
3133
0
  double result(self->M11());
3134
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3135
0
  args.rval().set(JS_NumberValue(double(result)));
3136
0
  return true;
3137
0
}
3138
3139
static const JSJitInfo m11_getterinfo = {
3140
  { (JSJitGetterOp)get_m11 },
3141
  { prototypes::id::DOMMatrixReadOnly },
3142
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3143
  JSJitInfo::Getter,
3144
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3145
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3146
  true,  /* isInfallible. False in setters. */
3147
  false,  /* isMovable.  Not relevant for setters. */
3148
  false, /* isEliminatable.  Not relevant for setters. */
3149
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3150
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3151
  false,  /* isTypedMethod.  Only relevant for methods. */
3152
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3153
};
3154
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3155
static_assert(0 < 1, "There is no slot for us");
3156
3157
MOZ_CAN_RUN_SCRIPT static bool
3158
get_m12(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3159
0
{
3160
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m12", DOM, cx);
3161
0
3162
0
  double result(self->M12());
3163
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3164
0
  args.rval().set(JS_NumberValue(double(result)));
3165
0
  return true;
3166
0
}
3167
3168
static const JSJitInfo m12_getterinfo = {
3169
  { (JSJitGetterOp)get_m12 },
3170
  { prototypes::id::DOMMatrixReadOnly },
3171
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3172
  JSJitInfo::Getter,
3173
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3174
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3175
  true,  /* isInfallible. False in setters. */
3176
  false,  /* isMovable.  Not relevant for setters. */
3177
  false, /* isEliminatable.  Not relevant for setters. */
3178
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3179
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3180
  false,  /* isTypedMethod.  Only relevant for methods. */
3181
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3182
};
3183
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3184
static_assert(0 < 1, "There is no slot for us");
3185
3186
MOZ_CAN_RUN_SCRIPT static bool
3187
get_m13(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3188
0
{
3189
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m13", DOM, cx);
3190
0
3191
0
  double result(self->M13());
3192
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3193
0
  args.rval().set(JS_NumberValue(double(result)));
3194
0
  return true;
3195
0
}
3196
3197
static const JSJitInfo m13_getterinfo = {
3198
  { (JSJitGetterOp)get_m13 },
3199
  { prototypes::id::DOMMatrixReadOnly },
3200
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3201
  JSJitInfo::Getter,
3202
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3203
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3204
  true,  /* isInfallible. False in setters. */
3205
  false,  /* isMovable.  Not relevant for setters. */
3206
  false, /* isEliminatable.  Not relevant for setters. */
3207
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3208
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3209
  false,  /* isTypedMethod.  Only relevant for methods. */
3210
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3211
};
3212
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3213
static_assert(0 < 1, "There is no slot for us");
3214
3215
MOZ_CAN_RUN_SCRIPT static bool
3216
get_m14(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3217
0
{
3218
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m14", DOM, cx);
3219
0
3220
0
  double result(self->M14());
3221
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3222
0
  args.rval().set(JS_NumberValue(double(result)));
3223
0
  return true;
3224
0
}
3225
3226
static const JSJitInfo m14_getterinfo = {
3227
  { (JSJitGetterOp)get_m14 },
3228
  { prototypes::id::DOMMatrixReadOnly },
3229
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3230
  JSJitInfo::Getter,
3231
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3232
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3233
  true,  /* isInfallible. False in setters. */
3234
  false,  /* isMovable.  Not relevant for setters. */
3235
  false, /* isEliminatable.  Not relevant for setters. */
3236
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3237
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3238
  false,  /* isTypedMethod.  Only relevant for methods. */
3239
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3240
};
3241
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3242
static_assert(0 < 1, "There is no slot for us");
3243
3244
MOZ_CAN_RUN_SCRIPT static bool
3245
get_m21(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3246
0
{
3247
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m21", DOM, cx);
3248
0
3249
0
  double result(self->M21());
3250
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3251
0
  args.rval().set(JS_NumberValue(double(result)));
3252
0
  return true;
3253
0
}
3254
3255
static const JSJitInfo m21_getterinfo = {
3256
  { (JSJitGetterOp)get_m21 },
3257
  { prototypes::id::DOMMatrixReadOnly },
3258
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3259
  JSJitInfo::Getter,
3260
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3261
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3262
  true,  /* isInfallible. False in setters. */
3263
  false,  /* isMovable.  Not relevant for setters. */
3264
  false, /* isEliminatable.  Not relevant for setters. */
3265
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3266
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3267
  false,  /* isTypedMethod.  Only relevant for methods. */
3268
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3269
};
3270
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3271
static_assert(0 < 1, "There is no slot for us");
3272
3273
MOZ_CAN_RUN_SCRIPT static bool
3274
get_m22(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3275
0
{
3276
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m22", DOM, cx);
3277
0
3278
0
  double result(self->M22());
3279
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3280
0
  args.rval().set(JS_NumberValue(double(result)));
3281
0
  return true;
3282
0
}
3283
3284
static const JSJitInfo m22_getterinfo = {
3285
  { (JSJitGetterOp)get_m22 },
3286
  { prototypes::id::DOMMatrixReadOnly },
3287
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3288
  JSJitInfo::Getter,
3289
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3290
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3291
  true,  /* isInfallible. False in setters. */
3292
  false,  /* isMovable.  Not relevant for setters. */
3293
  false, /* isEliminatable.  Not relevant for setters. */
3294
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3295
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3296
  false,  /* isTypedMethod.  Only relevant for methods. */
3297
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3298
};
3299
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3300
static_assert(0 < 1, "There is no slot for us");
3301
3302
MOZ_CAN_RUN_SCRIPT static bool
3303
get_m23(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3304
0
{
3305
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m23", DOM, cx);
3306
0
3307
0
  double result(self->M23());
3308
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3309
0
  args.rval().set(JS_NumberValue(double(result)));
3310
0
  return true;
3311
0
}
3312
3313
static const JSJitInfo m23_getterinfo = {
3314
  { (JSJitGetterOp)get_m23 },
3315
  { prototypes::id::DOMMatrixReadOnly },
3316
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3317
  JSJitInfo::Getter,
3318
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3319
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3320
  true,  /* isInfallible. False in setters. */
3321
  false,  /* isMovable.  Not relevant for setters. */
3322
  false, /* isEliminatable.  Not relevant for setters. */
3323
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3324
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3325
  false,  /* isTypedMethod.  Only relevant for methods. */
3326
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3327
};
3328
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3329
static_assert(0 < 1, "There is no slot for us");
3330
3331
MOZ_CAN_RUN_SCRIPT static bool
3332
get_m24(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3333
0
{
3334
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m24", DOM, cx);
3335
0
3336
0
  double result(self->M24());
3337
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3338
0
  args.rval().set(JS_NumberValue(double(result)));
3339
0
  return true;
3340
0
}
3341
3342
static const JSJitInfo m24_getterinfo = {
3343
  { (JSJitGetterOp)get_m24 },
3344
  { prototypes::id::DOMMatrixReadOnly },
3345
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3346
  JSJitInfo::Getter,
3347
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3348
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3349
  true,  /* isInfallible. False in setters. */
3350
  false,  /* isMovable.  Not relevant for setters. */
3351
  false, /* isEliminatable.  Not relevant for setters. */
3352
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3353
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3354
  false,  /* isTypedMethod.  Only relevant for methods. */
3355
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3356
};
3357
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3358
static_assert(0 < 1, "There is no slot for us");
3359
3360
MOZ_CAN_RUN_SCRIPT static bool
3361
get_m31(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3362
0
{
3363
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m31", DOM, cx);
3364
0
3365
0
  double result(self->M31());
3366
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3367
0
  args.rval().set(JS_NumberValue(double(result)));
3368
0
  return true;
3369
0
}
3370
3371
static const JSJitInfo m31_getterinfo = {
3372
  { (JSJitGetterOp)get_m31 },
3373
  { prototypes::id::DOMMatrixReadOnly },
3374
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3375
  JSJitInfo::Getter,
3376
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3377
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3378
  true,  /* isInfallible. False in setters. */
3379
  false,  /* isMovable.  Not relevant for setters. */
3380
  false, /* isEliminatable.  Not relevant for setters. */
3381
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3382
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3383
  false,  /* isTypedMethod.  Only relevant for methods. */
3384
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3385
};
3386
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3387
static_assert(0 < 1, "There is no slot for us");
3388
3389
MOZ_CAN_RUN_SCRIPT static bool
3390
get_m32(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3391
0
{
3392
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m32", DOM, cx);
3393
0
3394
0
  double result(self->M32());
3395
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3396
0
  args.rval().set(JS_NumberValue(double(result)));
3397
0
  return true;
3398
0
}
3399
3400
static const JSJitInfo m32_getterinfo = {
3401
  { (JSJitGetterOp)get_m32 },
3402
  { prototypes::id::DOMMatrixReadOnly },
3403
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3404
  JSJitInfo::Getter,
3405
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3406
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3407
  true,  /* isInfallible. False in setters. */
3408
  false,  /* isMovable.  Not relevant for setters. */
3409
  false, /* isEliminatable.  Not relevant for setters. */
3410
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3411
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3412
  false,  /* isTypedMethod.  Only relevant for methods. */
3413
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3414
};
3415
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3416
static_assert(0 < 1, "There is no slot for us");
3417
3418
MOZ_CAN_RUN_SCRIPT static bool
3419
get_m33(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3420
0
{
3421
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m33", DOM, cx);
3422
0
3423
0
  double result(self->M33());
3424
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3425
0
  args.rval().set(JS_NumberValue(double(result)));
3426
0
  return true;
3427
0
}
3428
3429
static const JSJitInfo m33_getterinfo = {
3430
  { (JSJitGetterOp)get_m33 },
3431
  { prototypes::id::DOMMatrixReadOnly },
3432
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3433
  JSJitInfo::Getter,
3434
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3435
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3436
  true,  /* isInfallible. False in setters. */
3437
  false,  /* isMovable.  Not relevant for setters. */
3438
  false, /* isEliminatable.  Not relevant for setters. */
3439
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3440
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3441
  false,  /* isTypedMethod.  Only relevant for methods. */
3442
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3443
};
3444
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3445
static_assert(0 < 1, "There is no slot for us");
3446
3447
MOZ_CAN_RUN_SCRIPT static bool
3448
get_m34(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3449
0
{
3450
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m34", DOM, cx);
3451
0
3452
0
  double result(self->M34());
3453
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3454
0
  args.rval().set(JS_NumberValue(double(result)));
3455
0
  return true;
3456
0
}
3457
3458
static const JSJitInfo m34_getterinfo = {
3459
  { (JSJitGetterOp)get_m34 },
3460
  { prototypes::id::DOMMatrixReadOnly },
3461
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3462
  JSJitInfo::Getter,
3463
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3464
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3465
  true,  /* isInfallible. False in setters. */
3466
  false,  /* isMovable.  Not relevant for setters. */
3467
  false, /* isEliminatable.  Not relevant for setters. */
3468
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3469
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3470
  false,  /* isTypedMethod.  Only relevant for methods. */
3471
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3472
};
3473
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3474
static_assert(0 < 1, "There is no slot for us");
3475
3476
MOZ_CAN_RUN_SCRIPT static bool
3477
get_m41(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3478
0
{
3479
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m41", DOM, cx);
3480
0
3481
0
  double result(self->M41());
3482
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3483
0
  args.rval().set(JS_NumberValue(double(result)));
3484
0
  return true;
3485
0
}
3486
3487
static const JSJitInfo m41_getterinfo = {
3488
  { (JSJitGetterOp)get_m41 },
3489
  { prototypes::id::DOMMatrixReadOnly },
3490
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3491
  JSJitInfo::Getter,
3492
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3493
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3494
  true,  /* isInfallible. False in setters. */
3495
  false,  /* isMovable.  Not relevant for setters. */
3496
  false, /* isEliminatable.  Not relevant for setters. */
3497
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3498
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3499
  false,  /* isTypedMethod.  Only relevant for methods. */
3500
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3501
};
3502
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3503
static_assert(0 < 1, "There is no slot for us");
3504
3505
MOZ_CAN_RUN_SCRIPT static bool
3506
get_m42(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3507
0
{
3508
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m42", DOM, cx);
3509
0
3510
0
  double result(self->M42());
3511
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3512
0
  args.rval().set(JS_NumberValue(double(result)));
3513
0
  return true;
3514
0
}
3515
3516
static const JSJitInfo m42_getterinfo = {
3517
  { (JSJitGetterOp)get_m42 },
3518
  { prototypes::id::DOMMatrixReadOnly },
3519
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3520
  JSJitInfo::Getter,
3521
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3522
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3523
  true,  /* isInfallible. False in setters. */
3524
  false,  /* isMovable.  Not relevant for setters. */
3525
  false, /* isEliminatable.  Not relevant for setters. */
3526
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3527
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3528
  false,  /* isTypedMethod.  Only relevant for methods. */
3529
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3530
};
3531
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3532
static_assert(0 < 1, "There is no slot for us");
3533
3534
MOZ_CAN_RUN_SCRIPT static bool
3535
get_m43(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3536
0
{
3537
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m43", DOM, cx);
3538
0
3539
0
  double result(self->M43());
3540
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3541
0
  args.rval().set(JS_NumberValue(double(result)));
3542
0
  return true;
3543
0
}
3544
3545
static const JSJitInfo m43_getterinfo = {
3546
  { (JSJitGetterOp)get_m43 },
3547
  { prototypes::id::DOMMatrixReadOnly },
3548
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3549
  JSJitInfo::Getter,
3550
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3551
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3552
  true,  /* isInfallible. False in setters. */
3553
  false,  /* isMovable.  Not relevant for setters. */
3554
  false, /* isEliminatable.  Not relevant for setters. */
3555
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3556
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3557
  false,  /* isTypedMethod.  Only relevant for methods. */
3558
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3559
};
3560
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3561
static_assert(0 < 1, "There is no slot for us");
3562
3563
MOZ_CAN_RUN_SCRIPT static bool
3564
get_m44(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
3565
0
{
3566
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.m44", DOM, cx);
3567
0
3568
0
  double result(self->M44());
3569
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3570
0
  args.rval().set(JS_NumberValue(double(result)));
3571
0
  return true;
3572
0
}
3573
3574
static const JSJitInfo m44_getterinfo = {
3575
  { (JSJitGetterOp)get_m44 },
3576
  { prototypes::id::DOMMatrixReadOnly },
3577
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3578
  JSJitInfo::Getter,
3579
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3580
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
3581
  true,  /* isInfallible. False in setters. */
3582
  false,  /* isMovable.  Not relevant for setters. */
3583
  false, /* isEliminatable.  Not relevant for setters. */
3584
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3585
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3586
  false,  /* isTypedMethod.  Only relevant for methods. */
3587
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3588
};
3589
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3590
static_assert(0 < 1, "There is no slot for us");
3591
3592
MOZ_CAN_RUN_SCRIPT static bool
3593
translate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3594
0
{
3595
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.translate", DOM, cx);
3596
0
3597
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
3598
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.translate");
3599
0
  }
3600
0
  double arg0;
3601
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3602
0
    return false;
3603
0
  }
3604
0
  double arg1;
3605
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
3606
0
    return false;
3607
0
  }
3608
0
  double arg2;
3609
0
  if (args.hasDefined(2)) {
3610
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
3611
0
      return false;
3612
0
    }
3613
0
  } else {
3614
0
    arg2 = 0.0;
3615
0
  }
3616
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->Translate(arg0, arg1, arg2)));
3617
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3618
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3619
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3620
0
    return false;
3621
0
  }
3622
0
  return true;
3623
0
}
3624
3625
static const JSJitInfo translate_methodinfo = {
3626
  { (JSJitGetterOp)translate },
3627
  { prototypes::id::DOMMatrixReadOnly },
3628
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3629
  JSJitInfo::Method,
3630
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3631
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3632
  false,  /* isInfallible. False in setters. */
3633
  false,  /* isMovable.  Not relevant for setters. */
3634
  false, /* isEliminatable.  Not relevant for setters. */
3635
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3636
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3637
  false,  /* isTypedMethod.  Only relevant for methods. */
3638
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3639
};
3640
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3641
static_assert(0 < 1, "There is no slot for us");
3642
3643
MOZ_CAN_RUN_SCRIPT static bool
3644
scale(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3645
0
{
3646
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.scale", DOM, cx);
3647
0
3648
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
3649
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.scale");
3650
0
  }
3651
0
  double arg0;
3652
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3653
0
    return false;
3654
0
  }
3655
0
  double arg1;
3656
0
  if (args.hasDefined(1)) {
3657
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
3658
0
      return false;
3659
0
    }
3660
0
  } else {
3661
0
    arg1 = 0.0;
3662
0
  }
3663
0
  double arg2;
3664
0
  if (args.hasDefined(2)) {
3665
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
3666
0
      return false;
3667
0
    }
3668
0
  } else {
3669
0
    arg2 = 0.0;
3670
0
  }
3671
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->Scale(arg0, arg1, arg2)));
3672
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3673
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3674
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3675
0
    return false;
3676
0
  }
3677
0
  return true;
3678
0
}
3679
3680
static const JSJitInfo scale_methodinfo = {
3681
  { (JSJitGetterOp)scale },
3682
  { prototypes::id::DOMMatrixReadOnly },
3683
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3684
  JSJitInfo::Method,
3685
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3686
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3687
  false,  /* isInfallible. False in setters. */
3688
  false,  /* isMovable.  Not relevant for setters. */
3689
  false, /* isEliminatable.  Not relevant for setters. */
3690
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3691
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3692
  false,  /* isTypedMethod.  Only relevant for methods. */
3693
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3694
};
3695
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3696
static_assert(0 < 1, "There is no slot for us");
3697
3698
MOZ_CAN_RUN_SCRIPT static bool
3699
scale3d(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3700
0
{
3701
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.scale3d", DOM, cx);
3702
0
3703
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
3704
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.scale3d");
3705
0
  }
3706
0
  double arg0;
3707
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3708
0
    return false;
3709
0
  }
3710
0
  double arg1;
3711
0
  if (args.hasDefined(1)) {
3712
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
3713
0
      return false;
3714
0
    }
3715
0
  } else {
3716
0
    arg1 = 0.0;
3717
0
  }
3718
0
  double arg2;
3719
0
  if (args.hasDefined(2)) {
3720
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
3721
0
      return false;
3722
0
    }
3723
0
  } else {
3724
0
    arg2 = 0.0;
3725
0
  }
3726
0
  double arg3;
3727
0
  if (args.hasDefined(3)) {
3728
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[3], &arg3)) {
3729
0
      return false;
3730
0
    }
3731
0
  } else {
3732
0
    arg3 = 0.0;
3733
0
  }
3734
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->Scale3d(arg0, arg1, arg2, arg3)));
3735
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3736
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3737
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3738
0
    return false;
3739
0
  }
3740
0
  return true;
3741
0
}
3742
3743
static const JSJitInfo scale3d_methodinfo = {
3744
  { (JSJitGetterOp)scale3d },
3745
  { prototypes::id::DOMMatrixReadOnly },
3746
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3747
  JSJitInfo::Method,
3748
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3749
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3750
  false,  /* isInfallible. False in setters. */
3751
  false,  /* isMovable.  Not relevant for setters. */
3752
  false, /* isEliminatable.  Not relevant for setters. */
3753
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3754
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3755
  false,  /* isTypedMethod.  Only relevant for methods. */
3756
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3757
};
3758
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3759
static_assert(0 < 1, "There is no slot for us");
3760
3761
MOZ_CAN_RUN_SCRIPT static bool
3762
scaleNonUniform(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3763
0
{
3764
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.scaleNonUniform", DOM, cx);
3765
0
3766
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
3767
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.scaleNonUniform");
3768
0
  }
3769
0
  double arg0;
3770
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3771
0
    return false;
3772
0
  }
3773
0
  double arg1;
3774
0
  if (args.hasDefined(1)) {
3775
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
3776
0
      return false;
3777
0
    }
3778
0
  } else {
3779
0
    arg1 = 1.0;
3780
0
  }
3781
0
  double arg2;
3782
0
  if (args.hasDefined(2)) {
3783
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
3784
0
      return false;
3785
0
    }
3786
0
  } else {
3787
0
    arg2 = 1.0;
3788
0
  }
3789
0
  double arg3;
3790
0
  if (args.hasDefined(3)) {
3791
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[3], &arg3)) {
3792
0
      return false;
3793
0
    }
3794
0
  } else {
3795
0
    arg3 = 0.0;
3796
0
  }
3797
0
  double arg4;
3798
0
  if (args.hasDefined(4)) {
3799
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[4], &arg4)) {
3800
0
      return false;
3801
0
    }
3802
0
  } else {
3803
0
    arg4 = 0.0;
3804
0
  }
3805
0
  double arg5;
3806
0
  if (args.hasDefined(5)) {
3807
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[5], &arg5)) {
3808
0
      return false;
3809
0
    }
3810
0
  } else {
3811
0
    arg5 = 0.0;
3812
0
  }
3813
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->ScaleNonUniform(arg0, arg1, arg2, arg3, arg4, arg5)));
3814
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3815
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3816
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3817
0
    return false;
3818
0
  }
3819
0
  return true;
3820
0
}
3821
3822
static const JSJitInfo scaleNonUniform_methodinfo = {
3823
  { (JSJitGetterOp)scaleNonUniform },
3824
  { prototypes::id::DOMMatrixReadOnly },
3825
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3826
  JSJitInfo::Method,
3827
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3828
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3829
  false,  /* isInfallible. False in setters. */
3830
  false,  /* isMovable.  Not relevant for setters. */
3831
  false, /* isEliminatable.  Not relevant for setters. */
3832
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3833
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3834
  false,  /* isTypedMethod.  Only relevant for methods. */
3835
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3836
};
3837
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3838
static_assert(0 < 1, "There is no slot for us");
3839
3840
MOZ_CAN_RUN_SCRIPT static bool
3841
rotate(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3842
0
{
3843
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.rotate", DOM, cx);
3844
0
3845
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
3846
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.rotate");
3847
0
  }
3848
0
  double arg0;
3849
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3850
0
    return false;
3851
0
  }
3852
0
  double arg1;
3853
0
  if (args.hasDefined(1)) {
3854
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
3855
0
      return false;
3856
0
    }
3857
0
  } else {
3858
0
    arg1 = 0.0;
3859
0
  }
3860
0
  double arg2;
3861
0
  if (args.hasDefined(2)) {
3862
0
    if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
3863
0
      return false;
3864
0
    }
3865
0
  } else {
3866
0
    arg2 = 0.0;
3867
0
  }
3868
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->Rotate(arg0, arg1, arg2)));
3869
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3870
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3871
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3872
0
    return false;
3873
0
  }
3874
0
  return true;
3875
0
}
3876
3877
static const JSJitInfo rotate_methodinfo = {
3878
  { (JSJitGetterOp)rotate },
3879
  { prototypes::id::DOMMatrixReadOnly },
3880
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3881
  JSJitInfo::Method,
3882
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3883
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3884
  false,  /* isInfallible. False in setters. */
3885
  false,  /* isMovable.  Not relevant for setters. */
3886
  false, /* isEliminatable.  Not relevant for setters. */
3887
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3888
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3889
  false,  /* isTypedMethod.  Only relevant for methods. */
3890
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3891
};
3892
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3893
static_assert(0 < 1, "There is no slot for us");
3894
3895
MOZ_CAN_RUN_SCRIPT static bool
3896
rotateFromVector(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3897
0
{
3898
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.rotateFromVector", DOM, cx);
3899
0
3900
0
  if (MOZ_UNLIKELY(args.length() < 2)) {
3901
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.rotateFromVector");
3902
0
  }
3903
0
  double arg0;
3904
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3905
0
    return false;
3906
0
  }
3907
0
  double arg1;
3908
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
3909
0
    return false;
3910
0
  }
3911
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->RotateFromVector(arg0, arg1)));
3912
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3913
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3914
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3915
0
    return false;
3916
0
  }
3917
0
  return true;
3918
0
}
3919
3920
static const JSJitInfo rotateFromVector_methodinfo = {
3921
  { (JSJitGetterOp)rotateFromVector },
3922
  { prototypes::id::DOMMatrixReadOnly },
3923
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3924
  JSJitInfo::Method,
3925
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3926
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3927
  false,  /* isInfallible. False in setters. */
3928
  false,  /* isMovable.  Not relevant for setters. */
3929
  false, /* isEliminatable.  Not relevant for setters. */
3930
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3931
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3932
  false,  /* isTypedMethod.  Only relevant for methods. */
3933
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3934
};
3935
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3936
static_assert(0 < 1, "There is no slot for us");
3937
3938
MOZ_CAN_RUN_SCRIPT static bool
3939
rotateAxisAngle(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3940
0
{
3941
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.rotateAxisAngle", DOM, cx);
3942
0
3943
0
  if (MOZ_UNLIKELY(args.length() < 4)) {
3944
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.rotateAxisAngle");
3945
0
  }
3946
0
  double arg0;
3947
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3948
0
    return false;
3949
0
  }
3950
0
  double arg1;
3951
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[1], &arg1)) {
3952
0
    return false;
3953
0
  }
3954
0
  double arg2;
3955
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[2], &arg2)) {
3956
0
    return false;
3957
0
  }
3958
0
  double arg3;
3959
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[3], &arg3)) {
3960
0
    return false;
3961
0
  }
3962
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->RotateAxisAngle(arg0, arg1, arg2, arg3)));
3963
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
3964
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
3965
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
3966
0
    return false;
3967
0
  }
3968
0
  return true;
3969
0
}
3970
3971
static const JSJitInfo rotateAxisAngle_methodinfo = {
3972
  { (JSJitGetterOp)rotateAxisAngle },
3973
  { prototypes::id::DOMMatrixReadOnly },
3974
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
3975
  JSJitInfo::Method,
3976
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
3977
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
3978
  false,  /* isInfallible. False in setters. */
3979
  false,  /* isMovable.  Not relevant for setters. */
3980
  false, /* isEliminatable.  Not relevant for setters. */
3981
  false, /* isAlwaysInSlot.  Only relevant for getters. */
3982
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
3983
  false,  /* isTypedMethod.  Only relevant for methods. */
3984
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
3985
};
3986
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
3987
static_assert(0 < 1, "There is no slot for us");
3988
3989
MOZ_CAN_RUN_SCRIPT static bool
3990
skewX(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
3991
0
{
3992
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.skewX", DOM, cx);
3993
0
3994
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
3995
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.skewX");
3996
0
  }
3997
0
  double arg0;
3998
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
3999
0
    return false;
4000
0
  }
4001
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->SkewX(arg0)));
4002
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4003
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4004
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4005
0
    return false;
4006
0
  }
4007
0
  return true;
4008
0
}
4009
4010
static const JSJitInfo skewX_methodinfo = {
4011
  { (JSJitGetterOp)skewX },
4012
  { prototypes::id::DOMMatrixReadOnly },
4013
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4014
  JSJitInfo::Method,
4015
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4016
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4017
  false,  /* isInfallible. False in setters. */
4018
  false,  /* isMovable.  Not relevant for setters. */
4019
  false, /* isEliminatable.  Not relevant for setters. */
4020
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4021
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4022
  false,  /* isTypedMethod.  Only relevant for methods. */
4023
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4024
};
4025
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4026
static_assert(0 < 1, "There is no slot for us");
4027
4028
MOZ_CAN_RUN_SCRIPT static bool
4029
skewY(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4030
0
{
4031
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.skewY", DOM, cx);
4032
0
4033
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4034
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.skewY");
4035
0
  }
4036
0
  double arg0;
4037
0
  if (!ValueToPrimitive<double, eDefault>(cx, args[0], &arg0)) {
4038
0
    return false;
4039
0
  }
4040
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->SkewY(arg0)));
4041
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4042
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4043
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4044
0
    return false;
4045
0
  }
4046
0
  return true;
4047
0
}
4048
4049
static const JSJitInfo skewY_methodinfo = {
4050
  { (JSJitGetterOp)skewY },
4051
  { prototypes::id::DOMMatrixReadOnly },
4052
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4053
  JSJitInfo::Method,
4054
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4055
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4056
  false,  /* isInfallible. False in setters. */
4057
  false,  /* isMovable.  Not relevant for setters. */
4058
  false, /* isEliminatable.  Not relevant for setters. */
4059
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4060
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4061
  false,  /* isTypedMethod.  Only relevant for methods. */
4062
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4063
};
4064
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4065
static_assert(0 < 1, "There is no slot for us");
4066
4067
MOZ_CAN_RUN_SCRIPT static bool
4068
multiply(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4069
0
{
4070
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.multiply", DOM, cx);
4071
0
4072
0
  if (MOZ_UNLIKELY(args.length() < 1)) {
4073
0
    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "DOMMatrixReadOnly.multiply");
4074
0
  }
4075
0
  NonNull<mozilla::dom::DOMMatrix> arg0;
4076
0
  if (args[0].isObject()) {
4077
0
    {
4078
0
      nsresult rv = UnwrapObject<prototypes::id::DOMMatrix, mozilla::dom::DOMMatrix>(args[0], arg0);
4079
0
      if (NS_FAILED(rv)) {
4080
0
        ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of DOMMatrixReadOnly.multiply", "DOMMatrix");
4081
0
        return false;
4082
0
      }
4083
0
    }
4084
0
  } else {
4085
0
    ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of DOMMatrixReadOnly.multiply");
4086
0
    return false;
4087
0
  }
4088
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->Multiply(MOZ_KnownLive(NonNullHelper(arg0)))));
4089
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4090
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4091
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4092
0
    return false;
4093
0
  }
4094
0
  return true;
4095
0
}
4096
4097
static const JSJitInfo multiply_methodinfo = {
4098
  { (JSJitGetterOp)multiply },
4099
  { prototypes::id::DOMMatrixReadOnly },
4100
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4101
  JSJitInfo::Method,
4102
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4103
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4104
  false,  /* isInfallible. False in setters. */
4105
  false,  /* isMovable.  Not relevant for setters. */
4106
  false, /* isEliminatable.  Not relevant for setters. */
4107
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4108
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4109
  false,  /* isTypedMethod.  Only relevant for methods. */
4110
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4111
};
4112
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4113
static_assert(0 < 1, "There is no slot for us");
4114
4115
MOZ_CAN_RUN_SCRIPT static bool
4116
flipX(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4117
0
{
4118
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.flipX", DOM, cx);
4119
0
4120
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->FlipX()));
4121
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4122
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4123
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4124
0
    return false;
4125
0
  }
4126
0
  return true;
4127
0
}
4128
4129
static const JSJitInfo flipX_methodinfo = {
4130
  { (JSJitGetterOp)flipX },
4131
  { prototypes::id::DOMMatrixReadOnly },
4132
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4133
  JSJitInfo::Method,
4134
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4135
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4136
  false,  /* isInfallible. False in setters. */
4137
  false,  /* isMovable.  Not relevant for setters. */
4138
  false, /* isEliminatable.  Not relevant for setters. */
4139
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4140
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4141
  false,  /* isTypedMethod.  Only relevant for methods. */
4142
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4143
};
4144
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4145
static_assert(0 < 1, "There is no slot for us");
4146
4147
MOZ_CAN_RUN_SCRIPT static bool
4148
flipY(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4149
0
{
4150
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.flipY", DOM, cx);
4151
0
4152
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->FlipY()));
4153
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4154
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4155
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4156
0
    return false;
4157
0
  }
4158
0
  return true;
4159
0
}
4160
4161
static const JSJitInfo flipY_methodinfo = {
4162
  { (JSJitGetterOp)flipY },
4163
  { prototypes::id::DOMMatrixReadOnly },
4164
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4165
  JSJitInfo::Method,
4166
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4167
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4168
  false,  /* isInfallible. False in setters. */
4169
  false,  /* isMovable.  Not relevant for setters. */
4170
  false, /* isEliminatable.  Not relevant for setters. */
4171
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4172
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4173
  false,  /* isTypedMethod.  Only relevant for methods. */
4174
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4175
};
4176
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4177
static_assert(0 < 1, "There is no slot for us");
4178
4179
MOZ_CAN_RUN_SCRIPT static bool
4180
inverse(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4181
0
{
4182
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.inverse", DOM, cx);
4183
0
4184
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrix>(self->Inverse()));
4185
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4186
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4187
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4188
0
    return false;
4189
0
  }
4190
0
  return true;
4191
0
}
4192
4193
static const JSJitInfo inverse_methodinfo = {
4194
  { (JSJitGetterOp)inverse },
4195
  { prototypes::id::DOMMatrixReadOnly },
4196
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4197
  JSJitInfo::Method,
4198
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4199
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4200
  false,  /* isInfallible. False in setters. */
4201
  false,  /* isMovable.  Not relevant for setters. */
4202
  false, /* isEliminatable.  Not relevant for setters. */
4203
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4204
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4205
  false,  /* isTypedMethod.  Only relevant for methods. */
4206
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4207
};
4208
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4209
static_assert(0 < 1, "There is no slot for us");
4210
4211
MOZ_CAN_RUN_SCRIPT static bool
4212
get_is2D(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
4213
0
{
4214
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.is2D", DOM, cx);
4215
0
4216
0
  bool result(self->Is2D());
4217
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4218
0
  args.rval().setBoolean(result);
4219
0
  return true;
4220
0
}
4221
4222
static const JSJitInfo is2D_getterinfo = {
4223
  { (JSJitGetterOp)get_is2D },
4224
  { prototypes::id::DOMMatrixReadOnly },
4225
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4226
  JSJitInfo::Getter,
4227
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4228
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
4229
  true,  /* isInfallible. False in setters. */
4230
  false,  /* isMovable.  Not relevant for setters. */
4231
  false, /* isEliminatable.  Not relevant for setters. */
4232
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4233
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4234
  false,  /* isTypedMethod.  Only relevant for methods. */
4235
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4236
};
4237
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4238
static_assert(0 < 1, "There is no slot for us");
4239
4240
MOZ_CAN_RUN_SCRIPT static bool
4241
get_isIdentity(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JSJitGetterCallArgs args)
4242
0
{
4243
0
  AUTO_PROFILER_LABEL_FAST("get DOMMatrixReadOnly.isIdentity", DOM, cx);
4244
0
4245
0
  bool result(self->IsIdentity());
4246
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4247
0
  args.rval().setBoolean(result);
4248
0
  return true;
4249
0
}
4250
4251
static const JSJitInfo isIdentity_getterinfo = {
4252
  { (JSJitGetterOp)get_isIdentity },
4253
  { prototypes::id::DOMMatrixReadOnly },
4254
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4255
  JSJitInfo::Getter,
4256
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4257
  JSVAL_TYPE_BOOLEAN,  /* returnType.  Not relevant for setters. */
4258
  true,  /* isInfallible. False in setters. */
4259
  false,  /* isMovable.  Not relevant for setters. */
4260
  false, /* isEliminatable.  Not relevant for setters. */
4261
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4262
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4263
  false,  /* isTypedMethod.  Only relevant for methods. */
4264
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4265
};
4266
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4267
static_assert(0 < 1, "There is no slot for us");
4268
4269
MOZ_CAN_RUN_SCRIPT static bool
4270
transformPoint(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4271
0
{
4272
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.transformPoint", DOM, cx);
4273
0
4274
0
  binding_detail::FastDOMPointInit arg0;
4275
0
  if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue,  "Argument 1 of DOMMatrixReadOnly.transformPoint", false)) {
4276
0
    return false;
4277
0
  }
4278
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMPoint>(self->TransformPoint(Constify(arg0))));
4279
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4280
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
4281
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4282
0
    return false;
4283
0
  }
4284
0
  return true;
4285
0
}
4286
4287
static const JSJitInfo transformPoint_methodinfo = {
4288
  { (JSJitGetterOp)transformPoint },
4289
  { prototypes::id::DOMMatrixReadOnly },
4290
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4291
  JSJitInfo::Method,
4292
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4293
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4294
  false,  /* isInfallible. False in setters. */
4295
  false,  /* isMovable.  Not relevant for setters. */
4296
  false, /* isEliminatable.  Not relevant for setters. */
4297
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4298
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4299
  false,  /* isTypedMethod.  Only relevant for methods. */
4300
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4301
};
4302
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4303
static_assert(0 < 1, "There is no slot for us");
4304
4305
MOZ_CAN_RUN_SCRIPT static bool
4306
toFloat32Array(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4307
0
{
4308
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.toFloat32Array", DOM, cx);
4309
0
4310
0
  FastErrorResult rv;
4311
0
  JS::Rooted<JSObject*> result(cx);
4312
0
  self->ToFloat32Array(cx, &result, rv);
4313
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
4314
0
    return false;
4315
0
  }
4316
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4317
0
  JS::ExposeObjectToActiveJS(result);
4318
0
  args.rval().setObject(*result);
4319
0
  if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
4320
0
    return false;
4321
0
  }
4322
0
  return true;
4323
0
}
4324
4325
static const JSJitInfo toFloat32Array_methodinfo = {
4326
  { (JSJitGetterOp)toFloat32Array },
4327
  { prototypes::id::DOMMatrixReadOnly },
4328
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4329
  JSJitInfo::Method,
4330
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4331
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4332
  false,  /* isInfallible. False in setters. */
4333
  false,  /* isMovable.  Not relevant for setters. */
4334
  false, /* isEliminatable.  Not relevant for setters. */
4335
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4336
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4337
  false,  /* isTypedMethod.  Only relevant for methods. */
4338
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4339
};
4340
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4341
static_assert(0 < 1, "There is no slot for us");
4342
4343
MOZ_CAN_RUN_SCRIPT static bool
4344
toFloat64Array(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4345
0
{
4346
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.toFloat64Array", DOM, cx);
4347
0
4348
0
  FastErrorResult rv;
4349
0
  JS::Rooted<JSObject*> result(cx);
4350
0
  self->ToFloat64Array(cx, &result, rv);
4351
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
4352
0
    return false;
4353
0
  }
4354
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4355
0
  JS::ExposeObjectToActiveJS(result);
4356
0
  args.rval().setObject(*result);
4357
0
  if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
4358
0
    return false;
4359
0
  }
4360
0
  return true;
4361
0
}
4362
4363
static const JSJitInfo toFloat64Array_methodinfo = {
4364
  { (JSJitGetterOp)toFloat64Array },
4365
  { prototypes::id::DOMMatrixReadOnly },
4366
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4367
  JSJitInfo::Method,
4368
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4369
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4370
  false,  /* isInfallible. False in setters. */
4371
  false,  /* isMovable.  Not relevant for setters. */
4372
  false, /* isEliminatable.  Not relevant for setters. */
4373
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4374
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4375
  false,  /* isTypedMethod.  Only relevant for methods. */
4376
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4377
};
4378
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4379
static_assert(0 < 1, "There is no slot for us");
4380
4381
MOZ_CAN_RUN_SCRIPT static bool
4382
__stringifier(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4383
0
{
4384
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.__stringifier", DOM, cx);
4385
0
4386
0
  DOMString result;
4387
0
  self->Stringify(result);
4388
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4389
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
4390
0
    return false;
4391
0
  }
4392
0
  return true;
4393
0
}
4394
4395
static const JSJitInfo __stringifier_methodinfo = {
4396
  { (JSJitGetterOp)__stringifier },
4397
  { prototypes::id::DOMMatrixReadOnly },
4398
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4399
  JSJitInfo::Method,
4400
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4401
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
4402
  false,  /* isInfallible. False in setters. */
4403
  false,  /* isMovable.  Not relevant for setters. */
4404
  false, /* isEliminatable.  Not relevant for setters. */
4405
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4406
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4407
  false,  /* isTypedMethod.  Only relevant for methods. */
4408
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4409
};
4410
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4411
static_assert(0 < 1, "There is no slot for us");
4412
4413
MOZ_CAN_RUN_SCRIPT static bool
4414
toJSON(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, const JSJitMethodCallArgs& args)
4415
0
{
4416
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly.toJSON", DOM, cx);
4417
0
4418
0
  JS::Rooted<JSObject*> result(cx, JS_NewPlainObject(cx));
4419
0
  if (!result) {
4420
0
    return false;
4421
0
  }
4422
0
  if (!DOMMatrixReadOnly_Binding::CollectJSONAttributes(cx, obj, self, result)) {
4423
0
    return false;
4424
0
  }
4425
0
  args.rval().setObject(*result);
4426
0
  return true;
4427
0
}
4428
4429
static const JSJitInfo toJSON_methodinfo = {
4430
  { (JSJitGetterOp)toJSON },
4431
  { prototypes::id::DOMMatrixReadOnly },
4432
  { PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth },
4433
  JSJitInfo::Method,
4434
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
4435
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
4436
  false,  /* isInfallible. False in setters. */
4437
  false,  /* isMovable.  Not relevant for setters. */
4438
  false, /* isEliminatable.  Not relevant for setters. */
4439
  false, /* isAlwaysInSlot.  Only relevant for getters. */
4440
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
4441
  false,  /* isTypedMethod.  Only relevant for methods. */
4442
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
4443
};
4444
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
4445
static_assert(0 < 1, "There is no slot for us");
4446
4447
static bool
4448
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
4449
0
{
4450
0
  mozilla::dom::DOMMatrixReadOnly* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::DOMMatrixReadOnly>(obj);
4451
0
  // We don't want to preserve if we don't have a wrapper, and we
4452
0
  // obviously can't preserve if we're not initialized.
4453
0
  if (self && self->GetWrapperPreserveColor()) {
4454
0
    PreserveWrapper(self);
4455
0
  }
4456
0
  return true;
4457
0
}
4458
4459
static void
4460
_finalize(js::FreeOp* fop, JSObject* obj)
4461
0
{
4462
0
  mozilla::dom::DOMMatrixReadOnly* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::DOMMatrixReadOnly>(obj);
4463
0
  if (self) {
4464
0
    ClearWrapper(self, self, obj);
4465
0
    AddForDeferredFinalization<mozilla::dom::DOMMatrixReadOnly>(self);
4466
0
  }
4467
0
}
4468
4469
static size_t
4470
_objectMoved(JSObject* obj, JSObject* old)
4471
0
{
4472
0
  mozilla::dom::DOMMatrixReadOnly* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::DOMMatrixReadOnly>(obj);
4473
0
  if (self) {
4474
0
    UpdateWrapper(self, self, obj, old);
4475
0
  }
4476
0
4477
0
  return 0;
4478
0
}
4479
4480
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
4481
#if defined(__clang__)
4482
#pragma clang diagnostic push
4483
#pragma clang diagnostic ignored "-Wmissing-braces"
4484
#endif
4485
static const JSFunctionSpec sMethods_specs[] = {
4486
  JS_FNSPEC("translate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&translate_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
4487
  JS_FNSPEC("scale", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&scale_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
4488
  JS_FNSPEC("scale3d", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&scale3d_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
4489
  JS_FNSPEC("scaleNonUniform", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&scaleNonUniform_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
4490
  JS_FNSPEC("rotate", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&rotate_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
4491
  JS_FNSPEC("rotateFromVector", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&rotateFromVector_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
4492
  JS_FNSPEC("rotateAxisAngle", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&rotateAxisAngle_methodinfo), 4, JSPROP_ENUMERATE, nullptr),
4493
  JS_FNSPEC("skewX", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&skewX_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
4494
  JS_FNSPEC("skewY", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&skewY_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
4495
  JS_FNSPEC("multiply", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&multiply_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
4496
  JS_FNSPEC("flipX", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&flipX_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4497
  JS_FNSPEC("flipY", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&flipY_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4498
  JS_FNSPEC("inverse", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&inverse_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4499
  JS_FNSPEC("transformPoint", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&transformPoint_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4500
  JS_FNSPEC("toFloat32Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&toFloat32Array_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4501
  JS_FNSPEC("toFloat64Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&toFloat64Array_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4502
  JS_FNSPEC("toJSON", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&toJSON_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4503
  JS_FNSPEC("toString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&__stringifier_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
4504
  JS_FS_END
4505
};
4506
#if defined(__clang__)
4507
#pragma clang diagnostic pop
4508
#endif
4509
4510
4511
static const Prefable<const JSFunctionSpec> sMethods[] = {
4512
  { nullptr, &sMethods_specs[0] },
4513
  { nullptr, nullptr }
4514
};
4515
4516
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
4517
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
4518
static_assert(18 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
4519
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
4520
4521
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
4522
#if defined(__clang__)
4523
#pragma clang diagnostic push
4524
#pragma clang diagnostic ignored "-Wmissing-braces"
4525
#endif
4526
static const JSPropertySpec sAttributes_specs[] = {
4527
  { "a", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &a_getterinfo, nullptr, nullptr },
4528
  { "b", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &b_getterinfo, nullptr, nullptr },
4529
  { "c", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &c_getterinfo, nullptr, nullptr },
4530
  { "d", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &d_getterinfo, nullptr, nullptr },
4531
  { "e", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &e_getterinfo, nullptr, nullptr },
4532
  { "f", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &f_getterinfo, nullptr, nullptr },
4533
  { "m11", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m11_getterinfo, nullptr, nullptr },
4534
  { "m12", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m12_getterinfo, nullptr, nullptr },
4535
  { "m13", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m13_getterinfo, nullptr, nullptr },
4536
  { "m14", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m14_getterinfo, nullptr, nullptr },
4537
  { "m21", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m21_getterinfo, nullptr, nullptr },
4538
  { "m22", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m22_getterinfo, nullptr, nullptr },
4539
  { "m23", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m23_getterinfo, nullptr, nullptr },
4540
  { "m24", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m24_getterinfo, nullptr, nullptr },
4541
  { "m31", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m31_getterinfo, nullptr, nullptr },
4542
  { "m32", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m32_getterinfo, nullptr, nullptr },
4543
  { "m33", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m33_getterinfo, nullptr, nullptr },
4544
  { "m34", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m34_getterinfo, nullptr, nullptr },
4545
  { "m41", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m41_getterinfo, nullptr, nullptr },
4546
  { "m42", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m42_getterinfo, nullptr, nullptr },
4547
  { "m43", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m43_getterinfo, nullptr, nullptr },
4548
  { "m44", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &m44_getterinfo, nullptr, nullptr },
4549
  { "is2D", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &is2D_getterinfo, nullptr, nullptr },
4550
  { "isIdentity", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &isIdentity_getterinfo, nullptr, nullptr },
4551
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
4552
};
4553
#if defined(__clang__)
4554
#pragma clang diagnostic pop
4555
#endif
4556
4557
4558
static const Prefable<const JSPropertySpec> sAttributes[] = {
4559
  { nullptr, &sAttributes_specs[0] },
4560
  { nullptr, nullptr }
4561
};
4562
4563
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
4564
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
4565
static_assert(24 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
4566
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
4567
4568
4569
static uint16_t sNativeProperties_sortedPropertyIndices[42];
4570
static PropertyInfo sNativeProperties_propertyInfos[42];
4571
4572
static const NativePropertiesN<2> sNativeProperties = {
4573
  false, 0,
4574
  false, 0,
4575
  true,  0 /* sMethods */,
4576
  true,  1 /* sAttributes */,
4577
  false, 0,
4578
  false, 0,
4579
  false, 0,
4580
  -1,
4581
  42,
4582
  sNativeProperties_sortedPropertyIndices,
4583
  {
4584
    { sMethods, &sNativeProperties_propertyInfos[0] },
4585
    { sAttributes, &sNativeProperties_propertyInfos[18] }
4586
  }
4587
};
4588
static_assert(42 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
4589
    "We have a property info count that is oversized");
4590
4591
MOZ_CAN_RUN_SCRIPT bool
4592
CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMMatrixReadOnly* self, JS::Rooted<JSObject*>& result)
4593
0
{
4594
0
  { // scope for "temp"
4595
0
    JS::Rooted<JS::Value> temp(cx);
4596
0
    if (!get_a(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4597
0
      return false;
4598
0
    }
4599
0
    if (!JS_DefineProperty(cx, result, "a", temp, JSPROP_ENUMERATE)) {
4600
0
      return false;
4601
0
    }
4602
0
  }
4603
0
  { // scope for "temp"
4604
0
    JS::Rooted<JS::Value> temp(cx);
4605
0
    if (!get_b(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4606
0
      return false;
4607
0
    }
4608
0
    if (!JS_DefineProperty(cx, result, "b", temp, JSPROP_ENUMERATE)) {
4609
0
      return false;
4610
0
    }
4611
0
  }
4612
0
  { // scope for "temp"
4613
0
    JS::Rooted<JS::Value> temp(cx);
4614
0
    if (!get_c(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4615
0
      return false;
4616
0
    }
4617
0
    if (!JS_DefineProperty(cx, result, "c", temp, JSPROP_ENUMERATE)) {
4618
0
      return false;
4619
0
    }
4620
0
  }
4621
0
  { // scope for "temp"
4622
0
    JS::Rooted<JS::Value> temp(cx);
4623
0
    if (!get_d(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4624
0
      return false;
4625
0
    }
4626
0
    if (!JS_DefineProperty(cx, result, "d", temp, JSPROP_ENUMERATE)) {
4627
0
      return false;
4628
0
    }
4629
0
  }
4630
0
  { // scope for "temp"
4631
0
    JS::Rooted<JS::Value> temp(cx);
4632
0
    if (!get_e(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4633
0
      return false;
4634
0
    }
4635
0
    if (!JS_DefineProperty(cx, result, "e", temp, JSPROP_ENUMERATE)) {
4636
0
      return false;
4637
0
    }
4638
0
  }
4639
0
  { // scope for "temp"
4640
0
    JS::Rooted<JS::Value> temp(cx);
4641
0
    if (!get_f(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4642
0
      return false;
4643
0
    }
4644
0
    if (!JS_DefineProperty(cx, result, "f", temp, JSPROP_ENUMERATE)) {
4645
0
      return false;
4646
0
    }
4647
0
  }
4648
0
  { // scope for "temp"
4649
0
    JS::Rooted<JS::Value> temp(cx);
4650
0
    if (!get_m11(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4651
0
      return false;
4652
0
    }
4653
0
    if (!JS_DefineProperty(cx, result, "m11", temp, JSPROP_ENUMERATE)) {
4654
0
      return false;
4655
0
    }
4656
0
  }
4657
0
  { // scope for "temp"
4658
0
    JS::Rooted<JS::Value> temp(cx);
4659
0
    if (!get_m12(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4660
0
      return false;
4661
0
    }
4662
0
    if (!JS_DefineProperty(cx, result, "m12", temp, JSPROP_ENUMERATE)) {
4663
0
      return false;
4664
0
    }
4665
0
  }
4666
0
  { // scope for "temp"
4667
0
    JS::Rooted<JS::Value> temp(cx);
4668
0
    if (!get_m13(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4669
0
      return false;
4670
0
    }
4671
0
    if (!JS_DefineProperty(cx, result, "m13", temp, JSPROP_ENUMERATE)) {
4672
0
      return false;
4673
0
    }
4674
0
  }
4675
0
  { // scope for "temp"
4676
0
    JS::Rooted<JS::Value> temp(cx);
4677
0
    if (!get_m14(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4678
0
      return false;
4679
0
    }
4680
0
    if (!JS_DefineProperty(cx, result, "m14", temp, JSPROP_ENUMERATE)) {
4681
0
      return false;
4682
0
    }
4683
0
  }
4684
0
  { // scope for "temp"
4685
0
    JS::Rooted<JS::Value> temp(cx);
4686
0
    if (!get_m21(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4687
0
      return false;
4688
0
    }
4689
0
    if (!JS_DefineProperty(cx, result, "m21", temp, JSPROP_ENUMERATE)) {
4690
0
      return false;
4691
0
    }
4692
0
  }
4693
0
  { // scope for "temp"
4694
0
    JS::Rooted<JS::Value> temp(cx);
4695
0
    if (!get_m22(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4696
0
      return false;
4697
0
    }
4698
0
    if (!JS_DefineProperty(cx, result, "m22", temp, JSPROP_ENUMERATE)) {
4699
0
      return false;
4700
0
    }
4701
0
  }
4702
0
  { // scope for "temp"
4703
0
    JS::Rooted<JS::Value> temp(cx);
4704
0
    if (!get_m23(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4705
0
      return false;
4706
0
    }
4707
0
    if (!JS_DefineProperty(cx, result, "m23", temp, JSPROP_ENUMERATE)) {
4708
0
      return false;
4709
0
    }
4710
0
  }
4711
0
  { // scope for "temp"
4712
0
    JS::Rooted<JS::Value> temp(cx);
4713
0
    if (!get_m24(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4714
0
      return false;
4715
0
    }
4716
0
    if (!JS_DefineProperty(cx, result, "m24", temp, JSPROP_ENUMERATE)) {
4717
0
      return false;
4718
0
    }
4719
0
  }
4720
0
  { // scope for "temp"
4721
0
    JS::Rooted<JS::Value> temp(cx);
4722
0
    if (!get_m31(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4723
0
      return false;
4724
0
    }
4725
0
    if (!JS_DefineProperty(cx, result, "m31", temp, JSPROP_ENUMERATE)) {
4726
0
      return false;
4727
0
    }
4728
0
  }
4729
0
  { // scope for "temp"
4730
0
    JS::Rooted<JS::Value> temp(cx);
4731
0
    if (!get_m32(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4732
0
      return false;
4733
0
    }
4734
0
    if (!JS_DefineProperty(cx, result, "m32", temp, JSPROP_ENUMERATE)) {
4735
0
      return false;
4736
0
    }
4737
0
  }
4738
0
  { // scope for "temp"
4739
0
    JS::Rooted<JS::Value> temp(cx);
4740
0
    if (!get_m33(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4741
0
      return false;
4742
0
    }
4743
0
    if (!JS_DefineProperty(cx, result, "m33", temp, JSPROP_ENUMERATE)) {
4744
0
      return false;
4745
0
    }
4746
0
  }
4747
0
  { // scope for "temp"
4748
0
    JS::Rooted<JS::Value> temp(cx);
4749
0
    if (!get_m34(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4750
0
      return false;
4751
0
    }
4752
0
    if (!JS_DefineProperty(cx, result, "m34", temp, JSPROP_ENUMERATE)) {
4753
0
      return false;
4754
0
    }
4755
0
  }
4756
0
  { // scope for "temp"
4757
0
    JS::Rooted<JS::Value> temp(cx);
4758
0
    if (!get_m41(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4759
0
      return false;
4760
0
    }
4761
0
    if (!JS_DefineProperty(cx, result, "m41", temp, JSPROP_ENUMERATE)) {
4762
0
      return false;
4763
0
    }
4764
0
  }
4765
0
  { // scope for "temp"
4766
0
    JS::Rooted<JS::Value> temp(cx);
4767
0
    if (!get_m42(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4768
0
      return false;
4769
0
    }
4770
0
    if (!JS_DefineProperty(cx, result, "m42", temp, JSPROP_ENUMERATE)) {
4771
0
      return false;
4772
0
    }
4773
0
  }
4774
0
  { // scope for "temp"
4775
0
    JS::Rooted<JS::Value> temp(cx);
4776
0
    if (!get_m43(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4777
0
      return false;
4778
0
    }
4779
0
    if (!JS_DefineProperty(cx, result, "m43", temp, JSPROP_ENUMERATE)) {
4780
0
      return false;
4781
0
    }
4782
0
  }
4783
0
  { // scope for "temp"
4784
0
    JS::Rooted<JS::Value> temp(cx);
4785
0
    if (!get_m44(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4786
0
      return false;
4787
0
    }
4788
0
    if (!JS_DefineProperty(cx, result, "m44", temp, JSPROP_ENUMERATE)) {
4789
0
      return false;
4790
0
    }
4791
0
  }
4792
0
  { // scope for "temp"
4793
0
    JS::Rooted<JS::Value> temp(cx);
4794
0
    if (!get_is2D(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4795
0
      return false;
4796
0
    }
4797
0
    if (!JS_DefineProperty(cx, result, "is2D", temp, JSPROP_ENUMERATE)) {
4798
0
      return false;
4799
0
    }
4800
0
  }
4801
0
  { // scope for "temp"
4802
0
    JS::Rooted<JS::Value> temp(cx);
4803
0
    if (!get_isIdentity(cx, obj, self, JSJitGetterCallArgs(&temp))) {
4804
0
      return false;
4805
0
    }
4806
0
    if (!JS_DefineProperty(cx, result, "isIdentity", temp, JSPROP_ENUMERATE)) {
4807
0
      return false;
4808
0
    }
4809
0
  }
4810
0
  return true;
4811
0
}
4812
4813
static bool
4814
_constructor(JSContext* cx, unsigned argc, JS::Value* vp)
4815
0
{
4816
0
  AUTO_PROFILER_LABEL_FAST("DOMMatrixReadOnly constructor", DOM, cx);
4817
0
4818
0
  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
4819
0
  JS::Rooted<JSObject*> obj(cx, &args.callee());
4820
0
  if (!args.isConstructing()) {
4821
0
    // XXXbz wish I could get the name from the callee instead of
4822
0
    // Adding more relocations
4823
0
    return ThrowConstructorWithoutNew(cx, "DOMMatrixReadOnly");
4824
0
  }
4825
0
4826
0
  JS::Rooted<JSObject*> desiredProto(cx);
4827
0
  if (!GetDesiredProto(cx, args, &desiredProto)) {
4828
0
    return false;
4829
0
  }
4830
0
4831
0
  GlobalObject global(cx, obj);
4832
0
  if (global.Failed()) {
4833
0
    return false;
4834
0
  }
4835
0
4836
0
  bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4837
0
  Optional<StringOrUnrestrictedDoubleSequence> arg0;
4838
0
  Maybe<StringOrUnrestrictedDoubleSequenceArgument> arg0_holder;
4839
0
  if (args.hasDefined(0)) {
4840
0
    arg0.Construct();
4841
0
    arg0_holder.emplace(arg0.Value());
4842
0
    {
4843
0
      bool done = false, failed = false, tryNext;
4844
0
      if (args[0].isObject()) {
4845
0
        done = (failed = !arg0_holder.ref().TrySetToUnrestrictedDoubleSequence(cx, args[0], tryNext, false)) || !tryNext;
4846
0
      }
4847
0
      if (!done) {
4848
0
        do {
4849
0
          done = (failed = !arg0_holder.ref().TrySetToString(cx, args[0], tryNext)) || !tryNext;
4850
0
          break;
4851
0
        } while (false);
4852
0
      }
4853
0
      if (failed) {
4854
0
        return false;
4855
0
      }
4856
0
      if (!done) {
4857
0
        ThrowErrorMessage(cx, MSG_NOT_IN_UNION, "Argument 1 of DOMMatrixReadOnly.constructor", "UnrestrictedDoubleSequence");
4858
0
        return false;
4859
0
      }
4860
0
    }
4861
0
  }
4862
0
  Maybe<JSAutoRealm> ar;
4863
0
  if (objIsXray) {
4864
0
    obj = js::CheckedUnwrap(obj);
4865
0
    if (!obj) {
4866
0
      return false;
4867
0
    }
4868
0
    ar.emplace(cx, obj);
4869
0
    if (!JS_WrapObject(cx, &desiredProto)) {
4870
0
      return false;
4871
0
    }
4872
0
  }
4873
0
  FastErrorResult rv;
4874
0
  auto result(StrongOrRawPtr<mozilla::dom::DOMMatrixReadOnly>(mozilla::dom::DOMMatrixReadOnly::Constructor(global, Constify(arg0), rv)));
4875
0
  if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
4876
0
    return false;
4877
0
  }
4878
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
4879
0
  static_assert(!IsPointer<decltype(result)>::value,
4880
0
                "NewObject implies that we need to keep the object alive with a strong reference.");
4881
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
4882
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
4883
0
    return false;
4884
0
  }
4885
0
  return true;
4886
0
}
4887
4888
static const js::ClassOps sInterfaceObjectClassOps = {
4889
    nullptr,               /* addProperty */
4890
    nullptr,               /* delProperty */
4891
    nullptr,               /* enumerate */
4892
    nullptr,               /* newEnumerate */
4893
    nullptr,               /* resolve */
4894
    nullptr,               /* mayResolve */
4895
    nullptr,               /* finalize */
4896
    _constructor, /* call */
4897
    nullptr,               /* hasInstance */
4898
    _constructor, /* construct */
4899
    nullptr,               /* trace */
4900
};
4901
4902
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
4903
  {
4904
    "Function",
4905
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
4906
    &sInterfaceObjectClassOps,
4907
    JS_NULL_CLASS_SPEC,
4908
    JS_NULL_CLASS_EXT,
4909
    &sInterfaceObjectClassObjectOps
4910
  },
4911
  eInterface,
4912
  true,
4913
  prototypes::id::DOMMatrixReadOnly,
4914
  PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth,
4915
  sNativePropertyHooks,
4916
  "function DOMMatrixReadOnly() {\n    [native code]\n}",
4917
  JS::GetRealmFunctionPrototype
4918
};
4919
4920
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
4921
  {
4922
    "DOMMatrixReadOnlyPrototype",
4923
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
4924
    JS_NULL_CLASS_OPS,
4925
    JS_NULL_CLASS_SPEC,
4926
    JS_NULL_CLASS_EXT,
4927
    JS_NULL_OBJECT_OPS
4928
  },
4929
  eInterfacePrototype,
4930
  false,
4931
  prototypes::id::DOMMatrixReadOnly,
4932
  PrototypeTraits<prototypes::id::DOMMatrixReadOnly>::Depth,
4933
  sNativePropertyHooks,
4934
  "[object DOMMatrixReadOnlyPrototype]",
4935
  JS::GetRealmObjectPrototype
4936
};
4937
4938
bool
4939
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj)
4940
0
{
4941
0
  static bool sPrefValue;
4942
0
  static bool sPrefCacheSetUp = false;
4943
0
  if (!sPrefCacheSetUp) {
4944
0
    sPrefCacheSetUp = true;
4945
0
    Preferences::AddBoolVarCache(&sPrefValue, "layout.css.DOMMatrix.enabled");
4946
0
  }
4947
0
4948
0
  return sPrefValue;
4949
0
}
4950
4951
static const js::ClassOps sClassOps = {
4952
  _addProperty, /* addProperty */
4953
  nullptr,               /* delProperty */
4954
  nullptr,               /* enumerate */
4955
  nullptr, /* newEnumerate */
4956
  nullptr, /* resolve */
4957
  nullptr, /* mayResolve */
4958
  _finalize, /* finalize */
4959
  nullptr, /* call */
4960
  nullptr,               /* hasInstance */
4961
  nullptr,               /* construct */
4962
  nullptr, /* trace */
4963
};
4964
4965
static const js::ClassExtension sClassExtension = {
4966
  nullptr, /* weakmapKeyDelegateOp */
4967
  _objectMoved /* objectMovedOp */
4968
};
4969
4970
static const DOMJSClass sClass = {
4971
  { "DOMMatrixReadOnly",
4972
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
4973
    &sClassOps,
4974
    JS_NULL_CLASS_SPEC,
4975
    &sClassExtension,
4976
    JS_NULL_OBJECT_OPS
4977
  },
4978
  { prototypes::id::DOMMatrixReadOnly, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
4979
  IsBaseOf<nsISupports, mozilla::dom::DOMMatrixReadOnly >::value,
4980
  sNativePropertyHooks,
4981
  FindAssociatedGlobalForNative<mozilla::dom::DOMMatrixReadOnly>::Get,
4982
  GetProtoObjectHandle,
4983
  GetCCParticipant<mozilla::dom::DOMMatrixReadOnly>::Get()
4984
};
4985
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
4986
              "Must have the right minimal number of reserved slots.");
4987
static_assert(1 >= 1,
4988
              "Must have enough reserved slots.");
4989
4990
const JSClass*
4991
GetJSClass()
4992
0
{
4993
0
  return sClass.ToJSClass();
4994
0
}
4995
4996
bool
4997
Wrap(JSContext* aCx, mozilla::dom::DOMMatrixReadOnly* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
4998
0
{
4999
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::DOMMatrixReadOnly>::value,
5000
0
                "Shouldn't have wrappercached things that are not refcounted.");
5001
0
  MOZ_ASSERT(static_cast<mozilla::dom::DOMMatrixReadOnly*>(aObject) ==
5002
0
             reinterpret_cast<mozilla::dom::DOMMatrixReadOnly*>(aObject),
5003
0
             "Multiple inheritance for mozilla::dom::DOMMatrixReadOnly is broken.");
5004
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
5005
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
5006
0
  MOZ_ASSERT(!aCache->GetWrapper(),
5007
0
             "You should probably not be using Wrap() directly; use "
5008
0
             "GetOrCreateDOMReflector instead");
5009
0
5010
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
5011
0
             "nsISupports must be on our primary inheritance chain");
5012
0
5013
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
5014
0
  if (!global) {
5015
0
    return false;
5016
0
  }
5017
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
5018
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
5019
0
5020
0
  // That might have ended up wrapping us already, due to the wonders
5021
0
  // of XBL.  Check for that, and bail out as needed.
5022
0
  aReflector.set(aCache->GetWrapper());
5023
0
  if (aReflector) {
5024
#ifdef DEBUG
5025
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
5026
#endif // DEBUG
5027
    return true;
5028
0
  }
5029
0
5030
0
  JSAutoRealm ar(aCx, global);
5031
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
5032
0
  if (!canonicalProto) {
5033
0
    return false;
5034
0
  }
5035
0
  JS::Rooted<JSObject*> proto(aCx);
5036
0
  if (aGivenProto) {
5037
0
    proto = aGivenProto;
5038
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
5039
0
    // coming in, we changed compartments to that of "parent" so may need
5040
0
    // to wrap the proto here.
5041
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
5042
0
      if (!JS_WrapObject(aCx, &proto)) {
5043
0
        return false;
5044
0
      }
5045
0
    }
5046
0
  } else {
5047
0
    proto = canonicalProto;
5048
0
  }
5049
0
5050
0
  BindingJSObjectCreator<mozilla::dom::DOMMatrixReadOnly> creator(aCx);
5051
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
5052
0
  if (!aReflector) {
5053
0
    return false;
5054
0
  }
5055
0
5056
0
  aCache->SetWrapper(aReflector);
5057
0
  creator.InitializationSucceeded();
5058
0
5059
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
5060
0
             aCache->GetWrapperPreserveColor() == aReflector);
5061
0
  // If proto != canonicalProto, we have to preserve our wrapper;
5062
0
  // otherwise we won't be able to properly recreate it later, since
5063
0
  // we won't know what proto to use.  Note that we don't check
5064
0
  // aGivenProto here, since it's entirely possible (and even
5065
0
  // somewhat common) to have a non-null aGivenProto which is the
5066
0
  // same as canonicalProto.
5067
0
  if (proto != canonicalProto) {
5068
0
    PreserveWrapper(aObject);
5069
0
  }
5070
0
5071
0
  return true;
5072
0
}
5073
5074
const NativePropertyHooks sNativePropertyHooks[] = { {
5075
  nullptr,
5076
  nullptr,
5077
  nullptr,
5078
  { sNativeProperties.Upcast(), nullptr },
5079
  prototypes::id::DOMMatrixReadOnly,
5080
  constructors::id::DOMMatrixReadOnly,
5081
  nullptr,
5082
  &DefaultXrayExpandoObjectClass
5083
} };
5084
5085
void
5086
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
5087
0
{
5088
0
  JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx));
5089
0
  if (!parentProto) {
5090
0
    return;
5091
0
  }
5092
0
5093
0
  JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx));
5094
0
  if (!constructorProto) {
5095
0
    return;
5096
0
  }
5097
0
5098
0
  static bool sIdsInited = false;
5099
0
  if (!sIdsInited && NS_IsMainThread()) {
5100
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
5101
0
      return;
5102
0
    }
5103
0
    sIdsInited = true;
5104
0
  }
5105
0
5106
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::DOMMatrixReadOnly);
5107
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::DOMMatrixReadOnly);
5108
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
5109
0
                              &sPrototypeClass.mBase, protoCache,
5110
0
                              nullptr,
5111
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
5112
0
                              interfaceCache,
5113
0
                              sNativeProperties.Upcast(),
5114
0
                              nullptr,
5115
0
                              "DOMMatrixReadOnly", aDefineOnGlobal,
5116
0
                              nullptr,
5117
0
                              false);
5118
0
}
5119
5120
JSObject*
5121
GetProtoObject(JSContext* aCx)
5122
0
{
5123
0
  return GetProtoObjectHandle(aCx);
5124
0
}
5125
5126
JSObject*
5127
GetConstructorObject(JSContext* aCx)
5128
0
{
5129
0
  return GetConstructorObjectHandle(aCx);
5130
0
}
5131
5132
} // namespace DOMMatrixReadOnly_Binding
5133
5134
5135
5136
} // namespace dom
5137
} // namespace mozilla