Bug 1267163 followup - Use static_assert instead of MOZ_ASSERT. r=red, CLOSED TREE
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 06 Oct 2016 15:27:02 +0200
changeset 316825 c64ed9250f55a4de8a2d5b57f06a9ff49e33a394
parent 316824 71808c547e9c2877d2d24a534e0b608ed2c053c4
child 316826 c93ea64807245839375bfcaa4a367f275d35f599
push id32932
push userphilringnalda@gmail.com
push dateFri, 07 Oct 2016 03:24:25 +0000
treeherderautoland@7affb66131bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersred, CLOSED
bugs1267163
milestone52.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 1267163 followup - Use static_assert instead of MOZ_ASSERT. r=red, CLOSED TREE
js/src/jit/CacheIR.h
--- a/js/src/jit/CacheIR.h
+++ b/js/src/jit/CacheIR.h
@@ -245,17 +245,17 @@ class MOZ_RAII CacheIRWriter
     }
 
     ObjOperandId guardIsObject(ValOperandId val) {
         writeOpWithOperandId(CacheOp::GuardIsObject, val);
         return ObjOperandId(val.id());
     }
     void guardType(ValOperandId val, JSValueType type) {
         writeOpWithOperandId(CacheOp::GuardType, val);
-        MOZ_ASSERT(uint32_t(type) <= UINT8_MAX);
+        static_assert(sizeof(type) == sizeof(uint8_t), "JSValueType should fit in a byte");
         buffer_.writeByte(uint32_t(type));
     }
     void guardShape(ObjOperandId obj, Shape* shape) {
         writeOpWithOperandId(CacheOp::GuardShape, obj);
         addStubWord(uintptr_t(shape), StubField::GCType::Shape);
     }
     void guardGroup(ObjOperandId obj, ObjectGroup* group) {
         writeOpWithOperandId(CacheOp::GuardGroup, obj);