Bug 1599416 - Part 6: Remove unused TypedObject functions. r=mgaudet
authorAndré Bargull <andre.bargull@gmail.com>
Wed, 27 Nov 2019 13:55:32 +0000
changeset 504042 8c36a33102d51e75ddbdc7133285cf5528783332
parent 504041 c49111d0a4401afa51ac2a32f090a80e9ab228cd
child 504043 fc9e0fa219ac42a448daba7a7dcb7a41088bdcf3
push id36855
push useraiakab@mozilla.com
push dateWed, 27 Nov 2019 21:56:55 +0000
treeherdermozilla-central@62ae0fda7cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmgaudet
bugs1599416
milestone72.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 1599416 - Part 6: Remove unused TypedObject functions. r=mgaudet Differential Revision: https://phabricator.services.mozilla.com/D54710
js/src/builtin/TypedObject.cpp
js/src/builtin/TypedObject.h
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -733,24 +733,16 @@ bool ArrayMetaTypeDescr::construct(JSCon
   if (!obj) {
     return false;
   }
 
   args.rval().setObject(*obj);
   return true;
 }
 
-bool js::IsTypedObjectArray(JSObject& obj) {
-  if (!obj.is<TypedObject>()) {
-    return false;
-  }
-  TypeDescr& d = obj.as<TypedObject>().typeDescr();
-  return d.is<ArrayTypeDescr>();
-}
-
 /*********************************
  * StructType class
  */
 
 static const JSClassOps StructTypeDescrClassOps = {nullptr, /* addProperty */
                                                    nullptr, /* delProperty */
                                                    nullptr, /* enumerate */
                                                    nullptr, /* newEnumerate */
--- a/js/src/builtin/TypedObject.h
+++ b/js/src/builtin/TypedObject.h
@@ -349,17 +349,16 @@ class ComplexTypeDescr : public TypeDesc
 
   bool allowConstruct() const {
     return getReservedSlot(JS_DESCR_SLOT_FLAGS).toInt32() &
            JS_DESCR_FLAG_ALLOW_CONSTRUCT;
   }
 };
 
 bool IsTypedObjectClass(const JSClass* clasp);  // Defined below
-bool IsTypedObjectArray(JSObject& obj);
 
 MOZ_MUST_USE bool CreateUserSizeAndAlignmentProperties(JSContext* cx,
                                                        HandleTypeDescr obj);
 
 class ArrayTypeDescr;
 
 /*
  * Properties and methods of the `ArrayType` meta type object. There
@@ -647,37 +646,30 @@ class OutlineTypedObject : public TypedO
   // barriers are managed directly.
   JSObject* owner_;
 
   // Data pointer to some offset in the owner's contents.
   uint8_t* data_;
 
   void setOwnerAndData(JSObject* owner, uint8_t* data);
 
+  void setData(uint8_t* data) { data_ = data; }
+
  public:
   // JIT accessors.
   static size_t offsetOfData() { return offsetof(OutlineTypedObject, data_); }
   static size_t offsetOfOwner() { return offsetof(OutlineTypedObject, owner_); }
 
   JSObject& owner() const {
     MOZ_ASSERT(owner_);
     return *owner_;
   }
 
-  JSObject* maybeOwner() const { return owner_; }
-
   uint8_t* outOfLineTypedMem() const { return data_; }
 
-  void setData(uint8_t* data) { data_ = data; }
-
-  void resetOffset(size_t offset) {
-    MOZ_ASSERT(offset <= (size_t)size());
-    setData(typedMemBase() + offset);
-  }
-
   // Helper for createUnattached()
   static OutlineTypedObject* createUnattachedWithClass(
       JSContext* cx, const JSClass* clasp, HandleTypeDescr type,
       gc::InitialHeap heap = gc::DefaultHeap);
 
   // Creates an unattached typed object or handle (depending on the
   // type parameter T). Note that it is only legal for unattached
   // handles to escape to the end user; for non-handles, the caller