mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 818958: Tell SPSProfiler when the JS runtime shuts down r=luke
This commit is contained in:
parent
009043843c
commit
7deeb3fb59
@ -1308,6 +1308,11 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
fprintf(stderr, "nJRSI: destroyed runtime %p\n", (void *)mJSRuntime);
|
||||
#endif
|
||||
}
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
// Tell the profiler that the runtime is gone
|
||||
if (ProfileStack *stack = mozilla_profile_stack())
|
||||
stack->sampleRuntime(nullptr);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
for (uint32_t i = 0; i < XPCCCX_STRING_CACHE_SIZE; ++i) {
|
||||
|
@ -368,6 +368,11 @@ public:
|
||||
|
||||
void sampleRuntime(JSRuntime *runtime) {
|
||||
mRuntime = runtime;
|
||||
if (!runtime) {
|
||||
// JS shut down
|
||||
return;
|
||||
}
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(mStack[0]) == sizeof(js::ProfileEntry));
|
||||
js::SetRuntimeProfilingStack(runtime,
|
||||
(js::ProfileEntry*) mStack,
|
||||
|
Loading…
Reference in New Issue
Block a user