Title: [164463] trunk/Source/_javascript_Core
Revision
164463
Author
[email protected]
Date
2014-02-20 18:53:14 -0800 (Thu, 20 Feb 2014)

Log Message

DefaultGCActivityCallback::doWork() should reschedule if GC is deferred.
<https://webkit.org/b/129131>

Reviewed by Mark Hahnenberg.

Currently, DefaultGCActivityCallback::doWork() does not check if the GC
needs to be deferred before commencing. As a result, the GC may crash
and/or corrupt data because the VM is not in the consistent state needed
for the GC to run. With this fix, doWork() now checks if the GC is
supposed to be deferred and re-schedules if needed. It only commences
with GC'ing when it's safe to do so.

* runtime/GCActivityCallback.cpp:
(JSC::DefaultGCActivityCallback::doWork):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (164462 => 164463)


--- trunk/Source/_javascript_Core/ChangeLog	2014-02-21 02:13:49 UTC (rev 164462)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-02-21 02:53:14 UTC (rev 164463)
@@ -1,3 +1,20 @@
+2014-02-20  Mark Lam  <[email protected]>
+
+        DefaultGCActivityCallback::doWork() should reschedule if GC is deferred.
+        <https://webkit.org/b/129131>
+
+        Reviewed by Mark Hahnenberg.
+
+        Currently, DefaultGCActivityCallback::doWork() does not check if the GC
+        needs to be deferred before commencing. As a result, the GC may crash
+        and/or corrupt data because the VM is not in the consistent state needed
+        for the GC to run. With this fix, doWork() now checks if the GC is
+        supposed to be deferred and re-schedules if needed. It only commences
+        with GC'ing when it's safe to do so.
+
+        * runtime/GCActivityCallback.cpp:
+        (JSC::DefaultGCActivityCallback::doWork):
+
 2014-02-20  Geoffrey Garen  <[email protected]>
 
         Math.imul gives wrong results

Modified: trunk/Source/_javascript_Core/runtime/GCActivityCallback.cpp (164462 => 164463)


--- trunk/Source/_javascript_Core/runtime/GCActivityCallback.cpp	2014-02-21 02:13:49 UTC (rev 164462)
+++ trunk/Source/_javascript_Core/runtime/GCActivityCallback.cpp	2014-02-21 02:53:14 UTC (rev 164463)
@@ -87,6 +87,11 @@
         return;
     
     APIEntryShim shim(m_vm);
+    if (heap->isDeferred()) {
+        scheduleTimer(0);
+        return;
+    }
+
 #if !PLATFORM(IOS)
     double startTime = WTF::monotonicallyIncreasingTime();
     if (heap->isPagedOut(startTime + pagingTimeOut)) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to