Bug 1585921 - Remove unnecessary static trace methods which are never called r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 09 Oct 2019 10:27:15 +0000
changeset 496955 71e0aaf161bf0b61cd3d3eee9ea988956f4629fd
parent 496954 bd5d7f97fb3625ea16af3c7234de1f3436991081
child 496956 bfbd9f2b907ccddc9303223e90ff0bd0d7a533aa
push id97554
push userjcoppeard@mozilla.com
push dateWed, 09 Oct 2019 10:56:10 +0000
treeherderautoland@754da41ac0f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1585921
milestone71.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 1585921 - Remove unnecessary static trace methods which are never called r=sfink GCPolicy<T> calls the instance method for these types so these static methods aren't required. Differential Revision: https://phabricator.services.mozilla.com/D48533
js/public/GCHashTable.h
js/public/GCVector.h
js/public/PropertyDescriptor.h
js/src/builtin/Promise.cpp
js/src/vm/JSONParser.h
js/src/vm/Shape.h
--- a/js/public/GCHashTable.h
+++ b/js/public/GCHashTable.h
@@ -56,17 +56,16 @@ template <typename Key, typename Value,
 class GCHashMap : public js::HashMap<Key, Value, HashPolicy, AllocPolicy> {
   using Base = js::HashMap<Key, Value, HashPolicy, AllocPolicy>;
 
  public:
   explicit GCHashMap(AllocPolicy a = AllocPolicy()) : Base(std::move(a)) {}
   explicit GCHashMap(size_t length) : Base(length) {}
   GCHashMap(AllocPolicy a, size_t length) : Base(std::move(a), length) {}
 
-  static void trace(GCHashMap* map, JSTracer* trc) { map->trace(trc); }
   void trace(JSTracer* trc) {
     for (typename Base::Enum e(*this); !e.empty(); e.popFront()) {
       GCPolicy<Value>::trace(trc, &e.front().value(), "hashmap value");
       GCPolicy<Key>::trace(trc, &e.front().mutableKey(), "hashmap key");
     }
   }
 
   bool needsSweep() const { return !this->empty(); }
@@ -232,17 +231,16 @@ template <typename T, typename HashPolic
 class GCHashSet : public js::HashSet<T, HashPolicy, AllocPolicy> {
   using Base = js::HashSet<T, HashPolicy, AllocPolicy>;
 
  public:
   explicit GCHashSet(AllocPolicy a = AllocPolicy()) : Base(std::move(a)) {}
   explicit GCHashSet(size_t length) : Base(length) {}
   GCHashSet(AllocPolicy a, size_t length) : Base(std::move(a), length) {}
 
-  static void trace(GCHashSet* set, JSTracer* trc) { set->trace(trc); }
   void trace(JSTracer* trc) {
     for (typename Base::Enum e(*this); !e.empty(); e.popFront()) {
       GCPolicy<T>::trace(trc, &e.mutableFront(), "hashset element");
     }
   }
 
   bool needsSweep() const { return !this->empty(); }
 
--- a/js/public/GCVector.h
+++ b/js/public/GCVector.h
@@ -123,18 +123,16 @@ class GCVector {
   size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
     return vector.sizeOfExcludingThis(mallocSizeOf);
   }
 
   size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
     return vector.sizeOfIncludingThis(mallocSizeOf);
   }
 
-  static void trace(GCVector* vec, JSTracer* trc) { vec->trace(trc); }
-
   void trace(JSTracer* trc) {
     for (auto& elem : vector) {
       GCPolicy<T>::trace(trc, &elem, "vector element");
     }
   }
 
   bool needsSweep() const { return !this->empty(); }
 
--- a/js/public/PropertyDescriptor.h
+++ b/js/public/PropertyDescriptor.h
@@ -127,19 +127,16 @@ struct JS_PUBLIC_API PropertyDescriptor 
   JSObject* obj = nullptr;
   unsigned attrs = 0;
   JSGetterOp getter = nullptr;
   JSSetterOp setter = nullptr;
   Value value;
 
   PropertyDescriptor() = default;
 
-  static void trace(PropertyDescriptor* self, JSTracer* trc) {
-    self->trace(trc);
-  }
   void trace(JSTracer* trc);
 };
 
 }  // namespace JS
 
 namespace js {
 
 template <typename Wrapper>
--- a/js/src/builtin/Promise.cpp
+++ b/js/src/builtin/Promise.cpp
@@ -145,19 +145,16 @@ enum PromiseAllDataHolderSlots {
 
 struct PromiseCapability {
   JSObject* promise = nullptr;
   JSObject* resolve = nullptr;
   JSObject* reject = nullptr;
 
   PromiseCapability() = default;
 
-  static void trace(PromiseCapability* self, JSTracer* trc) {
-    self->trace(trc);
-  }
   void trace(JSTracer* trc);
 };
 
 void PromiseCapability::trace(JSTracer* trc) {
   if (promise) {
     TraceRoot(trc, &promise, "PromiseCapability::promise");
   }
   if (resolve) {
--- a/js/src/vm/JSONParser.h
+++ b/js/src/vm/JSONParser.h
@@ -241,19 +241,16 @@ class MOZ_STACK_CLASS JSONParser : publi
    * Otherwise, if invalid input was specifed but no internal error occurred,
    * behavior depends upon the error handling specified at construction: if
    * error handling is RaiseError then throw a SyntaxError and return false,
    * otherwise return true and set *vp to |undefined|.  (JSON syntax can't
    * represent |undefined|, so the JSON data couldn't have specified it.)
    */
   bool parse(MutableHandleValue vp);
 
-  static void trace(JSONParser<CharT>* parser, JSTracer* trc) {
-    parser->trace(trc);
-  }
   void trace(JSTracer* trc) { JSONParserBase::trace(trc); }
 
  private:
   template <StringType ST>
   Token readString();
 
   Token readNumber();
 
--- a/js/src/vm/Shape.h
+++ b/js/src/vm/Shape.h
@@ -1624,20 +1624,17 @@ struct StackShape {
 
   HashNumber hash() const {
     HashNumber hash = HashId(propid);
     return mozilla::AddToHash(
         hash,
         mozilla::HashGeneric(base, attrs, maybeSlot(), rawGetter, rawSetter));
   }
 
-  // Traceable implementation.
-  static void trace(StackShape* stackShape, JSTracer* trc) {
-    stackShape->trace(trc);
-  }
+  // StructGCPolicy implementation.
   void trace(JSTracer* trc);
 };
 
 template <typename Wrapper>
 class WrappedPtrOperations<StackShape, Wrapper> {
   const StackShape& ss() const {
     return static_cast<const Wrapper*>(this)->get();
   }