Bug 1398086 - Remove unused functions and classes. r=till
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 08 Sep 2017 16:14:14 +0200
changeset 429412 94b2ac8be5db8e0792675a133934ecf92648a450
parent 429411 6e7763254023277b9b5526166e7f34c6b1f1802c
child 429413 c871d215b63bedfa18850ad116e5724c2cff360b
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)
reviewerstill
bugs1398086
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 1398086 - Remove unused functions and classes. r=till
js/src/frontend/BytecodeCompiler.h
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
js/src/jsarray.cpp
js/src/jsfun.h
js/src/jsmath.h
js/src/jsnum.cpp
js/src/jsnum.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/jspubtd.h
js/src/jsstr.cpp
js/src/jsstr.h
js/src/jsutil.h
js/src/vm/NativeObject.cpp
js/src/vm/NativeObject.h
js/src/vm/PropDesc.h
--- a/js/src/frontend/BytecodeCompiler.h
+++ b/js/src/frontend/BytecodeCompiler.h
@@ -87,21 +87,16 @@ CompileStandaloneAsyncFunction(JSContext
                                const mozilla::Maybe<uint32_t>& parameterListEnd);
 
 MOZ_MUST_USE bool
 CompileStandaloneAsyncGenerator(JSContext* cx, MutableHandleFunction fun,
                                 const ReadOnlyCompileOptions& options,
                                 JS::SourceBufferHolder& srcBuf,
                                 const mozilla::Maybe<uint32_t>& parameterListEnd);
 
