Bug 722345 part 1 - Remove now unused activity callback API. r=luke
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 28 Aug 2018 09:19:17 +0200
changeset 434748 6f17ffaad886eee469bd02aa97b359c61dde8eff
parent 434747 15812ad59a9019fcf40af44bff598007c7e1bb0e
child 434749 8542dc7212b42c892f8643d596c6e6ae64e3f0ed
push id107484
push userjandemooij@gmail.com
push dateWed, 05 Sep 2018 09:11:37 +0000
treeherdermozilla-inbound@e951ad8147a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs722345
milestone64.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 722345 part 1 - Remove now unused activity callback API. r=luke Differential Revision: https://phabricator.services.mozilla.com/D4422
js/src/jsapi.cpp
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/vm/JSContext.cpp
js/src/vm/JSContext.h
js/src/vm/Runtime.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -536,31 +536,29 @@ StartRequest(JSContext* cx)
 {
     MOZ_ASSERT(CurrentThreadCanAccessRuntime(cx->runtime()));
 
     if (cx->requestDepth) {
         cx->requestDepth++;
     } else {
         /* Indicate that a request is running. */
         cx->requestDepth = 1;
-        cx->triggerActivityCallback(true);
     }
 }
 
 static void
 StopRequest(JSContext* cx)
 {
     MOZ_ASSERT(CurrentThreadCanAccessRuntime(cx->runtime()));
 
     MOZ_ASSERT(cx->requestDepth != 0);
     if (cx->requestDepth != 1) {
         cx->requestDepth--;
     } else {
         cx->requestDepth = 0;
-        cx->triggerActivityCallback(false);
     }
 }
 
 JS_PUBLIC_API(void)
 JS_BeginRequest(JSContext* cx)
 {
     cx->outstandingRequests++;
     StartRequest(cx);
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -1264,23 +1264,16 @@ js::DumpHeap(JSContext* cx, FILE* fp, js
                            DumpHeapVisitRealm,
                            DumpHeapVisitArena,
                            DumpHeapVisitCell);
 
     fflush(dtrc.output);
 }
 
 JS_FRIEND_API(void)
-js::SetActivityCallback(JSContext* cx, ActivityCallback cb, void* arg)
-{
-    cx->activityCallback = cb;
-    cx->activityCallbackArg = arg;
-}
-
-JS_FRIEND_API(void)
 JS::NotifyGCRootsRemoved(JSContext* cx)
 {
     cx->runtime()->gc.notifyRootsRemoved();
 }
 
 JS_FRIEND_API(JS::Realm*)
 js::GetAnyRealmInZone(JS::Zone* zone)
 {
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -1156,27 +1156,16 @@ GetPCCountScriptContents(JSContext* cx, 
  * content within the buffer would be set to the length out-param.
  *
  * In case of out-of-memory, this function returns nullptr and does not set any
  * value to the length out-param.
  */
 JS_FRIEND_API(char*)
 GetCodeCoverageSummary(JSContext* cx, size_t* length);
 
-typedef void
-(* ActivityCallback)(void* arg, bool active);
-
-/**
- * Sets a callback that is run whenever the runtime goes idle - the
- * last active request ceases - and begins activity - when it was
- * idle and a request begins.
- */
-JS_FRIEND_API(void)
-SetActivityCallback(JSContext* cx, ActivityCallback cb, void* arg);
-
 typedef bool
 (* DOMInstanceClassHasProtoAtDepth)(const Class* instanceClass,
                                     uint32_t protoID, uint32_t depth);
 struct JSDOMCallbacks {
     DOMInstanceClassHasProtoAtDepth instanceClassMatchesProto;
 };
 typedef struct JSDOMCallbacks DOMCallbacks;
 
--- a/js/src/vm/JSContext.cpp
+++ b/js/src/vm/JSContext.cpp
@@ -1264,18 +1264,16 @@ JSContext::JSContext(JSRuntime* runtime,
     options_(options),
     freeLists_(nullptr),
     jitActivation(nullptr),
     activation_(nullptr),
     profilingActivation_(nullptr),
     nativeStackBase(GetNativeStackBase()),
     entryMonitor(nullptr),
     noExecuteDebuggerTop(nullptr),
-    activityCallback(nullptr),
-    activityCallbackArg(nullptr),
     requestDepth(0),
 #ifdef DEBUG
     checkRequestDepth(0),
     inUnsafeCallWithABI(false),
     hasAutoUnsafeCallWithABI(false),
 #endif
 #ifdef JS_SIMULATOR
     simulator_(nullptr),
--- a/js/src/vm/JSContext.h
+++ b/js/src/vm/JSContext.h
@@ -465,20 +465,16 @@ struct JSContext : public JS::RootingCon
      * Stack of debuggers that currently disallow debuggee execution.
      *
      * When we check for NX we are inside the debuggee compartment, and thus a
      * stack of Debuggers that have prevented execution need to be tracked to
      * enter the correct Debugger compartment to report the error.
      */
     js::ThreadData<js::EnterDebuggeeNoExecute*> noExecuteDebuggerTop;
 
-    js::ThreadData<js::ActivityCallback> activityCallback;
-    js::ThreadData<void*>                activityCallbackArg;
-    void triggerActivityCallback(bool active);
-
     /* The request depth for this thread. */
     js::ThreadData<unsigned> requestDepth;
 
 #ifdef DEBUG
     js::ThreadData<unsigned> checkRequestDepth;
     js::ThreadData<uint32_t> inUnsafeCallWithABI;
     js::ThreadData<bool> hasAutoUnsafeCallWithABI;
 #endif
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -567,34 +567,16 @@ JSRuntime::getDefaultLocale()
 }
 
 void
 JSRuntime::traceSharedIntlData(JSTracer* trc)
 {
     sharedIntlData.ref().trace(trc);
 }
 
-void
-JSContext::triggerActivityCallback(bool active)
-{
-    if (!activityCallback)
-        return;
-
-    /*
-     * The activity callback must not trigger a GC: it would create a cirular
-     * dependency between entering a request and Rooted's requirement of being
-     * in a request. In practice this callback already cannot trigger GC. The
-     * suppression serves to inform the exact rooting hazard analysis of this
-     * property and ensures that it remains true in the future.
-     */
-    AutoSuppressGC suppress(this);
-
-    activityCallback(activityCallbackArg, active);
-}
-
 FreeOp::FreeOp(JSRuntime* maybeRuntime)
   : JSFreeOp(maybeRuntime)
 {
     MOZ_ASSERT_IF(maybeRuntime, CurrentThreadCanAccessRuntime(maybeRuntime));
 }
 
 FreeOp::~FreeOp()
 {