Bug 1568903 - Part 5: Rename shared functions for Promise combinators. r=jorendorff
☠☠ backed out by cfe990fab350 ☠ ☠
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 12 Nov 2019 11:13:29 +0000
changeset 502141 567d497a39f42a347f0cdddb720cfc68256167a2
parent 502140 127a44494b67989bfe3afcd02ee48041ca566f16
child 502142 595accbef95e27f253a0c4539a31c6858f1cae7c
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1568903
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1568903 - Part 5: Rename shared functions for Promise combinators. r=jorendorff The draft proposal calls `Promise.all`, `Promise.allSettled`, `Promise.any`, and `Promise.race` "Promise combinators". Let's reuse that name to avoid having to spell each function name in shared functions. For example instead of `CommonStaticAllRace`, or soon `CommonStaticAllRaceAny`, we get `CommonPromiseCombinator`. - `PromiseAllDataHolder` is currently used for `Promise.all` and `Promise.allSettled`, and soon also for `Promise.any`. Rename it to `PromiseCombinatorDataHolder` to express that different Promise combinators use this object. Differential Revision: https://phabricator.services.mozilla.com/D51654
js/src/builtin/Promise.cpp
--- a/js/src/builtin/Promise.cpp
+++ b/js/src/builtin/Promise.cpp
@@ -131,24 +131,16 @@ enum BuiltinThenableJobSlots {
   // The Promise to resolve using the given thenable.
   BuiltinThenableJobSlot_Promise = 0,
 
   // The thenable to use as the receiver when calling the built-in `then`
   // function.
   BuiltinThenableJobSlot_Thenable,
 };
 
-enum PromiseAllDataHolderSlots {
-  PromiseAllDataHolderSlot_Promise = 0,
-  PromiseAllDataHolderSlot_RemainingElements,
-  PromiseAllDataHolderSlot_ValuesArray,
-  PromiseAllDataHolderSlot_ResolveFunction,
-  PromiseAllDataHolderSlots,
-};
-
 struct PromiseCapability {
   JSObject* promise = nullptr;
   JSObject* resolve = nullptr;
   JSObject* reject = nullptr;
 
   PromiseCapability() = default;
 
   void trace(JSTracer* trc);
@@ -200,74 +192,75 @@ class MutableWrappedPtrOperations<Promis
   }
   MutableHandleObject reject() {
     return MutableHandleObject::fromMarkedLocation(&capability().reject);
   }
 };
 
 }  // namespace js
 
