Bug 1222552 - Remove String generics. r=jorendorff
authorTom Schuster <evilpies@gmail.com>
Fri, 22 Mar 2019 18:11:08 +0000
changeset 465750 c59acf29813609e214c9ab6ac08a84bba078a411
parent 465749 38349ca764d764d99930bd94ae088072a4d93d1d
child 465751 a8c448b929137723938b1e4da97a9693f0937048
push id35746
push usershindli@mozilla.com
push dateSat, 23 Mar 2019 09:46:24 +0000
treeherdermozilla-central@02b7484f316b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1222552
milestone68.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 1222552 - Remove String generics. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D24406
js/src/builtin/SelfHostingDefines.h
js/src/builtin/String.cpp
js/src/builtin/String.js
js/src/js.msg
js/src/jsfriendapi.h
js/src/tests/non262/String/generics-deprecated.js
js/src/tests/non262/String/generics.js
js/src/tests/non262/String/regress-306591.js
js/src/tests/non262/extensions/eval-native-callback-is-indirect.js
js/src/tests/non262/extensions/regress-312385-01.js
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
@@ -113,42 +113,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 STRING_GENERICS_CHAR_AT 0
-#define STRING_GENERICS_CHAR_CODE_AT 1
-#define STRING_GENERICS_CONCAT 2
-#define STRING_GENERICS_ENDS_WITH 3
-#define STRING_GENERICS_INCLUDES 4
-#define STRING_GENERICS_INDEX_OF 5
-#define STRING_GENERICS_LAST_INDEX_OF 6
-#define STRING_GENERICS_LOCALE_COMPARE 7
-#define STRING_GENERICS_MATCH 8
-#define STRING_GENERICS_NORMALIZE 9
-#define STRING_GENERICS_REPLACE 10
-#define STRING_GENERICS_SEARCH 11
-#define STRING_GENERICS_SLICE 12
-#define STRING_GENERICS_SPLIT 13
-#define STRING_GENERICS_STARTS_WITH 14
-#define STRING_GENERICS_SUBSTR 15
-#define STRING_GENERICS_SUBSTRING 16
-#define STRING_GENERICS_TO_LOWER_CASE 17
-#define STRING_GENERICS_TO_LOCALE_LOWER_CASE 18
-#define STRING_GENERICS_TO_LOCALE_UPPER_CASE 19
-#define STRING_GENERICS_TO_UPPER_CASE 20
-#define STRING_GENERICS_TRIM 21
-#define STRING_GENERICS_TRIM_LEFT 22
-#define STRING_GENERICS_TRIM_RIGHT 23
-#define STRING_GENERICS_METHODS_LIMIT 24
-
 #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/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -3653,47 +3653,16 @@ bool js::str_fromCodePoint(JSContext* cx
 
 static const JSFunctionSpec string_static_methods[] = {
     JS_INLINABLE_FN("fromCharCode", js::str_fromCharCode, 1, 0,
                     StringFromCharCode),
     JS_INLINABLE_FN("fromCodePoint", js::str_fromCodePoint, 1, 0,
                     StringFromCodePoint),
 
     JS_SELF_HOSTED_FN("raw", "String_static_raw", 1, 0),
-    JS_SELF_HOSTED_FN("substring", "String_static_substring", 3, 0),
-    JS_SELF_HOSTED_FN("substr", "String_static_substr", 3, 0),
-    JS_SELF_HOSTED_FN("slice", "String_static_slice", 3, 0),
-
-    JS_SELF_HOSTED_FN("match", "String_generic_match", 2, 0),
-    JS_SELF_HOSTED_FN("replace", "String_generic_replace", 3, 0),
-    JS_SELF_HOSTED_FN("search", "String_generic_search", 2, 0),
-    JS_SELF_HOSTED_FN("split", "String_generic_split", 3, 0),
-
-    JS_SELF_HOSTED_FN("toLowerCase", "String_static_toLowerCase", 1, 0),
-    JS_SELF_HOSTED_FN("toUpperCase", "String_static_toUpperCase", 1, 0),
-    JS_SELF_HOSTED_FN("charAt", "String_static_charAt", 2, 0),
-    JS_SELF_HOSTED_FN("charCodeAt", "String_static_charCodeAt", 2, 0),
-    JS_SELF_HOSTED_FN("includes", "String_static_includes", 2, 0),
-    JS_SELF_HOSTED_FN("indexOf", "String_static_indexOf", 2, 0),
-    JS_SELF_HOSTED_FN("lastIndexOf", "String_static_lastIndexOf", 2, 0),
-    JS_SELF_HOSTED_FN("startsWith", "String_static_startsWith", 2, 0),
-    JS_SELF_HOSTED_FN("endsWith", "String_static_endsWith", 2, 0),
-    JS_SELF_HOSTED_FN("trim", "String_static_trim", 1, 0),
-    JS_SELF_HOSTED_FN("trimLeft", "String_static_trimLeft", 1, 0),
-    JS_SELF_HOSTED_FN("trimRight", "String_static_trimRight", 1, 0),
-    JS_SELF_HOSTED_FN("toLocaleLowerCase", "String_static_toLocaleLowerCase", 1,
-                      0),
-    JS_SELF_HOSTED_FN("toLocaleUpperCase", "String_static_toLocaleUpperCase", 1,
-                      0),
-#if EXPOSE_INTL_API
-    JS_SELF_HOSTED_FN("normalize", "String_static_normalize", 1, 0),
-#endif
-    JS_SELF_HOSTED_FN("concat", "String_static_concat", 2, 0),
-
-    JS_SELF_HOSTED_FN("localeCompare", "String_static_localeCompare", 2, 0),
     JS_FS_END};
 
 /* static */
 Shape* StringObject::assignInitialShape(JSContext* cx,
                                         Handle<StringObject*> obj) {
   MOZ_ASSERT(obj->empty());
 
   return NativeObject::addDataProperty(cx, obj, cx->names().length, LENGTH_SLOT,
--- a/js/src/builtin/String.js
+++ b/js/src/builtin/String.js
@@ -52,22 +52,16 @@ function String_match(regexp) {
     // Step 5 (optimized case).
     if (IsStringMatchOptimizable())
         return RegExpMatcher(rx, S, 0);
 
     // Step 5.
     return callContentFunction(GetMethod(rx, std_match), rx, S);
 }
 
-function String_generic_match(thisValue, regexp) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_MATCH, "match");
-    if (thisValue === undefined)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.match");
-    return callFunction(String_match, thisValue, regexp);
-}
 
 // String.prototype.matchAll proposal.
 //
 // String.prototype.matchAll ( regexp )
 function String_matchAll(regexp) {
     // Step 1.
     RequireObjectCoercible(this);
 
@@ -220,23 +214,16 @@ function String_replace(searchValue, rep
     var stringLength = string.length;
     if (tailPos < stringLength)
         newString += Substring(string, tailPos, stringLength - tailPos);
 
     // Step 12.
     return newString;
 }
 
-function String_generic_replace(thisValue, searchValue, replaceValue) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_REPLACE, "replace");
-    if (thisValue === undefined)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.replace");
-    return callFunction(String_replace, thisValue, searchValue, replaceValue);
-}
-
 function StringProtoHasNoSearch() {
     var ObjectProto = GetBuiltinPrototype("Object");
     var StringProto = GetBuiltinPrototype("String");
     if (!ObjectHasPrototype(StringProto, ObjectProto))
         return false;
     return !(std_search in StringProto);
 }
 
