Bug 1384513 backout followup - Add AutoCheckCannotGC in Stream.cpp. r=me
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 01 Aug 2017 10:49:02 +0200
changeset 420906 d7d20b3b2f303590edba39d9d86943e6e757a243
parent 420905 94b3c2e4a6fddabe0a67fd9a67f312206d49a5d6
child 420907 c893a197feb671331d469c231d5fc7d40e5fe62f
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1384513
milestone56.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 1384513 backout followup - Add AutoCheckCannotGC in Stream.cpp. r=me
js/src/builtin/Stream.cpp
--- a/js/src/builtin/Stream.cpp
+++ b/js/src/builtin/Stream.cpp
@@ -3497,17 +3497,18 @@ ReadableByteStreamControllerPullSteps(JS
             void* underlyingSource = val.toPrivate();
 
             view = JS_NewUint8Array(cx, queueTotalSize);
             if (!view)
                 return nullptr;
 
             size_t bytesWritten;
             {
-                JS::AutoSuppressGCAnalysis noGC(cx);
+                JS::AutoSuppressGCAnalysis suppressGC(cx);
+                JS::AutoCheckCannotGC noGC;
                 bool dummy;
                 void* buffer = JS_GetArrayBufferViewData(view, &dummy, noGC);
                 auto cb = cx->runtime()->readableStreamWriteIntoReadRequestCallback;
                 MOZ_ASSERT(cb);
                 // TODO: use bytesWritten to correctly update the request's state.
                 cb(cx, stream, underlyingSource, stream->embeddingFlags(), buffer,
                    queueTotalSize, &bytesWritten);
             }
@@ -4239,17 +4240,18 @@ ReadableByteStreamControllerFillPullInto
         Value val = controller->getFixedSlot(ControllerSlot_UnderlyingSource);
         void* underlyingSource = val.toPrivate();
 
         RootedArrayBufferObject targetBuffer(cx, pullIntoDescriptor->buffer());
         Rooted<ReadableStream*> stream(cx, StreamFromController(controller));
 
         size_t bytesWritten;
         {
-            JS::AutoSuppressGCAnalysis noGC(cx);
+            JS::AutoSuppressGCAnalysis suppressGC(cx);
+            JS::AutoCheckCannotGC noGC;
             bool dummy;
             uint8_t* buffer = JS_GetArrayBufferData(targetBuffer, &dummy, noGC);
             buffer += bytesFilled;
             auto cb = cx->runtime()->readableStreamWriteIntoReadRequestCallback;
             MOZ_ASSERT(cb);
             cb(cx, stream, underlyingSource, stream->embeddingFlags(), buffer,
                totalBytesToCopyRemaining, &bytesWritten);
             pullIntoDescriptor->setBytesFilled(bytesFilled + bytesWritten);
@@ -5395,17 +5397,18 @@ ReadableStream::updateDataAvailableFromS
         if (!transferredView)
             return false;
 
         Value val = controller->getFixedSlot(ControllerSlot_UnderlyingSource);
         void* underlyingSource = val.toPrivate();
 
         size_t bytesWritten;
         {
-            JS::AutoSuppressGCAnalysis noGC(cx);
+            JS::AutoSuppressGCAnalysis suppressGC(cx);
+            JS::AutoCheckCannotGC noGC;
             bool dummy;
             void* buffer = JS_GetArrayBufferViewData(transferredView, &dummy, noGC);
             auto cb = cx->runtime()->readableStreamWriteIntoReadRequestCallback;
             MOZ_ASSERT(cb);
             // TODO: use bytesWritten to correctly update the request's state.
             cb(cx, stream, underlyingSource, stream->embeddingFlags(), buffer,
                availableData, &bytesWritten);
         }