Changeset 164463 in webkit


Ignore:
Timestamp:
Feb 20, 2014 6:53:14 PM (10 years ago)
Author:
mark.lam@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r164461 r164463  
     12014-02-20  Mark Lam  <mark.lam@apple.com>
     2
     3        DefaultGCActivityCallback::doWork() should reschedule if GC is deferred.
     4        <https://webkit.org/b/129131>
     5
     6        Reviewed by Mark Hahnenberg.
     7
     8        Currently, DefaultGCActivityCallback::doWork() does not check if the GC
     9        needs to be deferred before commencing. As a result, the GC may crash
     10        and/or corrupt data because the VM is not in the consistent state needed
     11        for the GC to run. With this fix, doWork() now checks if the GC is
     12        supposed to be deferred and re-schedules if needed. It only commences
     13        with GC'ing when it's safe to do so.
     14
     15        * runtime/GCActivityCallback.cpp:
     16        (JSC::DefaultGCActivityCallback::doWork):
     17
    1182014-02-20  Geoffrey Garen  <ggaren@apple.com>
    219
  • trunk/Source/JavaScriptCore/runtime/GCActivityCallback.cpp

    r163384 r164463  
    8888   
    8989    APIEntryShim shim(m_vm);
     90    if (heap->isDeferred()) {
     91        scheduleTimer(0);
     92        return;
     93    }
     94
    9095#if !PLATFORM(IOS)
    9196    double startTime = WTF::monotonicallyIncreasingTime();
Note: See TracChangeset for help on using the changeset viewer.