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

- bug 1191326 - always initialize ProxyAccessible::mOuterDoc r=lsocks (74ed8d596)
- Bug 1156062 part 1a - New nsEditor::SplitNodeDeep variant; r=ehsan (a80d26ece)
- minor fix (c1e5c74e3)
- Bug 1172216 - Move nsStackwalk to mozglue. r=glandium (971014ffb)
- Bug 1156903: Add quirk flag that causes NPN_GetValue(NPNVdocumentOrigin) to return an empty string even when it fails; r=jimm (9508b57b1)
- Bug 554178 - Remove unused member variable PluginModuleChild::mUserAgent. r=jimm (a6fda391a)
- Bug 1203428 - E10S for device storage API r=cyu (da575f819)
- Bug 1150642 - Make mozilla_sampler_save_profile_to_file callable from lldb in Nightly builds. r=jrmuizel (bb98fafd6)
- Bug 1136834 - Stop leaking markers in ProfileBuffer. (r=mstange) (b2f5f813a)
- Bug 1148069 - Ensure synchronous sampling does not set JitcodeGlobalEntry's generation. (r=djvj) (f5a4dd6a4)
- Bug 1181348 - Fix ARM64 toggledCall() under debug mode. r=djvj (4bbbe51a4)
- Bug 1181354 - Account for initaliasedlexical in this one weird const cutout in jit::SetProperty. (r=jandem) (472179ea2)
- Bug 1181558 part 0 - Remove unused SnapshotIterator constructor. r=jandem (cae21907a)
- Bug 1181558 part 1 - Share the machine state between all SnapshotIterators of the same InlineFrameIterator. r=jandem (49e53a014)
- Bug 1177922 - Fix a bogus assert on OOM in markSafepointAt. r=nbp (cf26143e7)
- Bug 1182060 - IsObjectEscaped: Handle UnboxedPlainObject in guard shape. r=bhackett (35b6c285a)
- Bug 1183051: Fix register allocations of Atomics callouts on arm vfp; r=h4writer (42d708374)
- Bug 1138693 - Add comments and test. r=jandem (9619e8053)
- Bug 1138693 - Add an early quit to the test if TypedObject isn't enabled. r=nbp (f6b04026e)
- Bug 1180184 - Support JSOP_TOSTRING used by template strings in baseline JIT. r=jandem (8215c953b)
This commit is contained in:
2021-09-28 21:57:21 +08:00
parent 5313db75c9
commit 83aaad87df
48 changed files with 383 additions and 312 deletions
+7
View File
@@ -38,6 +38,7 @@ bool mozilla_sampler_is_active();
void mozilla_sampler_responsiveness(TimeStamp time);
void mozilla_sampler_frame_number(int frameNumber);
const double* mozilla_sampler_get_responsiveness();
void mozilla_sampler_save();
mozilla::UniquePtr<char[]> mozilla_sampler_get_profile(float aSinceTime);
@@ -46,6 +47,12 @@ JSObject *mozilla_sampler_get_profile_data(JSContext *aCx, float aSinceTime);
void mozilla_sampler_get_profile_data_async(float aSinceTime,
mozilla::dom::Promise* aPromise);
// Make this function easily callable from a debugger in a build without
// debugging information (work around http://llvm.org/bugs/show_bug.cgi?id=22211)
extern "C" {
void mozilla_sampler_save_profile_to_file(const char* aFilename);
}
const char** mozilla_sampler_get_features();
void mozilla_sampler_get_buffer_info(uint32_t *aCurrentPosition, uint32_t *aTotalSize,
+11 -1
View File
@@ -111,11 +111,21 @@ ProfileBuffer::ProfileBuffer(int aEntrySize)
{
}
ProfileBuffer::~ProfileBuffer()
{
while (mStoredMarkers.peek()) {
delete mStoredMarkers.popHead();
}
}
// Called from signal, call only reentrant functions
void ProfileBuffer::addTag(const ProfileEntry& aTag)
{
mEntries[mWritePos++] = aTag;
if (mWritePos == mEntrySize) {
// Wrapping around may result in things referenced in the buffer (e.g.,
// JIT code addresses and markers) being incorrectly collected.
MOZ_ASSERT(mGeneration != UINT32_MAX);
mGeneration++;
mWritePos = 0;
}
@@ -134,7 +144,7 @@ void ProfileBuffer::addStoredMarker(ProfilerMarker *aStoredMarker) {
void ProfileBuffer::deleteExpiredStoredMarkers() {
// Delete markers of samples that have been overwritten due to circular
// buffer wraparound.
int generation = mGeneration;
uint32_t generation = mGeneration;
while (mStoredMarkers.peek() &&
mStoredMarkers.peek()->HasExpired(generation)) {
delete mStoredMarkers.popHead();
+2 -3
View File
@@ -250,7 +250,7 @@ protected:
char* processDynamicTag(int readPos, int* tagsConsumed, char* tagBuff);
int FindLastSampleOfThread(int aThreadId);
~ProfileBuffer() {}
~ProfileBuffer();
public:
// Circular buffer 'Keep One Slot Open' implementation for simplicity
@@ -267,7 +267,7 @@ public:
int mEntrySize;
// How many times mWritePos has wrapped around.
int mGeneration;
uint32_t mGeneration;
// Markers that marker entries in the buffer might refer to.
ProfilerMarkerLinkedList mStoredMarkers;
@@ -410,7 +410,6 @@ public:
}
uint32_t bufferGeneration() const {
MOZ_ASSERT(mBuffer->mGeneration >= 0);
return mBuffer->mGeneration;
}
+3 -3
View File
@@ -92,9 +92,9 @@ public:
void StreamJSON(SpliceableJSONWriter& aWriter, UniqueStacks& aUniqueStacks) const;
void SetGeneration(int aGenID);
void SetGeneration(uint32_t aGenID);
bool HasExpired(int aGenID) const {
bool HasExpired(uint32_t aGenID) const {
return mGenID + 2 <= aGenID;
}
@@ -105,7 +105,7 @@ private:
ProfilerMarkerPayload* mPayload;
ProfilerMarker* mNext;
float mTime;
int mGenID;
uint32_t mGenID;
};
template<typename T>
+17 -12
View File
@@ -47,9 +47,6 @@
#if defined(MOZ_PROFILING) && (defined(XP_MACOSX) || defined(XP_WIN))
#define USE_NS_STACKWALK
#endif
#ifdef USE_NS_STACKWALK
#include "nsStackWalk.h"
#endif
#if defined(XP_WIN)
typedef CONTEXT tickcontext_t;
@@ -635,7 +632,16 @@ void mergeStacksIntoProfile(ThreadProfile& aProfile, TickSample* aSample, Native
// like the native stack, the JS stack is iterated youngest-to-oldest and we
// need to iterate oldest-to-youngest when adding entries to aProfile.
uint32_t startBufferGen = aProfile.bufferGeneration();
// Synchronous sampling reports an invalid buffer generation to
// ProfilingFrameIterator to avoid incorrectly resetting the generation of
// sampled JIT entries inside the JS engine. See note below concerning 'J'
// entries.
uint32_t startBufferGen;
if (aSample->isSamplingCurrentThread) {
startBufferGen = UINT32_MAX;
} else {
startBufferGen = aProfile.bufferGeneration();
}
uint32_t jsCount = 0;
JS::ProfilingFrameIterator::Frame jsFrames[1000];
// Only walk jit stack if profiling frame iterator is turned on.
@@ -781,14 +787,13 @@ void mergeStacksIntoProfile(ThreadProfile& aProfile, TickSample* aSample, Native
}
}
MOZ_ASSERT(aProfile.bufferGeneration() >= startBufferGen);
uint32_t lapCount = aProfile.bufferGeneration() - startBufferGen;
// Update the JS runtime with the current profile sample buffer generation.
//
// Do not do this for synchronous sampling, which create their own
// ProfileBuffers.
if (!aSample->isSamplingCurrentThread && pseudoStack->mRuntime) {
MOZ_ASSERT(aProfile.bufferGeneration() >= startBufferGen);
uint32_t lapCount = aProfile.bufferGeneration() - startBufferGen;
JS::UpdateJSRuntimeProfilerSampleBufferGen(pseudoStack->mRuntime,
aProfile.bufferGeneration(),
lapCount);
@@ -823,7 +828,7 @@ void TableTicker::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSample
};
// Start with the current function. We use 0 as the frame number here because
// the FramePointerStackWalk() and NS_StackWalk() calls below will use 1..N.
// the FramePointerStackWalk() and MozStackWalk() calls below will use 1..N.
// This is a bit weird but it doesn't matter because StackWalkCallback()
// doesn't use the frame number argument.
StackWalkCallback(/* frameNumber */ 0, aSample->pc, aSample->sp, &nativeStack);
@@ -834,7 +839,7 @@ void TableTicker::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSample
void *stackEnd = reinterpret_cast<void*>(-1);
if (pt)
stackEnd = static_cast<char*>(pthread_get_stackaddr_np(pt));
nsresult rv = NS_OK;
bool rv = true;
if (aSample->fp >= aSample->sp && aSample->fp <= stackEnd)
rv = FramePointerStackWalk(StackWalkCallback, /* skipFrames */ 0,
maxFrames, &nativeStack,
@@ -843,17 +848,17 @@ void TableTicker::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSample
void *platformData = nullptr;
#ifdef XP_WIN
if (aSample->isSamplingCurrentThread) {
// In this case we want NS_StackWalk to know that it's walking the
// In this case we want MozStackWalk to know that it's walking the
// current thread's stack, so we pass 0 as the thread handle.
thread = 0;
}
platformData = aSample->context;
#endif // XP_WIN
nsresult rv = NS_StackWalk(StackWalkCallback, /* skipFrames */ 0, maxFrames,
bool rv = MozStackWalk(StackWalkCallback, /* skipFrames */ 0, maxFrames,
&nativeStack, thread, platformData);
#endif
if (NS_SUCCEEDED(rv))
if (rv)
mergeStacksIntoProfile(aProfile, aSample, nativeStack);
}
#endif
+1 -1
View File
@@ -197,7 +197,7 @@ ProfilerMarker::~ProfilerMarker() {
}
void
ProfilerMarker::SetGeneration(int aGenID) {
ProfilerMarker::SetGeneration(uint32_t aGenID) {
mGenID = aGenID;
}