Title: [209440] trunk/Source/_javascript_Core
Revision
209440
Author
commit-qu...@webkit.org
Date
2016-12-06 18:52:35 -0800 (Tue, 06 Dec 2016)

Log Message

DumpRenderTree ASSERT in JSC::ExecutableBase::isHostFunction seen on bots
https://bugs.webkit.org/show_bug.cgi?id=165497
<rdar://problem/29538973>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-12-06
Reviewed by Saam Barati.

* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
Defer collection when extracting and processing the samples to avoid
any objects held by the samples from getting collected while processing.
This is because while processing we call into functions that can
allocate and we must prevent those functions from syncing with the
GC thread which may collect other sample data yet to be processed.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (209439 => 209440)


--- trunk/Source/_javascript_Core/ChangeLog	2016-12-07 01:23:54 UTC (rev 209439)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-12-07 02:52:35 UTC (rev 209440)
@@ -1,3 +1,19 @@
+2016-12-06  Joseph Pecoraro  <pecor...@apple.com>
+
+        DumpRenderTree ASSERT in JSC::ExecutableBase::isHostFunction seen on bots
+        https://bugs.webkit.org/show_bug.cgi?id=165497
+        <rdar://problem/29538973>
+
+        Reviewed by Saam Barati.
+
+        * inspector/agents/InspectorScriptProfilerAgent.cpp:
+        (Inspector::InspectorScriptProfilerAgent::trackingComplete):
+        Defer collection when extracting and processing the samples to avoid
+        any objects held by the samples from getting collected while processing.
+        This is because while processing we call into functions that can
+        allocate and we must prevent those functions from syncing with the
+        GC thread which may collect other sample data yet to be processed.
+
 2016-12-06  Alexey Proskuryakov  <a...@apple.com>
 
         Correct SDKROOT values in xcconfig files

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp (209439 => 209440)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp	2016-12-07 01:23:54 UTC (rev 209439)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp	2016-12-07 02:52:35 UTC (rev 209440)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "InspectorScriptProfilerAgent.h"
 
+#include "DeferGC.h"
+#include "HeapInlines.h"
 #include "InspectorEnvironment.h"
 #include "SamplingProfiler.h"
 #include <wtf/RunLoop.h>
@@ -203,8 +205,10 @@
 {
 #if ENABLE(SAMPLING_PROFILER)
     if (m_enabledSamplingProfiler) {
-        JSLockHolder lock(m_environment.scriptDebugServer().vm());
-        SamplingProfiler* samplingProfiler = m_environment.scriptDebugServer().vm().samplingProfiler();
+        VM& vm = m_environment.scriptDebugServer().vm();
+        JSLockHolder lock(vm);
+        DeferGC deferGC(vm.heap);
+        SamplingProfiler* samplingProfiler = vm.samplingProfiler();
         RELEASE_ASSERT(samplingProfiler);
 
         LockHolder locker(samplingProfiler->getLock());
@@ -212,7 +216,7 @@
         Vector<SamplingProfiler::StackTrace> stackTraces = samplingProfiler->releaseStackTraces(locker);
         locker.unlockEarly();
 
-        Ref<Protocol::ScriptProfiler::Samples> samples = buildSamples(m_environment.scriptDebugServer().vm(), WTFMove(stackTraces));
+        Ref<Protocol::ScriptProfiler::Samples> samples = buildSamples(vm, WTFMove(stackTraces));
 
         m_enabledSamplingProfiler = false;
 
@@ -230,8 +234,9 @@
     if (!m_enabledSamplingProfiler)
         return;
 
-    JSLockHolder lock(m_environment.scriptDebugServer().vm());
-    SamplingProfiler* samplingProfiler = m_environment.scriptDebugServer().vm().samplingProfiler();
+    VM& vm = m_environment.scriptDebugServer().vm();
+    JSLockHolder lock(vm);
+    SamplingProfiler* samplingProfiler = vm.samplingProfiler();
     RELEASE_ASSERT(samplingProfiler);
     LockHolder locker(samplingProfiler->getLock());
     samplingProfiler->pause(locker);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to