Skip to content

Commit bf8f6cb

Browse files
leemaguireMongoDB Bot
authored andcommitted
SERVER-98608 Update MozJS to 115.19 (#31793)
GitOrigin-RevId: d40dc08384d90ceb56477d285c5b6c0c771c77e7
1 parent e1010a6 commit bf8f6cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+646
-435
lines changed

README.third_party.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ a notice will be included in
3939
| [librdkafka] | BSD-2-Clause | 2.0.2 | | |
4040
| [linenoise] | BSD-3-Clause | 6cdc775 + changes | ||
4141
| [mongo-c-driver] | Apache-2.0 | 1.27.6 |||
42-
| [MozJS] | MPL-2.0 | ESR 115.7 | ||
42+
| [Mozilla Firefox] | MPL-2.0 | 115.19.0esr | unknown ||
4343
| [MurmurHash3] | Public Domain | Unknown + changes |||
4444
| [ocspbuilder] | MIT | 0.10.2 | | |
4545
| [ocspresponder] | Apache-2.0 | 0.5.0 | | |
@@ -77,7 +77,7 @@ a notice will be included in
7777
[libstemmer]: https://github.com/snowballstem/snowball
7878
[librdkafka]: https://github.com/confluentinc/librdkafka
7979
[linenoise]: https://github.com/antirez/linenoise
80-
[MozJS]: https://www.mozilla.org/en-US/security/known-vulnerabilities/firefox-esr
80+
[Mozilla Firefox]: https://www.mozilla.org/en-US/security/known-vulnerabilities/firefox-esr
8181
[MurmurHash3]: https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp
8282
[ocspbuilder]: https://github.com/wbond/ocspbuilder
8383
[ocspresponder]: https://github.com/threema-ch/ocspresponder

sbom.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,15 +942,15 @@
942942
"name": "Organization: debian"
943943
},
944944
"name": "Mozilla Firefox",
945-
"version": "115.7.0esr",
945+
"version": "115.19.0esr",
946946
"licenses": [
947947
{
948948
"license": {
949949
"id": "MPL-2.0"
950950
}
951951
}
952952
],
953-
"purl": "pkg:deb/debian/firefox-esr@115.7.0esr-1",
953+
"purl": "pkg:deb/debian/firefox-esr@115.19.0esr-1",
954954
"properties": [
955955
{
956956
"name": "internal:team_responsible",

src/third_party/mozjs/extract/js/src/builtin/intl/TimeZoneDataGenerated.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Generated by make_intl_data.py. DO NOT EDIT.
2-
// tzdata version = 2023c
2+
// tzdata version = 2024a
33

44
#ifndef builtin_intl_TimeZoneDataGenerated_h
55
#define builtin_intl_TimeZoneDataGenerated_h
@@ -22,8 +22,14 @@ const char* const ianaZonesTreatedAsLinksByICU[] = {
2222
"America/Ensenada", // America/Tijuana [backzone]
2323
"America/Indiana/Indianapolis", // America/Indianapolis [northamerica]
2424
"America/Kentucky/Louisville", // America/Louisville [northamerica]
25+
"America/Montreal", // America/Toronto [backzone]
26+
"America/Nipigon", // America/Toronto [backzone]
2527
"America/Nuuk", // America/Godthab [europe]
28+
"America/Pangnirtung", // America/Iqaluit [backzone]
29+
"America/Rainy_River", // America/Winnipeg [backzone]
2630
"America/Rosario", // America/Cordoba [backzone]
31+
"America/Thunder_Bay", // America/Toronto [backzone]
32+
"America/Yellowknife", // America/Edmonton [backzone]
2733
"Asia/Chongqing", // Asia/Shanghai [backzone]
2834
"Asia/Harbin", // Asia/Shanghai [backzone]
2935
"Asia/Ho_Chi_Minh", // Asia/Saigon [asia]
@@ -34,13 +40,17 @@ const char* const ianaZonesTreatedAsLinksByICU[] = {
3440
"Asia/Yangon", // Asia/Rangoon [asia]
3541
"Atlantic/Faroe", // Atlantic/Faeroe [europe]
3642
"Atlantic/Jan_Mayen", // Arctic/Longyearbyen [backzone]
43+
"Australia/Currie", // Australia/Hobart [backzone]
3744
"EST", // Etc/GMT+5 [northamerica]
3845
"Europe/Belfast", // Europe/London [backzone]
3946
"Europe/Kyiv", // Europe/Kiev [europe]
4047
"Europe/Tiraspol", // Europe/Chisinau [backzone]
48+
"Europe/Uzhgorod", // Europe/Kiev [backzone]
49+
"Europe/Zaporozhye", // Europe/Kiev [backzone]
4150
"HST", // Etc/GMT+10 [northamerica]
4251
"MST", // Etc/GMT+7 [northamerica]
4352
"Pacific/Chuuk", // Pacific/Truk [backzone]
53+
"Pacific/Johnston", // Pacific/Honolulu [backzone]
4454
"Pacific/Kanton", // Pacific/Enderbury [australasia]
4555
"Pacific/Pohnpei", // Pacific/Ponape [backzone]
4656
};
@@ -67,7 +77,6 @@ const LinkAndTarget ianaLinksCanonicalizedDifferentlyByICU[] = {
6777
{ "America/Lower_Princes", "America/Curacao" }, // America/Lower_Princes [backward]
6878
{ "America/Marigot", "America/Port_of_Spain" }, // America/Marigot [backward]
6979
{ "America/Mendoza", "America/Argentina/Mendoza" }, // America/Mendoza [backward]
70-
{ "America/Santa_Isabel", "America/Tijuana" }, // America/Santa_Isabel [backward]
7180
{ "America/St_Barthelemy", "America/Port_of_Spain" }, // America/St_Barthelemy [backward]
7281
{ "Antarctica/South_Pole", "Antarctica/McMurdo" }, // Pacific/Auckland [backward]
7382
{ "Arctic/Longyearbyen", "Europe/Oslo" }, // Arctic/Longyearbyen [backward]

src/third_party/mozjs/extract/js/src/gc/GC.cpp

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,20 +3100,14 @@ GCRuntime::MarkQueueProgress GCRuntime::processTestMarkQueue() {
31003100
return QueueSuspended;
31013101
}
31023102

3103-
// Mark the object and push it onto the stack.
3104-
size_t oldPosition = marker().stack.position();
3105-
marker().markAndTraverse<NormalMarkingOptions>(obj);
3106-
3107-
// If we overflow the stack here and delay marking, then we won't be
3108-
// testing what we think we're testing.
3109-
if (marker().stack.position() == oldPosition) {
3103+
// Mark the object.
3104+
AutoEnterOOMUnsafeRegion oomUnsafe;
3105+
if (!marker().markOneObjectForTest(obj)) {
3106+
// If we overflowed the stack here and delayed marking, then we won't be
3107+
// testing what we think we're testing.
31103108
MOZ_ASSERT(obj->asTenured().arena()->onDelayedMarkingList());
3111-
AutoEnterOOMUnsafeRegion oomUnsafe;
31123109
oomUnsafe.crash("Overflowed stack while marking test queue");
31133110
}
3114-
3115-
SliceBudget unlimited = SliceBudget::unlimited();
3116-
marker().processMarkStackTop<NormalMarkingOptions>(unlimited);
31173111
} else if (val.isString()) {
31183112
JSLinearString* str = &val.toString()->asLinear();
31193113
if (js::StringEqualsLiteral(str, "yield") && isIncrementalGc()) {
@@ -3604,10 +3598,7 @@ void GCRuntime::incrementalSlice(SliceBudget& budget, JS::GCReason reason,
36043598

36053599
case State::Mark:
36063600
if (mightSweepInThisSlice(budget.isUnlimited())) {
3607-
// Trace wrapper rooters before marking if we might start sweeping in
3608-
// this slice.
3609-
rt->mainContextFromOwnThread()->traceWrapperGCRooters(
3610-
marker().tracer());
3601+
prepareForSweepSlice(reason);
36113602
}
36123603

36133604
{
@@ -3656,13 +3647,8 @@ void GCRuntime::incrementalSlice(SliceBudget& budget, JS::GCReason reason,
36563647
[[fallthrough]];
36573648

36583649
case State::Sweep:
3659-
if (storeBuffer().mayHavePointersToDeadCells()) {
3660-
collectNurseryFromMajorGC(reason);
3661-
}
3662-
36633650
if (initialState == State::Sweep) {
3664-
rt->mainContextFromOwnThread()->traceWrapperGCRooters(
3665-
marker().tracer());
3651+
prepareForSweepSlice(reason);
36663652
}
36673653

36683654
if (performSweepActions(budget) == NotFinished) {

src/third_party/mozjs/extract/js/src/gc/GCMarker.h

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ namespace gc {
3838
enum IncrementalProgress { NotFinished = 0, Finished };
3939

4040
class AutoSetMarkColor;
41+
class AutoUpdateMarkStackRanges;
4142
struct Cell;
43+
class MarkStackIter;
4244
class ParallelMarker;
4345
class UnmarkGrayTracer;
4446

@@ -117,6 +119,7 @@ class MarkStack {
117119
public:
118120
TaggedPtr() = default;
119121
TaggedPtr(Tag tag, Cell* ptr);
122+
uintptr_t asBits() const;
120123
Tag tag() const;
121124
uintptr_t tagUnchecked() const;
122125
template <typename T>
@@ -136,10 +139,13 @@ class MarkStack {
136139
size_t start() const;
137140
TaggedPtr ptr() const;
138141

142+
void setStart(size_t newStart);
143+
void setEmpty();
144+
145+
private:
139146
static constexpr size_t StartShift = 2;
140147
static constexpr size_t KindMask = (1 << StartShift) - 1;
141148

142-
private:
143149
uintptr_t startAndKind_;
144150
TaggedPtr ptr_;
145151
};
@@ -224,6 +230,13 @@ class MarkStack {
224230
// The maximum stack capacity to grow to.
225231
MainThreadOrGCTaskData<size_t> maxCapacity_{SIZE_MAX};
226232
#endif
233+
234+
#ifdef DEBUG
235+
MainThreadOrGCTaskData<bool> elementsRangesAreValid;
236+
friend class js::GCMarker;
237+
#endif
238+
239+
friend class MarkStackIter;
227240
};
228241

229242
static_assert(unsigned(SlotsOrElementsKind::Unused) ==
@@ -232,6 +245,25 @@ static_assert(unsigned(SlotsOrElementsKind::Unused) ==
232245
"difference between SlotsOrElementsRange::startAndKind_ and a "
233246
"tagged SlotsOrElementsRange");
234247

248+
class MOZ_STACK_CLASS MarkStackIter {
249+
MarkStack& stack_;
250+
size_t pos_;
251+
252+
public:
253+
explicit MarkStackIter(MarkStack& stack);
254+
255+
bool done() const;
256+
void next();
257+
258+
MarkStack::Tag peekTag() const;
259+
bool isSlotsOrElementsRange() const;
260+
MarkStack::SlotsOrElementsRange& slotsOrElementsRange();
261+
262+
private:
263+
size_t position() const;
264+
MarkStack::TaggedPtr peekPtr() const;
265+
};
266+
235267
// Bitmask of options to parameterize MarkingTracerT.
236268
namespace MarkingOptions {
237269
enum : uint32_t {
@@ -361,6 +393,8 @@ class GCMarker {
361393
void setCheckAtomMarking(bool check);
362394

363395
bool shouldCheckCompartments() { return strictCompartmentChecking; }
396+
397+
bool markOneObjectForTest(JSObject* obj);
364398
#endif
365399

366400
bool markCurrentColorInParallel(SliceBudget& budget);
@@ -403,6 +437,13 @@ class GCMarker {
403437
template <typename Tracer>
404438
void setMarkingStateAndTracer(MarkingState prev, MarkingState next);
405439

440+
// The mutator can shift object elements which could invalidate any elements
441+
// index on the mark stack. Change the index to be relative to the elements
442+
// allocation (to ignore shifted elements) while the mutator is running.
443+
void updateRangesAtStartOfSlice();
444+
void updateRangesAtEndOfSlice();
445+
friend class gc::AutoUpdateMarkStackRanges;
446+
406447
template <uint32_t markingOptions>
407448
bool processMarkStackTop(SliceBudget& budget);
408449
friend class gc::GCRuntime;

src/third_party/mozjs/extract/js/src/gc/GCRuntime.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ class GCRuntime {
875875
void sweepBackgroundThings(ZoneList& zones);
876876
void backgroundFinalize(JS::GCContext* gcx, Zone* zone, AllocKind kind,
877877
Arena** empty);
878+
void prepareForSweepSlice(JS::GCReason reason);
878879
void assertBackgroundSweepingFinished();
879880

880881
bool allCCVisibleZonesWereCollected();

0 commit comments

Comments
 (0)