Backed out 2 changesets (bug 1514051) for hazard-linux64-haz bustages at Stream.cpp . CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Tue, 15 Jan 2019 01:19:36 +0200
changeset 510946 547d738dabfa0fc3064399a6ea1c0c950af59971
parent 510945 850b70af2f47be4f8a0d72dc860f39d6ee7d9916
child 510947 e4177ef055d37264b366b86312dbd5e612895321
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1514051
milestone66.0a1
backs out4b9bf0633280fa3fc6994e45700d1626be970cab
bd071dbcecad945f22ef53c976e312d3a2ee0c21
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
Backed out 2 changesets (bug 1514051) for hazard-linux64-haz bustages at Stream.cpp . CLOSED TREE Backed out changeset 4b9bf0633280 (bug 1514051) Backed out changeset bd071dbcecad (bug 1514051)
js/src/builtin/Stream.cpp
js/src/builtin/Stream.h
--- a/js/src/builtin/Stream.cpp
+++ b/js/src/builtin/Stream.cpp
@@ -2630,22 +2630,19 @@ static JSObject* ReadableStreamDefaultCo
   if (unwrappedQueue && unwrappedQueue->length() != 0) {
     // Step a: Let chunk be ! DequeueValue(this).
     RootedValue chunk(cx);
     if (!DequeueValue(cx, unwrappedController, &chunk)) {
       return nullptr;
     }
 
     // Step b: If this.[[closeRequested]] is true and this.[[queue]] is empty,
+    //         perform ! ReadableStreamClose(stream).
     if (unwrappedController->closeRequested() &&
         unwrappedQueue->length() == 0) {
-      // Step i: Perform ! ReadableStreamDefaultControllerClearAlgorithms(this).
-      ReadableStreamControllerClearAlgorithms(unwrappedController);
-
-      // Step ii: Perform ! ReadableStreamClose(stream).
       if (!ReadableStreamCloseInternal(cx, unwrappedStream)) {
         return nullptr;
       }
     }
 
     // Step c: Otherwise, perform
     //         ! ReadableStreamDefaultControllerCallPullIfNeeded(this).
     else {
@@ -2942,22 +2939,20 @@ static bool ReadableStreamControllerShou
  * Streams spec, 3.9.4.
  *      ReadableStreamDefaultControllerClearAlgorithms ( controller )
  * and 3.12.4.
  *      ReadableByteStreamControllerClearAlgorithms ( controller )
  */
 static void ReadableStreamControllerClearAlgorithms(
     ReadableStreamController* controller) {
   // Step 1: Set controller.[[pullAlgorithm]] to undefined.
+  controller->setPullMethod(UndefinedHandleValue);
+
   // Step 2: Set controller.[[cancelAlgorithm]] to undefined.
-  // (In this implementation, the UnderlyingSource slot is part of the
-  // representation of these algorithms.)
-  controller->setPullMethod(UndefinedHandleValue);
   controller->setCancelMethod(UndefinedHandleValue);
-  controller->clearUnderlyingSource();
 
   // Step 3 (of 3.9.4 only) : Set controller.[[strategySizeAlgorithm]] to
   // undefined.
   if (controller->is<ReadableStreamDefaultController>()) {
     controller->as<ReadableStreamDefaultController>().setStrategySize(
         UndefinedHandleValue);
   }
 }
@@ -2975,24 +2970,20 @@ static MOZ_MUST_USE bool ReadableStreamD
   //         ! ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)
   //         is true.
   MOZ_ASSERT(!unwrappedController->closeRequested());
   MOZ_ASSERT(unwrappedStream->readable());
 
   // Step 3: Set controller.[[closeRequested]] to true.
   unwrappedController->setCloseRequested();
 
-  // Step 4: If controller.[[queue]] is empty,
+  // Step 5: If controller.[[queue]] is empty, perform
+  //         ! ReadableStreamClose(stream).
   Rooted<ListObject*> unwrappedQueue(cx, unwrappedController->queue());
   if (unwrappedQueue->length() == 0) {
-    // Step a: Perform
-    //         ! ReadableStreamDefaultControllerClearAlgorithms(controller).
-    ReadableStreamControllerClearAlgorithms(unwrappedController);
-
-    // Step b: Perform ! ReadableStreamClose(stream).
     return ReadableStreamCloseInternal(cx, unwrappedStream);
   }
 
   return true;
 }
 
 static MOZ_MUST_USE bool EnqueueValueWithSize(
     JSContext* cx, Handle<ReadableStreamController*> unwrappedContainer,
@@ -3112,22 +3103,17 @@ static MOZ_MUST_USE bool ReadableStreamC
     }
   }
 
   // Step 3 (or 4): Perform ! ResetQueue(controller).
   if (!ResetQueue(cx, unwrappedController)) {
     return false;
   }
 
