Bug 1447442 - Part 1: Remove unused functions and definitions. r=jorendorff
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 13 Apr 2018 02:25:58 -0700
changeset 466862 fde411a83e7f419be5c48b2a07e52c4c567059f5
parent 466861 676c6c0096afa3e77d32ace4cfd4b21f65b53d15
child 466863 f1921838273471f888fa7de7874587cd879f987b
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [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 1: Remove unused functions and definitions. r=jorendorff
js/src/builtin/Promise.h
js/src/frontend/FullParseHandler.h
js/src/jit/CodeGenerator.cpp
js/src/vm/GlobalObject.h
js/src/vm/JSAtom.cpp
js/src/vm/JSAtom.h
js/src/vm/JSObject.h
js/src/vm/MatchPairs.h
--- a/js/src/builtin/Promise.h
+++ b/js/src/builtin/Promise.h
@@ -21,20 +21,19 @@ enum PromiseSlots {
     PromiseSlot_AwaitGenerator = PromiseSlot_RejectFunction,
     PromiseSlot_DebugInfo,
     PromiseSlots,
 };
 
 #define PROMISE_FLAG_RESOLVED  0x1
 #define PROMISE_FLAG_FULFILLED 0x2
 #define PROMISE_FLAG_HANDLED   0x4
-#define PROMISE_FLAG_REPORTED  0x8
-#define PROMISE_FLAG_DEFAULT_RESOLVE_FUNCTION 0x10
-#define PROMISE_FLAG_DEFAULT_REJECT_FUNCTION  0x20
-#define PROMISE_FLAG_ASYNC    0x40
+#define PROMISE_FLAG_DEFAULT_RESOLVE_FUNCTION 0x08
+#define PROMISE_FLAG_DEFAULT_REJECT_FUNCTION  0x10
+#define PROMISE_FLAG_ASYNC    0x20
 
 class AutoSetNewObjectMetadata;
 
 class PromiseObject : public NativeObject
 {
   public:
     static const unsigned RESERVED_SLOTS = PromiseSlots;
     static const Class class_;
@@ -83,21 +82,16 @@ class PromiseObject : public NativeObjec
         return resolutionTime() - allocationTime();
     }
     MOZ_MUST_USE bool dependentPromises(JSContext* cx, MutableHandle<GCVector<Value>> values);
     uint64_t getID();
     bool isUnhandled() {
         MOZ_ASSERT(state() == JS::PromiseState::Rejected);
         return !(getFixedSlot(PromiseSlot_Flags).toInt32() & PROMISE_FLAG_HANDLED);
     }
-    void markAsReported() {
-        MOZ_ASSERT(isUnhandled());
-        int32_t flags = getFixedSlot(PromiseSlot_Flags).toInt32();
-        setFixedSlot(PromiseSlot_Flags, Int32Value(flags | PROMISE_FLAG_REPORTED));
-    }
 };
 
 /**
  * Unforgeable version of the JS builtin Promise.all.
  *
  * Takes an AutoObjectVector of Promise objects and returns a promise that's
  * resolved with an array of resolution values when all those promises have
  * been resolved, or rejected with the rejection value of the first rejected
--- a/js/src/frontend/FullParseHandler.h
+++ b/js/src/frontend/FullParseHandler.h
@@ -710,24 +710,16 @@ class FullParseHandler
     }
 
     ParseNode* newObjectMethodOrPropertyDefinition(ParseNode* key, ParseNode* fn, AccessorType atype) {
         MOZ_ASSERT(isUsableAsObjectPropertyName(key));
 
         return newBinary(ParseNodeKind::Colon, key, fn, AccessorTypeToJSOp(atype));
     }
 
-    bool setComprehensionLambdaBody(ParseNode* pn, ParseNode* body) {
-        MOZ_ASSERT(body->isKind(ParseNodeKind::StatementList));
-        ParseNode* paramsBody = newList(ParseNodeKind::ParamsBody, body);
-        if (!paramsBody)
-            return false;
-        setFunctionFormalParametersAndBody(pn, paramsBody);
-        return true;
-    }
     void setFunctionFormalParametersAndBody(ParseNode* funcNode, ParseNode* kid) {
         MOZ_ASSERT_IF(kid, kid->isKind(ParseNodeKind::ParamsBody));
         funcNode->pn_body = kid;
     }
     void setFunctionBox(ParseNode* pn, FunctionBox* funbox) {
         MOZ_ASSERT(pn->isKind(ParseNodeKind::Function));
         pn->pn_funbox = funbox;
         funbox->functionNode = pn;
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -12064,19 +12064,16 @@ CodeGenerator::emitInstanceOf(LInstructi
 
     masm.bind(&testLazy);
     masm.branchPtr(Assembler::Equal, output, ImmWord(1), lazyEntry);
 
     masm.bind(&done);
     masm.bind(ool->rejoin());
 }
 
-typedef bool (*HasInstanceFn)(JSContext*, HandleObject, HandleValue, bool*);
-static const VMFunction HasInstanceInfo = FunctionInfo<HasInstanceFn>(js::HasInstance, "HasInstance");
-
 void
 CodeGenerator::visitInstanceOfCache(LInstanceOfCache* ins)
 {
     // The Lowering ensures that RHS is an object, and that LHS is a value.
     LiveRegisterSet liveRegs = ins->safepoint()->liveRegs();
     TypedOrValueRegister lhs = TypedOrValueRegister(ToValue(ins, LInstanceOfCache::LHS));
     Register rhs = ToRegister(ins->rhs());
     Register output = ToRegister(ins->output());
--- a/js/src/vm/GlobalObject.h
+++ b/js/src/vm/GlobalObject.h
@@ -217,31 +217,16 @@ class GlobalObject : public NativeObject
         // If the constructor is undefined, then it hasn't been initialized.
         Value value = getConstructor(key);
         MOZ_ASSERT(value.isUndefined() ||
                    value.isObject() ||
                    value.isMagic(JS_OFF_THREAD_CONSTRUCTOR));
         return !value.isUndefined();
     }
 
-    /*
-     * Using a Handle<GlobalObject*> as a Handle<Object*> is always safe as
-     * GlobalObject derives JSObject. However, with C++'s semantics, Handle<T>
-     * is not related to Handle<S>, independent of how S and T are related.
-     * Further, Handle stores an indirect pointer and, again because of C++'s
-     * semantics, T** is not related to S**, independent of how S and T are
-     * related. Since we know that this specific case is safe, we provide a
-     * manual upcast operation here to do the reinterpret_cast in a known-safe
-     * manner.
-     */
-    static HandleObject upcast(Handle<GlobalObject*> global) {
-        return HandleObject::fromMarkedLocation(
-                reinterpret_cast<JSObject * const*>(global.address()));
-    }
-
   private:
     bool arrayClassInitialized() const {
         return classIsInitialized(JSProto_Array);
     }
 
     bool booleanClassInitialized() const {
         return classIsInitialized(JSProto_Boolean);
     }
