import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1158344 part 1 - Use the an instruction which is not a beta node for hoisting bounds checks. r=sunfish (2174d2c83)
- Bug 1158344 part 2 - Do not produce upper bounds check if the condition is always verified. r=sunfish (dd93b1595)
- Bug 1160911 - JIT: precise shift right derived result range for all int32 input ranges. r=sunfish (87589affe)
- Bug 1055473 - Make WeakMap/Set.prototype a plain object. r=Waldo (07835bfde)
- Bug 1055473 - Actually disable the web-platform test ON CLOSED TREE (3e8601a23)
- Bug 1157239 - Give MGuardShape and friends a resultTypeSet. r=h4writer (63b4fedb7)
- Bug 1124870 - Use LookupPropertyPure instead of LookupProperty in IsCacheableDOMProxyUnshadowedSetterCall. r=evilpie (57dc89ac7)
- Bug 1162078 - Ignore timeouts for some CGC tests r=terrence DONTBUILD (ac4468c9d)
- Bug 967544 - make gServiceInterrupt Atomic; r=Waldo (bb34afcc6)
- Bug 1178998 - Identify which hang detector reports a hang. r=billm (b2f9d3184)
- Bug 1133391 - Remove unused variables in TabParent::RecvDispatchAfterKeyboardEvent. r=smaug. (a7a9b985f)
- Bug 1180125 part 0 - Fix an obvious bug in animation_utils.js; r=dbaron (f5729da0e)
- Bug 1183223 - Create a markers directory temporarily inside docshell/base where all marker logic should go into, r=smaug (56b821e0a)
- Bug 1183228 - Use separate files for AutoTimelineMarker and AutoGlobalTimelineMarker, r=smaug (38fbe5409)
- Bug 1183229 - Add a way to count the number of timeline-observed docshells outside of nsDocShell, r=smaug (ee6e7d081)
- Bug 1183231 - Maintain a list of timeline-observed docshells outside of nsDocShell, r=smaug (b2f6a778b)
- Bug 1183235 - Keep the dochsell-specific markers inside a ObservedDocShell managed list instead of nsDocShell, r=smaug (50d45b9b2)
- Bug 1137109 move the displaylist tracing inside nsViewManager::ProcessPendingUpdates, r=benwa, mattwoodrow (2bebfe820)
- Bug 1184376 - Remove nsDocShell::AddProfileTimelineMarker, r=smaug (db31f7621)
This commit is contained in:
2021-11-29 09:26:06 +08:00
parent 8cdfd32011
commit 496b2e34f3
42 changed files with 628 additions and 340 deletions
+21 -47
View File
@@ -2820,29 +2820,17 @@ nsDocShell::HistoryTransactionRemoved(int32_t aIndex)
return NS_OK;
}
unsigned long nsDocShell::gProfileTimelineRecordingsCount = 0;
mozilla::LinkedList<nsDocShell::ObservedDocShell>* nsDocShell::gObservedDocShells = nullptr;
NS_IMETHODIMP
nsDocShell::SetRecordProfileTimelineMarkers(bool aValue)
{
bool currentValue = nsIDocShell::GetRecordProfileTimelineMarkers();
if (currentValue != aValue) {
if (aValue) {
++gProfileTimelineRecordingsCount;
TimelineConsumers::AddConsumer(this);
UseEntryScriptProfiling();
MOZ_ASSERT(!mObserved);
mObserved.reset(new ObservedDocShell(this));
GetOrCreateObservedDocShells().insertFront(mObserved.get());
} else {
--gProfileTimelineRecordingsCount;
TimelineConsumers::RemoveConsumer(this);
UnuseEntryScriptProfiling();
mObserved.reset(nullptr);
ClearProfileTimelineMarkers();
}
}
@@ -2873,13 +2861,23 @@ nsDocShell::PopProfileTimelineMarkers(
SequenceRooter<mozilla::dom::ProfileTimelineMarker> rooter(
aCx, &profileTimelineMarkers);
if (!IsObserved()) {
if (!ToJSValue(aCx, profileTimelineMarkers, aProfileTimelineMarkers)) {
JS_ClearPendingException(aCx);
return NS_ERROR_UNEXPECTED;
}
return NS_OK;
}
nsTArray<UniquePtr<TimelineMarker>>& markersStore = mObserved.get()->mTimelineMarkers;
// If we see an unpaired START, we keep it around for the next call
// to PopProfileTimelineMarkers. We store the kept START objects in
// this array.
nsTArray<UniquePtr<TimelineMarker>> keptMarkers;
for (uint32_t i = 0; i < mProfileTimelineMarkers.Length(); ++i) {
UniquePtr<TimelineMarker>& startPayload = mProfileTimelineMarkers[i];
for (uint32_t i = 0; i < markersStore.Length(); ++i) {
UniquePtr<TimelineMarker>& startPayload = markersStore[i];
const char* startMarkerName = startPayload->GetName();
bool hasSeenPaintedLayer = false;
@@ -2915,8 +2913,8 @@ nsDocShell::PopProfileTimelineMarkers(
// The assumption is that the devtools timeline flushes markers frequently
// enough for the amount of markers to always be small enough that the
// nested for loop isn't going to be a performance problem.
for (uint32_t j = i + 1; j < mProfileTimelineMarkers.Length(); ++j) {
UniquePtr<TimelineMarker>& endPayload = mProfileTimelineMarkers[j];
for (uint32_t j = i + 1; j < markersStore.Length(); ++j) {
UniquePtr<TimelineMarker>& endPayload = markersStore[j];
const char* endMarkerName = endPayload->GetName();
// Look for Layer markers to stream out paint markers.
@@ -2962,14 +2960,14 @@ nsDocShell::PopProfileTimelineMarkers(
// If we did not see the corresponding END, keep the START.
if (!hasSeenEnd) {
keptMarkers.AppendElement(Move(mProfileTimelineMarkers[i]));
mProfileTimelineMarkers.RemoveElementAt(i);
keptMarkers.AppendElement(Move(markersStore[i]));
markersStore.RemoveElementAt(i);
--i;
}
}
}
mProfileTimelineMarkers.SwapElements(keptMarkers);
markersStore.SwapElements(keptMarkers);
if (!ToJSValue(aCx, profileTimelineMarkers, aProfileTimelineMarkers)) {
JS_ClearPendingException(aCx);
@@ -2988,24 +2986,6 @@ nsDocShell::Now(DOMHighResTimeStamp* aWhen)
return NS_OK;
}
void
nsDocShell::AddProfileTimelineMarker(const char* aName,
TracingMetadata aMetaData)
{
if (IsObserved()) {
TimelineMarker* marker = new TimelineMarker(this, aName, aMetaData);
mProfileTimelineMarkers.AppendElement(marker);
}
}
void
nsDocShell::AddProfileTimelineMarker(UniquePtr<TimelineMarker>&& aMarker)
{
if (IsObserved()) {
mProfileTimelineMarkers.AppendElement(Move(aMarker));
}
}
NS_IMETHODIMP
nsDocShell::SetWindowDraggingAllowed(bool aValue)
{
@@ -3035,12 +3015,6 @@ nsDocShell::GetWindowDraggingAllowed(bool* aValue)
return NS_OK;
}
void
nsDocShell::ClearProfileTimelineMarkers()
{
mProfileTimelineMarkers.Clear();
}
nsIDOMStorageManager*
nsDocShell::TopSessionStorageManager()
{
@@ -14082,7 +14056,7 @@ nsDocShell::NotifyJSRunToCompletionStart(const char* aReason,
MakeUnique<JavascriptTimelineMarker>(this, "Javascript", aReason,
aFunctionName, aFilename,
aLineNumber);
AddProfileTimelineMarker(Move(marker));
TimelineConsumers::AddMarkerForDocShell(this, Move(marker));
}
mJSRunToCompletionDepth++;
}
@@ -14095,7 +14069,7 @@ nsDocShell::NotifyJSRunToCompletionStop()
// If last stop, mark interval end.
mJSRunToCompletionDepth--;
if (timelineOn && mJSRunToCompletionDepth == 0) {
AddProfileTimelineMarker("Javascript", TRACING_INTERVAL_END);
TimelineConsumers::AddMarkerForDocShell(this, "Javascript", TRACING_INTERVAL_END);
}
}