Bug 1170182 - Remove dead functions from js/src. r=jorendorff
authorJan de Mooij <jdemooij@mozilla.com>
Sat, 27 Jun 2015 08:56:58 -0700
changeset 250406 8fe7179bfc6c991acf287d061d0cbf70323714ed
parent 250405 30e8c73f674ef5c6567b580b2f0e8caa627d1117
child 250407 dd2f0a7e0db39154468d56e22e651dab897812d9
push id61550
push userjandemooij@gmail.com
push dateSat, 27 Jun 2015 15:57:31 +0000
treeherdermozilla-inbound@8fe7179bfc6c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1170182
milestone41.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 1170182 - Remove dead functions from js/src. r=jorendorff
js/src/gc/Zone.cpp
js/src/gc/Zone.h
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/jsiter.cpp
js/src/jsiter.h
js/src/vm/ArrayObject-inl.h
js/src/vm/ArrayObject.h
js/src/vm/ForOfIterator.cpp
js/src/vm/Interpreter-inl.h
js/src/vm/Interpreter.cpp
js/src/vm/Interpreter.h
js/src/vm/MatchPairs.h
js/src/vm/ObjectGroup.h
js/src/vm/Probes-inl.h
js/src/vm/Probes.cpp
js/src/vm/Probes.h
js/src/vm/RegExpObject.cpp
js/src/vm/Runtime.cpp
js/src/vm/Runtime.h
js/src/vm/SavedStacks.cpp
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/TypeInference-inl.h
js/src/vm/TypeInference.cpp
--- a/js/src/gc/Zone.cpp
+++ b/js/src/gc/Zone.cpp
@@ -274,25 +274,16 @@ Zone::notifyObservingDebuggers()
                         "hook will not be fired for this GC for some Debuggers!\n");
 #endif
                 return;
             }
         }
     }
 }
 
-JS::Zone*
-js::ZoneOfValue(const JS::Value& value)
-{
-    MOZ_ASSERT(value.isMarkable());
-    if (value.isObject())
-        return value.toObject().zone();
-    return js::gc::TenuredCell::fromPointer(value.toGCThing())->zone();
-}
-
 bool
 js::ZonesIter::atAtomsZone(JSRuntime* rt)
 {
     return rt->isAtomsZone(*it);
 }
 
 bool
 Zone::isOnList() const
--- a/js/src/gc/Zone.h
+++ b/js/src/gc/Zone.h
@@ -450,15 +450,11 @@ class CompartmentsIterT
     }
 
     operator JSCompartment*() const { return get(); }
     JSCompartment* operator->() const { return get(); }
 };
 
 typedef CompartmentsIterT<ZonesIter> CompartmentsIter;
 
-// Return the Zone* of a Value. Asserts if the Value is not a GC thing.
-Zone*
-ZoneOfValue(const JS::Value& value);
-
 } // namespace js
 
 #endif // gc_Zone_h
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -5224,23 +5224,16 @@ class MOZ_STACK_CLASS JS_PUBLIC_API(ForO
      * the @@iterator property from iterable returns undefined init() will just
      * return true instead of throwing.  Callers must then check
      * valueIsIterable() before continuing with the iteration.
      */
     bool init(JS::HandleValue iterable,
               NonIterableBehavior nonIterableBehavior = ThrowOnNonIterable);
 
     /*
-     * This method assumes that |iterator| is already an iterator.  It will not
-     * check for, and call @@iterator.  Callers should make sure that the passed
-     * in value is in fact an iterator.
-     */
-    bool initWithIterator(JS::HandleValue aIterator);
-
-    /*
      * Get the next value from the iterator.  If false *done is true
      * after this call, do not examine val.
      */
     bool next(JS::MutableHandleValue val, bool* done);
 
     /*
      * If initialized with throwOnNonCallable = false, check whether
      * the value is iterable.
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -3434,35 +3434,16 @@ js::NewDensePartlyAllocatedArray(Exclusi
 ArrayObject * JS_FASTCALL
 js::NewDenseUnallocatedArray(ExclusiveContext* cx, uint32_t length,
                              HandleObject proto /* = nullptr */,
                              NewObjectKind newKind /* = GenericObject */)
 {
     return NewArray<0>(cx, length, proto, newKind);
 }
 