-MOZ_MUST_USE bool
-CompileAsyncFunctionBody(JSContext* cx, MutableHandleFunction fun,
-                         const ReadOnlyCompileOptions& options,
-                         Handle<PropertyNameVector> formals, JS::SourceBufferHolder& srcBuf);
-
 ScriptSourceObject*
 CreateScriptSourceObject(JSContext* cx, const ReadOnlyCompileOptions& options,
                          const mozilla::Maybe<uint32_t>& parameterListEnd = mozilla::Nothing());
 
 /*
  * True if str consists of an IdentifierStart character, followed by one or
  * more IdentifierPart characters, i.e. it matches the IdentifierName production
  * in the language spec.
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -3661,32 +3661,16 @@ BytecodeEmitter::reportExtraWarning(Pars
     bool result = parser.tokenStream()
                         .reportExtraWarningErrorNumberVA(nullptr, pos.begin, errorNumber, args);
 
     va_end(args);
     return result;
 }
 
 bool
-BytecodeEmitter::reportStrictModeError(ParseNode* pn, unsigned errorNumber, ...)
-{
-    TokenPos pos = pn ? pn->pn_pos : tokenStream().currentToken().pos;
-
-    va_list args;
-    va_start(args, errorNumber);
-    // FIXME: parser.tokenStream() should be a TokenStreamAnyChars for bug 1351107,
-    // but caused problems, cf. bug 1363116.
-    bool result = parser.tokenStream()
-                        .reportStrictModeErrorNumberVA(nullptr, pos.begin, sc->strict(),
-                                                       errorNumber, args);
-    va_end(args);
-    return result;
-}
-
-bool
 BytecodeEmitter::emitNewInit(JSProtoKey key)
 {
     const size_t len = 1 + UINT32_INDEX_LEN;
     ptrdiff_t offset;
     if (!emitCheck(len, &offset))
         return false;
 
     jsbytecode* code = this->code(offset);
@@ -3756,28 +3740,16 @@ BytecodeEmitter::emitFinishIteratorResul
     if (!emit1(done ? JSOP_TRUE : JSOP_FALSE))
         return false;
     if (!emitIndex32(JSOP_INITPROP, done_id))
         return false;
     return true;
 }
 
 bool
-BytecodeEmitter::emitToIteratorResult(bool done)
-{
-    if (!emitPrepareIteratorResult())    // VALUE OBJ
-        return false;
-    if (!emit1(JSOP_SWAP))               // OBJ VALUE
-        return false;
-    if (!emitFinishIteratorResult(done)) // RESULT
-        return false;
-    return true;
-}
-
-bool
 BytecodeEmitter::emitGetNameAtLocation(JSAtom* name, const NameLocation& loc, bool callContext)
 {
     switch (loc.kind()) {
       case NameLocation::Kind::Dynamic:
         if (!emitAtomOp(name, JSOP_GETNAME))
             return false;
         break;
 
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -412,17 +412,16 @@ struct MOZ_STACK_CLASS BytecodeEmitter
 
     void setFunctionBodyEndPos(TokenPos pos) {
         functionBodyEndPos = pos.end;
         functionBodyEndPosSet = true;
     }
 
     void reportError(ParseNode* pn, unsigned errorNumber, ...);
     bool reportExtraWarning(ParseNode* pn, unsigned errorNumber, ...);
-    bool reportStrictModeError(ParseNode* pn, unsigned errorNumber, ...);
 
     // If pn contains a useful expression, return true with *answer set to true.
     // If pn contains a useless expression, return true with *answer set to
     // false. Return false on error.
     //
     // The caller should initialize *answer to false and invoke this function on
     // an expression statement or similar subtree to decide whether the tree
     // could produce code that has any side effects.  For an expression
@@ -627,17 +626,16 @@ struct MOZ_STACK_CLASS BytecodeEmitter
                                             ParseNode* initializer);
 
     MOZ_MUST_USE bool emitNewInit(JSProtoKey key);
     MOZ_MUST_USE bool emitSingletonInitialiser(ParseNode* pn);
 
     MOZ_MUST_USE bool emitPrepareIteratorResult();
     MOZ_MUST_USE bool emitFinishIteratorResult(bool done);
     MOZ_MUST_USE bool iteratorResultShape(unsigned* shape);
-    MOZ_MUST_USE bool emitToIteratorResult(bool done);
 
     MOZ_MUST_USE bool emitGetDotGenerator();
 
     MOZ_MUST_USE bool emitInitialYield(ParseNode* pn);
     MOZ_MUST_USE bool emitYield(ParseNode* pn);
     MOZ_MUST_USE bool emitYieldOp(JSOp op);
     MOZ_MUST_USE bool emitYieldStar(ParseNode* iter);
     MOZ_MUST_USE bool emitAwait();
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -630,21 +630,23 @@ array_length_getter(JSContext* cx, Handl
     vp.setNumber(obj->as<ArrayObject>().length());
     return true;
 }
 
 static bool
 array_length_setter(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp,
                     ObjectOpResult& result)
 {
+    MOZ_ASSERT(id == NameToId(cx->names().length));
+
     if (!obj->is<ArrayObject>()) {
         // This array .length property was found on the prototype
         // chain. Ideally the setter should not have been called, but since
         // we're here, do an impression of SetPropertyByDefining.
-        return DefineDataProperty(cx, obj, cx->names().length, vp, JSPROP_ENUMERATE, result);
+        return DefineDataProperty(cx, obj, id, vp, JSPROP_ENUMERATE, result);
     }
 
     Rooted<ArrayObject*> arr(cx, &obj->as<ArrayObject>());
     MOZ_ASSERT(arr->lengthIsWritable(),
                "setter shouldn't be called if property is non-writable");
 
     return ArraySetLength(cx, arr, id, JSPROP_PERMANENT, vp, result);
 }
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -744,19 +744,16 @@ extern bool
 SetFunctionNameIfNoOwnName(JSContext* cx, HandleFunction fun, HandleValue name,
                            FunctionPrefixKind prefixKind);
 
 extern JSFunction*
 DefineFunction(JSContext* cx, HandleObject obj, HandleId id, JSNative native,
                unsigned nargs, unsigned flags,
                gc::AllocKind allocKind = gc::AllocKind::FUNCTION);
 
-bool
-FunctionHasResolveHook(const JSAtomState& atomState, jsid id);
-
 extern bool
 fun_toString(JSContext* cx, unsigned argc, Value* vp);
 
 struct WellKnownSymbols;
 
 extern bool
 FunctionHasDefaultHasInstance(JSFunction* fun, const WellKnownSymbols& symbols);
 
--- a/js/src/jsmath.h
+++ b/js/src/jsmath.h
@@ -89,19 +89,16 @@ InitMathClass(JSContext* cx, HandleObjec
 extern uint64_t
 GenerateRandomSeed();
 
 // Fill |seed[0]| and |seed[1]| with random bits, suitable for
 // seeding a XorShift128+ random number generator.
 extern void
 GenerateXorShift128PlusSeed(mozilla::Array<uint64_t, 2>& seed);
 
-extern uint64_t
-random_next(uint64_t* rngState, int bits);
-
 extern double
 math_random_impl(JSContext* cx);
 
 extern bool
 math_random(JSContext* cx, unsigned argc, js::Value* vp);
 
 extern bool
 math_abs_handle(JSContext* cx, js::HandleValue v, js::MutableHandleValue r);
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -1436,24 +1436,16 @@ js::NumberToAtom(JSContext* cx, double d
         return nullptr;
 
     CacheNumber(cx, d, atom);
 
     return atom;
 }
 
 JSFlatString*
-js::NumberToString(JSContext* cx, double d)
-{
-    if (JSString* str = NumberToStringWithBase<CanGC>(cx, d, 10))
-        return &str->asFlat();
-    return nullptr;
-}
-
-JSFlatString*
 js::IndexToString(JSContext* cx, uint32_t index)
 {
     if (StaticStrings::hasUint(index))
         return cx->staticStrings().getUint(index);
 
     JSCompartment* c = cx->compartment();
     if (JSFlatString* str = c->dtoaCache.lookup(10, index))
         return str;
--- a/js/src/jsnum.h
+++ b/js/src/jsnum.h
@@ -87,20 +87,16 @@ IsInteger(const Value& val);
 
 /*
  * Convert an integer or double (contained in the given value) to a string and
  * append to the given buffer.
  */
 extern MOZ_MUST_USE bool JS_FASTCALL
 NumberValueToStringBuffer(JSContext* cx, const Value& v, StringBuffer& sb);
 
-/* Same as js_NumberToString, different signature. */
-extern JSFlatString*
-NumberToString(JSContext* cx, double d);
-
 extern JSFlatString*
 IndexToString(JSContext* cx, uint32_t index);
 
 /*
  * Usually a small amount of static storage is enough, but sometimes we need
  * to dynamically allocate much more.  This struct encapsulates that.
  * Dynamically allocated memory will be freed when the object is destroyed.
  */
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -260,39 +260,23 @@ js::Throw(JSContext* cx, jsid id, unsign
        return false;
     JSAutoByteString bytes(cx, idstr);
     if (!bytes)
         return false;
 
     if (details) {
         JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, errorNumber, bytes.ptr(),
                                    details);
-    }
-    else {
+    } else {
         JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, errorNumber, bytes.ptr());
     }
 
     return false;
 }
 
-bool
-js::Throw(JSContext* cx, JSObject* obj, unsigned errorNumber)
-{
-    if (js_ErrorFormatString[errorNumber].argCount == 1) {
-        RootedValue val(cx, ObjectValue(*obj));
-        ReportValueErrorFlags(cx, JSREPORT_ERROR, errorNumber,
-                              JSDVG_IGNORE_STACK, val, nullptr,
-                              nullptr, nullptr);
-    } else {
-        MOZ_ASSERT(js_ErrorFormatString[errorNumber].argCount == 0);
-        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, errorNumber);
-    }
-    return false;
-}
-
 
 /*** PropertyDescriptor operations and DefineProperties ******************************************/
 
 static Result<>
 CheckCallable(JSContext* cx, JSObject* obj, const char* fieldName)
 {
     if (obj && !obj->isCallable()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_GET_SET_FIELD,
@@ -1944,19 +1928,19 @@ JSObject::fixupAfterMovingGC()
                 owner = Forwarded(owner);
             if (owner != &obj && owner->hasFixedElements())
                 obj.elements_ = owner->getElementsHeader()->elements();
             MOZ_ASSERT(!IsForwarded(obj.getElementsHeader()->ownerObject().get()));
         }
     }
 }
 
