Ignore:
Timestamp:
Oct 16, 2008, 1:00:53 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=21609
Make MessagePorts protect their peers across heaps

JavaScriptCore:

  • JavaScriptCore.exp:
  • kjs/JSGlobalObject.cpp: (JSC::JSGlobalObject::markCrossHeapDependentObjects):
  • kjs/JSGlobalObject.h:
  • kjs/collector.cpp: (JSC::Heap::collect): Before GC sweep phase, a function supplied by global object is now called for all global objects in the heap, making it possible to implement cross-heap dependencies.

WebCore:

  • dom/MessagePort.cpp: (WebCore::MessagePort::MessagePort):
  • dom/MessagePort.h: (WebCore::MessagePort::setJSWrapperIsKnownToBeInaccessible): (WebCore::MessagePort::jsWrapperIsKnownToBeInaccessible): Track objects whose JS wrappers are no longer reachable in MessagePort. Unfortunately, this means that the implementation object knows about JS bindings - but it is not possible to access JS wrappers from another heap/thread.
  • bindings/js/JSDOMBinding.cpp: (WebCore::markCrossHeapDependentObjectsForDocument):
  • bindings/js/JSDOMBinding.h:
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::markCrossHeapDependentObjects):
  • bindings/js/JSDOMWindowBase.h: Implement cross-heap dependency tracking for entangled MessagePorts. If a wrapper object hasn't been marked normally, it is marked as inaccessible. It is then marked manually, as long as its entangled port is accessible itself.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/collector.cpp

    r37622 r37631  
    970970    m_globalData->smallStrings.mark();
    971971
     972    JSGlobalObject* globalObject = m_globalData->head;
     973    do {
     974        globalObject->markCrossHeapDependentObjects();
     975        globalObject = globalObject->next();
     976    } while (globalObject != m_globalData->head);
     977
    972978    JAVASCRIPTCORE_GC_MARKED();
    973979
Note: See TracChangeset for help on using the changeset viewer.