+37
−24
Loading
Bug 1716959 - On-thread sampling uses a per-thread JS frame buffer that's only allocated when there's also a JSContext - r=canaltinova MergeStack requires a fairly large buffer to store JS frames, too big to be allocated on the stack without risking a stack overflow. Until now, there was only one buffer, stored in CorePS, and only accessible while holding the Profiler gPSMutex. Now each thread that has a JSContext, also has its own JS frame buffer, which is accessible on the thread without needing any lock. The Profiler's Sampler still uses the CorePS buffer for its periodic sampling, but it won't prevent parallel on-thread sampling anymore. The appropriate buffer is passed to ExtractJsFrames and then MergeStacks. MergeStacks accepts a null pointer, which happens on threads where there is no JSContext, and therefore no JS to sample. Differential Revision: https://phabricator.services.mozilla.com/D122087