Bug 1289987 - Part 3: Remove curly braces workaround for VS2013 ICE in ranged for loops in js/. r=fitzgen
authorChris Peterson <cpeterson@mozilla.com>
Thu, 28 Jul 2016 22:23:10 -0700
changeset 307383 e2582f36b0e3be2c6bf1184adf506e36770249ed
parent 307382 2b9b892d36ff4e85c7dac2f0b65608ceebe531d7
child 307384 29315d9869a2305543e7dbf5e2f269d7dda43d6e
push id30508
push usercbook@mozilla.com
push dateSat, 30 Jul 2016 14:21:21 +0000
treeherdermozilla-central@e5859dfe0bcb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1289987
milestone50.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 1289987 - Part 3: Remove curly braces workaround for VS2013 ICE in ranged for loops in js/. r=fitzgen
js/public/HeapAPI.h
js/src/asmjs/WasmIonCompile.cpp
js/src/jsapi-tests/testGCExactRooting.cpp
js/src/jsapi-tests/testSharedImmutableStringsCache.cpp
js/src/jscntxt.cpp
js/src/jsgc.cpp
js/src/jspubtd.h
js/src/jsweakmap.cpp
--- a/js/public/HeapAPI.h
+++ b/js/public/HeapAPI.h
@@ -121,19 +121,18 @@ struct Zone
 
     bool needsIncrementalBarrier_;
 
     Zone(JSRuntime* runtime, JSTracer* barrierTracerArg)
       : runtime_(runtime),
         barrierTracer_(barrierTracerArg),
         needsIncrementalBarrier_(false)
     {
-        for (auto& stackRootPtr : stackRoots_) {
+        for (auto& stackRootPtr : stackRoots_)
             stackRootPtr = nullptr;
-        }
     }
 
     bool needsIncrementalBarrier() const {
         return needsIncrementalBarrier_;
     }
 
     JSTracer* barrierTracer() {
         MOZ_ASSERT(needsIncrementalBarrier_);
--- a/js/src/asmjs/WasmIonCompile.cpp
+++ b/js/src/asmjs/WasmIonCompile.cpp
@@ -215,19 +215,18 @@ class FunctionCompiler
     void finish()
     {
         mirGen().initWasmMaxStackArgBytes(maxStackArgBytes_);
 
         MOZ_ASSERT(callStack_.empty());
         MOZ_ASSERT(loopDepth_ == 0);
         MOZ_ASSERT(blockDepth_ == 0);
 #ifdef DEBUG
-        for (ControlFlowPatchVector& patches : blockPatches_) {
+        for (ControlFlowPatchVector& patches : blockPatches_)
             MOZ_ASSERT(patches.empty());
-        }
 #endif
         MOZ_ASSERT(inDeadCode());
         MOZ_ASSERT(done(), "all bytes must be consumed");
         MOZ_ASSERT(func_.callSiteLineNums().length() == lastReadCallSite_);
     }
 
     /************************* Read-only interface (after local scope setup) */
 
--- a/js/src/jsapi-tests/testGCExactRooting.cpp
+++ b/js/src/jsapi-tests/testGCExactRooting.cpp
@@ -258,56 +258,52 @@ BEGIN_TEST(testGCRootedVector)
         buffer[0] = 'a' + i;
         buffer[1] = '\0';
         bool match;
         CHECK(JS_StringEqualsAscii(cx, JSID_TO_STRING(shapes[i]->propid()), buffer, &match));
         CHECK(match);
     }
 
     // Ensure iterator enumeration works through the rooted.
