SERVER-105611 Upgrade MozJS/Spidermonkey to ESR 128.11 (#37481)

GitOrigin-RevId: 59e172cd91444bd56c9ceed375e9702e70c62b6c
This commit is contained in:
Joshua Siegel 2025-07-03 07:10:51 -05:00 committed by MongoDB Bot
parent 7fff269377
commit 216f3cfd15
32 changed files with 142 additions and 72 deletions

View File

@ -39,7 +39,7 @@ a notice will be included in
| [librdkafka] | BSD-2-Clause | 2.0.2 | | |
| [linenoise] | BSD-3-Clause | 6cdc775 + changes | | ✗ |
| [mongo-c-driver] | Apache-2.0 | 1.27.6 | ✗ | ✗ |
| [Mozilla Firefox] | MPL-2.0 | 128.10.0esr | unknown | ✗ |
| [Mozilla Firefox] | MPL-2.0 | 128.11.0esr | unknown | ✗ |
| [MurmurHash3] | Public Domain | Unknown + changes | ✗ | ✗ |
| [ocspbuilder] | MIT | 0.10.2 | | |
| [ocspresponder] | Apache-2.0 | 0.5.0 | | |

View File

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

View File

@ -101,7 +101,7 @@ enum RejectFunctionSlots {
enum PromiseCombinatorElementFunctionSlots {
PromiseCombinatorElementFunctionSlot_Data = 0,
PromiseCombinatorElementFunctionSlot_ElementIndex,
PromiseCombinatorElementFunctionSlot_ElementIndexOrResolveFunc,
};
enum ReactionJobSlots {
@ -3138,7 +3138,8 @@ static bool Promise_static_all(JSContext* cx, unsigned argc, Value* vp) {
static JSFunction* NewPromiseCombinatorElementFunction(
JSContext* cx, Native native,
Handle<PromiseCombinatorDataHolder*> dataHolder, uint32_t index);
Handle<PromiseCombinatorDataHolder*> dataHolder, uint32_t index,
Handle<Value> maybeResolveFunc);
static bool PromiseAllResolveElementFunction(JSContext* cx, unsigned argc,
Value* vp);
@ -3240,7 +3241,8 @@ static bool PromiseAllResolveElementFunction(JSContext* cx, unsigned argc,
// Steps 4.j-q.
JSFunction* resolveFunc = NewPromiseCombinatorElementFunction(
cx, PromiseAllResolveElementFunction, dataHolder, index);
cx, PromiseAllResolveElementFunction, dataHolder, index,
UndefinedHandleValue);
if (!resolveFunc) {
return nullptr;
}
@ -3886,7 +3888,8 @@ template <typename T>
static JSFunction* NewPromiseCombinatorElementFunction(
JSContext* cx, Native native,
Handle<PromiseCombinatorDataHolder*> dataHolder, uint32_t index) {
Handle<PromiseCombinatorDataHolder*> dataHolder, uint32_t index,
Handle<Value> maybeResolveFunc) {
JSFunction* fn = NewNativeFunction(
cx, native, 1, nullptr, gc::AllocKind::FUNCTION_EXTENDED, GenericObject);
if (!fn) {
@ -3895,8 +3898,15 @@ static JSFunction* NewPromiseCombinatorElementFunction(
fn->setExtendedSlot(PromiseCombinatorElementFunctionSlot_Data,
ObjectValue(*dataHolder));
fn->setExtendedSlot(PromiseCombinatorElementFunctionSlot_ElementIndex,
Int32Value(index));
if (maybeResolveFunc.isObject()) {
fn->setExtendedSlot(
PromiseCombinatorElementFunctionSlot_ElementIndexOrResolveFunc,
maybeResolveFunc);
} else {
fn->setExtendedSlot(
PromiseCombinatorElementFunctionSlot_ElementIndexOrResolveFunc,
Int32Value(index));
}
return fn;
}
@ -3929,6 +3939,14 @@ static bool PromiseCombinatorElementFunctionAlreadyCalled(
// Step 1. Let F be the active function object.
JSFunction* fn = &args.callee().as<JSFunction>();
constexpr size_t indexOrResolveFuncSlot =
PromiseCombinatorElementFunctionSlot_ElementIndexOrResolveFunc;
if (fn->getExtendedSlot(indexOrResolveFuncSlot).isObject()) {
Value slotVal = fn->getExtendedSlot(indexOrResolveFuncSlot);
fn = &slotVal.toObject().as<JSFunction>();
}
MOZ_RELEASE_ASSERT(fn->getExtendedSlot(indexOrResolveFuncSlot).isInt32());
// Promise.all functions
// Step 2. If F.[[AlreadyCalled]] is true, return undefined.
// Promise.allSettled functions
@ -3957,9 +3975,7 @@ static bool PromiseCombinatorElementFunctionAlreadyCalled(
// Step 4. Let index be F.[[Index]].
// Promise.allSettled functions
// Step 5. Let index be F.[[Index]].
int32_t idx =
fn->getExtendedSlot(PromiseCombinatorElementFunctionSlot_ElementIndex)
.toInt32();
int32_t idx = fn->getExtendedSlot(indexOrResolveFuncSlot).toInt32();
MOZ_ASSERT(idx >= 0);
*index = uint32_t(idx);
@ -4013,7 +4029,8 @@ static bool PromiseCombinatorElementFunctionAlreadyCalled(
// Steps 4.j-q.
JSFunction* resolveFunc = NewPromiseCombinatorElementFunction(
cx, PromiseAllResolveElementFunction, dataHolder, index);
cx, PromiseAllResolveElementFunction, dataHolder, index,
UndefinedHandleValue);
if (!resolveFunc) {
return false;
}
@ -4237,7 +4254,8 @@ static bool Promise_static_allSettled(JSContext* cx, unsigned argc, Value* vp) {
// Steps 4.j-r.
JSFunction* resolveFunc = NewPromiseCombinatorElementFunction(
cx, PromiseAllSettledResolveElementFunction, dataHolder, index);
cx, PromiseAllSettledResolveElementFunction, dataHolder, index,
UndefinedHandleValue);
if (!resolveFunc) {
return false;
}
@ -4245,7 +4263,8 @@ static bool Promise_static_allSettled(JSContext* cx, unsigned argc, Value* vp) {
// Steps 4.s-z.
JSFunction* rejectFunc = NewPromiseCombinatorElementFunction(
cx, PromiseAllSettledRejectElementFunction, dataHolder, index);
cx, PromiseAllSettledRejectElementFunction, dataHolder, index,
resolveFunVal);
if (!rejectFunc) {
return false;
}
@ -4474,7 +4493,8 @@ static void ThrowAggregateError(JSContext* cx,
// Steps 4.j-q.
JSFunction* rejectFunc = NewPromiseCombinatorElementFunction(
cx, PromiseAnyRejectElementFunction, dataHolder, index);
cx, PromiseAnyRejectElementFunction, dataHolder, index,
UndefinedHandleValue);
if (!rejectFunc) {
return false;
}

View File

@ -166,6 +166,7 @@ struct MOZ_STACK_CLASS DebuggerObject::CallData {
bool boundArgumentsGetter();
bool allocationSiteGetter();
bool isErrorGetter();
bool isMutedErrorGetter();
bool errorMessageNameGetter();
bool errorNotesGetter();
bool errorLineNumberGetter();
@ -506,6 +507,11 @@ bool DebuggerObject::CallData::isErrorGetter() {
return true;
}
bool DebuggerObject::CallData::isMutedErrorGetter() {
args.rval().setBoolean(object->isMutedError(cx));
return true;
}
bool DebuggerObject::CallData::errorNotesGetter() {
return DebuggerObject::getErrorNotes(cx, object, args.rval());
}
@ -1502,6 +1508,7 @@ const JSPropertySpec DebuggerObject::properties_[] = {
JS_DEBUG_PSG("boundArguments", boundArgumentsGetter),
JS_DEBUG_PSG("allocationSite", allocationSiteGetter),
JS_DEBUG_PSG("isError", isErrorGetter),
JS_DEBUG_PSG("isMutedError", isMutedErrorGetter),
JS_DEBUG_PSG("errorMessageName", errorMessageNameGetter),
JS_DEBUG_PSG("errorNotes", errorNotesGetter),
JS_DEBUG_PSG("errorLineNumber", errorLineNumberGetter),
@ -1675,6 +1682,31 @@ bool DebuggerObject::isError() const {
return referent->is<ErrorObject>();
}
bool DebuggerObject::isMutedError(JSContext* cx) const {
JS::Rooted<JSObject*> referent(cx, this->referent());
if (IsCrossCompartmentWrapper(referent)) {
// We only check for error classes, so CheckedUnwrapStatic is OK.
referent = CheckedUnwrapStatic(referent);
if (!referent) {
return false;
}
}
if (!referent->is<ErrorObject>()) {
return false;
}
JSErrorReport* report = referent->as<ErrorObject>().getErrorReport();
if (!report) {
// If the error report was missing, isMuted field can never be true,
// and just returning false is OK.
return false;
}
return report->isMuted;
}
/* static */
bool DebuggerObject::getClassName(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandleString result) {

View File

@ -174,6 +174,7 @@ class DebuggerObject : public NativeObject {
bool isScriptedProxy() const;
bool isPromise() const;
bool isError() const;
bool isMutedError(JSContext* cx) const;
bool name(JSContext* cx, JS::MutableHandle<JSAtom*> result) const;
bool displayName(JSContext* cx, JS::MutableHandle<JSAtom*> result) const;

View File

@ -3874,6 +3874,10 @@ SimpleLinearSum jit::ExtractLinearSum(MDefinition* ins, MathSpace space,
}
MOZ_ASSERT(space == MathSpace::Modulo || space == MathSpace::Infinite);
if (space == MathSpace::Modulo) {
return SimpleLinearSum(ins, 0);
}
MDefinition* lhs = ins->getOperand(0);
MDefinition* rhs = ins->getOperand(1);
if (lhs->type() != MIRType::Int32 || rhs->type() != MIRType::Int32) {

View File

@ -499,6 +499,10 @@ bool JS::ErrorReportBuilder::init(JSContext* cx,
// unrooted, we must root our exception object, if any.
exnObject = &exnStack.exception().toObject();
reportp = ErrorFromException(cx, exnObject);
if (reportp && reportp->isMuted) {
sniffingBehavior = SniffingBehavior::NoSideEffects;
}
}
// Be careful not to invoke ToString if we've already successfully extracted

File diff suppressed because one or more lines are too long

View File

@ -659,9 +659,18 @@ class Decoder {
inline ValType Decoder::uncheckedReadValType(const TypeContext& types) {
uint8_t code = uncheckedReadFixedU8();
switch (code) {
case uint8_t(TypeCode::AnyRef):
case uint8_t(TypeCode::EqRef):
case uint8_t(TypeCode::I31Ref):
case uint8_t(TypeCode::StructRef):
case uint8_t(TypeCode::ArrayRef):
case uint8_t(TypeCode::NullAnyRef):
case uint8_t(TypeCode::FuncRef):
case uint8_t(TypeCode::NullFuncRef):
case uint8_t(TypeCode::ExternRef):
case uint8_t(TypeCode::NullExternRef):
case uint8_t(TypeCode::ExnRef):
case uint8_t(TypeCode::NullExnRef):
return RefType::fromTypeCode(TypeCode(code), true);
case uint8_t(TypeCode::Ref):
case uint8_t(TypeCode::NullableRef): {

View File

@ -8,9 +8,9 @@ set -vx
NAME=spidermonkey
VERSION="128.10.0esr"
LIB_GIT_BRANCH=spidermonkey-esr128.10-cpp-only
LIB_GIT_REVISION=98c8be22bec7bb650156e0d389b425322d8c323c
VERSION="128.11.0esr"
LIB_GIT_BRANCH=spidermonkey-esr128.11-cpp-only
LIB_GIT_REVISION=5acd3be6c9563ad3e7ca6182285c69a38de47bab
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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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 11
#define MOZJS_MINOR_VERSION 12
#endif /* js_config_h */

View File

@ -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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#define MOZ_AARCH64_JSCVT 1
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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 11
#define MOZJS_MINOR_VERSION 12
#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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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 11
#define MOZJS_MINOR_VERSION 12
#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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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 11
#define MOZJS_MINOR_VERSION 12
#endif /* js_config_h */

File diff suppressed because one or more lines are too long

View File

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

View File

@ -71,10 +71,10 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "128.0"
#define MOZILLA_VERSION "128.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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 11
#define MOZJS_MINOR_VERSION 12
#endif /* js_config_h */

View File

@ -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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#define MOZ_AARCH64_JSCVT 0
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"

View File

@ -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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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 11
#define MOZJS_MINOR_VERSION 12
#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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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.11.0"
#define MOZILLA_VERSION_U 128.11.0
#define MOZILLA_VERSION "128.12.0"
#define MOZILLA_VERSION_U 128.12.0
#define MOZJS_MAJOR_VERSION 128
#define MOZJS_MINOR_VERSION 11
#define MOZJS_MINOR_VERSION 12
#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 11
#define MOZJS_MINOR_VERSION 12
#endif /* js_config_h */