@@ -276,23 +263,16 @@ function String_search(regexp) {
 
     // Step 4.
     var rx = RegExpCreate(regexp);
 
     // Step 5.
     return callContentFunction(GetMethod(rx, std_search), rx, string);
 }
 
-function String_generic_search(thisValue, regexp) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_SEARCH, "search");
-    if (thisValue === undefined)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.search");
-    return callFunction(String_search, thisValue, regexp);
-}
-
 function StringProtoHasNoSplit() {
     var ObjectProto = GetBuiltinPrototype("Object");
     var StringProto = GetBuiltinPrototype("String");
     if (!ObjectHasPrototype(StringProto, ObjectProto))
         return false;
     return !(std_split in StringProto);
 }
 
@@ -358,23 +338,16 @@ function String_split(separator, limit) 
     if (separator === undefined)
         return [S];
 
     // Optimized path.
     // Steps 4, 8, 12-18.
     return StringSplitString(S, R);
 }
 
-function String_generic_split(thisValue, separator, limit) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_SPLIT, "split");
-    if (thisValue === undefined)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.split");
-    return callFunction(String_split, thisValue, separator, limit);
-}
-
 /* ES6 Draft Oct 14, 2014 21.1.3.19 */
 function String_substring(start, end) {
     // Steps 1-3.
     RequireObjectCoercible(this);
     var str = ToString(this);
 
     // Step 4.
     var len = str.length;
@@ -403,23 +376,16 @@ function String_substring(start, end) {
 
     // Step 11.
     // While |from| and |to - from| are bounded to the length of |str| and this
     // and thus definitely in the int32 range, they can still be typed as
     // double. Eagerly truncate since SubstringKernel only accepts int32.
     return SubstringKernel(str, from | 0, (to - from) | 0);
 }
 
-function String_static_substring(string, start, end) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_SUBSTRING, "substring");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.substring");
-    return callFunction(String_substring, string, start, end);
-}
-
 /* ES6 Draft Oct 14, 2014 B.2.3.1 */
 function String_substr(start, length) {
     // Steps 1-2.
     RequireObjectCoercible(this);
     var str = ToString(this);
 
     // Steps 3-4.
     var intStart = ToInteger(start);
@@ -443,23 +409,16 @@ function String_substr(start, length) {
 
     // Step 11.
     // While |intStart| and |resultLength| are bounded to the length of |str|
     // and thus definitely in the int32 range, they can still be typed as
     // double. Eagerly truncate since SubstringKernel only accepts int32.
     return SubstringKernel(str, intStart | 0, resultLength | 0);
 }
 
-function String_static_substr(string, start, length) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_SUBSTR, "substr");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.substr");
-    return callFunction(String_substr, string, start, length);
-}
-
 /* ES6 Draft Oct 14, 2014 21.1.3.16 */
 function String_slice(start, end) {
     // Steps 1-3.
     RequireObjectCoercible(this);
     var str = ToString(this);
 
     // Step 4.
     var len = str.length;
@@ -481,23 +440,16 @@ function String_slice(start, end) {
 
     // Step 10.
     // While |from| and |span| are bounded to the length of |str|
     // and thus definitely in the int32 range, they can still be typed as
     // double. Eagerly truncate since SubstringKernel only accepts int32.
     return SubstringKernel(str, from | 0, span | 0);
 }
 
-function String_static_slice(string, start, end) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_SLICE, "slice");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.slice");
-    return callFunction(String_slice, string, start, end);
-}
-
 /* ES6 Draft September 5, 2013 21.1.3.3 */
 function String_codePointAt(pos) {
     // Steps 1-3.
     RequireObjectCoercible(this);
     var S = ToString(this);
 
     // Steps 4-5.
     var position = ToInteger(pos);
@@ -773,38 +725,16 @@ function String_static_raw(callSite/*, .
         // Steps 9.a-c.
         resultString += ToString(raw[nextIndex]);
     }
 
     // Step 9.d.i.
     return resultString;
 }
 
-/**
- * Compare String str1 against String str2, using the locale and collation
- * options provided.
- *
- * Mozilla proprietary.
- * Spec: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String#String_generic_methods
- */
-function String_static_localeCompare(str1, str2) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_LOCALE_COMPARE, "localeCompare");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.localeCompare");
-    var locales = arguments.length > 2 ? arguments[2] : undefined;
-    var options = arguments.length > 3 ? arguments[3] : undefined;
-/* eslint-disable no-unreachable */
-#if EXPOSE_INTL_API
-    return callFunction(String_localeCompare, str1, str2, locales, options);
-#else
-    return callFunction(std_String_localeCompare, str1, str2, locales, options);
-#endif
-/* eslint-enable no-unreachable */
-}
-
 // ES6 draft 2014-04-27 B.2.3.3
 function String_big() {
     RequireObjectCoercible(this);
     return "<big>" + ToString(this) + "</big>";
 }
 
 // ES6 draft 2014-04-27 B.2.3.4
 function String_blink() {
@@ -895,142 +825,8 @@ function String_fontsize(size) {
 
 // ES6 draft 2014-04-27 B.2.3.10
 function String_link(url) {
     RequireObjectCoercible(this);
     var S = ToString(this);
     return '<a href="' + EscapeAttributeValue(url) + '">' + S + "</a>";
 }
 
-function String_static_toLowerCase(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_TO_LOWER_CASE, "toLowerCase");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.toLowerCase");
-    return callFunction(std_String_toLowerCase, string);
-}
-
-function String_static_toUpperCase(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_TO_UPPER_CASE, "toUpperCase");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.toUpperCase");
-    return callFunction(std_String_toUpperCase, string);
-}
-
-function String_static_charAt(string, pos) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_CHAR_AT, "charAt");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.charAt");
-    return callFunction(std_String_charAt, string, pos);
-}
-
-function String_static_charCodeAt(string, pos) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_CHAR_CODE_AT, "charCodeAt");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.charCodeAt");
-    return callFunction(std_String_charCodeAt, string, pos);
-}
-
-function String_static_includes(string, searchString) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_INCLUDES, "includes");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.includes");
-    var position = arguments.length > 2 ? arguments[2] : undefined;
-    return callFunction(std_String_includes, string, searchString, position);
-}
-
-function String_static_indexOf(string, searchString) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_INDEX_OF, "indexOf");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.indexOf");
-    var position = arguments.length > 2 ? arguments[2] : undefined;
-    return callFunction(std_String_indexOf, string, searchString, position);
-}
-
-function String_static_lastIndexOf(string, searchString) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_LAST_INDEX_OF, "lastIndexOf");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.lastIndexOf");
-    var position = arguments.length > 2 ? arguments[2] : undefined;
-    return callFunction(std_String_lastIndexOf, string, searchString, position);
-}
-
-function String_static_startsWith(string, searchString) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_STARTS_WITH, "startsWith");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.startsWith");
-    var position = arguments.length > 2 ? arguments[2] : undefined;
-    return callFunction(std_String_startsWith, string, searchString, position);
-}
-
-function String_static_endsWith(string, searchString) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_ENDS_WITH, "endsWith");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.endsWith");
-    var endPosition = arguments.length > 2 ? arguments[2] : undefined;
-    return callFunction(std_String_endsWith, string, searchString, endPosition);
-}
-
-function String_static_trim(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_TRIM, "trim");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.trim");
-    return callFunction(std_String_trim, string);
-}
-
-function String_static_trimLeft(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_TRIM_LEFT, "trimLeft");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.trimLeft");
-    return callFunction(std_String_trimStart, string);
-}
-
-function String_static_trimRight(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_TRIM_RIGHT, "trimRight");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.trimRight");
-    return callFunction(std_String_trimEnd, string);
-}
-
-function String_static_toLocaleLowerCase(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_TO_LOCALE_LOWER_CASE, "toLocaleLowerCase");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.toLocaleLowerCase");
-/* eslint-disable no-unreachable */
-#if EXPOSE_INTL_API
-    var locales = arguments.length > 1 ? arguments[1] : undefined;
-    return callFunction(String_toLocaleLowerCase, string, locales);
-#else
-    return callFunction(std_String_toLocaleLowerCase, string);
-#endif
-/* eslint-enable no-unreachable */
-}
-
-function String_static_toLocaleUpperCase(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_TO_LOCALE_UPPER_CASE, "toLocaleUpperCase");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.toLocaleUpperCase");
-/* eslint-disable no-unreachable */
-#if EXPOSE_INTL_API
-    var locales = arguments.length > 1 ? arguments[1] : undefined;
-    return callFunction(String_toLocaleUpperCase, string, locales);
-#else
-    return callFunction(std_String_toLocaleUpperCase, string);
-#endif
-/* eslint-enable no-unreachable */
-}
-
-#if EXPOSE_INTL_API
-function String_static_normalize(string) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_NORMALIZE, "normalize");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.normalize");
-    var form = arguments.length > 1 ? arguments[1] : undefined;
-    return callFunction(std_String_normalize, string, form);
-}
-#endif
-
-function String_static_concat(string, arg1) {
-    WarnDeprecatedStringMethod(STRING_GENERICS_CONCAT, "concat");
-    if (arguments.length < 1)
-        ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, "String.concat");
-    var args = callFunction(std_Array_slice, arguments, 1);
-    return callFunction(std_Function_apply, std_String_concat, string, args);
-}
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -131,17 +131,16 @@ MSG_DEF(JSMSG_INVALID_DATE,            0
 MSG_DEF(JSMSG_BAD_TOISOSTRING_PROP,    0, JSEXN_TYPEERR, "toISOString property is not callable")
 
 // String
 MSG_DEF(JSMSG_BAD_URI,                 0, JSEXN_URIERR, "malformed URI sequence")
 MSG_DEF(JSMSG_INVALID_NORMALIZE_FORM,  0, JSEXN_RANGEERR, "form must be one of 'NFC', 'NFD', 'NFKC', or 'NFKD'")
 MSG_DEF(JSMSG_NEGATIVE_REPETITION_COUNT, 0, JSEXN_RANGEERR, "repeat count must be non-negative")
 MSG_DEF(JSMSG_NOT_A_CODEPOINT,         1, JSEXN_RANGEERR, "{0} is not a valid code point")
 MSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 0, JSEXN_RANGEERR, "repeat count must be less than infinity and not overflow maximum string size")