-    for (auto shape : shapes) {
+    for (auto shape : shapes)
         CHECK(shape);
-    }
 
     CHECK(receiveConstRefToShapeVector(shapes));
 
     // Ensure rooted converts to handles.
     CHECK(receiveHandleToShapeVector(shapes));
     CHECK(receiveMutableHandleToShapeVector(&shapes));
 
     return true;
 }
 
 bool
 receiveConstRefToShapeVector(const JS::Rooted<GCVector<Shape*>>& rooted)
 {
     // Ensure range enumeration works through the reference.
-    for (auto shape : rooted) {
+    for (auto shape : rooted)
         CHECK(shape);
-    }
     return true;
 }
 
 bool
 receiveHandleToShapeVector(JS::Handle<GCVector<Shape*>> handle)
 {
     // Ensure range enumeration works through the handle.
-    for (auto shape : handle) {
+    for (auto shape : handle)
         CHECK(shape);
-    }
     return true;
 }
 
 bool
 receiveMutableHandleToShapeVector(JS::MutableHandle<GCVector<Shape*>> handle)
 {
     // Ensure range enumeration works through the handle.
-    for (auto shape : handle) {
+    for (auto shape : handle)
         CHECK(shape);
-    }
     return true;
 }
 END_TEST(testGCRootedVector)
 
 BEGIN_TEST(testTraceableFifo)
 {
     using ShapeFifo = TraceableFifo<Shape*>;
     JS::Rooted<ShapeFifo> shapes(cx, ShapeFifo(cx));
--- a/js/src/jsapi-tests/testSharedImmutableStringsCache.cpp
+++ b/js/src/jsapi-tests/testSharedImmutableStringsCache.cpp
@@ -76,15 +76,14 @@ BEGIN_TEST(testSharedImmutableStringsCac
                                       PR_PRIORITY_NORMAL,
                                       PR_LOCAL_THREAD,
                                       PR_JOINABLE_THREAD,
                                       0);
         CHECK(thread);
         threads.infallibleAppend(thread);
     }
 
-    for (auto thread : threads) {
+    for (auto thread : threads)
         CHECK(PR_JoinThread(thread) == PR_SUCCESS);
-    }
 
     return true;
 }
 END_TEST(testSharedImmutableStringsCache)
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -135,19 +135,18 @@ js::DestroyContext(JSContext* cx)
         PrintTypes(cx, c, false);
 
     js_delete_poison(cx);
 }
 
 void
 RootLists::checkNoGCRooters() {
 #ifdef DEBUG
-    for (auto const& stackRootPtr : stackRoots_) {
+    for (auto const& stackRootPtr : stackRoots_)
         MOZ_ASSERT(stackRootPtr == nullptr);
-    }
 #endif
 }
 
 bool
 AutoResolving::alreadyStartedSlow() const
 {
     MOZ_ASSERT(link);
     AutoResolving* cursor = link;
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1421,19 +1421,18 @@ GCRuntime::removeFinalizeCallback(JSFina
             break;
         }
     }
 }
 
 void
 GCRuntime::callFinalizeCallbacks(FreeOp* fop, JSFinalizeStatus status) const
 {
-    for (auto& p : finalizeCallbacks) {
+    for (auto& p : finalizeCallbacks)
         p.op(fop, status, !isFull, p.data);
-    }
 }
 
 bool
 GCRuntime::addWeakPointerZoneGroupCallback(JSWeakPointerZoneGroupCallback callback, void* data)
 {
     return updateWeakPointerZoneGroupCallbacks.append(
             Callback<JSWeakPointerZoneGroupCallback>(callback, data));
 }
@@ -1447,19 +1446,18 @@ GCRuntime::removeWeakPointerZoneGroupCal
             break;
         }
     }
 }
 
 void
 GCRuntime::callWeakPointerZoneGroupCallbacks() const
 {
-    for (auto const& p : updateWeakPointerZoneGroupCallbacks) {
+    for (auto const& p : updateWeakPointerZoneGroupCallbacks)
         p.op(rt->contextFromMainThread(), p.data);
-    }
 }
 
 bool
 GCRuntime::addWeakPointerCompartmentCallback(JSWeakPointerCompartmentCallback callback, void* data)
 {
     return updateWeakPointerCompartmentCallbacks.append(
             Callback<JSWeakPointerCompartmentCallback>(callback, data));
 }
@@ -1473,19 +1471,18 @@ GCRuntime::removeWeakPointerCompartmentC
             break;
         }
     }
 }
 
 void
 GCRuntime::callWeakPointerCompartmentCallbacks(JSCompartment* comp) const
 {
-    for (auto const& p : updateWeakPointerCompartmentCallbacks) {
+    for (auto const& p : updateWeakPointerCompartmentCallbacks)
         p.op(rt->contextFromMainThread(), comp, p.data);
-    }
 }
 
 JS::GCSliceCallback
 GCRuntime::setSliceCallback(JS::GCSliceCallback callback) {
     return stats.setSliceCallback(callback);
 }
 
 JS::GCNurseryCollectionCallback