-ArrayObject*
-js::NewDenseCopiedArray(ExclusiveContext* cx, uint32_t length, HandleArrayObject src,
-                        uint32_t elementOffset, HandleObject proto /* = nullptr */)
-{
-    MOZ_ASSERT(!src->isIndexed());
-
-    ArrayObject* arr = NewArray<UINT32_MAX>(cx, length, proto);
-    if (!arr)
-        return nullptr;
-
-    MOZ_ASSERT(arr->getDenseCapacity() >= length);
-
-    const Value* vp = src->getDenseElements() + elementOffset;
-    arr->setDenseInitializedLength(length);
-    arr->initDenseElements(0, vp, length);
-
-    return arr;
-}
-
 // values must point at already-rooted Value objects
 ArrayObject*
 js::NewDenseCopiedArray(ExclusiveContext* cx, uint32_t length, const Value* values,
                         HandleObject proto /* = nullptr */,
                         NewObjectKind newKind /* = GenericObject */)
 {
     ArrayObject* arr = NewArray<UINT32_MAX>(cx, length, proto, newKind);
     if (!arr)
--- a/js/src/jsarray.h
+++ b/js/src/jsarray.h
@@ -60,21 +60,16 @@ extern ArrayObject * JS_FASTCALL
 NewDensePartlyAllocatedArray(ExclusiveContext* cx, uint32_t length, HandleObject proto = nullptr,
                              NewObjectKind newKind = GenericObject);
 
 /* Create a dense array with length and capacity == 'length', initialized length set to 0. */
 extern ArrayObject * JS_FASTCALL
 NewDenseFullyAllocatedArray(ExclusiveContext* cx, uint32_t length, HandleObject proto = nullptr,
                             NewObjectKind newKind = GenericObject);
 
-/* Create a dense array with a copy of the dense array elements in src. */
-extern ArrayObject*
-NewDenseCopiedArray(ExclusiveContext* cx, uint32_t length, HandleArrayObject src,
-                    uint32_t elementOffset, HandleObject proto = nullptr);
-
 /* Create a dense array from the given array values, which must be rooted */
 extern ArrayObject*
 NewDenseCopiedArray(ExclusiveContext* cx, uint32_t length, const Value* values,
                     HandleObject proto = nullptr, NewObjectKind newKind = GenericObject);
 
 /* Create a dense array based on templateObject with the given length. */
 extern ArrayObject*
 NewDenseFullyAllocatedArrayWithTemplate(JSContext* cx, uint32_t length, JSObject* templateObject);
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -66,23 +66,16 @@ js::ForgetSourceHook(JSRuntime* rt)
 }
 
 JS_FRIEND_API(void)
 JS_SetGrayGCRootsTracer(JSRuntime* rt, JSTraceDataOp traceOp, void* data)
 {
     rt->gc.setGrayRootsTracer(traceOp, data);
 }
 
