SERVER-103275 Upgrade MozJS to ESR 128.10 (#35608)

GitOrigin-RevId: ac84dc1238904b66246053bd3d3ec872d54db831
This commit is contained in:
Chi-I Huang 2025-05-02 11:12:47 -07:00 committed by MongoDB Bot
parent 114828c907
commit dbbe7de9ca
29 changed files with 110 additions and 90 deletions

View File

@ -51,7 +51,7 @@ a notice will be included in
| [libunwind/libunwind] | MIT | v1.8.1 | | ✗ |
| [linenoise] | BSD-2-Clause | Unknown | | ✗ |
| [MongoDB C Driver] | Apache-2.0 | 1.28.1 | ✗ | ✗ |
| [Mozilla Firefox] | MPL-2.0 | 128.8.0esr | unknown | ✗ |
| [Mozilla Firefox] | MPL-2.0 | 128.10.0esr | unknown | ✗ |
| [nlohmann-json] | MIT | 3.11.3 | ✗ | |
| [nlohmann.json.decomposed] | MIT | 3.10.5 | unknown | |
| [node] | ISC | 22.1.0 | unknown | |

View File

@ -1277,7 +1277,7 @@
"name": "Organization: debian"
},
"name": "Mozilla Firefox",
"version": "128.8.0esr",
"version": "128.10.0esr",
"licenses": [
{
"license": {
@ -1285,7 +1285,7 @@
}
}
],
"purl": "pkg:deb/debian/firefox-esr@128.8.0esr-1",
"purl": "pkg:deb/debian/firefox-esr@128.10.0esr-1",
"properties": [
{
"name": "internal:team_responsible",

View File

@ -57,12 +57,12 @@ find ./mozilla-release/js/src/_build/mfbt -name "Unified_cpp_mfbt*.cpp" -exec cp
SEDOPTION="-i"
if [[ "$OSTYPE" == "darwin"* ]]; then
SEDOPTION="-i ''"
SEDOPTION=(-i '')
fi
for unified_file in extract/js/src/mfbt/*.cpp ; do
echo "Processing $unified_file"
sed $SEDOPTION \
sed "${SEDOPTION[@]}" \
-e 's|#include ".*/mfbt/|#include "|' \
-e 's|#error ".*/mfbt/|#error "|' \
"$unified_file"

View File

@ -5,6 +5,9 @@
#if JS_HAS_INTL_API
// This cache, once primed, has these properties:
//
// locale:
// The requested locale, either |undefined| or a string. Not necessarily a
// valid and supported DateTimeFormat locale.
// runtimeDefaultLocale:
// Locale information provided by the embedding, guiding SpiderMonkey's
// selection of a default locale. See intl_RuntimeDefaultLocale(), whose
@ -15,10 +18,10 @@
// whose value controls the value returned by DefaultTimeZone() that's
// what's *actually* used.
// formatters:
// A Record storing formatters consistent with the above
// runtimeDefaultLocale/localTZA values, for use with the appropriate
// ES6 toLocale*String Date method when called with its first two
// arguments having the value |undefined|.
// A Record storing formatters consistent with the above locale and time
// zone values, for use with the appropriate toLocale*String Date method
// when called with the |locales| argument either |undefined| or a string,
// and the |options| argument having the value |undefined|.
//
// The "formatters" Record has (some subset of) these properties, as determined
// by all values of the first argument passed to |GetCachedFormat|:
@ -28,20 +31,25 @@
// timeFormat: for Date's toLocaleTimeString operation
//
// Using this cache, then, requires
// 1) verifying the current runtimeDefaultLocale/icuDefaultTimeZone are
// 1) verifying the requested locale is consistent with the cached value, then
// 2) verifying the current runtimeDefaultLocale/icuDefaultTimeZone are
// consistent with cached values, then
// 2) seeing if the desired formatter is cached and returning it if so, or else
// 3) create the desired formatter and store and return it.
// 3) seeing if the desired formatter is cached and returning it if so, or else
// 4) create the desired formatter and store and return it.
var dateTimeFormatCache = new_Record();
/**
* Get a cached DateTimeFormat formatter object, created like so:
*
* CreateDateTimeFormat(undefined, undefined, required, defaults);
* CreateDateTimeFormat(locale, undefined, required, defaults);
*
* |format| must be a key from the "formatters" Record described above.
*/
function GetCachedFormat(format, required, defaults) {
function GetCachedFormat(locale, format, required, defaults) {
assert(
locale === undefined || typeof locale === "string",
"bad locale type"
);
assert(
format === "dateTimeFormat" ||
format === "dateFormat" ||
@ -51,10 +59,12 @@ function GetCachedFormat(format, required, defaults) {
var formatters;
if (
locale !== dateTimeFormatCache.locale ||
!intl_IsRuntimeDefaultLocale(dateTimeFormatCache.runtimeDefaultLocale) ||
!intl_isDefaultTimeZone(dateTimeFormatCache.icuDefaultTimeZone)
) {
formatters = dateTimeFormatCache.formatters = new_Record();
dateTimeFormatCache.locale = locale;
dateTimeFormatCache.runtimeDefaultLocale = intl_RuntimeDefaultLocale();
dateTimeFormatCache.icuDefaultTimeZone = intl_defaultTimeZone();
} else {
@ -63,7 +73,7 @@ function GetCachedFormat(format, required, defaults) {
var fmt = formatters[format];
if (fmt === undefined) {
fmt = formatters[format] = intl_CreateDateTimeFormat(undefined, undefined, required, defaults);
fmt = formatters[format] = intl_CreateDateTimeFormat(locale, undefined, required, defaults);
}
return fmt;
@ -89,10 +99,12 @@ function Date_toLocaleString() {
// Step 5-6.
var dateTimeFormat;
if (locales === undefined && options === undefined) {
// This cache only optimizes for the old ES5 toLocaleString without
// locales and options.
dateTimeFormat = GetCachedFormat("dateTimeFormat", "any", "all");
if (
(locales === undefined || typeof locales === "string") &&
options === undefined
) {
// This cache only optimizes when |options| isn't used.
dateTimeFormat = GetCachedFormat(locales, "dateTimeFormat", "any", "all");
} else {
dateTimeFormat = intl_CreateDateTimeFormat(locales, options, "any", "all");
}
@ -121,10 +133,12 @@ function Date_toLocaleDateString() {
// Step 5-6.
var dateTimeFormat;
if (locales === undefined && options === undefined) {
// This cache only optimizes for the old ES5 toLocaleDateString without
// locales and options.
dateTimeFormat = GetCachedFormat("dateFormat", "date", "date");
if (
(locales === undefined || typeof locales === "string") &&
options === undefined
) {
// This cache only optimizes when |options| isn't used.
dateTimeFormat = GetCachedFormat(locales, "dateFormat", "date", "date");
} else {
dateTimeFormat = intl_CreateDateTimeFormat(locales, options, "date", "date");
}
@ -153,10 +167,12 @@ function Date_toLocaleTimeString() {
// Step 5-6.
var dateTimeFormat;
if (locales === undefined && options === undefined) {
// This cache only optimizes for the old ES5 toLocaleTimeString without
// locales and options.
dateTimeFormat = GetCachedFormat("timeFormat", "time", "time");
if (
(locales === undefined || typeof locales === "string") &&
options === undefined
) {
// This cache only optimizes when |options| isn't used.
dateTimeFormat = GetCachedFormat(locales, "timeFormat", "time", "time");
} else {
dateTimeFormat = intl_CreateDateTimeFormat(locales, options, "time", "time");
}

View File

@ -1161,9 +1161,9 @@ bool MWasmTernarySimd128::specializeBitselectConstantMaskAsShuffle(
const SimdConstant::I8x16& bytes = constant.asInt8x16();
for (int8_t i = 0; i < 16; i++) {
if (bytes[i] == -1) {
shuffle[i] = i + 16;
} else if (bytes[i] == 0) {
shuffle[i] = i;
} else if (bytes[i] == 0) {
shuffle[i] = i + 16;
} else {
return false;
}

View File

@ -8,9 +8,9 @@ set -vx
NAME=spidermonkey
VERSION="128.8.0esr"
LIB_GIT_BRANCH=spidermonkey-esr128.8-cpp-only
LIB_GIT_REVISION=ce5a650267050c12052e748363092b530e5f5fc5
VERSION="128.10.0esr"
LIB_GIT_BRANCH=spidermonkey-esr128.10-cpp-only
LIB_GIT_REVISION=98c8be22bec7bb650156e0d389b425322d8c323c
LIB_GIT_REPO=git@github.com:mongodb-forks/spidermonkey.git
DEST_DIR=$(git rev-parse --show-toplevel)/src/third_party/mozjs

View File

@ -70,10 +70,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -70,10 +70,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -72,6 +72,6 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#endif /* js_config_h */

View File

@ -7,7 +7,7 @@
#define js_confdefs_h
// Expands to all the defines from configure.
#define CROSS_COMPILE
#define CROSS_COMPILE
#define ENABLE_SHARED_MEMORY 1
#define ENABLE_WASM_GC 1
#define ENABLE_WASM_JS_STRING_BUILTINS 1
@ -57,10 +57,10 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 1
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -7,7 +7,7 @@
#define js_confdefs_h
// Expands to all the defines from configure.
#define CROSS_COMPILE
#define CROSS_COMPILE
#define ENABLE_SHARED_MEMORY 1
#define ENABLE_WASM_GC 1
#define ENABLE_WASM_JS_STRING_BUILTINS 1
@ -57,10 +57,10 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 1
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -72,6 +72,6 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#endif /* js_config_h */

View File

@ -69,10 +69,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -69,10 +69,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -72,6 +72,6 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#endif /* js_config_h */

View File

@ -69,10 +69,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -69,10 +69,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -72,6 +72,6 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#endif /* js_config_h */

File diff suppressed because one or more lines are too long

View File

@ -24,6 +24,7 @@
#define HAVE_GETC_UNLOCKED 1
#define HAVE_GETOPT_H 1
#define HAVE_GETPAGESIZE 1
#define HAVE_GETTID 1
#define HAVE_GMTIME_R 1
#define HAVE_INTTYPES_H 1
#define HAVE_LINUX_IF_ADDR_H 1
@ -39,6 +40,7 @@
#define HAVE_NETINET_IN_H 1
#define HAVE_NL_TYPES_H 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_PTHREAD_GETNAME_NP 1
#define HAVE_PTHREAD_H 1
#define HAVE_RES_NINIT 1
#define HAVE_SETPRIORITY 1
@ -69,10 +71,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -24,6 +24,7 @@
#define HAVE_GETC_UNLOCKED 1
#define HAVE_GETOPT_H 1
#define HAVE_GETPAGESIZE 1
#define HAVE_GETTID 1
#define HAVE_GMTIME_R 1
#define HAVE_INTTYPES_H 1
#define HAVE_LINUX_IF_ADDR_H 1
@ -39,6 +40,7 @@
#define HAVE_NETINET_IN_H 1
#define HAVE_NL_TYPES_H 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_PTHREAD_GETNAME_NP 1
#define HAVE_PTHREAD_H 1
#define HAVE_RES_NINIT 1
#define HAVE_SETPRIORITY 1
@ -69,10 +71,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -72,6 +72,6 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#endif /* js_config_h */

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
#define js_confdefs_h
// Expands to all the defines from configure.
#define CROSS_COMPILE
#define CROSS_COMPILE
#define ENABLE_SHARED_MEMORY 1
#define ENABLE_WASM_GC 1
#define ENABLE_WASM_JS_STRING_BUILTINS 1
@ -57,10 +57,10 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -7,7 +7,7 @@
#define js_confdefs_h
// Expands to all the defines from configure.
#define CROSS_COMPILE
#define CROSS_COMPILE
#define ENABLE_SHARED_MEMORY 1
#define ENABLE_WASM_GC 1
#define ENABLE_WASM_JS_STRING_BUILTINS 1
@ -57,10 +57,10 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -72,6 +72,6 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#endif /* js_config_h */

View File

@ -32,10 +32,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX ""

View File

@ -32,10 +32,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.9.0"
#define MOZILLA_VERSION_U 128.9.0
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX ""

View File

@ -72,6 +72,6 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 9
#define MOZJS_MINOR_VERSION 11
#endif /* js_config_h */