mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1167230 - Use nsCString instead of std::string in FrameKey in the profiler. (r=mstange)
This commit is contained in:
parent
95302871f0
commit
35c01fcb4f
@ -360,7 +360,10 @@ uint32_t UniqueStacks::Stack::GetOrAddIndex() const
|
||||
|
||||
uint32_t UniqueStacks::FrameKey::Hash() const
|
||||
{
|
||||
uint32_t hash = mozilla::HashString(mLocation.c_str(), mLocation.length());
|
||||
uint32_t hash = 0;
|
||||
if (!mLocation.IsEmpty()) {
|
||||
hash = mozilla::HashString(mLocation.get());
|
||||
}
|
||||
if (mLine.isSome()) {
|
||||
hash = mozilla::AddToHash(hash, *mLine);
|
||||
}
|
||||
@ -493,7 +496,7 @@ void UniqueStacks::StreamFrame(const OnStackFrameKey& aFrame)
|
||||
|
||||
mFrameTableWriter.StartArrayElement();
|
||||
if (!aFrame.mJITFrameHandle) {
|
||||
mUniqueStrings.WriteElement(mFrameTableWriter, aFrame.mLocation.c_str());
|
||||
mUniqueStrings.WriteElement(mFrameTableWriter, aFrame.mLocation.get());
|
||||
if (aFrame.mLine.isSome()) {
|
||||
mFrameTableWriter.NullElement(); // implementation
|
||||
mFrameTableWriter.NullElement(); // optimizations
|
||||
|
@ -109,7 +109,7 @@ class UniqueStacks
|
||||
{
|
||||
public:
|
||||
struct FrameKey {
|
||||
std::string mLocation;
|
||||
nsCString mLocation;
|
||||
mozilla::Maybe<unsigned> mLine;
|
||||
mozilla::Maybe<unsigned> mCategory;
|
||||
mozilla::Maybe<void*> mJITAddress;
|
||||
@ -119,6 +119,14 @@ public:
|
||||
: mLocation(aLocation)
|
||||
{ }
|
||||
|
||||
FrameKey(const FrameKey& aToCopy)
|
||||
: mLocation(aToCopy.mLocation)
|
||||
, mLine(aToCopy.mLine)
|
||||
, mCategory(aToCopy.mCategory)
|
||||
, mJITAddress(aToCopy.mJITAddress)
|
||||
, mJITDepth(aToCopy.mJITDepth)
|
||||
{ }
|
||||
|
||||
FrameKey(void* aJITAddress, uint32_t aJITDepth)
|
||||
: mJITAddress(mozilla::Some(aJITAddress))
|
||||
, mJITDepth(mozilla::Some(aJITDepth))
|
||||
@ -137,6 +145,11 @@ public:
|
||||
, mJITFrameHandle(nullptr)
|
||||
{ }
|
||||
|
||||
OnStackFrameKey(const OnStackFrameKey& aToCopy)
|
||||
: FrameKey(aToCopy)
|
||||
, mJITFrameHandle(aToCopy.mJITFrameHandle)
|
||||
{ }
|
||||
|
||||
OnStackFrameKey(void* aJITAddress, unsigned aJITDepth)
|
||||
: FrameKey(aJITAddress, aJITDepth)
|
||||
, mJITFrameHandle(nullptr)
|
||||
|
Loading…
Reference in New Issue
Block a user