Bug 1393089 - Part 5: Remove no longer used variable and avoid one unnecessary rooting. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Mon, 28 Aug 2017 16:26:19 +0200
changeset 429837 4cc7890ba6e3dcad8304e8f9019111cac06de002
parent 429836 3e943b6a9520ca0ae4c9b4d7e0fc8965b5537d76
child 429838 4acbcf36de474be12c30a07a913236d8041d5319
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1393089
milestone57.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 1393089 - Part 5: Remove no longer used variable and avoid one unnecessary rooting. r=jandem
js/src/vm/TypedArrayObject.cpp
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -694,17 +694,16 @@ class TypedArrayObjectTemplate : public 
         return true;
     }
 
   private:
     static JSObject*
     create(JSContext* cx, const CallArgs& args)
     {
         MOZ_ASSERT(args.isConstructing());
-        RootedObject newTarget(cx, &args.newTarget().toObject());
 
         // 22.2.4.1 TypedArray ( )
         // 22.2.4.2 TypedArray ( length )
         if (args.length() == 0 || !args[0].isObject()) {
             // 22.2.4.2, step 3.
             uint64_t len;
             if (!ToIndex(cx, args.get(0), JSMSG_BAD_ARRAY_LENGTH, &len))
                 return nullptr;
@@ -1294,17 +1293,17 @@ TypedArrayObjectTemplate<T>::fromObject(
 
     bool optimized = false;
     if (!IsOptimizableInit(cx, other, &optimized))
         return nullptr;
 
     // Fast path when iterable is a packed array using the default iterator.
     if (optimized) {
         // Step 6.a (We don't need to call IterableToList for the fast path).
-        RootedArrayObject array(cx, &other->as<ArrayObject>());
+        HandleArrayObject array = other.as<ArrayObject>();
 
         // Step 6.b.
         uint32_t len = array->getDenseInitializedLength();
 
         // Step 6.c.
         Rooted<ArrayBufferObject*> buffer(cx);
         if (!maybeCreateArrayBuffer(cx, len, BYTES_PER_ELEMENT, nullptr, &buffer))
             return nullptr;