-JS_FRIEND_API(JSString*)
-JS_GetAnonymousString(JSRuntime* rt)
-{
-    MOZ_ASSERT(rt->hasContexts());
-    return rt->commonNames->anonymous;
-}
-
 JS_FRIEND_API(JSObject*)
 JS_FindCompilationScope(JSContext* cx, HandleObject objArg)
 {
     RootedObject obj(cx, objArg);
 
     /*
      * We unwrap wrappers here. This is a little weird, but it's what's being
      * asked of us.
@@ -309,55 +302,31 @@ js::IsAtomsZone(JS::Zone* zone)
 }
 
 JS_FRIEND_API(bool)
 js::IsFunctionObject(JSObject* obj)
 {
     return obj->is<JSFunction>();
 }
 
-JS_FRIEND_API(bool)
-js::IsScopeObject(JSObject* obj)
-{
-    return obj->is<ScopeObject>();
-}
-
-JS_FRIEND_API(bool)
-js::IsCallObject(JSObject* obj)
-{
-    return obj->is<CallObject>();
-}
-
-JS_FRIEND_API(bool)
-js::CanAccessObjectShape(JSObject* obj)
-{
-    return obj->maybeShape() != nullptr;
-}
-
 JS_FRIEND_API(JSObject*)
 js::GetGlobalForObjectCrossCompartment(JSObject* obj)
 {
     return &obj->global();
 }
 
 JS_FRIEND_API(JSObject*)
 js::GetPrototypeNoProxy(JSObject* obj)
 {
     MOZ_ASSERT(!obj->is<js::ProxyObject>());
     MOZ_ASSERT(!obj->getTaggedProto().isLazy());
     return obj->getTaggedProto().toObjectOrNull();
 }
 
 JS_FRIEND_API(void)
-js::SetPendingExceptionCrossContext(JSContext* cx, JS::HandleValue v)
-{
-    cx->setPendingException(v);
-}
-
-JS_FRIEND_API(void)
 js::AssertSameCompartment(JSContext* cx, JSObject* obj)
 {
     assertSameCompartment(cx, obj);
 }
 
 #ifdef DEBUG
 JS_FRIEND_API(void)
 js::AssertSameCompartment(JSObject* objA, JSObject* objB)
@@ -505,29 +474,16 @@ js::SetReservedOrProxyPrivateSlotWithBar
     if (IsProxy(obj)) {
         MOZ_ASSERT(slot == 0);
         obj->as<ProxyObject>().setSameCompartmentPrivate(value);
     } else {
         obj->as<NativeObject>().setSlot(slot, value);
     }
 }
 
-JS_FRIEND_API(bool)
-js::GetGeneric(JSContext* cx, JSObject* objArg, JSObject* receiverArg, jsid idArg,
-               Value* vp)
-{
-    RootedObject obj(cx, objArg), receiver(cx, receiverArg);
-    RootedId id(cx, idArg);
-    RootedValue value(cx);
-    if (!GetProperty(cx, obj, receiver, id, &value))
-        return false;
-    *vp = value;
-    return true;
-}
-
 void
 js::SetPreserveWrapperCallback(JSRuntime* rt, PreserveWrapperCallback callback)
 {
     rt->preserveWrapperCallback = callback;
 }
 
 /*
  * The below code is for temporary telemetry use. It can be removed when
@@ -1013,28 +969,16 @@ js::SetActivityCallback(JSRuntime* rt, A
 }
 
 JS_FRIEND_API(bool)
 js::IsContextRunningJS(JSContext* cx)
 {
     return cx->currentlyRunning();
 }
 
-JS_FRIEND_API(int64_t)
-GetMaxGCPauseSinceClear(JSRuntime* rt)
-{
-    return rt->gc.stats.getMaxGCPauseSinceClear();
-}
-
-JS_FRIEND_API(int64_t)
-ClearMaxGCPauseAccumulator(JSRuntime* rt)
-{
-    return rt->gc.stats.clearMaxGCPauseAccumulator();
-}
-
 JS_FRIEND_API(void)
 JS::NotifyDidPaint(JSRuntime* rt)
 {
     rt->gc.notifyDidPaint();
 }
 
 JS_FRIEND_API(void)
 JS::PokeGC(JSRuntime* rt)
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -39,19 +39,16 @@ class Heap;
 namespace js {
 class JS_FRIEND_API(BaseProxyHandler);
 class InterpreterFrame;
 } /* namespace js */
 
 extern JS_FRIEND_API(void)
 JS_SetGrayGCRootsTracer(JSRuntime* rt, JSTraceDataOp traceOp, void* data);
 
-extern JS_FRIEND_API(JSString*)
-JS_GetAnonymousString(JSRuntime* rt);
-
 extern JS_FRIEND_API(JSObject*)
 JS_FindCompilationScope(JSContext* cx, JS::HandleObject obj);
 
 extern JS_FRIEND_API(JSFunction*)
 JS_GetObjectFunction(JSObject* obj);
 
 extern JS_FRIEND_API(bool)
 JS_SplicePrototype(JSContext* cx, JS::HandleObject obj, JS::HandleObject proto);
@@ -672,42 +669,28 @@ IsInnerObject(JSObject* obj) {
 inline bool
 IsOuterObject(JSObject* obj) {
     return !!GetObjectClass(obj)->ext.innerObject;
 }
 
 JS_FRIEND_API(bool)
 IsFunctionObject(JSObject* obj);
 
-JS_FRIEND_API(bool)
-IsScopeObject(JSObject* obj);
-
-JS_FRIEND_API(bool)
-IsCallObject(JSObject* obj);
-
-JS_FRIEND_API(bool)
-CanAccessObjectShape(JSObject* obj);
-
 static MOZ_ALWAYS_INLINE JSCompartment*
 GetObjectCompartment(JSObject* obj)
 {
     return reinterpret_cast<shadow::Object*>(obj)->group->compartment;
 }
 
 JS_FRIEND_API(JSObject*)
 GetGlobalForObjectCrossCompartment(JSObject* obj);
 
 JS_FRIEND_API(JSObject*)
 GetPrototypeNoProxy(JSObject* obj);
 
-// Sidestep the activeContext checking implicitly performed in
-// JS_SetPendingException.
-JS_FRIEND_API(void)
-SetPendingExceptionCrossContext(JSContext* cx, JS::HandleValue v);
-
 JS_FRIEND_API(void)
 AssertSameCompartment(JSContext* cx, JSObject* obj);
 
 #ifdef JS_DEBUG
 JS_FRIEND_API(void)
 AssertSameCompartment(JSObject* objA, JSObject* objB);
 #else
 inline void AssertSameCompartment(JSObject* objA, JSObject* objB) {}
@@ -940,19 +923,16 @@ CopyFlatStringChars(char16_t* dest, JSFl
 
 JS_FRIEND_API(bool)
 GetPropertyKeys(JSContext* cx, JS::HandleObject obj, unsigned flags, JS::AutoIdVector* props);
 
 JS_FRIEND_API(bool)
 AppendUnique(JSContext* cx, JS::AutoIdVector& base, JS::AutoIdVector& others);
 
 JS_FRIEND_API(bool)
-GetGeneric(JSContext* cx, JSObject* obj, JSObject* receiver, jsid id, JS::Value* vp);
-
-JS_FRIEND_API(bool)
 StringIsArrayIndex(JSLinearString* str, uint32_t* indexp);
 
 JS_FRIEND_API(void)
 SetPreserveWrapperCallback(JSRuntime* rt, PreserveWrapperCallback callback);
 
 JS_FRIEND_API(bool)
 IsObjectInContextCompartment(JSObject* obj, const JSContext* cx);
 
@@ -2787,24 +2767,16 @@ SetJitExceptionHandler(JitExceptionHandl
  * NewObjectEnvironment) sense for a given function.  If the function is not
  * scripted or does not have an object environment, just returns the function's
  * parent.
  */
 extern JS_FRIEND_API(JSObject*)
 GetObjectEnvironmentObjectForFunction(JSFunction* fun);
 
 /*
- * Get the stored principal of the stack frame this SavedFrame object
- * represents.  note that this is not the same thing as the object principal of
- * the object itself.  Do NOT pass a non-SavedFrame object here.
- */
-extern JS_FRIEND_API(JSPrincipals*)
-GetSavedFramePrincipals(JS::HandleObject savedFrame);
-
-/*
  * Get the first SavedFrame object in this SavedFrame stack whose principals are
  * subsumed by the cx's principals. If there is no such frame, return nullptr.
  *
  * Do NOT pass a non-SavedFrame object here.
  *
  * The savedFrame and cx do not need to be in the same compartment.
  */
 extern JS_FRIEND_API(JSObject*)
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -1291,40 +1291,16 @@ bool
 js::SuppressDeletedElement(JSContext* cx, HandleObject obj, uint32_t index)
 {
     RootedId id(cx);
     if (!IndexToId(cx, index, &id))
         return false;
     return SuppressDeletedProperty(cx, obj, id);
 }
 
-namespace {
-
-class IndexRangePredicate {
-    uint32_t begin, end;
-
-  public:
-    IndexRangePredicate(uint32_t begin, uint32_t end) : begin(begin), end(end) {}
-
-    bool operator()(JSFlatString* str) {
-        uint32_t index;
-        return str->isIndex(&index) && begin <= index && index < end;
-    }
-
-    bool matchesAtMostOne() { return false; }
-};
-
-} /* anonymous namespace */
-
-bool
-js::SuppressDeletedElements(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end)
-{
-    return SuppressDeletedPropertyHelper(cx, obj, IndexRangePredicate(begin, end));
-}
-
 bool
 js::IteratorMore(JSContext* cx, HandleObject iterobj, MutableHandleValue rval)
 {
     // Fast path for native iterators.
     if (iterobj->is<PropertyIteratorObject>()) {
         NativeIterator* ni = iterobj->as<PropertyIteratorObject>().getNativeIterator();
         bool done;
         if (!NativeIteratorNext(cx, ni, rval, &done))
--- a/js/src/jsiter.h
+++ b/js/src/jsiter.h
@@ -188,19 +188,16 @@ bool
 IteratorConstructor(JSContext* cx, unsigned argc, Value* vp);
 
 extern bool
 SuppressDeletedProperty(JSContext* cx, HandleObject obj, jsid id);
 
 extern bool
 SuppressDeletedElement(JSContext* cx, HandleObject obj, uint32_t index);
 
-extern bool
-SuppressDeletedElements(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end);
-
 /*
  * IteratorMore() returns the next iteration value. If no value is available,
  * MagicValue(JS_NO_ITER_VALUE) is returned.
  */
 extern bool
 IteratorMore(JSContext* cx, HandleObject iterobj, MutableHandleValue rval);
 
 extern bool
--- a/js/src/vm/ArrayObject-inl.h
+++ b/js/src/vm/ArrayObject-inl.h
@@ -86,35 +86,16 @@ ArrayObject::createArray(ExclusiveContex
 
     obj->setFixedElements();
     new (obj->getElementsHeader()) ObjectElements(capacity, length);
 
     return finishCreateArray(obj, shape);
 }
 
 /* static */ inline ArrayObject*
-ArrayObject::createArray(ExclusiveContext* cx, gc::InitialHeap heap,
-                         HandleShape shape, HandleObjectGroup group,
-                         HeapSlot* elements)
-{
-    // Use the smallest allocation kind for the array, as it can't have any
-    // fixed slots (see the assert in createArrayInternal) and will not be using
-    // its fixed elements.
-    gc::AllocKind kind = gc::AllocKind::OBJECT0_BACKGROUND;
-
-    ArrayObject* obj = createArrayInternal(cx, kind, heap, shape, group);
-    if (!obj)
-        return nullptr;
-
-    obj->elements_ = elements;
-
-    return finishCreateArray(obj, shape);
-}
-
-/* static */ inline ArrayObject*
 ArrayObject::createCopyOnWriteArray(ExclusiveContext* cx, gc::InitialHeap heap,
                                     HandleArrayObject sharedElementsOwner)
 {
     MOZ_ASSERT(sharedElementsOwner->getElementsHeader()->isCopyOnWrite());
     MOZ_ASSERT(sharedElementsOwner->getElementsHeader()->ownerObject() == sharedElementsOwner);
 
     // Use the smallest allocation kind for the array, as it can't have any
     // fixed slots (see the assert in createArrayInternal) and will not be using
--- a/js/src/vm/ArrayObject.h
+++ b/js/src/vm/ArrayObject.h
@@ -42,24 +42,16 @@ class ArrayObject : public NativeObject
     static inline ArrayObject*
     createArray(ExclusiveContext* cx,
                 gc::AllocKind kind,
                 gc::InitialHeap heap,
                 HandleShape shape,
                 HandleObjectGroup group,
                 uint32_t length);
 
-    // Make an array object with the specified initial state and elements.
-    static inline ArrayObject*
-    createArray(ExclusiveContext* cx,
-                gc::InitialHeap heap,
-                HandleShape shape,
-                HandleObjectGroup group,
-                HeapSlot* elements);
-
     // Make a copy-on-write array object which shares the elements of an
     // existing object.
     static inline ArrayObject*
     createCopyOnWriteArray(ExclusiveContext* cx,
                            gc::InitialHeap heap,
                            HandleArrayObject sharedElementsOwner);
 
   private:
--- a/js/src/vm/ForOfIterator.cpp
+++ b/js/src/vm/ForOfIterator.cpp
@@ -85,24 +85,16 @@ ForOfIterator::init(HandleValue iterable
 
     iterator = ToObject(cx, args.rval());
     if (!iterator)
         return false;
 
     return true;
 }
 
-bool
-ForOfIterator::initWithIterator(HandleValue aIterator)
-{
-    JSContext* cx = cx_;
-    RootedObject iteratorObj(cx, ToObject(cx, aIterator));
-    return iterator = iteratorObj;
-}
-
 inline bool
 ForOfIterator::nextFromOptimizedArray(MutableHandleValue vp, bool* done)
 {
     MOZ_ASSERT(index != NOT_ARRAY);
 
     if (!CheckForInterrupt(cx_))
         return false;
 
--- a/js/src/vm/Interpreter-inl.h
+++ b/js/src/vm/Interpreter-inl.h
@@ -155,47 +155,16 @@ CheckUninitializedLexical(JSContext* cx,
 {
     if (IsUninitializedLexical(val)) {
         ReportUninitializedLexical(cx, script, pc);
         return false;
     }
     return true;
 }
 
-/*
- * Return an object on which we should look for the properties of |value|.
- * This helps us implement the custom [[Get]] method that ES5's GetValue
- * algorithm uses for primitive values, without actually constructing the
- * temporary object that the specification does.
- *
- * For objects, return the object itself. For string, boolean, and number
- * primitive values, return the appropriate constructor's prototype. For
- * undefined and null, throw an error and return nullptr, attributing the
- * problem to the value at |spindex| on the stack.
- */
-MOZ_ALWAYS_INLINE JSObject*
-ValuePropertyBearer(JSContext* cx, InterpreterFrame* fp, HandleValue v, int spindex)
-{
-    if (v.isObject())
-        return &v.toObject();
-
-    Rooted<GlobalObject*> global(cx, &fp->global());
-
-    if (v.isString())
-        return GlobalObject::getOrCreateStringPrototype(cx, global);
-    if (v.isNumber())
-        return GlobalObject::getOrCreateNumberPrototype(cx, global);
-    if (v.isBoolean())
-        return GlobalObject::getOrCreateBooleanPrototype(cx, global);
-
-    MOZ_ASSERT(v.isNull() || v.isUndefined());
-    ReportIsNullOrUndefined(cx, spindex, v, nullptr);
-    return nullptr;
-}
-
 inline bool
 GetLengthProperty(const Value& lval, MutableHandleValue vp)
 {
     /* Optimize length accesses on strings, arrays, and arguments. */
     if (lval.isString()) {
         vp.setInt32(lval.toString()->length());
         return true;
     }
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -4807,16 +4807,8 @@ js::ReportUninitializedLexical(JSContext
         }
     } else {
         MOZ_ASSERT(JSOp(*pc) == JSOP_CHECKALIASEDLEXICAL);
         name = ScopeCoordinateName(cx->runtime()->scopeCoordinateNameCache, script, pc);
     }
 
     ReportUninitializedLexical(cx, name);
 }
-
-void
-js::ReportUninitializedLexical(JSContext* cx, HandleScript script, jsbytecode* pc, ScopeCoordinate sc)
-{
-    RootedPropertyName name(cx, ScopeCoordinateName(cx->runtime()->scopeCoordinateNameCache,
-                                                    script, pc));
-    ReportUninitializedLexical(cx, name);
-}
--- a/js/src/vm/Interpreter.h
+++ b/js/src/vm/Interpreter.h
@@ -467,14 +467,11 @@ SetConstOperation(JSContext* cx, HandleO
 }
 
 void
 ReportUninitializedLexical(JSContext* cx, HandlePropertyName name);
 
 void
 ReportUninitializedLexical(JSContext* cx, HandleScript script, jsbytecode* pc);
 
-void
-ReportUninitializedLexical(JSContext* cx, HandleScript script, jsbytecode* pc, ScopeCoordinate sc);
-
 }  /* namespace js */
 
 #endif /* vm_Interpreter_h */
--- a/js/src/vm/MatchPairs.h
+++ b/js/src/vm/MatchPairs.h
@@ -71,17 +71,16 @@ class MatchPairs
   protected:
     /* Functions used by friend classes. */
     friend class RegExpShared;
     friend class RegExpStatics;
 
     /* MatchPair buffer allocator: set pairs_ and pairCount_. */
     virtual bool allocOrExpandArray(size_t pairCount) = 0;
 
-    bool initArray(size_t pairCount);
     bool initArrayFrom(MatchPairs& copyFrom);
     void forgetArray() { pairs_ = nullptr; }
 
     void displace(size_t disp);
     void checkAgainst(size_t inputLength) {
 #ifdef DEBUG
         for (size_t i = 0; i < pairCount_; i++) {
             const MatchPair& p = (*this)[i];
--- a/js/src/vm/ObjectGroup.h
+++ b/js/src/vm/ObjectGroup.h
@@ -486,18 +486,16 @@ class ObjectGroup : public gc::TenuredCe
     bool matchDefiniteProperties(HandleObject obj);
     void markPropertyNonData(ExclusiveContext* cx, JSObject* obj, jsid id);
     void markPropertyNonWritable(ExclusiveContext* cx, JSObject* obj, jsid id);
     void markStateChange(ExclusiveContext* cx);
     void setFlags(ExclusiveContext* cx, ObjectGroupFlags flags);
     void markUnknown(ExclusiveContext* cx);
     void maybeClearNewScriptOnOOM();
     void clearNewScript(ExclusiveContext* cx, ObjectGroup* replacement = nullptr);
-    bool isPropertyNonData(jsid id);
-    bool isPropertyNonWritable(jsid id);
 
     void print();
 
     inline void clearProperties();
     void traceChildren(JSTracer* trc);
 
     inline bool needsSweep();
     inline void maybeSweep(AutoClearTypeInferenceStateOnOOM* oom);
--- a/js/src/vm/Probes-inl.h
+++ b/js/src/vm/Probes-inl.h
@@ -24,23 +24,16 @@ probes::CallTrackingActive(JSContext* cx
 #ifdef INCLUDE_MOZILLA_DTRACE
     if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED() || JAVASCRIPT_FUNCTION_RETURN_ENABLED())
         return true;
 #endif
     return false;
 }
 
 inline bool
-probes::WantNativeAddressInfo(JSContext* cx)
-{
-    return cx->reportGranularity >= JITREPORT_GRANULARITY_FUNCTION &&
-           JITGranularityRequested(cx) >= JITREPORT_GRANULARITY_FUNCTION;
-}
-
-inline bool
 probes::EnterScript(JSContext* cx, JSScript* script, JSFunction* maybeFun,
                     InterpreterFrame* fp)
 {
 #ifdef INCLUDE_MOZILLA_DTRACE
     if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED())
         DTraceEnterJSFun(cx, maybeFun, script);
 #endif
 
--- a/js/src/vm/Probes.cpp
+++ b/js/src/vm/Probes.cpp
@@ -16,34 +16,16 @@
 
 using namespace js;
 
 const char probes::nullName[] = "(null)";
 const char probes::anonymousName[] = "(anonymous)";
 
 bool probes::ProfilingActive = true;
 
-probes::JITReportGranularity
-probes::JITGranularityRequested(JSContext* cx)
-{
-    if (cx->runtime()->spsProfiler.enabled())
-        return JITREPORT_GRANULARITY_LINE;
-    return JITREPORT_GRANULARITY_NONE;
-}
-
-/* ICs are unregistered in a batch */
-void
-probes::DiscardExecutableRegion(void* start, size_t size)
-{
-    /*
-     * Not needed for SPS because ICs are disposed of when the normal JITChunk
-     * is disposed of
-     */
-}
-
 #ifdef INCLUDE_MOZILLA_DTRACE
 static const char*
 ScriptFilename(const JSScript* script)
 {
     if (!script)
         return probes::nullName;
     if (!script->filename())
         return probes::anonymousName;
--- a/js/src/vm/Probes.h
+++ b/js/src/vm/Probes.h
@@ -54,22 +54,16 @@ extern const char anonymousName[];
 
 /*
  * Test whether we are tracking JS function call enter/exit. The JITs use this
  * to decide whether they can optimize in a way that would prevent probes from
  * firing.
  */
 bool CallTrackingActive(JSContext*);
 
-/*
- * Test whether anything is looking for JIT native code registration events.
- * This information will not be collected otherwise.
- */
-bool WantNativeAddressInfo(JSContext*);
-
 /* Entering a JS function */
 bool EnterScript(JSContext*, JSScript*, JSFunction*, InterpreterFrame*);
 
 /* About to leave a JS function */
 void ExitScript(JSContext*, JSScript*, JSFunction*, bool popSPSFrame);
 
 /* Executing a script */
 bool StartExecution(JSScript* script);
@@ -83,38 +77,16 @@ bool StopExecution(JSScript* script);
 bool CreateObject(ExclusiveContext* cx, JSObject* obj);
 
 /*
  * Object is about to be finalized. |obj| must still exist (its class is
  * read)
  */
 bool FinalizeObject(JSObject* obj);
 
-/* JIT code observation */
-
-enum JITReportGranularity {
-    JITREPORT_GRANULARITY_NONE = 0,
-    JITREPORT_GRANULARITY_FUNCTION = 1,
-    JITREPORT_GRANULARITY_LINE = 2,
-    JITREPORT_GRANULARITY_OP = 3
-};
-
-/*
- * Finest granularity of JIT information desired by all watchers.
- */
-JITReportGranularity
-JITGranularityRequested(JSContext* cx);
-
-/*
- * A whole region of code has been deallocated, containing any number of ICs.
- * (ICs are unregistered in a batch, so individual ICs are not registered.)
- */
-void
-DiscardExecutableRegion(void* start, size_t size);
-
 /*
  * Internal: DTrace-specific functions to be called during probes::EnterScript
  * and probes::ExitScript. These will not be inlined, but the argument
  * marshalling required for these probe points is expensive enough that it
  * shouldn't really matter.
  */
 void DTraceEnterJSFun(JSContext* cx, JSFunction* fun, JSScript* script);
 void DTraceExitJSFun(JSContext* cx, JSFunction* fun, JSScript* script);
--- a/js/src/vm/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -130,34 +130,16 @@ RegExpObjectBuilder::clone(Handle<RegExp
 
     Rooted<JSAtom*> source(cx, other->getSource());
     return build(source, *g);
 }
 
 /* MatchPairs */
 
 bool
-MatchPairs::initArray(size_t pairCount)
-{
-    MOZ_ASSERT(pairCount > 0);
-
-    /* Guarantee adequate space in buffer. */
-    if (!allocOrExpandArray(pairCount))
-        return false;
-
-    /* Initialize all MatchPair objects to invalid locations. */
-    for (size_t i = 0; i < pairCount; i++) {
-        pairs_[i].start = -1;
-        pairs_[i].limit = -1;
-    }
-
-    return true;
-}
-
-bool
 MatchPairs::initArrayFrom(MatchPairs& copyFrom)
 {
     MOZ_ASSERT(copyFrom.pairCount() > 0);
 
     if (!allocOrExpandArray(copyFrom.pairCount()))
         return false;
 
     PodCopy(pairs_, copyFrom.pairs_, pairCount_);
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -729,22 +729,16 @@ JSRuntime::updateMallocCounter(size_t nb
 }
 
 void
 JSRuntime::updateMallocCounter(JS::Zone* zone, size_t nbytes)
 {
     gc.updateMallocCounter(zone, nbytes);
 }
 
-JS_FRIEND_API(void)
-JSRuntime::onTooMuchMalloc()
-{
-    gc.onTooMuchMalloc();
-}
-
 JS_FRIEND_API(void*)
 JSRuntime::onOutOfMemory(AllocFunction allocFunc, size_t nbytes, void* reallocPtr,
                          JSContext* maybecx)
 {
     MOZ_ASSERT_IF(allocFunc != AllocFunction::Realloc, !reallocPtr);
 
     if (isHeapBusy())
         return nullptr;
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -1354,21 +1354,16 @@ struct JSRuntime : public JS::shadow::Ru
      * the caller must ensure that no deadlock possible during OOM reporting.
      */
     void updateMallocCounter(size_t nbytes);
     void updateMallocCounter(JS::Zone* zone, size_t nbytes);
 
     void reportAllocationOverflow() { js::ReportAllocationOverflow(nullptr); }
 
     /*
-     * The function must be called outside the GC lock.
-     */
-    JS_FRIEND_API(void) onTooMuchMalloc();
-
-    /*
      * This should be called after system malloc/calloc/realloc returns nullptr
      * to try to recove some memory or to report an error.  For realloc, the
      * original pointer must be passed as reallocPtr.
      *
      * The function must be called outside the GC lock.
      */
     JS_FRIEND_API(void*) onOutOfMemory(js::AllocFunction allocator, size_t nbytes,
                                        void* reallocPtr = nullptr, JSContext* maybecx = nullptr);
--- a/js/src/vm/SavedStacks.cpp
+++ b/js/src/vm/SavedStacks.cpp
@@ -1236,24 +1236,16 @@ SavedStacksMetadataCallback(JSContext* c
 
     if (!Debugger::onLogAllocationSite(cx, obj, frame, JS_GetCurrentEmbedderTime()))
         CrashAtUnhandlableOOM("SavedStacksMetadataCallback");
 
     MOZ_ASSERT_IF(frame, !frame->is<WrapperObject>());
     return frame;
 }
 
-JS_FRIEND_API(JSPrincipals*)
-GetSavedFramePrincipals(HandleObject savedFrame)
-{
-    MOZ_ASSERT(savedFrame);
-    MOZ_ASSERT(savedFrame->is<SavedFrame>());
-    return savedFrame->as<SavedFrame>().getPrincipals();
-}
-
 #ifdef JS_CRASH_DIAGNOSTICS
 void
 CompartmentChecker::check(SavedStacks* stacks)
 {
     if (&compartment->savedStacks() != stacks) {
         printf("*** Compartment SavedStacks mismatch: %p vs. %p\n",
                (void*) &compartment->savedStacks(), stacks);
         MOZ_CRASH();
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -102,35 +102,16 @@ InterpreterFrame::initExecuteFrame(JSCon
     if (script->isDebuggee())
         setIsDebuggee();
 
 #ifdef DEBUG
     Debug_SetValueRangeToCrashOnTouch(&rval_, 1);
 #endif
 }
 
-void
-InterpreterFrame::writeBarrierPost()
-{
-    /* This needs to follow the same rules as in InterpreterFrame::mark. */
-    if (scopeChain_)
-        JSObject::writeBarrierPost(scopeChain_, &scopeChain_);
-    if (flags_ & HAS_ARGS_OBJ)
-        JSObject::writeBarrierPost(argsObj_, &argsObj_);
-    if (isFunctionFrame()) {
-        JSFunction::writeBarrierPost(exec.fun, &exec.fun);
-        if (isEvalFrame())
-            JSScript::writeBarrierPost(u.evalScript, &u.evalScript);
-    } else {
-        JSScript::writeBarrierPost(exec.script, &exec.script);
-    }
-    if (hasReturnValue())
-        HeapValue::writeBarrierPost(rval_, &rval_);
-}
-
 bool
 InterpreterFrame::copyRawFrameSlots(AutoValueVector* vec)
 {
     if (!vec->resize(numFormalArgs() + script()->nfixed()))
         return false;
     PodCopy(vec->begin(), argv(), numFormalArgs());
     PodCopy(vec->begin() + numFormalArgs(), slots(), script()->nfixed());
     return true;
@@ -1391,36 +1372,16 @@ NonBuiltinScriptFrameIter::settle()
     if (!SelfHostedFramesVisible()) {
         while (!done() && script()->selfHosted())
             ScriptFrameIter::operator++();
     }
 }
 
 /*****************************************************************************/
 
-JSObject*
-AbstractFramePtr::evalPrevScopeChain(JSContext* cx) const
-{
-    // Eval frames are not compiled by Ion, though their caller might be.
-    AllFramesIter iter(cx);
-    while (iter.isIon() || iter.abstractFramePtr() != *this)
-        ++iter;
-    ++iter;
-    return iter.scopeChain(cx);
-}
-
-bool
-AbstractFramePtr::hasPushedSPSFrame() const
-{
-    if (isInterpreterFrame())
-        return asInterpreterFrame()->hasPushedSPSFrame();
-    MOZ_ASSERT(isBaselineFrame());
-    return false;
-}
-
 jit::JitActivation::JitActivation(JSContext* cx, CalleeToken entryPoint, bool active)
   : Activation(cx, Jit),
     active_(active),
     isLazyLinkExitFrame_(false),
     rematerializedFrames_(nullptr),
     ionRecovery_(cx),
     bailoutData_(nullptr),
     lastProfilingFrame_(nullptr),
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -231,23 +231,19 @@ class AbstractFramePtr
     inline bool prevUpToDate() const;
     inline void setPrevUpToDate() const;
     inline void unsetPrevUpToDate() const;
 
     inline bool isDebuggee() const;
     inline void setIsDebuggee();
     inline void unsetIsDebuggee();
 
-    JSObject* evalPrevScopeChain(JSContext* cx) const;
-
     inline HandleValue returnValue() const;
     inline void setReturnValue(const Value& rval) const;
 
-    bool hasPushedSPSFrame() const;
-
     inline bool freshenBlock(JSContext* cx) const;
 
     inline void popBlock(JSContext* cx) const;
     inline void popWith(JSContext* cx) const;
 
     friend void GDBTestInitAbstractFramePtr(AbstractFramePtr&, void*);
     friend void GDBTestInitAbstractFramePtr(AbstractFramePtr&, InterpreterFrame*);
     friend void GDBTestInitAbstractFramePtr(AbstractFramePtr&, jit::BaselineFrame*);
@@ -376,18 +372,16 @@ class InterpreterFrame
     Value*              argv_;         /* If hasArgs(), points to frame's arguments. */
     LifoAlloc::Mark     mark_;          /* Used to release memory for this frame. */
 
     static void staticAsserts() {
         JS_STATIC_ASSERT(offsetof(InterpreterFrame, rval_) % sizeof(Value) == 0);
         JS_STATIC_ASSERT(sizeof(InterpreterFrame) % sizeof(Value) == 0);
     }
 
-    void writeBarrierPost();
-
     /*
      * The utilities are private since they are not able to assert that only
      * unaliased vars/formals are accessed. Normal code should prefer the
      * InterpreterFrame::unaliased* members (or InterpreterRegs::stackDepth for
      * the usual "depth is at least" assertions).
      */
     Value* slots() const { return (Value*)(this + 1); }
     Value* base() const { return slots() + script()->nfixed(); }
--- a/js/src/vm/TypeInference-inl.h
+++ b/js/src/vm/TypeInference-inl.h
@@ -447,28 +447,16 @@ MarkTypePropertyNonData(ExclusiveContext
 inline void
 MarkTypePropertyNonWritable(ExclusiveContext* cx, JSObject* obj, jsid id)
 {
     id = IdToTypeId(id);
     if (TrackPropertyTypes(cx, obj, id))
         obj->group()->markPropertyNonWritable(cx, obj, id);
 }
 
-inline bool
-IsTypePropertyIdMarkedNonData(JSObject* obj, jsid id)
-{
-    return obj->group()->isPropertyNonData(id);
-}
-
-inline bool
-IsTypePropertyIdMarkedNonWritable(JSObject* obj, jsid id)
-{
-    return obj->group()->isPropertyNonWritable(id);
-}
-
 /* Mark a state change on a particular object. */
 inline void
 MarkObjectStateChange(ExclusiveContext* cx, JSObject* obj)
 {
     if (!obj->hasLazyGroup() && !obj->group()->unknownProperties())
         obj->group()->markStateChange(cx);
 }
 
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -2819,34 +2819,16 @@ ObjectGroup::markPropertyNonWritable(Exc
 
     id = IdToTypeId(id);
 
     HeapTypeSet* types = getProperty(cx, obj, id);
     if (types)
         types->setNonWritableProperty(cx);
 }
 
-bool
-ObjectGroup::isPropertyNonData(jsid id)
-{
-    TypeSet* types = maybeGetProperty(id);
-    if (types)
-        return types->nonDataProperty();
-    return false;
-}
-
-bool
-ObjectGroup::isPropertyNonWritable(jsid id)
-{
-    TypeSet* types = maybeGetProperty(id);
-    if (types)
-        return types->nonWritableProperty();
-    return false;
-}
-
 void
 ObjectGroup::markStateChange(ExclusiveContext* cxArg)
 {
     if (unknownProperties())
         return;
 
     AutoEnterAnalysis enter(cxArg);
     HeapTypeSet* types = maybeGetProperty(JSID_EMPTY);