@@ -2049,19 +2046,18 @@ ArenaLists::relocateArenas(Zone* zone, A
             al.clear();
             relocatedListOut = al.relocateArenas(allArenas, relocatedListOut, sliceBudget, stats);
         }
     } else {
         size_t arenaCount = 0;
         size_t relocCount = 0;
         AllAllocKindArray<Arena**> toRelocate;
 
-        for (auto kind : AllocKindsToRelocate) {
+        for (auto kind : AllocKindsToRelocate)
             toRelocate[kind] = arenaLists[kind].pickArenasToRelocate(arenaCount, relocCount);
-        }
 
         if (!ShouldRelocateZone(arenaCount, relocCount, reason))
             return false;
 
         zone->prepareForCompacting();
         for (auto kind : AllocKindsToRelocate) {
             if (toRelocate[kind]) {
                 ArenaList& al = arenaLists[kind];
@@ -2819,19 +2815,18 @@ ArenaLists::backgroundFinalize(FreeOp* f
 }
 
 void
 ArenaLists::queueForegroundObjectsForSweep(FreeOp* fop)
 {
     gcstats::AutoPhase ap(fop->runtime()->gc.stats, gcstats::PHASE_SWEEP_OBJECT);
 
 #ifdef DEBUG
-    for (auto i : ObjectAllocKinds()) { // Braces needed to appease MSVC 2013.
+    for (auto i : ObjectAllocKinds())
         MOZ_ASSERT(savedObjectArenas[i].isEmpty());
-    }
     MOZ_ASSERT(savedEmptyObjectArenas == nullptr);
 #endif
 
     // Foreground finalized objects must be finalized at the beginning of the
     // sweep phase, before control can return to the mutator. Otherwise,
     // mutator behavior can resurrect certain objects whose references would
     // otherwise have been erased by the finalizer.
     finalizeNow(fop, AllocKind::OBJECT0, KEEP_ARENAS, &savedEmptyObjectArenas);
@@ -3780,19 +3775,18 @@ GCRuntime::beginMarkPhase(JS::gcreason::
     isFull = true;
     bool any = false;
 
     for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
         /* Assert that zone state is as we expect */
         MOZ_ASSERT(!zone->isCollecting());
         MOZ_ASSERT(!zone->compartments.empty());
 #ifdef DEBUG
-        for (auto i : AllAllocKinds()) { // Braces needed to appease MSVC 2013.
+        for (auto i : AllAllocKinds())
             MOZ_ASSERT(!zone->arenas.arenaListsToSweep[i]);
-        }
 #endif
 
         /* Set up which zones will be collected. */
         if (zone->isGCScheduled()) {
             if (!zone->isAtomsZone()) {
                 any = true;
                 zone->setGCState(Zone::Mark);
             }
--- a/js/src/jspubtd.h
+++ b/js/src/jspubtd.h
@@ -282,19 +282,18 @@ class RootLists
 
     // Heap GC roots for PersistentRooted pointers.
     mozilla::EnumeratedArray<JS::RootKind, JS::RootKind::Limit,
                              mozilla::LinkedList<JS::PersistentRooted<void*>>> heapRoots_;
     template <typename T> friend class JS::PersistentRooted;
 
   public:
     RootLists() : autoGCRooters_(nullptr) {
-        for (auto& stackRootPtr : stackRoots_) {
+        for (auto& stackRootPtr : stackRoots_)
             stackRootPtr = nullptr;
-        }
     }
 
     ~RootLists() {
         // The semantics of PersistentRooted containing pointers and tagged
         // pointers are somewhat different from those of PersistentRooted
         // containing a structure with a trace method. PersistentRooted
         // containing pointers are allowed to outlive the owning RootLists,
         // whereas those containing a traceable structure are not.
--- a/js/src/jsweakmap.cpp
+++ b/js/src/jsweakmap.cpp
@@ -84,19 +84,18 @@ WeakMapBase::sweepZone(JS::Zone* zone)
             /* Destroy the hash map now to catch any use after this point. */
             m->finish();
             m->removeFrom(zone->gcWeakMapList);
         }
         m = next;
     }
 
 #ifdef DEBUG
-    for (WeakMapBase* m : zone->gcWeakMapList) {
+    for (WeakMapBase* m : zone->gcWeakMapList)
         MOZ_ASSERT(m->isInList() && m->marked);
-    }
 #endif
 }
 
 void
 WeakMapBase::traceAllMappings(WeakMapTracer* tracer)
 {
     JSRuntime* rt = tracer->runtime;
     for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {