Bug 1623957 - Part 9: Replace mozilla::IsVoid with std::is_void. r=jwalden
authorAndré Bargull <andre.bargull@gmail.com>
Sat, 21 Mar 2020 14:22:30 +0000
changeset 519993 83191a5d4366cb754560e195cbfa4827a5a17e91
parent 519992 2244abeb2f3602e8d4a8536b7e08660d3e3d7fa3
child 519994 49efd8881aab338d6f6801629226c78ffc9ad702
push id37237
push useraiakab@mozilla.com
push dateSat, 21 Mar 2020 21:28:09 +0000
treeherdermozilla-central@a1bea41f99f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1623957
milestone76.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 1623957 - Part 9: Replace mozilla::IsVoid with std::is_void. r=jwalden Differential Revision: https://phabricator.services.mozilla.com/D67657
js/src/vm/SharedMem.h
--- a/js/src/vm/SharedMem.h
+++ b/js/src/vm/SharedMem.h
@@ -73,21 +73,22 @@ class SharedMem {
   }
 
   // Reinterpret-cast the pointer to type U, preserving sharedness.
   // Eg, "obj->dataPointerEither().cast<uint8_t*>()" yields a
   // SharedMem<uint8_t*>.
   template <typename U>
   inline SharedMem<U> cast() const {
 #ifdef DEBUG
-    MOZ_ASSERT(asValue() %
-                   sizeof(mozilla::Conditional<
-                          mozilla::IsVoid<std::remove_pointer_t<U>>::value,
-                          char, std::remove_pointer_t<U>>) ==
-               0);
+    MOZ_ASSERT(
+        asValue() %
+            sizeof(
+                mozilla::Conditional<std::is_void_v<std::remove_pointer_t<U>>,
+                                     char, std::remove_pointer_t<U>>) ==
+        0);
     if (sharedness_ == IsUnshared) {
       return SharedMem<U>::unshared(unwrap());
     }
 #endif
     return SharedMem<U>::shared(unwrap());
   }
 
   explicit operator bool() { return ptr_ != nullptr; }
@@ -118,20 +119,22 @@ class SharedMem {
     return result;
   }
 
   uintptr_t asValue() const { return reinterpret_cast<uintptr_t>(ptr_); }
 
   // Cast to char*, add nbytes, and cast back to T.  Simplifies code in a few
   // places.
   SharedMem addBytes(size_t nbytes) {
-    MOZ_ASSERT(nbytes % sizeof(mozilla::Conditional<
-                               mozilla::IsVoid<std::remove_pointer_t<T>>::value,
-                               char, std::remove_pointer_t<T>>) ==
-               0);
+    MOZ_ASSERT(
+        nbytes %
+            sizeof(
+                mozilla::Conditional<std::is_void_v<std::remove_pointer_t<T>>,
+                                     char, std::remove_pointer_t<T>>) ==
+        0);
     return SharedMem(
         reinterpret_cast<T>(reinterpret_cast<char*>(ptr_) + nbytes), *this);
   }
 
   T unwrap() const { return ptr_; }
 
   T unwrapUnshared() const {
     MOZ_ASSERT(sharedness_ == IsUnshared);