Bug 1517259 - Part 2: Remove dead or useless code. r=tcampbell
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 03 Jan 2019 02:43:39 -0800
changeset 509943 9ee71cbdb6ab65bd05c2c33edded8b5fa9faebde
parent 509942 0d14ab4c9b5b31c4466252774a68539320f46f52
child 509944 8f35396665f570d44b59fd968ceccc5dd62dddcc
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)
reviewerstcampbell
bugs1517259
milestone66.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 1517259 - Part 2: Remove dead or useless code. r=tcampbell
js/src/jsfriendapi.h
js/src/vm/TypedArrayObject.cpp
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -1449,17 +1449,16 @@ static inline size_t byteSize(Type atype
       return 2;
     case Int32:
     case Uint32:
     case Float32:
       return 4;
     case Int64:
     case Float64:
       return 8;
-      return 16;
     default:
       MOZ_CRASH("invalid scalar type");
   }
 }
 
 static inline bool isSignedIntType(Type atype) {
   switch (atype) {
     case Int8:
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -3,17 +3,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "vm/TypedArrayObject-inl.h"
 #include "vm/TypedArrayObject.h"
 
 #include "mozilla/Alignment.h"
-#include "mozilla/Casting.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/TextUtils.h"
 
 #include <string.h>
 #ifndef XP_WIN
 #include <sys/mman.h>
 #endif
@@ -51,17 +50,16 @@
 #include "vm/NativeObject-inl.h"
 #include "vm/Shape-inl.h"
 
 using namespace js;
 
 using JS::CanonicalizeNaN;
 using JS::ToInt32;
 using JS::ToUint32;
-using mozilla::AssertedCast;
 using mozilla::IsAsciiDigit;
 
 /*
  * TypedArrayObject
  *
  * The non-templated base class for the specific typed implementations.
  * This class holds all the member variables that are used by
  * the subclasses.
@@ -274,19 +272,16 @@ uint32_t JS_FASTCALL js::ClampDoubleToUi
      * want.
      */
     return y & ~1;
   }
 
   return y;
 }
 
-template <typename ElementType>
-static inline JSObject* NewArray(JSContext* cx, uint32_t nelements);
-
 namespace {
 
 enum class SpeciesConstructorOverride { None, ArrayBuffer };
 
 enum class CreateSingleton { Yes, No };
 
 template <typename NativeType>
 class TypedArrayObjectTemplate : public TypedArrayObject {
@@ -486,18 +481,17 @@ class TypedArrayObjectTemplate : public 
     }
 
     return tarray;
   }
 
   static void initTypedArraySlots(TypedArrayObject* tarray, int32_t len) {
     MOZ_ASSERT(len >= 0);
     tarray->setFixedSlot(TypedArrayObject::BUFFER_SLOT, NullValue());
-    tarray->setFixedSlot(TypedArrayObject::LENGTH_SLOT,
-                         Int32Value(AssertedCast<int32_t>(len)));
+    tarray->setFixedSlot(TypedArrayObject::LENGTH_SLOT, Int32Value(len));
     tarray->setFixedSlot(TypedArrayObject::BYTEOFFSET_SLOT, Int32Value(0));
 
     // Verify that the private slot is at the expected place.
     MOZ_ASSERT(tarray->numFixedSlots() == TypedArrayObject::DATA_SLOT);
 
 #ifdef DEBUG
     if (len == 0) {
       uint8_t* output = tarray->fixedData(TypedArrayObject::FIXED_DATA_START);