Bug 1222547 - Remove telemetry. r=jandem
authorTom Schuster <evilpies@gmail.com>
Mon, 30 Sep 2019 10:45:55 +0000
changeset 495635 004f5255d2fc01ee3e74f5214ea8ea81f0a1c1bc
parent 495634 ee339b902006a015bdf6ca9e649de4bd6c408e5e
child 495636 09cfae95708ed9e4932d498bba15582f2c253b43
push id114140
push userdvarga@mozilla.com
push dateWed, 02 Oct 2019 18:04:51 +0000
treeherdermozilla-inbound@32eb0ea893f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1222547
milestone71.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 1222547 - Remove telemetry. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D47414
js/src/builtin/SelfHostingDefines.h
js/src/js.msg
js/src/jsfriendapi.h
js/src/vm/Realm.h
js/src/vm/SelfHosting.cpp
js/xpconnect/src/XPCJSRuntime.cpp
toolkit/components/telemetry/Histograms.json
--- a/js/src/builtin/SelfHostingDefines.h
+++ b/js/src/builtin/SelfHostingDefines.h
@@ -112,37 +112,16 @@
 
 #define MODULE_STATUS_UNINSTANTIATED 0
 #define MODULE_STATUS_INSTANTIATING 1
 #define MODULE_STATUS_INSTANTIATED 2
 #define MODULE_STATUS_EVALUATING 3
 #define MODULE_STATUS_EVALUATED 4
 #define MODULE_STATUS_EVALUATED_ERROR 5
 
-#define ARRAY_GENERICS_INDEXOF 0
-#define ARRAY_GENERICS_LASTINDEXOF 1
-#define ARRAY_GENERICS_EVERY 2
-#define ARRAY_GENERICS_SOME 3
-#define ARRAY_GENERICS_FOREACH 4
-#define ARRAY_GENERICS_MAP 5
-#define ARRAY_GENERICS_FILTER 6
-#define ARRAY_GENERICS_REDUCE 7
-#define ARRAY_GENERICS_REDUCERIGHT 8
-#define ARRAY_GENERICS_CONCAT 9
-#define ARRAY_GENERICS_JOIN 10
-#define ARRAY_GENERICS_REVERSE 11
-#define ARRAY_GENERICS_SORT 12
-#define ARRAY_GENERICS_PUSH 13
-#define ARRAY_GENERICS_POP 14
-#define ARRAY_GENERICS_SHIFT 15
-#define ARRAY_GENERICS_UNSHIFT 16
-#define ARRAY_GENERICS_SPLICE 17
-#define ARRAY_GENERICS_SLICE 18
-#define ARRAY_GENERICS_METHODS_LIMIT 19
-
 #define INTL_INTERNALS_OBJECT_SLOT 0
 
 #define NOT_OBJECT_KIND_DESCRIPTOR 0
 
 #define TYPEDARRAY_KIND_INT8 0
 #define TYPEDARRAY_KIND_UINT8 1
 #define TYPEDARRAY_KIND_INT16 2
 #define TYPEDARRAY_KIND_UINT16 3
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -569,17 +569,16 @@ MSG_DEF(JSMSG_TYPEDOBJECT_HANDLE_UNATTAC
 MSG_DEF(JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS, 0, JSEXN_RANGEERR, "invalid field descriptor")
 MSG_DEF(JSMSG_TYPEDOBJECT_STRUCTTYPE_NOT_CALLABLE, 0, JSEXN_TYPEERR, "not callable")
 MSG_DEF(JSMSG_TYPEDOBJECT_TOO_BIG,     0, JSEXN_ERR, "Type is too large to allocate")
 MSG_DEF(JSMSG_TYPEDOBJECT_SETTING_IMMUTABLE, 0, JSEXN_ERR, "setting immutable field")
 MSG_DEF(JSMSG_TYPEDOBJECT_NOT_CONSTRUCTIBLE, 0, JSEXN_TYPEERR, "not constructible")
 
 // Array
 MSG_DEF(JSMSG_TOO_LONG_ARRAY,         0, JSEXN_TYPEERR, "Too long array")
-MSG_DEF(JSMSG_DEPRECATED_ARRAY_METHOD, 2, JSEXN_WARN, "Array.{0} is deprecated; use Array.prototype.{1} instead")
 
 // Typed array
 MSG_DEF(JSMSG_BAD_INDEX,               0, JSEXN_RANGEERR, "invalid or out-of-range index")
 MSG_DEF(JSMSG_NON_ARRAY_BUFFER_RETURNED, 0, JSEXN_TYPEERR, "expected ArrayBuffer, but species constructor returned non-ArrayBuffer")
 MSG_DEF(JSMSG_SAME_ARRAY_BUFFER_RETURNED, 0, JSEXN_TYPEERR, "expected different ArrayBuffer, but species constructor returned same ArrayBuffer")
 MSG_DEF(JSMSG_SHORT_ARRAY_BUFFER_RETURNED, 2, JSEXN_TYPEERR, "expected ArrayBuffer with at least {0} bytes, but species constructor returns ArrayBuffer with {1} bytes")
 MSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS,    0, JSEXN_TYPEERR, "invalid arguments")
 MSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG,1, JSEXN_RANGEERR, "argument {0} must be >= 0")
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -171,17 +171,16 @@ enum {
   JS_TELEMETRY_GC_TENURED_SURVIVAL_RATE,
   JS_TELEMETRY_GC_MARK_RATE,
   JS_TELEMETRY_GC_TIME_BETWEEN_S,
   JS_TELEMETRY_GC_TIME_BETWEEN_SLICES_MS,
   JS_TELEMETRY_GC_SLICE_COUNT,
   JS_TELEMETRY_GC_EFFECTIVENESS,
   JS_TELEMETRY_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS,
   JS_TELEMETRY_WEB_PARSER_COMPILE_LAZY_AFTER_MS,
-  JS_TELEMETRY_DEPRECATED_ARRAY_GENERICS,
   JS_TELEMETRY_END
 };
 
 typedef void (*JSAccumulateTelemetryDataCallback)(int id, uint32_t sample,
                                                   const char* key);
 
 extern JS_FRIEND_API void JS_SetAccumulateTelemetryCallback(
     JSContext* cx, JSAccumulateTelemetryDataCallback callback);