--- a/js/src/vm/JSAtom.cpp
+++ b/js/src/vm/JSAtom.cpp
@@ -129,17 +129,16 @@ JS_FOR_EACH_PROTOTYPE(DEFINE_PROTO_STRIN
 #undef DEFINE_PROTO_STRING
 
 #define CONST_CHAR_STR(idpart, id, text) const char js_##idpart##_str[] = text;
 FOR_EACH_COMMON_PROPERTYNAME(CONST_CHAR_STR)
 #undef CONST_CHAR_STR
 
 /* Constant strings that are not atomized. */
 const char js_getter_str[]          = "getter";
-const char js_send_str[]            = "send";
 const char js_setter_str[]          = "setter";
 
 // Use a low initial capacity for atom hash tables to avoid penalizing runtimes
 // which create a small number of atoms.
 static const uint32_t JS_STRING_HASH_COUNT = 64;
 
 MOZ_ALWAYS_INLINE AtomSet::Ptr
 js::FrozenAtomSet::readonlyThreadsafeLookup(const AtomSet::Lookup& l) const
--- a/js/src/vm/JSAtom.h
+++ b/js/src/vm/JSAtom.h
@@ -34,17 +34,16 @@ JS_FOR_EACH_PROTOTYPE(DECLARE_PROTO_STR)
 #undef DECLARE_PROTO_STR
 
 #define DECLARE_CONST_CHAR_STR(idpart, id, text)  extern const char js_##idpart##_str[];
 FOR_EACH_COMMON_PROPERTYNAME(DECLARE_CONST_CHAR_STR)
 #undef DECLARE_CONST_CHAR_STR
 
 /* Constant strings that are not atomized. */
 extern const char js_getter_str[];
-extern const char js_send_str[];
 extern const char js_setter_str[];
 
 namespace js {
 
 class AutoLockForExclusiveAccess;
 
 /*
  * Atom tracing and garbage collection hooks.
--- a/js/src/vm/JSObject.h
+++ b/js/src/vm/JSObject.h
@@ -183,17 +183,16 @@ class JSObject : public js::gc::Cell
     // environment chain. Optimization heuristics will make use of this flag.
     // See: ReshapeForProtoMutation, ReshapeForShadowedProp
     inline bool isDelegate() const;
     static bool setDelegate(JSContext* cx, JS::HandleObject obj) {
         return setFlags(cx, obj, js::BaseShape::DELEGATE, GENERATE_SHAPE);
     }
 
     inline bool isBoundFunction() const;
-    inline bool hasSpecialEquality() const;
 
     // A "qualified" varobj is the object on which "qualified" variable
     // declarations (i.e., those defined with "var") are kept.
     //
     // Conceptually, when a var binding is defined, it is defined on the
     // innermost qualified varobj on the scope chain.
     //
     // Function scopes (CallObjects) are qualified varobjs, and there can be
--- a/js/src/vm/MatchPairs.h
+++ b/js/src/vm/MatchPairs.h
@@ -30,24 +30,18 @@ struct MatchPair
       : start(-1), limit(-1)
     { }
 
     MatchPair(int32_t start, int32_t limit)
       : start(start), limit(limit)
     { }
 
     size_t length()      const { MOZ_ASSERT(!isUndefined()); return limit - start; }
-    bool isEmpty()       const { return length() == 0; }
     bool isUndefined()   const { return start < 0; }
 
-    void displace(size_t amount) {
-        start += (start < 0) ? 0 : amount;
-        limit += (limit < 0) ? 0 : amount;
-    }
-
     inline bool check() const {
         MOZ_ASSERT(limit >= start);
         MOZ_ASSERT_IF(start < 0, start == -1);
         MOZ_ASSERT_IF(limit < 0, limit == -1);
         return true;
     }
 };
 
@@ -58,17 +52,17 @@ class MatchPairs
   protected:
     /* Length of pairs_. */
     uint32_t pairCount_;
 
     /* Raw pointer into an allocated MatchPair buffer. */
     MatchPair* pairs_;
 
   protected:
-    /* Not used directly: use ScopedMatchPairs or VectorMatchPairs. */
+    /* Not used directly: use VectorMatchPairs. */
     MatchPairs()
       : pairCount_(0), pairs_(nullptr)
     { }
 
   protected:
     /* Functions used by friend classes. */
     friend class RegExpShared;
     friend class RegExpStatics;
@@ -86,17 +80,16 @@ class MatchPairs
         }
 #endif
     }
 
   public:
     /* Querying functions in the style of RegExpStatics. */
     bool   empty() const           { return pairCount_ == 0; }
     size_t pairCount() const       { MOZ_ASSERT(pairCount_ > 0); return pairCount_; }
-    size_t parenCount() const      { return pairCount_ - 1; }
 
     static size_t offsetOfPairs() { return offsetof(MatchPairs, pairs_); }
     static size_t offsetOfPairCount() { return offsetof(MatchPairs, pairCount_); }
 
     int32_t* pairsRaw() { return reinterpret_cast<int32_t*>(pairs_); }
 
   public:
     size_t length() const { return pairCount_; }