-  // Step 4 (or 5):
-  //      Perform ! ReadableStreamDefaultControllerClearAlgorithms(controller)
-  //      (or ReadableByteStreamControllerClearAlgorithms(controller)).
-  ReadableStreamControllerClearAlgorithms(unwrappedController);
-
-  // Step 5 (or 6): Perform ! ReadableStreamError(stream, e).
+  // Step 4 (or 5): Perform ! ReadableStreamError(stream, e).
   return ReadableStreamErrorInternal(cx, unwrappedStream, e);
 }
 
 /**
  * Streams spec, 3.9.8.
  *      ReadableStreamDefaultControllerGetDesiredSize ( controller )
  * Streams spec 3.12.14.
  *      ReadableByteStreamControllerGetDesiredSize ( controller )
@@ -3887,20 +3873,17 @@ static MOZ_MUST_USE bool ReadableByteStr
       }
 
       // Step iii: Throw e.
       cx->setPendingException(e);
       return false;
     }
   }
 
-  // Step 6: Perform ! ReadableByteStreamControllerClearAlgorithms(controller).
-  ReadableStreamControllerClearAlgorithms(unwrappedController);
-
-  // Step 7: Perform ! ReadableStreamClose(stream).
+  // Step 6: Perform ! ReadableStreamClose(stream).
   return ReadableStreamCloseInternal(cx, unwrappedStream);
 }
 
 // Streams spec, 3.12.11. ReadableByteStreamControllerError ( controller, e )
 // Unified with 3.9.7 above.
 
 // Streams spec 3.12.14.
 //      ReadableByteStreamControllerGetDesiredSize ( controller )
@@ -3919,20 +3902,16 @@ static MOZ_MUST_USE bool ReadableByteStr
   Rooted<ReadableStream*> unwrappedStream(cx, unwrappedController->stream());
   MOZ_ASSERT(unwrappedStream->readable());
 
   // Step 2: If controller.[[queueTotalSize]] is 0 and
   //         controller.[[closeRequested]] is true,
   if (unwrappedController->queueTotalSize() == 0 &&
       unwrappedController->closeRequested()) {
     // Step a: Perform
-    //         ! ReadableByteStreamControllerClearAlgorithms(controller).
-    ReadableStreamControllerClearAlgorithms(unwrappedController);
-
-    // Step b: Perform
     //         ! ReadableStreamClose(controller.[[controlledReadableStream]]).
     return ReadableStreamCloseInternal(cx, unwrappedStream);
   }
 
   // Step 3: Otherwise,
   // Step a: Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller).
   return ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController);
 }
--- a/js/src/builtin/Stream.h
+++ b/js/src/builtin/Stream.h
@@ -311,23 +311,16 @@ class ReadableStreamController : public 
     MOZ_ASSERT(hasExternalSource());
     return static_cast<JS::ReadableStreamUnderlyingSource*>(
         underlyingSource().toPrivate());
   }
   void setExternalSource(JS::ReadableStreamUnderlyingSource* underlyingSource) {
     setUnderlyingSource(JS::PrivateValue(underlyingSource));
     addFlags(Flag_ExternalSource);
   }
-  void clearUnderlyingSource() {
-    if (hasExternalSource()) {
-      externalSource()->finalize();
-      setFlags(flags() & ~Flag_ExternalSource);
-    }
-    setUnderlyingSource(JS::UndefinedHandleValue);
-  }
   double strategyHWM() const {
     return getFixedSlot(Slot_StrategyHWM).toNumber();
   }
   void setStrategyHWM(double highWaterMark) {
     setFixedSlot(Slot_StrategyHWM, NumberValue(highWaterMark));
   }
   uint32_t flags() const { return getFixedSlot(Slot_Flags).toInt32(); }
   void setFlags(uint32_t flags) { setFixedSlot(Slot_Flags, Int32Value(flags)); }