summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/src/XPCJSContext.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-10 11:39:27 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-10 11:39:27 +0100
commit974a481d12bf430891725bd3662876358e57e11a (patch)
treecad011151456251fef2f1b8d02ef4b4e45fad61a /js/xpconnect/src/XPCJSContext.cpp
parent6bd66b1728eeddb058066edda740aaeb2ceaec23 (diff)
parent736d25cbec4541186ed46c935c117ce4d1c7f3bb (diff)
downloadUXP-974a481d12bf430891725bd3662876358e57e11a.tar
UXP-974a481d12bf430891725bd3662876358e57e11a.tar.gz
UXP-974a481d12bf430891725bd3662876358e57e11a.tar.lz
UXP-974a481d12bf430891725bd3662876358e57e11a.tar.xz
UXP-974a481d12bf430891725bd3662876358e57e11a.zip
Merge branch 'master' into js-modules
# Conflicts: # modules/libpref/init/all.js
Diffstat (limited to 'js/xpconnect/src/XPCJSContext.cpp')
-rw-r--r--js/xpconnect/src/XPCJSContext.cpp118
1 files changed, 0 insertions, 118 deletions
diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
index f352607d4..0243d80e3 100644
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -28,7 +28,6 @@
#include "nsPIDOMWindow.h"
#include "nsPrintfCString.h"
#include "mozilla/Preferences.h"
-#include "mozilla/Telemetry.h"
#include "mozilla/Services.h"
#include "mozilla/dom/ScriptSettings.h"
@@ -133,10 +132,7 @@ class AsyncFreeSnowWhite : public Runnable
public:
NS_IMETHOD Run() override
{
- TimeStamp start = TimeStamp::Now();
bool hadSnowWhiteObjects = nsCycleCollector_doDeferredDeletion();
- Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_ASYNC_SNOW_WHITE_FREEING,
- uint32_t((TimeStamp::Now() - start).ToMilliseconds()));
if (hadSnowWhiteObjects && !mContinuation) {
mContinuation = true;
if (NS_FAILED(NS_DispatchToCurrentThread(this))) {
@@ -1238,8 +1234,6 @@ XPCJSContext::InterruptCallback(JSContext* cx)
if (self->mSlowScriptCheckpoint.IsNull()) {
self->mSlowScriptCheckpoint = TimeStamp::NowLoRes();
self->mSlowScriptSecondHalf = false;
- self->mSlowScriptActualWait = mozilla::TimeDuration();
- self->mTimeoutAccumulated = false;
return true;
}
@@ -1261,8 +1255,6 @@ XPCJSContext::InterruptCallback(JSContext* cx)
if (limit == 0 || duration.ToSeconds() < limit / 2.0)
return true;
- self->mSlowScriptActualWait += duration;
-
// In order to guard against time changes or laptops going to sleep, we
// don't trigger the slow script warning until (limit/2) seconds have
// elapsed twice.
@@ -1314,13 +1306,6 @@ XPCJSContext::InterruptCallback(JSContext* cx)
return false;
}
- // Accumulate slow script invokation delay.
- if (!chrome && !self->mTimeoutAccumulated) {
- uint32_t delay = uint32_t(self->mSlowScriptActualWait.ToMilliseconds() - (limit * 1000.0));
- Telemetry::Accumulate(Telemetry::SLOW_SCRIPT_NOTIFY_DELAY, delay);
- self->mTimeoutAccumulated = true;
- }
-
// Show the prompt to the user, and kill if requested.
nsGlobalWindow::SlowScriptResponse response = win->ShowSlowScriptDialog();
if (response == nsGlobalWindow::KillSlowScript) {
@@ -2953,105 +2938,6 @@ JSSizeOfTab(JSObject* objArg, size_t* jsObjectsSize, size_t* jsStringsSize,
} // namespace xpc
static void
-AccumulateTelemetryCallback(int id, uint32_t sample, const char* key)
-{
- switch (id) {
- case JS_TELEMETRY_GC_REASON:
- Telemetry::Accumulate(Telemetry::GC_REASON_2, sample);
- break;
- case JS_TELEMETRY_GC_IS_ZONE_GC:
- Telemetry::Accumulate(Telemetry::GC_IS_COMPARTMENTAL, sample);
- break;
- case JS_TELEMETRY_GC_MS:
- Telemetry::Accumulate(Telemetry::GC_MS, sample);
- break;
- case JS_TELEMETRY_GC_BUDGET_MS:
- Telemetry::Accumulate(Telemetry::GC_BUDGET_MS, sample);
- break;
- case JS_TELEMETRY_GC_ANIMATION_MS:
- Telemetry::Accumulate(Telemetry::GC_ANIMATION_MS, sample);
- break;
- case JS_TELEMETRY_GC_MAX_PAUSE_MS:
- Telemetry::Accumulate(Telemetry::GC_MAX_PAUSE_MS, sample);
- break;
- case JS_TELEMETRY_GC_MARK_MS:
- Telemetry::Accumulate(Telemetry::GC_MARK_MS, sample);
- break;
- case JS_TELEMETRY_GC_SWEEP_MS:
- Telemetry::Accumulate(Telemetry::GC_SWEEP_MS, sample);
- break;
- case JS_TELEMETRY_GC_COMPACT_MS:
- Telemetry::Accumulate(Telemetry::GC_COMPACT_MS, sample);
- break;
- case JS_TELEMETRY_GC_MARK_ROOTS_MS:
- Telemetry::Accumulate(Telemetry::GC_MARK_ROOTS_MS, sample);
- break;
- case JS_TELEMETRY_GC_MARK_GRAY_MS:
- Telemetry::Accumulate(Telemetry::GC_MARK_GRAY_MS, sample);
- break;
- case JS_TELEMETRY_GC_SLICE_MS:
- Telemetry::Accumulate(Telemetry::GC_SLICE_MS, sample);
- break;
- case JS_TELEMETRY_GC_SLOW_PHASE:
- Telemetry::Accumulate(Telemetry::GC_SLOW_PHASE, sample);
- break;
- case JS_TELEMETRY_GC_MMU_50:
- Telemetry::Accumulate(Telemetry::GC_MMU_50, sample);
- break;
- case JS_TELEMETRY_GC_RESET:
- Telemetry::Accumulate(Telemetry::GC_RESET, sample);
- break;
- case JS_TELEMETRY_GC_RESET_REASON:
- Telemetry::Accumulate(Telemetry::GC_RESET_REASON, sample);
- break;
- case JS_TELEMETRY_GC_INCREMENTAL_DISABLED:
- Telemetry::Accumulate(Telemetry::GC_INCREMENTAL_DISABLED, sample);
- break;
- case JS_TELEMETRY_GC_NON_INCREMENTAL:
- Telemetry::Accumulate(Telemetry::GC_NON_INCREMENTAL, sample);
- break;
- case JS_TELEMETRY_GC_NON_INCREMENTAL_REASON:
- Telemetry::Accumulate(Telemetry::GC_NON_INCREMENTAL_REASON, sample);
- break;
- case JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS:
- Telemetry::Accumulate(Telemetry::GC_SCC_SWEEP_TOTAL_MS, sample);
- break;
- case JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS:
- Telemetry::Accumulate(Telemetry::GC_SCC_SWEEP_MAX_PAUSE_MS, sample);
- break;
- case JS_TELEMETRY_GC_MINOR_REASON:
- Telemetry::Accumulate(Telemetry::GC_MINOR_REASON, sample);
- break;
- case JS_TELEMETRY_GC_MINOR_REASON_LONG:
- Telemetry::Accumulate(Telemetry::GC_MINOR_REASON_LONG, sample);
- break;
- case JS_TELEMETRY_GC_MINOR_US:
- Telemetry::Accumulate(Telemetry::GC_MINOR_US, sample);
- break;
- case JS_TELEMETRY_GC_NURSERY_BYTES:
- Telemetry::Accumulate(Telemetry::GC_NURSERY_BYTES, sample);
- break;
- case JS_TELEMETRY_GC_PRETENURE_COUNT:
- Telemetry::Accumulate(Telemetry::GC_PRETENURE_COUNT, sample);
- break;
- case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT:
- Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, sample);
- break;
- case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS:
- Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS, sample);
- break;
- case JS_TELEMETRY_ADDON_EXCEPTIONS:
- Telemetry::Accumulate(Telemetry::JS_TELEMETRY_ADDON_EXCEPTIONS, nsDependentCString(key), sample);
- break;
- case JS_TELEMETRY_AOT_USAGE:
- Telemetry::Accumulate(Telemetry::JS_AOT_USAGE, sample);
- break;
- default:
- MOZ_ASSERT_UNREACHABLE("Unexpected JS_TELEMETRY id");
- }
-}
-
-static void
CompartmentNameCallback(JSContext* cx, JSCompartment* comp,
char* buf, size_t bufsize)
{
@@ -3210,7 +3096,6 @@ XPCJSContext::XPCJSContext()
mWatchdogManager(new WatchdogManager(this)),
mAsyncSnowWhiteFreer(new AsyncFreeSnowWhite()),
mSlowScriptSecondHalf(false),
- mTimeoutAccumulated(false),
mPendingResult(NS_OK)
{
}
@@ -3376,7 +3261,6 @@ XPCJSContext::Initialize()
JS_AddWeakPointerCompartmentCallback(cx, WeakPointerCompartmentCallback, this);
JS_SetWrapObjectCallbacks(cx, &WrapObjectCallbacks);
js::SetPreserveWrapperCallback(cx, PreserveWrapper);
- JS_SetAccumulateTelemetryCallback(cx, AccumulateTelemetryCallback);
js::SetActivityCallback(cx, ActivityCallback, this);
JS_AddInterruptCallback(cx, InterruptCallback);
js::SetWindowProxyClass(cx, &OuterWindowProxyClass);
@@ -3541,8 +3425,6 @@ XPCJSContext::BeforeProcessTask(bool aMightBlock)
// Start the slow script timer.
mSlowScriptCheckpoint = mozilla::TimeStamp::NowLoRes();
mSlowScriptSecondHalf = false;
- mSlowScriptActualWait = mozilla::TimeDuration();
- mTimeoutAccumulated = false;
// As we may be entering a nested event loop, we need to
// cancel any ongoing performance measurement.