@@ -8428,8 +8428,8 @@ void CodeGenerator::visitNewObjectVMCall(LNewObject* lir) {
8428
8428
restoreLive(lir);
8429
8429
}
8430
8430
8431
- static bool ShouldInitFixedSlots(LNewPlainObject* lir, const Shape* shape ,
8432
- uint32_t nfixed) {
8431
+ static bool ShouldInitFixedSlots(MIRGenerator* gen, LNewPlainObject* lir ,
8432
+ const Shape* shape, uint32_t nfixed) {
8433
8433
// Look for StoreFixedSlot instructions following an object allocation
8434
8434
// that write to this object before a GC is triggered or this object is
8435
8435
// passed to a VM call. If all fixed slots will be initialized, the
@@ -8439,6 +8439,14 @@ static bool ShouldInitFixedSlots(LNewPlainObject* lir, const Shape* shape,
8439
8439
return false;
8440
8440
}
8441
8441
8442
+ #ifdef DEBUG
8443
+ // The bailAfter testing function can trigger a bailout between allocating the
8444
+ // object and initializing the slots.
8445
+ if (gen->options.ionBailAfterEnabled()) {
8446
+ return true;
8447
+ }
8448
+ #endif
8449
+
8442
8450
// Keep track of the fixed slots that are initialized. initializedSlots is
8443
8451
// a bit mask with a bit for each slot.
8444
8452
MOZ_ASSERT(nfixed <= NativeObject::MAX_FIXED_SLOTS);
@@ -8556,7 +8564,8 @@ void CodeGenerator::visitNewPlainObject(LNewPlainObject* lir) {
8556
8564
Imm32(int32_t(initialHeap))),
8557
8565
StoreRegisterTo(objReg));
8558
8566
8559
- bool initContents = ShouldInitFixedSlots(lir, shape, mir->numFixedSlots());
8567
+ bool initContents =
8568
+ ShouldInitFixedSlots(gen, lir, shape, mir->numFixedSlots());
8560
8569
8561
8570
masm.movePtr(ImmGCPtr(shape), shapeReg);
8562
8571
masm.createPlainGCObject(
0 commit comments