-MSG_DEF(JSMSG_DEPRECATED_STRING_METHOD, 2, JSEXN_WARN, "String.{0} is deprecated; use String.prototype.{1} instead")
 
 // Number
 MSG_DEF(JSMSG_BAD_RADIX,               0, JSEXN_RANGEERR, "radix must be an integer at least 2 and no greater than 36")
 MSG_DEF(JSMSG_PRECISION_RANGE,         1, JSEXN_RANGEERR, "precision {0} out of range")
 
 // Function
 MSG_DEF(JSMSG_BAD_APPLY_ARGS,          1, JSEXN_TYPEERR, "second argument to Function.prototype.{0} must be an array")
 MSG_DEF(JSMSG_BAD_FORMAL,              0, JSEXN_SYNTAXERR, "malformed formal parameter")
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -165,17 +165,16 @@ enum {
   JS_TELEMETRY_GC_MINOR_REASON_LONG,
   JS_TELEMETRY_GC_MINOR_US,
   JS_TELEMETRY_GC_NURSERY_BYTES,
   JS_TELEMETRY_GC_PRETENURE_COUNT,
   JS_TELEMETRY_GC_NURSERY_PROMOTION_RATE,
   JS_TELEMETRY_GC_MARK_RATE,
   JS_TELEMETRY_PRIVILEGED_PARSER_COMPILE_LAZY_AFTER_MS,
   JS_TELEMETRY_WEB_PARSER_COMPILE_LAZY_AFTER_MS,
-  JS_TELEMETRY_DEPRECATED_STRING_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);
deleted file mode 100644
--- a/js/src/tests/non262/String/generics-deprecated.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// |reftest| skip-if(!xulRuntime.shell)
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Warn once for each String generics method.
-
-var methods = {
-    charAt: ["", 0],
-    charCodeAt: ["", 0],
-    concat: ["", ""],
-    endsWith: ["", ""],
-    includes: ["", ""],
-    indexOf: ["", ""],
-    lastIndexOf: ["", ""],
-    localeCompare: ["", ""],
-    match: ["", ""],
-    normalize: [""],
-    replace: ["", ""],
-    search: ["", ""],
-    slice: ["", 0],
-    split: ["", ""],
-    startsWith: ["", ""],
-    substr: ["", 0],
-    substring: ["", 0],
-    toLowerCase: [""],
-    toLocaleLowerCase: [""],
-    toLocaleUpperCase: [""],
-    toUpperCase: [""],
-    trim: [""],
-    trimLeft: [""],
-    trimRight: [""]
-};
-
-for (var name in methods) {
-    var args = methods[name];
-
-    // String.normalize not available on every platform.
-    if (name === "normalize" && !(name in String.prototype))
-        continue;
-
-    enableLastWarning();
-
-    String[name].apply(null, args);
-
-    var warning = getLastWarning();
-    assertEq(warning !== null, true, "warning should be emitted for " + name);
-    assertEq(warning.name, "Warning");
-    assertEq(warning.message.indexOf(name) !== -1, true,
-             "warning should mention " + name);
-
-    clearLastWarning();
-
-    String[name].apply(null, args);
-
-    warning = getLastWarning();
-    assertEq(warning, null, "warning shouldn't be emitted for 2nd call to " + name);
-
-    disableLastWarning();
-}
-
-if (typeof reportCompare === 'function')
-    reportCompare(0, 0);
deleted file mode 100644
--- a/js/src/tests/non262/String/generics.js
+++ /dev/null
@@ -1,228 +0,0 @@
-var BUGNUMBER = 1263558;
-var summary = "Self-host all String generics.";
-
-print(BUGNUMBER + ": " + summary);
-
-var result;
-var str = "ABCde";
-var strObj = {
-  toString() {
-    return "ABCde";
-  }
-};
-
-// String.substring.
-assertThrowsInstanceOf(() => String.substring(), TypeError);
-assertEq(String.substring(str), "ABCde");
-assertEq(String.substring(str, 1), "BCde");
-assertEq(String.substring(str, 1, 3), "BC");
-assertEq(String.substring(strObj), "ABCde");
-assertEq(String.substring(strObj, 1), "BCde");
-assertEq(String.substring(strObj, 1, 3), "BC");
-
-// String.substr.
-assertThrowsInstanceOf(() => String.substr(), TypeError);
-assertEq(String.substr(str), "ABCde");
-assertEq(String.substr(str, 1), "BCde");
-assertEq(String.substr(str, 1, 3), "BCd");
-assertEq(String.substr(strObj), "ABCde");
-assertEq(String.substr(strObj, 1), "BCde");
-assertEq(String.substr(strObj, 1, 3), "BCd");
-
-// String.slice.
-assertThrowsInstanceOf(() => String.slice(), TypeError);
-assertEq(String.slice(str), "ABCde");
-assertEq(String.slice(str, 1), "BCde");
-assertEq(String.slice(str, 1, 3), "BC");
-assertEq(String.slice(strObj), "ABCde");
-assertEq(String.slice(strObj, 1), "BCde");
-assertEq(String.slice(strObj, 1, 3), "BC");
-
-// String.match.
-assertThrowsInstanceOf(() => String.match(), TypeError);
-result = String.match(str);
-assertEq(result.index, 0);
-assertEq(result.length, 1);
-assertEq(result[0], "");
-result = String.match(str, /c/i);
-assertEq(result.index, 2);
-assertEq(result.length, 1);
-assertEq(result[0], "C");
-result = String.match(strObj);
-assertEq(result.index, 0);
-assertEq(result.length, 1);
-assertEq(result[0], "");
-result = String.match(strObj, /c/i);
-assertEq(result.index, 2);
-assertEq(result.length, 1);
-assertEq(result[0], "C");
-
-// String.replace.
-assertThrowsInstanceOf(() => String.replace(), TypeError);
-assertEq(String.replace(str), "ABCde");
-assertEq(String.replace(str, /c/i), "ABundefinedde");
-assertEq(String.replace(str, /c/i, "x"), "ABxde");
-assertEq(String.replace(strObj), "ABCde");
-assertEq(String.replace(strObj, /c/i), "ABundefinedde");
-assertEq(String.replace(strObj, /c/i, "x"), "ABxde");
-
-// String.search.
-assertThrowsInstanceOf(() => String.search(), TypeError);
-assertEq(String.search(str), 0);
-assertEq(String.search(str, /c/i), 2);
-assertEq(String.search(strObj), 0);
-assertEq(String.search(strObj, /c/i), 2);
-
-// String.split.
-assertThrowsInstanceOf(() => String.split(), TypeError);
-assertEq(String.split(str).join(","), "ABCde");
-assertEq(String.split(str, /[bd]/i).join(","), "A,C,e");
-assertEq(String.split(str, /[bd]/i, 2).join(","), "A,C");
-assertEq(String.split(strObj).join(","), "ABCde");
-assertEq(String.split(strObj, /[bd]/i).join(","), "A,C,e");
-assertEq(String.split(strObj, /[bd]/i, 2).join(","), "A,C");
-
-// String.toLowerCase.
-assertThrowsInstanceOf(() => String.toLowerCase(), TypeError);
-assertEq(String.toLowerCase(str), "abcde");
-assertEq(String.toLowerCase(strObj), "abcde");
-
-// String.toUpperCase.
-assertThrowsInstanceOf(() => String.toUpperCase(), TypeError);
-assertEq(String.toUpperCase(str), "ABCDE");
-assertEq(String.toUpperCase(strObj), "ABCDE");
-
-// String.charAt.
-assertThrowsInstanceOf(() => String.charAt(), TypeError);
-assertEq(String.charAt(str), "A");
-assertEq(String.charAt(str, 2), "C");
-assertEq(String.charAt(strObj), "A");
-assertEq(String.charAt(strObj, 2), "C");
-
-// String.charCodeAt.
-assertThrowsInstanceOf(() => String.charCodeAt(), TypeError);
-assertEq(String.charCodeAt(str), 65);
-assertEq(String.charCodeAt(str, 2), 67);
-assertEq(String.charCodeAt(strObj), 65);
-assertEq(String.charCodeAt(strObj, 2), 67);
-
-// String.includes.
-assertThrowsInstanceOf(() => String.includes(), TypeError);
-assertEq(String.includes(str), false);
-assertEq(String.includes(str, "C"), true);
-assertEq(String.includes(str, "C", 2), true);
-assertEq(String.includes(str, "C", 3), false);
-assertEq(String.includes(strObj), false);
-assertEq(String.includes(strObj, "C"), true);
-assertEq(String.includes(strObj, "C", 2), true);
-assertEq(String.includes(strObj, "C", 3), false);
-
-// String.indexOf.
-assertThrowsInstanceOf(() => String.indexOf(), TypeError);
-assertEq(String.indexOf(str), -1);
-assertEq(String.indexOf(str, "C"), 2);
-assertEq(String.indexOf(str, "C", 2), 2);
-assertEq(String.indexOf(str, "C", 3), -1);
-assertEq(String.indexOf(strObj), -1);
-assertEq(String.indexOf(strObj, "C"), 2);
-assertEq(String.indexOf(strObj, "C", 2), 2);
-assertEq(String.indexOf(strObj, "C", 3), -1);
-
-// String.lastIndexOf.
-assertThrowsInstanceOf(() => String.lastIndexOf(), TypeError);
-assertEq(String.lastIndexOf(str), -1);
-assertEq(String.lastIndexOf(str, "C"), 2);
-assertEq(String.lastIndexOf(str, "C", 2), 2);
-assertEq(String.lastIndexOf(str, "C", 1), -1);
-assertEq(String.lastIndexOf(strObj), -1);
-assertEq(String.lastIndexOf(strObj, "C"), 2);
-assertEq(String.lastIndexOf(strObj, "C", 2), 2);
-assertEq(String.lastIndexOf(strObj, "C", 1), -1);
-
-// String.startsWith.
-assertThrowsInstanceOf(() => String.startsWith(), TypeError);
-assertEq(String.startsWith(str), false);
-assertEq(String.startsWith(str, "A"), true);
-assertEq(String.startsWith(str, "B", 0), false);
-assertEq(String.startsWith(str, "B", 1), true);
-assertEq(String.startsWith(strObj), false);
-assertEq(String.startsWith(strObj, "A"), true);
-assertEq(String.startsWith(strObj, "B", 0), false);
-assertEq(String.startsWith(strObj, "B", 1), true);
-
-// String.endsWith.
-assertThrowsInstanceOf(() => String.endsWith(), TypeError);
-assertEq(String.endsWith(str), false);
-assertEq(String.endsWith(str, "e"), true);
-assertEq(String.endsWith(str, "B", 0), false);
-assertEq(String.endsWith(str, "B", 2), true);
-assertEq(String.endsWith(strObj), false);
-assertEq(String.endsWith(strObj, "e"), true);
-assertEq(String.endsWith(strObj, "B", 0), false);
-assertEq(String.endsWith(strObj, "B", 2), true);
-
-// String.trim.
-var str2 = "  ABCde  ";
-var strObj2 = {
-  toString() {
-    return "  ABCde  ";
-  }
-};
-assertThrowsInstanceOf(() => String.trim(), TypeError);
-assertEq(String.trim(str2), "ABCde");
-assertEq(String.trim(strObj2), "ABCde");
-
-// String.trimLeft.
-assertThrowsInstanceOf(() => String.trimLeft(), TypeError);
-assertEq(String.trimLeft(str2), "ABCde  ");
-assertEq(String.trimLeft(strObj2), "ABCde  ");
-
-// String.trimRight.
-assertThrowsInstanceOf(() => String.trimRight(), TypeError);
-assertEq(String.trimRight(str2), "  ABCde");
-assertEq(String.trimRight(strObj2), "  ABCde");
-
-// String.toLocaleLowerCase.
-assertThrowsInstanceOf(() => String.toLocaleLowerCase(), TypeError);
-assertEq(String.toLocaleLowerCase(str), str.toLocaleLowerCase());
-assertEq(String.toLocaleLowerCase(strObj), str.toLocaleLowerCase());
-
-// String.toLocaleUpperCase.
-assertThrowsInstanceOf(() => String.toLocaleUpperCase(), TypeError);
-assertEq(String.toLocaleUpperCase(str), str.toLocaleUpperCase());
-assertEq(String.toLocaleUpperCase(strObj), str.toLocaleUpperCase());
-
-// String.localeCompare.
-assertThrowsInstanceOf(() => String.localeCompare(), TypeError);
-assertEq(String.localeCompare(str), str.localeCompare());
-assertEq(String.localeCompare(str, "abcde"), str.localeCompare("abcde"));
-assertEq(String.localeCompare(strObj), str.localeCompare());
-assertEq(String.localeCompare(strObj, "abcde"), str.localeCompare("abcde"));
-
-// String.normalize.
-if ("normalize" in String.prototype) {
-  var str3 = "\u3082\u3058\u3089 \u3082\u3057\u3099\u3089";
-  var strObj3 = {
-    toString() {
-      return "\u3082\u3058\u3089 \u3082\u3057\u3099\u3089";
-    }
-  };
-  assertThrowsInstanceOf(() => String.normalize(), TypeError);
-
-  assertEq(String.normalize(str3), "\u3082\u3058\u3089 \u3082\u3058\u3089");
-  assertEq(String.normalize(str3, "NFD"), "\u3082\u3057\u3099\u3089 \u3082\u3057\u3099\u3089");
-  assertEq(String.normalize(strObj3), "\u3082\u3058\u3089 \u3082\u3058\u3089");
-  assertEq(String.normalize(strObj3, "NFD"), "\u3082\u3057\u3099\u3089 \u3082\u3057\u3099\u3089");
-}
-
-// String.concat.
-assertThrowsInstanceOf(() => String.concat(), TypeError);
-assertEq(String.concat(str), "ABCde");
-assertEq(String.concat(str, "f"), "ABCdef");
-assertEq(String.concat(str, "f", "g"), "ABCdefg");
-assertEq(String.concat(strObj), "ABCde");
-assertEq(String.concat(strObj, "f"), "ABCdef");
-assertEq(String.concat(strObj, "f", "g"), "ABCdefg");
-
-if (typeof reportCompare === "function")
-  reportCompare(true, true);
deleted file mode 100644
--- a/js/src/tests/non262/String/regress-306591.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 306591;
-var summary = 'String static methods';
-var actual = '';
-var expect = '';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
-printStatus ('See https://bugzilla.mozilla.org/show_bug.cgi?id=304828');
- 
-expect = ['a', 'b', 'c'].toString();
-actual = String.split(new String('abc'), '').toString();
-reportCompare(expect, actual, summary +
-              " String.split(new String('abc'), '')");
-
-expect = '2';
-actual = String.substring(new Number(123), 1, 2);
-reportCompare(expect, actual, summary +
-              " String.substring(new Number(123), 1, 2)");
-
-expect = 'TRUE';
-actual = String.toUpperCase(new Boolean(true)); 
-reportCompare(expect, actual, summary +
-              " String.toUpperCase(new Boolean(true))");
-
-try
-{
-  String.indexOf(null, 'l');
-  throw new Error("should have thrown a TypeError");
-}
-catch (e)
-{
-  assertEq(e instanceof TypeError, true,
-           "String.indexOf(null [, ...]) didn't work correctly");
-}
-
-expect = 2;
-actual = String.indexOf(String(null), 'l');             
-reportCompare(expect, actual, summary +
-              " String.indexOf(String(null), 'l')");
-
-expect = ['a', 'b', 'c'].toString();
-actual = String.split('abc', '').toString();
-reportCompare(expect, actual, summary +
-              " String.split('abc', '')");
-
-expect = '2';
-actual = String.substring(123, 1, 2);
-reportCompare(expect, actual, summary +
-              " String.substring(123, 1, 2)");
-
-expect = 'TRUE';
-actual = String.toUpperCase(true);
-reportCompare(expect, actual, summary +
-              " String.toUpperCase(true)");
-
-try
-{
-  String.indexOf(undefined, 'd');
-  throw new Error("should have thrown a TypeError");
-}
-catch (e)
-{
-  assertEq(e instanceof TypeError, true,
-           "String.indexOf(undefined [, ...]) didn't work correctly");
-}
-
-expect = 2;
-actual = String.indexOf(String(undefined), 'd');
-reportCompare(expect, actual, summary +
-              " String.indexOf(String(undefined), 'd')");
--- a/js/src/tests/non262/extensions/eval-native-callback-is-indirect.js
+++ b/js/src/tests/non262/extensions/eval-native-callback-is-indirect.js
@@ -20,24 +20,14 @@ function testArrayGeneric()
 {
   var global = "psych!";
   var eval = Array.map;
 
   var mapped = eval([directCheckCode], originalEval);
   assertEq(mapped[0], true);
 }
 