-class PromiseAllDataHolder : public NativeObject {
+class PromiseCombinatorDataHolder : public NativeObject {
+  enum {
+    Slot_Promise = 0,
+    Slot_RemainingElements,
+    Slot_ValuesArray,
+    Slot_ResolveOrRejectFunction,
+    SlotsCount,
+  };
+
  public:
   static const JSClass class_;
-  JSObject* promiseObj() {
-    return &getFixedSlot(PromiseAllDataHolderSlot_Promise).toObject();
-  }
-  JSObject* resolveObj() {
-    return &getFixedSlot(PromiseAllDataHolderSlot_ResolveFunction).toObject();
-  }
-  Value valuesArray() {
-    return getFixedSlot(PromiseAllDataHolderSlot_ValuesArray);
-  }
+  JSObject* promiseObj() { return &getFixedSlot(Slot_Promise).toObject(); }
+  JSObject* resolveOrRejectObj() {
+    return &getFixedSlot(Slot_ResolveOrRejectFunction).toObject();
+  }
+  Value valuesArray() { return getFixedSlot(Slot_ValuesArray); }
   int32_t remainingCount() {
-    return getFixedSlot(PromiseAllDataHolderSlot_RemainingElements).toInt32();
+    return getFixedSlot(Slot_RemainingElements).toInt32();
   }
   int32_t increaseRemainingCount() {
-    int32_t remainingCount =
-        getFixedSlot(PromiseAllDataHolderSlot_RemainingElements).toInt32();
+    int32_t remainingCount = getFixedSlot(Slot_RemainingElements).toInt32();
     remainingCount++;
-    setFixedSlot(PromiseAllDataHolderSlot_RemainingElements,
-                 Int32Value(remainingCount));
+    setFixedSlot(Slot_RemainingElements, Int32Value(remainingCount));
     return remainingCount;
   }
   int32_t decreaseRemainingCount() {
-    int32_t remainingCount =
-        getFixedSlot(PromiseAllDataHolderSlot_RemainingElements).toInt32();
+    int32_t remainingCount = getFixedSlot(Slot_RemainingElements).toInt32();
     remainingCount--;
-    setFixedSlot(PromiseAllDataHolderSlot_RemainingElements,
-                 Int32Value(remainingCount));
+    MOZ_ASSERT(remainingCount >= 0, "unpaired calls to decreaseRemainingCount");
+    setFixedSlot(Slot_RemainingElements, Int32Value(remainingCount));
     return remainingCount;
   }
+
+  static PromiseCombinatorDataHolder* New(JSContext* cx,
+                                          HandleObject resultPromise,
+                                          HandleValue valuesArray,
+                                          HandleObject resolveOrReject);
 };
 
-const JSClass PromiseAllDataHolder::class_ = {
-    "PromiseAllDataHolder",
-    JSCLASS_HAS_RESERVED_SLOTS(PromiseAllDataHolderSlots)};
-
-static PromiseAllDataHolder* NewPromiseAllDataHolder(JSContext* cx,
-                                                     HandleObject resultPromise,
-                                                     HandleValue valuesArray,
-                                                     HandleObject resolve) {
-  PromiseAllDataHolder* dataHolder =
-      NewBuiltinClassInstance<PromiseAllDataHolder>(cx);
+const JSClass PromiseCombinatorDataHolder::class_ = {
+    "PromiseCombinatorDataHolder", JSCLASS_HAS_RESERVED_SLOTS(SlotsCount)};
+
+PromiseCombinatorDataHolder* PromiseCombinatorDataHolder::New(
+    JSContext* cx, HandleObject resultPromise, HandleValue valuesArray,
+    HandleObject resolveOrReject) {
+  auto* dataHolder = NewBuiltinClassInstance<PromiseCombinatorDataHolder>(cx);
   if (!dataHolder) {
     return nullptr;
   }
 
   cx->check(resultPromise);
   cx->check(valuesArray);
-  cx->check(resolve);
-
-  dataHolder->setFixedSlot(PromiseAllDataHolderSlot_Promise,
-                           ObjectValue(*resultPromise));
-  dataHolder->setFixedSlot(PromiseAllDataHolderSlot_RemainingElements,
-                           Int32Value(1));
-  dataHolder->setFixedSlot(PromiseAllDataHolderSlot_ValuesArray, valuesArray);
-  dataHolder->setFixedSlot(PromiseAllDataHolderSlot_ResolveFunction,
-                           ObjectValue(*resolve));
+  cx->check(resolveOrReject);
+
+  dataHolder->setFixedSlot(Slot_Promise, ObjectValue(*resultPromise));
+  dataHolder->setFixedSlot(Slot_RemainingElements, Int32Value(1));
+  dataHolder->setFixedSlot(Slot_ValuesArray, valuesArray);
+  dataHolder->setFixedSlot(Slot_ResolveOrRejectFunction,
+                           ObjectValue(*resolveOrReject));
   return dataHolder;
 }
 
 namespace {
 // Generator used by PromiseObject::getID.
 mozilla::Atomic<uint64_t> gIDGenerator(0);
 }  // namespace
 
@@ -2277,44 +2270,44 @@ static MOZ_MUST_USE bool PerformPromiseA
 static MOZ_MUST_USE bool PerformPromiseAllSettled(
     JSContext* cx, PromiseForOfIterator& iterator, HandleObject C,
     Handle<PromiseCapability> resultCapability, bool* done);
 
 static MOZ_MUST_USE bool PerformPromiseRace(
     JSContext* cx, PromiseForOfIterator& iterator, HandleObject C,
     Handle<PromiseCapability> resultCapability, bool* done);
 
-enum class IterationMode { All, AllSettled, Race };
+enum class CombinatorKind { All, AllSettled, Race };
 
 // ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
 //
 // Unified implementation of
 // 25.6.4.1 Promise.all ( iterable )
 // 25.6.4.3 Promise.race ( iterable )
 //
 // Promise.allSettled (Stage 4 proposal)
 // https://tc39.github.io/proposal-promise-allSettled/
 //
 // Promise.allSettled ( iterable )
-static MOZ_MUST_USE bool CommonStaticAllRace(JSContext* cx, CallArgs& args,
-                                             IterationMode mode) {
+static MOZ_MUST_USE bool CommonPromiseCombinator(JSContext* cx, CallArgs& args,
+                                                 CombinatorKind kind) {
   HandleValue iterable = args.get(0);
 
   // Step 2 (moved from NewPromiseCapability, step 1).
   HandleValue CVal = args.thisv();
   if (!CVal.isObject()) {
     const char* message;
-    switch (mode) {
-      case IterationMode::All:
+    switch (kind) {
+      case CombinatorKind::All:
         message = "Receiver of Promise.all call";
         break;
-      case IterationMode::AllSettled:
+      case CombinatorKind::AllSettled:
         message = "Receiver of Promise.allSettled call";
         break;
-      case IterationMode::Race:
+      case CombinatorKind::Race:
         message = "Receiver of Promise.race call";
         break;
     }
     JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                               JSMSG_OBJECT_REQUIRED, message);
     return false;
   }
 
@@ -2330,42 +2323,42 @@ static MOZ_MUST_USE bool CommonStaticAll
   // Steps 3-4.
   PromiseForOfIterator iter(cx);
   if (!iter.init(iterable, JS::ForOfIterator::AllowNonIterable)) {
     return AbruptRejectPromise(cx, args, promiseCapability);
   }
 
   if (!iter.valueIsIterable()) {
     const char* message;
-    switch (mode) {
-      case IterationMode::All:
+    switch (kind) {
+      case CombinatorKind::All:
         message = "Argument of Promise.all";
         break;
-      case IterationMode::AllSettled:
+      case CombinatorKind::AllSettled:
         message = "Argument of Promise.allSettled";
         break;
-      case IterationMode::Race:
+      case CombinatorKind::Race:
         message = "Argument of Promise.race";
         break;
     }
     JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_ITERABLE,
                               message);
     return AbruptRejectPromise(cx, args, promiseCapability);
   }
 
   // Step 5.
   bool done, result;
-  switch (mode) {
-    case IterationMode::All:
+  switch (kind) {
+    case CombinatorKind::All:
       result = PerformPromiseAll(cx, iter, C, promiseCapability, &done);
       break;
-    case IterationMode::AllSettled:
+    case CombinatorKind::AllSettled:
       result = PerformPromiseAllSettled(cx, iter, C, promiseCapability, &done);
       break;
-    case IterationMode::Race:
+    case CombinatorKind::Race:
       result = PerformPromiseRace(cx, iter, C, promiseCapability, &done);
       break;
   }
 
   // Step 6.
   if (!result) {
     // Step 6.a.
     if (!done) {
@@ -2380,17 +2373,17 @@ static MOZ_MUST_USE bool CommonStaticAll
   args.rval().setObject(*promiseCapability.promise());
   return true;
 }
 
 // ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
 // 25.6.4.1 Promise.all ( iterable )
 static bool Promise_static_all(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
-  return CommonStaticAllRace(cx, args, IterationMode::All);
+  return CommonPromiseCombinator(cx, args, CombinatorKind::All);
 }
 
 static MOZ_MUST_USE bool PerformPromiseThen(
     JSContext* cx, Handle<PromiseObject*> promise, HandleValue onFulfilled_,
     HandleValue onRejected_, Handle<PromiseCapability> resultCapability);
 
 static MOZ_MUST_USE bool PerformPromiseThenWithoutSettleHandlers(
     JSContext* cx, Handle<PromiseObject*> promise,
@@ -2444,20 +2437,21 @@ MOZ_MUST_USE JSObject* js::GetWaitForAll
     valuesArray->ensureDenseInitializedLength(cx, 0, promiseCount);
 
     // Sub-step 4.
     // Create our data holder that holds all the things shared across
     // every step of the iterator.  In particular, this holds the
     // remainingElementsCount (as an integer reserved slot), the array of
     // values, and the resolve function from our PromiseCapability.
     RootedValue valuesArrayVal(cx, ObjectValue(*valuesArray));
-    Rooted<PromiseAllDataHolder*> dataHolder(cx);
-    dataHolder =
-        NewPromiseAllDataHolder(cx, resultCapability.promise(), valuesArrayVal,
-                                resultCapability.resolve());
+    Rooted<PromiseCombinatorDataHolder*> dataHolder(cx);
+    dataHolder = PromiseCombinatorDataHolder::New(cx,
+                                                  resultCapability.promise(),
+                                                  valuesArrayVal,
+                                                  resultCapability.resolve());
     if (!dataHolder) {
       return nullptr;
     }
 
     // Call PerformPromiseThen with resolve and reject set to nullptr.
     Rooted<PromiseCapability> resultCapabilityWithoutResolving(cx);
     resultCapabilityWithoutResolving.promise().set(resultCapability.promise());
 
@@ -2601,17 +2595,17 @@ static bool IsPromiseSpecies(JSContext* 
 // ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
 // 25.6.4.1.1 Runtime Semantics: PerformPromiseAll, steps 5-6 and step 8.
 // 25.6.4.3.1 Runtime Semantics: PerformPromiseRace, steps 3-5.
 //
 // Promise.allSettled (Stage 4 proposal)
 // https://tc39.github.io/proposal-promise-allSettled/
 // Runtime Semantics: PerformPromiseAllSettled, steps 5-6 and step 8.
 template <typename T>
-static MOZ_MUST_USE bool CommonPerformPromiseAllRace(
+static MOZ_MUST_USE bool CommonPerformPromiseCombinator(
     JSContext* cx, PromiseForOfIterator& iterator, HandleObject C,
     HandleObject resultPromise, bool* done, bool resolveReturnsUndefined,
     T getResolveAndReject) {
   RootedObject promiseCtor(
       cx, GlobalObject::getOrCreatePromiseConstructor(cx, cx->global()));
   if (!promiseCtor) {
     return false;
   }
@@ -2964,20 +2958,20 @@ static MOZ_MUST_USE bool PerformPromiseA
     valuesArrayVal.setObject(*valuesArray);
   }
 
   // Step 4.
   // Create our data holder that holds all the things shared across
   // every step of the iterator.  In particular, this holds the
   // remainingElementsCount (as an integer reserved slot), the array of
   // values, and the resolve function from our PromiseCapability.
-  Rooted<PromiseAllDataHolder*> dataHolder(cx);
-  dataHolder =
-      NewPromiseAllDataHolder(cx, resultCapability.promise(), valuesArrayVal,
-                              resultCapability.resolve());
+  Rooted<PromiseCombinatorDataHolder*> dataHolder(cx);
+  dataHolder = PromiseCombinatorDataHolder::New(cx, resultCapability.promise(),
+                                                valuesArrayVal,
+                                                resultCapability.resolve());
   if (!dataHolder) {
     return false;
   }
 
   // Step 7.
   uint32_t index = 0;
 
   auto getResolveAndReject = [cx, &resultCapability, &valuesArray, &dataHolder,
@@ -3018,18 +3012,19 @@ static MOZ_MUST_USE bool PerformPromiseA
     MOZ_ASSERT(index > 0);
 
     resolveFunVal.setObject(*resolveFunc);
     rejectFunVal.setObject(*resultCapability.reject());
     return true;
   };
 
   // Steps 5-6 and 8.
-  if (!CommonPerformPromiseAllRace(cx, iterator, C, resultCapability.promise(),
-                                   done, true, getResolveAndReject)) {
+  if (!CommonPerformPromiseCombinator(cx, iterator, C,
+                                      resultCapability.promise(), done, true,
+                                      getResolveAndReject)) {
     return false;
   }
 
   // Step 8.d.ii.
   int32_t remainingCount = dataHolder->decreaseRemainingCount();
 
   // Steps 8.d.iii-iv.
   if (remainingCount == 0) {
@@ -3056,18 +3051,18 @@ static bool PromiseAllResolveElementFunc
   // We use the existence of the data holder as a signal for whether the
   // Promise was already resolved. Upon resolution, it's reset to
   // `undefined`.
   if (dataVal.isUndefined()) {
     args.rval().setUndefined();
     return true;
   }
 
-  Rooted<PromiseAllDataHolder*> data(
-      cx, &dataVal.toObject().as<PromiseAllDataHolder>());
+  Rooted<PromiseCombinatorDataHolder*> data(
+      cx, &dataVal.toObject().as<PromiseCombinatorDataHolder>());
 
   // Step 3.
   resolve->setExtendedSlot(PromiseAllResolveElementFunctionSlot_Data,
                            UndefinedValue());
 
   // Step 4.
   int32_t index =
       resolve
@@ -3102,38 +3097,38 @@ static bool PromiseAllResolveElementFunc
   MOZ_ASSERT(values->getDenseElement(index).isUndefined());
   values->setDenseElement(index, xVal);
 
   // Steps 7,9.
   uint32_t remainingCount = data->decreaseRemainingCount();
 
   // Step 10.
   if (remainingCount == 0) {
-    // Step 10.a. (Omitted, happened in PerformPromiseAll.)
-    // Step 10.b.
-
-    // Step 6 (Adapted to work with PromiseAllDataHolder's layout).
-    RootedObject resolveAllFun(cx, data->resolveObj());
+    // Step 11.a. (Omitted, happened in PerformPromiseAll.)
+    // Step 11.b.
+
+    // Step 7 (Adapted to work with PromiseCombinatorDataHolder's layout).
+    RootedObject resolveAllFun(cx, data->resolveOrRejectObj());
     RootedObject promiseObj(cx, data->promiseObj());
     if (!RunResolutionFunction(cx, resolveAllFun, valuesVal, ResolveMode,
                                promiseObj)) {
       return false;
     }
   }
 
   // Step 11.
   args.rval().setUndefined();
   return true;
 }
 
 // ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
 // 25.6.4.3 Promise.race ( iterable )
 static bool Promise_static_race(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
-  return CommonStaticAllRace(cx, args, IterationMode::Race);
+  return CommonPromiseCombinator(cx, args, CombinatorKind::Race);
 }
 
 // ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9
 // 25.6.4.3.1 PerformPromiseRace (iteratorRecord, constructor, resultCapability)
 static MOZ_MUST_USE bool PerformPromiseRace(
     JSContext* cx, PromiseForOfIterator& iterator, HandleObject C,
     Handle<PromiseCapability> resultCapability, bool* done) {
   *done = false;
@@ -3153,19 +3148,19 @@ static MOZ_MUST_USE bool PerformPromiseR
                                  MutableHandleValue resolveFunVal,
                                  MutableHandleValue rejectFunVal) {
     resolveFunVal.setObject(*resultCapability.resolve());
     rejectFunVal.setObject(*resultCapability.reject());
     return true;
   };
 
   // Steps 3-5.
-  return CommonPerformPromiseAllRace(cx, iterator, C,
-                                     resultCapability.promise(), done,
-                                     isDefaultResolveFn, getResolveAndReject);
+  return CommonPerformPromiseCombinator(
+      cx, iterator, C, resultCapability.promise(), done, isDefaultResolveFn,
+      getResolveAndReject);
 }
 
 enum class PromiseAllSettledElementFunctionKind { Resolve, Reject };
 
 // Promise.allSettled (Stage 4 proposal)
 // https://tc39.github.io/proposal-promise-allSettled/
 //
 // Promise.allSettled Resolve Element Functions
@@ -3175,17 +3170,17 @@ static bool PromiseAllSettledElementFunc
                                              Value* vp);
 
 // Promise.allSettled (Stage 4 proposal)
 // https://tc39.github.io/proposal-promise-allSettled/
 //
 // Promise.allSettled ( iterable )
 static bool Promise_static_allSettled(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
-  return CommonStaticAllRace(cx, args, IterationMode::AllSettled);
+  return CommonPromiseCombinator(cx, args, CombinatorKind::AllSettled);
 }
 
 // Promise.allSettled (Stage 4 proposal)
 // https://tc39.github.io/proposal-promise-allSettled/
 //
 // PerformPromiseAllSettled ( iteratorRecord, constructor, resultCapability )
 static MOZ_MUST_USE bool PerformPromiseAllSettled(
     JSContext* cx, PromiseForOfIterator& iterator, HandleObject C,
@@ -3228,20 +3223,20 @@ static MOZ_MUST_USE bool PerformPromiseA
     valuesArrayVal.setObject(*valuesArray);
   }
 
   // Step 4.
   // Create our data holder that holds all the things shared across every step
   // of the iterator. In particular, this holds the remainingElementsCount
   // (as an integer reserved slot), the array of values, and the resolve
   // function from our PromiseCapability.
-  Rooted<PromiseAllDataHolder*> dataHolder(cx);
-  dataHolder =
-      NewPromiseAllDataHolder(cx, resultCapability.promise(), valuesArrayVal,
-                              resultCapability.resolve());
+  Rooted<PromiseCombinatorDataHolder*> dataHolder(cx);
+  dataHolder = PromiseCombinatorDataHolder::New(cx, resultCapability.promise(),
+                                                valuesArrayVal,
+                                                resultCapability.resolve());
   if (!dataHolder) {
     return false;
   }
 
   // Step 7.
   uint32_t index = 0;
 
   auto getResolveAndReject = [cx, &valuesArray, &dataHolder, &index](
@@ -3305,18 +3300,19 @@ static MOZ_MUST_USE bool PerformPromiseA
     // Step 8.aa.
     index++;
     MOZ_ASSERT(index > 0);
 
     return true;
   };
 
   // Steps 5-6 and 8.
-  if (!CommonPerformPromiseAllRace(cx, iterator, C, resultCapability.promise(),
-                                   done, true, getResolveAndReject)) {
+  if (!CommonPerformPromiseCombinator(cx, iterator, C,
+                                      resultCapability.promise(), done, true,
+                                      getResolveAndReject)) {
     return false;
   }
 
   // Step 8.d.ii.
   int32_t remainingCount = dataHolder->decreaseRemainingCount();
 
   // Steps 8.d.iii-iv.
   if (remainingCount == 0) {
@@ -3335,20 +3331,20 @@ static MOZ_MUST_USE bool PerformPromiseA
 template <PromiseAllSettledElementFunctionKind Kind>
 static bool PromiseAllSettledElementFunction(JSContext* cx, unsigned argc,
                                              Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   HandleValue valueOrReason = args.get(0);
 
   // Step 1.
   JSFunction* resolve = &args.callee().as<JSFunction>();
-  Rooted<PromiseAllDataHolder*> data(
+  Rooted<PromiseCombinatorDataHolder*> data(
       cx, &resolve->getExtendedSlot(PromiseAllSettledElementFunctionSlot_Data)
                .toObject()
-               .as<PromiseAllDataHolder>());
+               .as<PromiseCombinatorDataHolder>());
 
   // Steps 2-4 (moved below).
 
   // Step 5.
   int32_t index =
       resolve
           ->getExtendedSlot(PromiseAllSettledElementFunctionSlot_ElementIndex)
           .toInt32();
@@ -3423,18 +3419,18 @@ static bool PromiseAllSettledElementFunc
   // Steps 8, 13.
   uint32_t remainingCount = data->decreaseRemainingCount();
 
   // Step 14.
   if (remainingCount == 0) {
     // Step 14.a. (Omitted, happened in PerformPromiseAllSettled.)
     // Step 14.b.
 
-    // Step 7 (Adapted to work with PromiseAllDataHolder's layout).
-    RootedObject resolveAllFun(cx, data->resolveObj());
+    // Step 7 (Adapted to work with PromiseCombinatorDataHolder's layout).
+    RootedObject resolveAllFun(cx, data->resolveOrRejectObj());
     RootedObject promiseObj(cx, data->promiseObj());
     if (!RunResolutionFunction(cx, resolveAllFun, valuesVal, ResolveMode,
                                promiseObj)) {
       return false;
     }
   }
 
   // Step 15.