-bool
-js::SetClassAndProto(JSContext* cx, HandleObject obj,
-                     const Class* clasp, Handle<js::TaggedProto> proto)
+static bool
+SetClassAndProto(JSContext* cx, HandleObject obj,
+                 const Class* clasp, Handle<js::TaggedProto> proto)
 {
     // Regenerate the object's shape. If the object is a proto (isDelegate()),
     // we also need to regenerate shapes for all of the objects along the old
     // prototype chain, in case any entries were filled by looking up through
     // obj. Stop when a non-native object is found, prototype lookups will not
     // be cached across these.
     //
     // How this shape change is done is very delicate; the change can be made
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -37,40 +37,16 @@ namespace js {
 using PropertyDescriptorVector = JS::GCVector<JS::PropertyDescriptor>;
 class GCMarker;
 class Nursery;
 
 namespace gc {
 class RelocationOverlay;
 } // namespace gc
 
-inline JSObject*
-CastAsObject(GetterOp op)
-{
-    return JS_FUNC_TO_DATA_PTR(JSObject*, op);
-}
-
-inline JSObject*
-CastAsObject(SetterOp op)
-{
-    return JS_FUNC_TO_DATA_PTR(JSObject*, op);
-}
-
-inline Value
-CastAsObjectJsval(GetterOp op)
-{
-    return ObjectOrNullValue(CastAsObject(op));
-}
-
-inline Value
-CastAsObjectJsval(SetterOp op)
-{
-    return ObjectOrNullValue(CastAsObject(op));
-}
-
 /******************************************************************************/
 
 extern const Class IntlClass;
 extern const Class JSONClass;
 extern const Class MathClass;
 
 class GlobalObject;
 class NewObjectCache;
@@ -880,39 +856,24 @@ GetElement(JSContext* cx, HandleObject o
 inline bool
 GetElement(JSContext* cx, HandleObject obj, HandleObject receiver, uint32_t index,
            MutableHandleValue vp);
 
 inline bool
 GetPropertyNoGC(JSContext* cx, JSObject* obj, const Value& receiver, jsid id, Value* vp);
 
 inline bool
-GetPropertyNoGC(JSContext* cx, JSObject* obj, JSObject* receiver, jsid id, Value* vp)
-{
-    return GetPropertyNoGC(cx, obj, ObjectValue(*receiver), id, vp);
-}
-
-inline bool
 GetPropertyNoGC(JSContext* cx, JSObject* obj, const Value& receiver, PropertyName* name, Value* vp)
 {
     return GetPropertyNoGC(cx, obj, receiver, NameToId(name), vp);
 }
 
 inline bool
-GetPropertyNoGC(JSContext* cx, JSObject* obj, JSObject* receiver, PropertyName* name, Value* vp)
-{
-    return GetPropertyNoGC(cx, obj, ObjectValue(*receiver), name, vp);
-}
-
-inline bool
 GetElementNoGC(JSContext* cx, JSObject* obj, const Value& receiver, uint32_t index, Value* vp);
 
-inline bool
-GetElementNoGC(JSContext* cx, JSObject* obj, JSObject* receiver, uint32_t index, Value* vp);
-
 // Returns whether |obj| or an object on its proto chain may have an interesting
 // symbol property (see JSObject::hasInterestingSymbolProperty). If it returns
 // true, *holder is set to the object that may have this property.
 MOZ_ALWAYS_INLINE bool
 MaybeHasInterestingSymbolProperty(JSContext* cx, JSObject* obj, Symbol* symbol,
                                   JSObject** holder = nullptr);
 
 // Like GetProperty but optimized for interesting symbol properties like
@@ -1120,40 +1081,20 @@ GetBuiltinConstructor(JSContext* cx, JSP
 
 bool
 GetBuiltinPrototype(JSContext* cx, JSProtoKey key, MutableHandleObject objp);
 
 JSObject*
 GetBuiltinPrototypePure(GlobalObject* global, JSProtoKey protoKey);
 
 extern bool
-SetClassAndProto(JSContext* cx, HandleObject obj,
-                 const Class* clasp, Handle<TaggedProto> proto);
-
-extern bool
 IsStandardPrototype(JSObject* obj, JSProtoKey key);
 
 } /* namespace js */
 
-/*
- * Select Object.prototype method names shared between jsapi.cpp and jsobj.cpp.
- */
-extern const char js_watch_str[];
-extern const char js_unwatch_str[];
-extern const char js_hasOwnProperty_str[];
-extern const char js_isPrototypeOf_str[];
-extern const char js_propertyIsEnumerable_str[];
-
-#ifdef JS_OLD_GETTER_SETTER_METHODS
-extern const char js_defineGetter_str[];
-extern const char js_defineSetter_str[];
-extern const char js_lookupGetter_str[];
-extern const char js_lookupSetter_str[];
-#endif
-
 namespace js {
 
 inline gc::InitialHeap
 GetInitialHeap(NewObjectKind newKind, const Class* clasp)
 {
     if (newKind == NurseryAllocatedProxy) {
         MOZ_ASSERT(clasp->isProxy());
         MOZ_ASSERT(clasp->hasFinalize());
@@ -1279,19 +1220,16 @@ LookupNameWithGlobalDefault(JSContext* c
 extern bool
 LookupNameUnqualified(JSContext* cx, HandlePropertyName name, HandleObject scopeChain,
                       MutableHandleObject objp);
 
 } // namespace js
 
 namespace js {
 
-extern JSObject*
-FindVariableScope(JSContext* cx, JSFunction** funp);
-
 bool
 LookupPropertyPure(JSContext* cx, JSObject* obj, jsid id, JSObject** objp,
                    PropertyResult* propp);
 
 bool
 LookupOwnPropertyPure(JSContext* cx, JSObject* obj, jsid id, PropertyResult* propp,
                       bool* isTypedArrayOutOfRange = nullptr);
 
@@ -1309,19 +1247,16 @@ GetOwnNativeGetterPure(JSContext* cx, JS
 
 bool
 HasOwnDataPropertyPure(JSContext* cx, JSObject* obj, jsid id, bool* result);
 
 bool
 GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
                          MutableHandle<JS::PropertyDescriptor> desc);
 
-bool
-GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp);
-
 /*
  * Like JS::FromPropertyDescriptor, but ignore desc.object() and always set vp
  * to an object on success.
  *
  * Use JS::FromPropertyDescriptor for getOwnPropertyDescriptor, since desc.object()
  * is used to indicate whether a result was found or not.  Use this instead for
  * defineProperty: it would be senseless to define a "missing" property.
  */
@@ -1407,23 +1342,20 @@ NonNullObjectWithName(JSContext* cx, con
     return nullptr;
 }
 
 
 extern bool
 GetFirstArgumentAsObject(JSContext* cx, const CallArgs& args, const char* method,
                          MutableHandleObject objp);
 
-/* Helpers for throwing. These always return false. */
+/* Helper for throwing, always returns false. */
 extern bool
 Throw(JSContext* cx, jsid id, unsigned errorNumber, const char* details = nullptr);
 
-extern bool
-Throw(JSContext* cx, JSObject* obj, unsigned errorNumber);
-
 /*
  * ES6 rev 29 (6 Dec 2014) 7.3.13. Mark obj as non-extensible, and adjust each
  * of obj's own properties' attributes appropriately: each property becomes
  * non-configurable, and if level == Frozen, data properties become
  * non-writable as well.
  */
 extern bool
 SetIntegrityLevel(JSContext* cx, HandleObject obj, IntegrityLevel level);
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -247,22 +247,16 @@ js::GetElementNoGC(JSContext* cx, JSObje
         return false;
 
     if (index > JSID_INT_MAX)
         return false;
     return GetPropertyNoGC(cx, obj, receiver, INT_TO_JSID(index), vp);
 }
 
 inline bool
-js::GetElementNoGC(JSContext* cx, JSObject* obj, JSObject* receiver, uint32_t index, Value* vp)
-{
-    return GetElementNoGC(cx, obj, ObjectValue(*receiver), index, vp);
-}
-
-inline bool
 js::DeleteProperty(JSContext* cx, HandleObject obj, HandleId id, ObjectOpResult& result)
 {
     MarkTypePropertyNonData(cx, obj, id);
     if (DeletePropertyOp op = obj->getOpsDeleteProperty())
         return op(cx, obj, id, result);
     return NativeDeleteProperty(cx, obj.as<NativeObject>(), id, result);
 }
 
--- a/js/src/jspubtd.h
+++ b/js/src/jspubtd.h
@@ -81,24 +81,21 @@ enum JSProtoKey {
     JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)
 #undef PROTOKEY_AND_INITIALIZER
     JSProto_LIMIT
 };
 
 /* Struct forward declarations. */
 struct JSClass;
 struct JSCompartment;
-struct JSCrossCompartmentCall;
 class JSErrorReport;
 struct JSExceptionState;
 struct JSFunctionSpec;
 struct JSLocaleCallbacks;
-struct JSObjectMap;
 struct JSPrincipals;
-struct JSPropertyName;
 struct JSPropertySpec;
 struct JSRuntime;
 struct JSSecurityCallbacks;
 struct JSStructuredCloneCallbacks;
 struct JSStructuredCloneReader;
 struct JSStructuredCloneWriter;
 class JS_PUBLIC_API(JSTracer);
 
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -1862,25 +1862,16 @@ StringMatch(JSLinearString* text, JSLine
             match = StringMatch(textChars, textLen, pat->twoByteChars(nogc), patLen);
     }
 
     return (match == -1) ? -1 : start + match;
 }
 
 static const size_t sRopeMatchThresholdRatioLog2 = 4;
 
-bool
-js::StringHasPattern(JSLinearString* text, const char16_t* pat, uint32_t patLen)
-{
-    AutoCheckCannotGC nogc;
-    return text->hasLatin1Chars()
-           ? StringMatch(text->latin1Chars(nogc), text->length(), pat, patLen) != -1
-           : StringMatch(text->twoByteChars(nogc), text->length(), pat, patLen) != -1;
-}
-
 int
 js::StringFindPattern(JSLinearString* text, JSLinearString* pat, size_t start)
 {
     return StringMatch(text, pat, start);
 }
 
 // When an algorithm does not need a string represented as a single linear
 // array of characters, this range utility may be used to traverse the string a
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -229,20 +229,16 @@ extern int32_t
 CompareAtoms(JSAtom* atom1, JSAtom* atom2);
 
 /*
  * Return true if the string matches the given sequence of ASCII bytes.
  */
 extern bool
 StringEqualsAscii(JSLinearString* str, const char* asciiBytes);
 
-/* Return true if the string contains a pattern anywhere inside it. */
-extern bool
-StringHasPattern(JSLinearString* text, const char16_t* pat, uint32_t patlen);
-
 extern int
 StringFindPattern(JSLinearString* text, JSLinearString* pat, size_t start);
 
 /* Return true if the string contains a pattern at |start|. */
 extern bool
 HasSubstringAt(JSLinearString* text, JSLinearString* pat, size_t start);
 
 template <typename Char1, typename Char2>
--- a/js/src/jsutil.h
+++ b/js/src/jsutil.h
@@ -43,54 +43,16 @@ js_memcpy(void* dst_, const void* src_, 
     MOZ_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len);
 
     return memcpy(dst, src, len);
 }
 
 namespace js {
 
 template <class T>
-class AlignedPtrAndFlag
-{
-    uintptr_t bits;
-
-  public:
-    AlignedPtrAndFlag(T* t, bool aFlag) {
-        MOZ_ASSERT((uintptr_t(t) & 1) == 0);
-        bits = uintptr_t(t) | uintptr_t(aFlag);
-    }
-
-    T* ptr() const {
-        return (T*)(bits & ~uintptr_t(1));
-    }
-
-    bool flag() const {
-        return (bits & 1) != 0;
-    }
-
-    void setPtr(T* t) {
-        MOZ_ASSERT((uintptr_t(t) & 1) == 0);
-        bits = uintptr_t(t) | uintptr_t(flag());
-    }
-
-    void setFlag() {
-        bits |= 1;
-    }
-
-    void unsetFlag() {
-        bits &= ~uintptr_t(1);
-    }
-
-    void set(T* t, bool aFlag) {
-        MOZ_ASSERT((uintptr_t(t) & 1) == 0);
-        bits = uintptr_t(t) | aFlag;
-    }
-};
-
-template <class T>
 static inline void
 Reverse(T* beg, T* end)
 {
     while (beg != end) {
         if (--end == beg)
             return;
         T tmp = *beg;
         *beg = *end;
@@ -178,32 +140,16 @@ Min(T t1, T t2)
 
 template <class T>
 static inline T
 Max(T t1, T t2)
 {
     return t1 > t2 ? t1 : t2;
 }
 
-/* Allows a const variable to be initialized after its declaration. */
-template <class T>
-static T&
-InitConst(const T& t)
-{
-    return const_cast<T&>(t);
-}
-
-template <class T, class U>
-MOZ_ALWAYS_INLINE T&
-ImplicitCast(U& u)
-{
-    T& t = u;
-    return t;
-}
-
 template<typename T>
 class MOZ_RAII AutoScopedAssign
 {
   public:
     AutoScopedAssign(T* addr, const T& value
                      MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
         : addr_(addr), old(*addr_)
     {
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -1854,44 +1854,16 @@ js::NativeDefineProperty(JSContext* cx, 
                          ObjectOpResult& result)
 {
     Rooted<PropertyDescriptor> desc(cx);
     desc.initFields(nullptr, value, attrs, getter, setter);
     return NativeDefineProperty(cx, obj, id, desc, result);
 }
 
 bool
-js::NativeDefineProperty(JSContext* cx, HandleNativeObject obj, PropertyName* name,
-                         HandleValue value, GetterOp getter, SetterOp setter, unsigned attrs,
-                         ObjectOpResult& result)
-{
-    RootedId id(cx, NameToId(name));
-    return NativeDefineProperty(cx, obj, id, value, getter, setter, attrs, result);
-}
-
-bool
-js::NativeDefineElement(JSContext* cx, HandleNativeObject obj, uint32_t index,
-                        HandleValue value, GetterOp getter, SetterOp setter, unsigned attrs,
-                        ObjectOpResult& result)
-{
-    RootedId id(cx);
-    if (index <= JSID_INT_MAX) {
-        id = INT_TO_JSID(index);
-        return NativeDefineProperty(cx, obj, id, value, getter, setter, attrs, result);
-    }
-
-    AutoRooterGetterSetter gsRoot(cx, attrs, &getter, &setter);
-
-    if (!IndexToId(cx, index, &id))
-        return false;
-
-    return NativeDefineProperty(cx, obj, id, value, getter, setter, attrs, result);
-}
-
-bool
 js::NativeDefineProperty(JSContext* cx, HandleNativeObject obj, HandleId id,
                          HandleValue value, JSGetterOp getter, JSSetterOp setter,
                          unsigned attrs)
 {
     ObjectOpResult result;
     if (!NativeDefineProperty(cx, obj, id, value, getter, setter, attrs, result))
         return false;
     if (!result) {
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -1392,26 +1392,16 @@ NativeDefineProperty(JSContext* cx, Hand
                      Handle<JS::PropertyDescriptor> desc,
                      ObjectOpResult& result);
 
 extern bool
 NativeDefineProperty(JSContext* cx, HandleNativeObject obj, HandleId id, HandleValue value,
                      JSGetterOp getter, JSSetterOp setter, unsigned attrs,
                      ObjectOpResult& result);
 
-extern bool
-NativeDefineProperty(JSContext* cx, HandleNativeObject obj, PropertyName* name,
-                     HandleValue value, GetterOp getter, SetterOp setter,
-                     unsigned attrs, ObjectOpResult& result);
-
-extern bool
-NativeDefineElement(JSContext* cx, HandleNativeObject obj, uint32_t index, HandleValue value,
-                    JSGetterOp getter, JSSetterOp setter, unsigned attrs,
-                    ObjectOpResult& result);
-
 /* If the result out-param is omitted, throw on failure. */
 extern bool
 NativeDefineProperty(JSContext* cx, HandleNativeObject obj, HandleId id, HandleValue value,
                      JSGetterOp getter, JSSetterOp setter, unsigned attrs);
 
 extern bool
 NativeDefineProperty(JSContext* cx, HandleNativeObject obj, PropertyName* name,
                      HandleValue value, JSGetterOp getter, JSSetterOp setter,
deleted file mode 100644