Fixed <rdar://problem/8310571> CrashTracer: 60 crashes in Photo Booth at
com.apple.JavaScriptCore: JSC::Heap::markRoots + 746
        
Reviewed by Gavin Barraclough.

* API/APIShims.h:
(JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Call our new
synchronize() function.

* runtime/Collector.cpp:
(JSC::Heap::activityCallback):
* runtime/Collector.h: Added an activityCallback() accessor, for the
call above.

* runtime/GCActivityCallback.h:
(JSC::GCActivityCallback::synchronize):
* runtime/GCActivityCallbackCF.cpp:
(JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
(JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
(JSC::DefaultGCActivityCallback::operator()):
(JSC::DefaultGCActivityCallback::synchronize): Track the run loop we're
scheduled in. If we begin/resume execution within a new run loop, reschedule
on it. This prevents a crash when using a lockless context group on
multiple threads -- the crash would happen if the GC timer scheduled on
thread A, then you continued execution on thread B, then the thread A
timer fired.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/runtime/Collector.cpp b/JavaScriptCore/runtime/Collector.cpp
index 3fbd278..3d8b583 100644
--- a/JavaScriptCore/runtime/Collector.cpp
+++ b/JavaScriptCore/runtime/Collector.cpp
@@ -1232,4 +1232,9 @@
     m_activityCallback = activityCallback;
 }
 
+GCActivityCallback* Heap::activityCallback()
+{
+    return m_activityCallback.get();
+}
+
 } // namespace JSC