mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1577658 - UniqueStacks constructor can accept a ProfilerCodeAddressService - r=canaltinova
When it's constructed, UniqueStacks can now take a ProfilerCodeAddressService pointer, instead of having to add it separately. It will be even more useful in a later patch, when constructing it as a struct member in one shot. Differential Revision: https://phabricator.services.mozilla.com/D128434
This commit is contained in:
parent
302a5711fa
commit
153c2bb05e
@ -288,8 +288,11 @@ bool UniqueStacks::FrameKey::JITFrameData::operator==(
|
||||
// ranges. The JIT frame info contains JSON which refers to strings from the
|
||||
// JIT frame info's string table, so our string table needs to have the same
|
||||
// strings at the same indices.
|
||||
UniqueStacks::UniqueStacks(JITFrameInfo&& aJITFrameInfo)
|
||||
UniqueStacks::UniqueStacks(
|
||||
JITFrameInfo&& aJITFrameInfo,
|
||||
ProfilerCodeAddressService* aCodeAddressService /* = nullptr */)
|
||||
: mUniqueStrings(std::move(aJITFrameInfo.mUniqueStrings)),
|
||||
mCodeAddressService(aCodeAddressService),
|
||||
mJITInfoRanges(std::move(aJITFrameInfo.mRanges)) {
|
||||
mFrameTableWriter.StartBareList();
|
||||
mStackTableWriter.StartBareList();
|
||||
|
@ -311,7 +311,9 @@ class UniqueStacks {
|
||||
}
|
||||
};
|
||||
|
||||
explicit UniqueStacks(JITFrameInfo&& aJITFrameInfo);
|
||||
explicit UniqueStacks(
|
||||
JITFrameInfo&& aJITFrameInfo,
|
||||
ProfilerCodeAddressService* aCodeAddressService = nullptr);
|
||||
|
||||
// Return a StackKey for aFrame as the stack's root frame (no prefix).
|
||||
[[nodiscard]] StackKey BeginStack(const FrameKey& aFrame);
|
||||
|
@ -53,8 +53,7 @@ void ProfiledThreadData::StreamJSON(
|
||||
mThreadInfo.ThreadId(), aCx, jitFrameInfo);
|
||||
}
|
||||
|
||||
UniqueStacks uniqueStacks(std::move(jitFrameInfo));
|
||||
uniqueStacks.mCodeAddressService = aService;
|
||||
UniqueStacks uniqueStacks(std::move(jitFrameInfo), aService);
|
||||
|
||||
MOZ_ASSERT(uniqueStacks.mUniqueStrings);
|
||||
aWriter.SetUniqueStrings(*uniqueStacks.mUniqueStrings);
|
||||
|
Loading…
x
Reference in New Issue
Block a user