--- a/js/src/vm/Realm.h
+++ b/js/src/vm/Realm.h
@@ -431,17 +431,16 @@ class JS::Realm : public JS::shadow::Rea
    * For generational GC, record whether a write barrier has added this
    * realm's global to the store buffer since the last minor GC.
    *
    * This is used to avoid calling into the VM every time a nursery object is
    * written to a property of the global.
    */
   uint32_t globalWriteBarriered = 0;
 
-  uint32_t warnedAboutArrayGenericsMethods = 0;
 #ifdef DEBUG
   bool firedOnNewGlobalObject = false;
 #endif
 
   // True if all incoming wrappers have been nuked. This happens when
   // NukeCrossCompartmentWrappers is called with the NukeAllReferences option.
   // This prevents us from creating new wrappers for the compartment.
   bool nukedIncomingWrappers = false;
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -1808,56 +1808,16 @@ static bool intrinsic_GetBuiltinIntlCons
     return false;
   }
 
   args.rval().setObject(*constructor);
   return true;
 }
 #endif  // ENABLE_INTL_API
 
-static bool intrinsic_WarnDeprecatedMethod(JSContext* cx, unsigned argc,
-                                           Value* vp) {
-  CallArgs args = CallArgsFromVp(argc, vp);
-  MOZ_ASSERT(args.length() == 2);
-  MOZ_RELEASE_ASSERT(args[0].isInt32());
-  MOZ_ASSERT(args[1].isString());
-
-  uint32_t id = uint32_t(args[0].toInt32());
-  MOZ_ASSERT(id < ARRAY_GENERICS_METHODS_LIMIT);
-
-  uint32_t mask = (1 << id);
-  if (!(cx->realm()->warnedAboutArrayGenericsMethods & mask)) {
-    JSFlatString* name = args[1].toString()->ensureFlat(cx);
-    if (!name) {
-      return false;
-    }
-
-    AutoStableStringChars stableChars(cx);
-    if (!stableChars.initTwoByte(cx, name)) {
-      return false;
-    }
-    const char16_t* nameChars = stableChars.twoByteRange().begin().get();
-
-    if (!JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_WARNING, GetErrorMessage,
-                                        nullptr, JSMSG_DEPRECATED_ARRAY_METHOD,
-                                        nameChars, nameChars)) {
-      return false;
-    }
-
-    if (!cx->realm()->isProbablySystemCode()) {
-      cx->runtime()->addTelemetry(JS_TELEMETRY_DEPRECATED_ARRAY_GENERICS, id);
-    }
-
-    cx->realm()->warnedAboutArrayGenericsMethods |= mask;
-  }
-
-  args.rval().setUndefined();
-  return true;
-}
-
 static bool intrinsic_ThrowArgTypeNotObject(JSContext* cx, unsigned argc,
                                             Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   MOZ_ASSERT(args.length() == 2);
   MOZ_ASSERT(args[0].isNumber());
   MOZ_ASSERT(!args[1].isObject());
   if (args[0].toNumber() == NOT_OBJECT_KIND_DESCRIPTOR) {
     ReportNotObject(cx, JSMSG_OBJECT_REQUIRED_PROP_DESC, args[1]);
@@ -2573,17 +2533,16 @@ static const JSFunctionSpec intrinsic_fu
 
     JS_FN("FlatStringMatch", FlatStringMatch, 2, 0),
     JS_FN("FlatStringSearch", FlatStringSearch, 2, 0),
     JS_INLINABLE_FN("StringReplaceString", intrinsic_StringReplaceString, 3, 0,
                     IntrinsicStringReplaceString),
     JS_INLINABLE_FN("StringSplitString", intrinsic_StringSplitString, 2, 0,
                     IntrinsicStringSplitString),
     JS_FN("StringSplitStringLimit", intrinsic_StringSplitStringLimit, 3, 0),
-    JS_FN("WarnDeprecatedArrayMethod", intrinsic_WarnDeprecatedMethod, 2, 0),
     JS_FN("ThrowArgTypeNotObject", intrinsic_ThrowArgTypeNotObject, 2, 0),
 
     // See builtin/RegExp.h for descriptions of the regexp_* functions.
     JS_FN("regexp_construct_raw_flags", regexp_construct_raw_flags, 2, 0),
 
     JS_FN("IsModule", intrinsic_IsInstanceOfBuiltin<ModuleObject>, 1, 0),
     JS_FN("CallModuleMethodIfWrapped",
           CallNonGenericSelfhostedMethod<Is<ModuleObject>>, 2, 0),
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2766,19 +2766,16 @@ static void AccumulateTelemetryCallback(
     case JS_TELEMETRY_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS:
       Telemetry::Accumulate(
           Telemetry::JS_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS, sample);
       break;
     case JS_TELEMETRY_WEB_PARSER_COMPILE_LAZY_AFTER_MS:
       Telemetry::Accumulate(Telemetry::JS_WEB_PARSER_COMPILE_LAZY_AFTER_MS,
                             sample);
       break;
-    case JS_TELEMETRY_DEPRECATED_ARRAY_GENERICS:
-      Telemetry::Accumulate(Telemetry::JS_DEPRECATED_ARRAY_GENERICS, sample);
-      break;
     default:
       MOZ_ASSERT_UNREACHABLE("Unexpected JS_TELEMETRY id");
   }
 }
 
 static void SetUseCounterCallback(JSObject* obj, JSUseCounter counter) {
   switch (counter) {
     case JSUseCounter::ASMJS:
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -1199,26 +1199,16 @@
     "expires_in_version": "70",
     "bug_numbers": [1343483],
     "kind": "exponential",
     "low": 10,
     "high": 10000,
     "n_buckets": 10,
     "description": "Time elapsed between the moment a function is lazy-parsed (end of parsing of the ScriptSource) and the moment it is recompiled as non-lazy (start of compilation), in milliseconds, for web code."
   },
-  "JS_DEPRECATED_ARRAY_GENERICS": {
-    "record_in_processes": ["content"],
-    "products": ["firefox", "fennec", "geckoview"],
-    "alert_emails": ["jdemooij@mozilla.com"],
-    "expires_in_version": "74",
-    "bug_numbers": [1536860],
-    "kind": "enumerated",
-    "n_values": 20,
-    "description": "A array generic function was called, like Array.forEach etc. See ARRAY_GENERICS_* defines in SelfHostingDefines.h for the meaning of values."
-  },
   "XUL_CACHE_DISABLED": {
     "record_in_processes": ["main", "content"],
     "products": ["firefox", "fennec", "geckoview"],
     "expires_in_version": "default",
     "kind": "flag",
     "description": "XUL cache was disabled"
   },
   "MEMORY_RESIDENT_FAST": {