Ignore:
Timestamp:
Apr 15, 2014, 2:05:09 PM (11 years ago)
Author:
[email protected]
Message:

Objective-C API external object graphs don't handle generational collection properly
https://bugs.webkit.org/show_bug.cgi?id=131634

Reviewed by Geoffrey Garen.

If the set of Objective-C objects transitively reachable through an object changes, we
need to update the set of opaque roots accordingly. If we don't, the next EdenCollection
won't rescan the external object graph, which would lead us to consider a newly allocated
JSManagedValue to be dead.

  • API/JSBase.cpp:

(JSSynchronousEdenCollectForDebugging):

  • API/JSVirtualMachine.mm:

(-[JSVirtualMachine initWithContextGroupRef:]):
(-[JSVirtualMachine dealloc]):
(-[JSVirtualMachine isOldExternalObject:]):
(-[JSVirtualMachine addExternalRememberedObject:]):
(-[JSVirtualMachine addManagedReference:withOwner:]):
(-[JSVirtualMachine removeManagedReference:withOwner:]):
(-[JSVirtualMachine externalRememberedSet]):
(scanExternalObjectGraph):
(scanExternalRememberedSet):

  • API/JSVirtualMachineInternal.h:
  • API/tests/testapi.mm:
  • heap/Heap.cpp:

(JSC::Heap::markRoots):

  • heap/Heap.h:

(JSC::Heap::slotVisitor):

  • heap/SlotVisitor.h:
  • heap/SlotVisitorInlines.h:

(JSC::SlotVisitor::containsOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRootTriState):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSVirtualMachineInternal.h

    r148696 r167326  
    2727#define JSVirtualMachineInternal_h
    2828
     29#if JSC_OBJC_API_ENABLED
     30
    2931#import <JavaScriptCore/JavaScriptCore.h>
    30 
    31 #if JSC_OBJC_API_ENABLED
    3232
    3333namespace JSC {
     
    5252
    5353void scanExternalObjectGraph(JSC::VM&, JSC::SlotVisitor&, void* root);
     54void scanExternalRememberedSet(JSC::VM&, JSC::SlotVisitor&);
    5455
    55 #endif
     56#endif // JSC_OBJC_API_ENABLED
    5657
    5758#endif // JSVirtualMachineInternal_h
Note: See TracChangeset for help on using the changeset viewer.