Bug 1341255 - Profiler tidyups: remove StackEntry, rename ProfileEntry to ProfileBufferEntry (part 1: remove StackEntry). r=n.nethercote.

--HG--
extra : rebase_source : 6418946b1ebeb82abdccdb10a03380a40c00da21
This commit is contained in:
Julian Seward 2017-02-23 23:04:13 +01:00
Родитель c9aa17537a
Коммит 4cd04ecc8a
4 изменённых файлов: 16 добавлений и 29 удалений

Просмотреть файл

@ -251,12 +251,12 @@ AddDynamicCodeLocationTag(ThreadInfo& aInfo, const char* aStr)
}
static void
AddPseudoEntry(volatile StackEntry& entry, ThreadInfo& aInfo,
AddPseudoEntry(volatile js::ProfileEntry& entry, ThreadInfo& aInfo,
PseudoStack* stack, void* lastpc)
{
// Pseudo-frames with the BEGIN_PSEUDO_JS flag are just annotations and
// should not be recorded in the profile.
if (entry.hasFlag(StackEntry::BEGIN_PSEUDO_JS)) {
if (entry.hasFlag(js::ProfileEntry::BEGIN_PSEUDO_JS)) {
return;
}
@ -307,8 +307,8 @@ AddPseudoEntry(volatile StackEntry& entry, ThreadInfo& aInfo,
}
uint32_t category = entry.category();
MOZ_ASSERT(!(category & StackEntry::IS_CPP_ENTRY));
MOZ_ASSERT(!(category & StackEntry::FRAME_LABEL_COPY));
MOZ_ASSERT(!(category & js::ProfileEntry::IS_CPP_ENTRY));
MOZ_ASSERT(!(category & js::ProfileEntry::FRAME_LABEL_COPY));
if (category) {
aInfo.addTag(ProfileEntry::Category((int)category));
@ -345,7 +345,7 @@ MergeStacksIntoProfile(ThreadInfo& aInfo, TickSample* aSample,
NativeStack& aNativeStack)
{
PseudoStack* pseudoStack = aInfo.Stack();
volatile StackEntry* pseudoFrames = pseudoStack->mStack;
volatile js::ProfileEntry* pseudoFrames = pseudoStack->mStack;
uint32_t pseudoCount = pseudoStack->stackSize();
// Make a copy of the JS stack into a JSFrame array. This is necessary since,
@ -420,7 +420,7 @@ MergeStacksIntoProfile(ThreadInfo& aInfo, TickSample* aSample,
uint8_t* nativeStackAddr = nullptr;
if (pseudoIndex != pseudoCount) {
volatile StackEntry& pseudoFrame = pseudoFrames[pseudoIndex];
volatile js::ProfileEntry& pseudoFrame = pseudoFrames[pseudoIndex];
if (pseudoFrame.isCpp()) {
lastPseudoCppStackAddr = (uint8_t*) pseudoFrame.stackAddress();
@ -471,7 +471,7 @@ MergeStacksIntoProfile(ThreadInfo& aInfo, TickSample* aSample,
// Check to see if pseudoStack frame is top-most.
if (pseudoStackAddr > jsStackAddr && pseudoStackAddr > nativeStackAddr) {
MOZ_ASSERT(pseudoIndex < pseudoCount);
volatile StackEntry& pseudoFrame = pseudoFrames[pseudoIndex];
volatile js::ProfileEntry& pseudoFrame = pseudoFrames[pseudoIndex];
AddPseudoEntry(pseudoFrame, aInfo, pseudoStack, nullptr);
pseudoIndex++;
continue;
@ -616,7 +616,7 @@ DoNativeBacktrace(ThreadInfo& aInfo, TickSample* aSample)
for (uint32_t i = pseudoStack->stackSize(); i > 0; --i) {
// The pseudostack grows towards higher indices, so we iterate
// backwards (from callee to caller).
volatile StackEntry& entry = pseudoStack->mStack[i - 1];
volatile js::ProfileEntry& entry = pseudoStack->mStack[i - 1];
if (!entry.isJs() && strcmp(entry.label(), "EnterJIT") == 0) {
// Found JIT entry frame. Unwind up to that point (i.e., force
// the stack walk to stop before the block of saved registers;
@ -2486,7 +2486,7 @@ profiler_get_backtrace_noalloc(char *output, size_t outputSize)
return;
}
volatile StackEntry *pseudoFrames = pseudoStack->mStack;
volatile js::ProfileEntry *pseudoFrames = pseudoStack->mStack;
uint32_t pseudoCount = pseudoStack->stackSize();
for (uint32_t i = 0; i < pseudoCount; i++) {

Просмотреть файл

@ -49,18 +49,6 @@ LinuxKernelMemoryBarrierFunc pLinuxKernelMemoryBarrier __attribute__((weak)) =
# error "Memory clobber not supported for your platform."
#endif
// A stack entry exists to allow the JS engine to inform the Gecko Profiler of
// the current backtrace, but also to instrument particular points in C++ in
// case stack walking is not available on the platform we are running on.
//
// Each entry has a descriptive string, a relevant stack address, and some extra
// information the JS engine might want to inform the Gecko Profiler of. This
// class inherits from the JS engine's version of the entry to ensure that the
// size and layout of the two representations are consistent.
class StackEntry : public js::ProfileEntry
{
};
class ProfilerMarkerPayload;
template<typename T>
class ProfilerLinkedList;
@ -273,7 +261,7 @@ public:
return;
}
volatile StackEntry& entry = mStack[mStackPointer];
volatile js::ProfileEntry& entry = mStack[mStackPointer];
// Make sure we increment the pointer after the name has been written such
// that mStack is always consistent.
@ -412,7 +400,7 @@ private:
public:
// The list of active checkpoints.
StackEntry volatile mStack[1024];
js::ProfileEntry volatile mStack[1024];
private:
// A list of pending markers that must be moved to the circular buffer.

Просмотреть файл

@ -426,7 +426,7 @@ GetPathAfterComponent(const char* filename, const char (&component)[LEN]) {
} // namespace
const char*
ThreadStackHelper::AppendJSEntry(const volatile StackEntry* aEntry,
ThreadStackHelper::AppendJSEntry(const volatile js::ProfileEntry* aEntry,
intptr_t& aAvailableBufferSize,
const char* aPrevLabel)
{
@ -513,8 +513,8 @@ ThreadStackHelper::FillStackBuffer()
intptr_t availableBufferSize = intptr_t(reservedBufferSize);
// Go from front to back
const volatile StackEntry* entry = mPseudoStack->mStack;
const volatile StackEntry* end = entry + mPseudoStack->stackSize();
const volatile js::ProfileEntry* entry = mPseudoStack->mStack;
const volatile js::ProfileEntry* end = entry + mPseudoStack->stackSize();
// Deduplicate identical, consecutive frames
const char* prevLabel = nullptr;
for (; reservedSize-- && entry != end; entry++) {

Просмотреть файл

@ -8,8 +8,7 @@
#define mozilla_ThreadStackHelper_h
#include "mozilla/ThreadHangStats.h"
#include "GeckoProfiler.h"
#include "js/ProfilingStack.h"
#include <stddef.h>
@ -79,7 +78,7 @@ private:
void FillStackBuffer();
void FillThreadContext(void* aContext = nullptr);
#ifdef MOZ_THREADSTACKHELPER_PSEUDO
const char* AppendJSEntry(const volatile StackEntry* aEntry,
const char* AppendJSEntry(const volatile js::ProfileEntry* aEntry,
intptr_t& aAvailableBufferSize,
const char* aPrevLabel);
#endif