-function testStringGeneric()
-{
-  var global = "psych!";
-  var eval = String.replace;
-
-  var newString = eval(directCheckCode, directCheckCode, originalEval);
-  assertEq(newString, "true");
-}
-testStringGeneric();
-
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
 
 print("All tests passed!");
--- a/js/src/tests/non262/extensions/regress-312385-01.js
+++ b/js/src/tests/non262/extensions/regress-312385-01.js
@@ -9,34 +9,16 @@ var summary = 'Generic methods with null
 var actual = '';
 var expect = true;
 var voids = [null, undefined];
 
 
 function noop() { }
 
 var generics = {
-String: [{ substring: [] },
-{ toLowerCase: [] },
-{ toUpperCase: [] },
-{ charAt: [] },
-{ charCodeAt: [] },
-{ indexOf: [] },
-{ lastIndexOf: [] },
-{ toLocaleLowerCase: [] },
-{ toLocaleUpperCase: [] },
-{ localeCompare: [] },
-{ match: [/(?:)/] }, // match(regexp)
-{ search: [] },
-{ replace: [] },
-{ split: [] },
-{ substr: [] },
-{ concat: [] },
-{ slice: [] }],
-
   Array:  [{ join: [] },
 { reverse: [] },
 { sort: [] },
            // { push: [0] },  // push(item1, ...)
            // { pop: [] },
            // { shift: [] },
 { unshift: [] },
            // { splice: [0, 0, 1] }, // splice(start, deleteCount, item1, ...)
--- a/js/src/vm/Realm.h
+++ b/js/src/vm/Realm.h
@@ -433,17 +433,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 warnedAboutStringGenericsMethods = 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
@@ -2054,56 +2054,16 @@ static bool intrinsic_GetBuiltinIntlCons
   if (!constructor) {
     return false;
   }
 
   args.rval().setObject(*constructor);
   return true;
 }
 
-static bool intrinsic_WarnDeprecatedStringMethod(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 < STRING_GENERICS_METHODS_LIMIT);
-
-  uint32_t mask = (1 << id);
-  if (!(cx->realm()->warnedAboutStringGenericsMethods & 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_STRING_METHOD,
-                                        nameChars, nameChars)) {
-      return false;
-    }
-
-    if (!cx->realm()->isProbablySystemCode()) {
-      cx->runtime()->addTelemetry(JS_TELEMETRY_DEPRECATED_STRING_GENERICS, id);
-    }
-
-    cx->realm()->warnedAboutStringGenericsMethods |= 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) {
     ReportNotObjectWithName(cx, "descriptor", args[1]);
@@ -2802,18 +2762,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("WarnDeprecatedStringMethod", intrinsic_WarnDeprecatedStringMethod, 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
@@ -2745,19 +2745,16 @@ static void AccumulateTelemetryCallback(
                             sample);
       break;
     case JS_TELEMETRY_GC_NURSERY_PROMOTION_RATE:
       Telemetry::Accumulate(Telemetry::GC_NURSERY_PROMOTION_RATE, sample);
       break;
     case JS_TELEMETRY_GC_MARK_RATE:
       Telemetry::Accumulate(Telemetry::GC_MARK_RATE, sample);
       break;
-    case JS_TELEMETRY_DEPRECATED_STRING_GENERICS:
-      Telemetry::Accumulate(Telemetry::JS_DEPRECATED_STRING_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
@@ -1028,25 +1028,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_STRING_GENERICS": {
-    "record_in_processes": ["content"],
-    "alert_emails": ["jdemooij@mozilla.com"],
-    "expires_in_version": "72",
-    "bug_numbers": [1339777],
-    "kind": "enumerated",
-    "n_values": 25,
-    "description": "A string generic function was called, like String.join etc. See STRING_GENERICS_* defines in SelfHostingDefines.h for the meaning of values."
-  },
   "XUL_CACHE_DISABLED": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "default",
     "kind": "flag",
     "description": "XUL cache was disabled"
   },
   "MEMORY_RESIDENT_FAST": {
     "record_in_processes": ["main", "content"],