Bug 1447442 - Part 3: Remove JSValueArray and ValueArray. r=jorendorff
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 13 Apr 2018 02:25:59 -0700
changeset 413331 236f58368a5035b629217ccfeff52ed80f46142e
parent 413330 f1921838273471f888fa7de7874587cd879f987b
child 413332 5965536457835e02ce0e412349ed00fe541ca661
push id33843
push usernerli@mozilla.com
push dateSat, 14 Apr 2018 09:49:25 +0000
treeherdermozilla-central@37b8862d354e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1447442
milestone61.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 1447442 - Part 3: Remove JSValueArray and ValueArray. r=jorendorff
js/src/jsapi.cpp
js/src/vm/JSContext-inl.h
js/src/vm/JSObject.h
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1324,17 +1324,17 @@ JS::CurrentGlobalOrNull(JSContext* cx)
         return nullptr;
     return cx->global();
 }
 
 JS_PUBLIC_API(bool)
 JS::detail::ComputeThis(JSContext* cx, Value* vp, MutableHandleObject thisObject)
 {
     AssertHeapIsIdle();
-    assertSameCompartment(cx, JSValueArray(vp, 2));
+    assertSameCompartment(cx, vp[0], vp[1]);
 
     MutableHandleValue thisv = MutableHandleValue::fromMarkedLocation(&vp[1]);
     if (!BoxNonStrictThis(cx, thisv, thisv))
         return false;
 
     thisObject.set(&thisv.toObject());
     return true;
 }
--- a/js/src/vm/JSContext-inl.h
+++ b/js/src/vm/JSContext-inl.h
@@ -134,26 +134,16 @@ class CompartmentChecker
             decltype(((Container*)nullptr)->end())
         >::value
     >::Type
     check(const Container& container) {
         for (auto i : container)
             check(i);
     }
 
-    void check(const ValueArray& arr) {
-        for (size_t i = 0; i < arr.length; i++)
-            check(arr.array[i]);
-    }
-
-    void check(const JSValueArray& arr) {
-        for (size_t i = 0; i < arr.length; i++)
-            check(arr.array[i]);
-    }
-
     void check(const JS::HandleValueArray& arr) {
         for (size_t i = 0; i < arr.length(); i++)
             check(arr[i]);
     }
 
     void check(const CallArgs& args) {
         for (Value* p = args.base(); p != args.end(); ++p)
             check(*p);
--- a/js/src/vm/JSObject.h
+++ b/js/src/vm/JSObject.h
@@ -641,32 +641,16 @@ JSObject::writeBarrierPost(void* cellp, 
     }
 
     // Remove the prev entry if the new value does not need it. There will only
     // be a prev entry if the prev value was in the nursery.
     if (prev && (buffer = prev->storeBuffer()))
         buffer->unputCell(static_cast<js::gc::Cell**>(cellp));
 }
 
-class JSValueArray {
-  public:
-    const js::Value* array;
-    size_t length;
-
-    JSValueArray(const js::Value* v, size_t c) : array(v), length(c) {}
-};
-
-class ValueArray {
-  public:
-    js::Value* array;
-    size_t length;
-
-    ValueArray(js::Value* v, size_t c) : array(v), length(c) {}
-};
-
 namespace js {
 
 /*** Standard internal methods ********************************************************************
  *
  * The functions below are the fundamental operations on objects. See the
  * comment about "Standard internal methods" in jsapi.h.
  */